aclocal.m4 revision f29dbc25
1f29dbc25Smrg# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
2f29dbc25Smrg
3f29dbc25Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4f29dbc25Smrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5f29dbc25Smrg# This file is free software; the Free Software Foundation
6f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
7f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
8f29dbc25Smrg
9f29dbc25Smrg# This program is distributed in the hope that it will be useful,
10f29dbc25Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11f29dbc25Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12f29dbc25Smrg# PARTICULAR PURPOSE.
13f29dbc25Smrg
14f29dbc25Smrgm4_ifndef([AC_AUTOCONF_VERSION],
15f29dbc25Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16f29dbc25Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],,
17f29dbc25Smrg[m4_warning([this file was generated for autoconf 2.65.
18f29dbc25SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19f29dbc25SmrgIf you have problems, you may need to regenerate the build system entirely.
20f29dbc25SmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21f29dbc25Smrg
22f29dbc25Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
23f29dbc25Smrg#
24f29dbc25Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
25f29dbc25Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
26f29dbc25Smrg#   Written by Gordon Matzigkeit, 1996
27f29dbc25Smrg#
28f29dbc25Smrg# This file is free software; the Free Software Foundation gives
29f29dbc25Smrg# unlimited permission to copy and/or distribute it, with or without
30f29dbc25Smrg# modifications, as long as this notice is preserved.
31f29dbc25Smrg
32f29dbc25Smrgm4_define([_LT_COPYING], [dnl
33f29dbc25Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
34f29dbc25Smrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
35f29dbc25Smrg#   Written by Gordon Matzigkeit, 1996
36f29dbc25Smrg#
37f29dbc25Smrg#   This file is part of GNU Libtool.
38f29dbc25Smrg#
39f29dbc25Smrg# GNU Libtool is free software; you can redistribute it and/or
40f29dbc25Smrg# modify it under the terms of the GNU General Public License as
41f29dbc25Smrg# published by the Free Software Foundation; either version 2 of
42f29dbc25Smrg# the License, or (at your option) any later version.
43f29dbc25Smrg#
44f29dbc25Smrg# As a special exception to the GNU General Public License,
45f29dbc25Smrg# if you distribute this file as part of a program or library that
46f29dbc25Smrg# is built using GNU Libtool, you may include this file under the
47f29dbc25Smrg# same distribution terms that you use for the rest of that program.
48f29dbc25Smrg#
49f29dbc25Smrg# GNU Libtool is distributed in the hope that it will be useful,
50f29dbc25Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
51f29dbc25Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52f29dbc25Smrg# GNU General Public License for more details.
53f29dbc25Smrg#
54f29dbc25Smrg# You should have received a copy of the GNU General Public License
55f29dbc25Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
56f29dbc25Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
57f29dbc25Smrg# obtained by writing to the Free Software Foundation, Inc.,
58f29dbc25Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
59f29dbc25Smrg])
60f29dbc25Smrg
61f29dbc25Smrg# serial 56 LT_INIT
62f29dbc25Smrg
63f29dbc25Smrg
64f29dbc25Smrg# LT_PREREQ(VERSION)
65f29dbc25Smrg# ------------------
66f29dbc25Smrg# Complain and exit if this libtool version is less that VERSION.
67f29dbc25Smrgm4_defun([LT_PREREQ],
68f29dbc25Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
69f29dbc25Smrg       [m4_default([$3],
70f29dbc25Smrg		   [m4_fatal([Libtool version $1 or higher is required],
71f29dbc25Smrg		             63)])],
72f29dbc25Smrg       [$2])])
73f29dbc25Smrg
74f29dbc25Smrg
75f29dbc25Smrg# _LT_CHECK_BUILDDIR
76f29dbc25Smrg# ------------------
77f29dbc25Smrg# Complain if the absolute build directory name contains unusual characters
78f29dbc25Smrgm4_defun([_LT_CHECK_BUILDDIR],
79f29dbc25Smrg[case `pwd` in
80f29dbc25Smrg  *\ * | *\	*)
81f29dbc25Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
82f29dbc25Smrgesac
83f29dbc25Smrg])
84f29dbc25Smrg
85f29dbc25Smrg
86f29dbc25Smrg# LT_INIT([OPTIONS])
87f29dbc25Smrg# ------------------
88f29dbc25SmrgAC_DEFUN([LT_INIT],
89f29dbc25Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
90f29dbc25SmrgAC_BEFORE([$0], [LT_LANG])dnl
91f29dbc25SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
92f29dbc25SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
93f29dbc25Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
94f29dbc25Smrg
95f29dbc25Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
96f29dbc25Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
97f29dbc25Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
98f29dbc25Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
99f29dbc25Smrgdnl unless we require an AC_DEFUNed macro:
100f29dbc25SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
101f29dbc25SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
102f29dbc25SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
103f29dbc25SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
104f29dbc25Smrgm4_require([_LT_PROG_LTMAIN])dnl
105f29dbc25Smrg
106f29dbc25Smrgdnl Parse OPTIONS
107f29dbc25Smrg_LT_SET_OPTIONS([$0], [$1])
108f29dbc25Smrg
109f29dbc25Smrg# This can be used to rebuild libtool when needed
110f29dbc25SmrgLIBTOOL_DEPS="$ltmain"
111f29dbc25Smrg
112f29dbc25Smrg# Always use our own libtool.
113f29dbc25SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
114f29dbc25SmrgAC_SUBST(LIBTOOL)dnl
115f29dbc25Smrg
116f29dbc25Smrg_LT_SETUP
117f29dbc25Smrg
118f29dbc25Smrg# Only expand once:
119f29dbc25Smrgm4_define([LT_INIT])
120f29dbc25Smrg])# LT_INIT
121f29dbc25Smrg
122f29dbc25Smrg# Old names:
123f29dbc25SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
124f29dbc25SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
125f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
126f29dbc25Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
127f29dbc25Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
128f29dbc25Smrg
129f29dbc25Smrg
130f29dbc25Smrg# _LT_CC_BASENAME(CC)
131f29dbc25Smrg# -------------------
132f29dbc25Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
133f29dbc25Smrgm4_defun([_LT_CC_BASENAME],
134f29dbc25Smrg[for cc_temp in $1""; do
135f29dbc25Smrg  case $cc_temp in
136f29dbc25Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137f29dbc25Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138f29dbc25Smrg    \-*) ;;
139f29dbc25Smrg    *) break;;
140f29dbc25Smrg  esac
141f29dbc25Smrgdone
142f29dbc25Smrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
143f29dbc25Smrg])
144f29dbc25Smrg
145f29dbc25Smrg
146f29dbc25Smrg# _LT_FILEUTILS_DEFAULTS
147f29dbc25Smrg# ----------------------
148f29dbc25Smrg# It is okay to use these file commands and assume they have been set
149f29dbc25Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
150f29dbc25Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
151f29dbc25Smrg[: ${CP="cp -f"}
152f29dbc25Smrg: ${MV="mv -f"}
153f29dbc25Smrg: ${RM="rm -f"}
154f29dbc25Smrg])# _LT_FILEUTILS_DEFAULTS
155f29dbc25Smrg
156f29dbc25Smrg
157f29dbc25Smrg# _LT_SETUP
158f29dbc25Smrg# ---------
159f29dbc25Smrgm4_defun([_LT_SETUP],
160f29dbc25Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161f29dbc25SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
162f29dbc25Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
163f29dbc25Smrg_LT_DECL([], [host], [0])dnl
164f29dbc25Smrg_LT_DECL([], [host_os], [0])dnl
165f29dbc25Smrgdnl
166f29dbc25Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
167f29dbc25Smrg_LT_DECL([], [build], [0])dnl
168f29dbc25Smrg_LT_DECL([], [build_os], [0])dnl
169f29dbc25Smrgdnl
170f29dbc25SmrgAC_REQUIRE([AC_PROG_CC])dnl
171f29dbc25SmrgAC_REQUIRE([LT_PATH_LD])dnl
172f29dbc25SmrgAC_REQUIRE([LT_PATH_NM])dnl
173f29dbc25Smrgdnl
174f29dbc25SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
175f29dbc25Smrgtest -z "$LN_S" && LN_S="ln -s"
176f29dbc25Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
177f29dbc25Smrgdnl
178f29dbc25SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
179f29dbc25Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
180f29dbc25Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
181f29dbc25Smrgdnl
182f29dbc25Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
183f29dbc25Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
184f29dbc25Smrgm4_require([_LT_CMD_RELOAD])dnl
185f29dbc25Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
186f29dbc25Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
187f29dbc25Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
188f29dbc25Smrg
189f29dbc25Smrg_LT_CONFIG_LIBTOOL_INIT([
190f29dbc25Smrg# See if we are running on zsh, and set the options which allow our
191f29dbc25Smrg# commands through without removal of \ escapes INIT.
192f29dbc25Smrgif test -n "\${ZSH_VERSION+set}" ; then
193f29dbc25Smrg   setopt NO_GLOB_SUBST
194f29dbc25Smrgfi
195f29dbc25Smrg])
196f29dbc25Smrgif test -n "${ZSH_VERSION+set}" ; then
197f29dbc25Smrg   setopt NO_GLOB_SUBST
198f29dbc25Smrgfi
199f29dbc25Smrg
200f29dbc25Smrg_LT_CHECK_OBJDIR
201f29dbc25Smrg
202f29dbc25Smrgm4_require([_LT_TAG_COMPILER])dnl
203f29dbc25Smrg_LT_PROG_ECHO_BACKSLASH
204f29dbc25Smrg
205f29dbc25Smrgcase $host_os in
206f29dbc25Smrgaix3*)
207f29dbc25Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
208f29dbc25Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
209f29dbc25Smrg  # vanish in a puff of smoke.
210f29dbc25Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
211f29dbc25Smrg    COLLECT_NAMES=
212f29dbc25Smrg    export COLLECT_NAMES
213f29dbc25Smrg  fi
214f29dbc25Smrg  ;;
215f29dbc25Smrgesac
216f29dbc25Smrg
217f29dbc25Smrg# Sed substitution that helps us do robust quoting.  It backslashifies
218f29dbc25Smrg# metacharacters that are still active within double-quoted strings.
219f29dbc25Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
220f29dbc25Smrg
221f29dbc25Smrg# Same as above, but do not quote variable references.
222f29dbc25Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
223f29dbc25Smrg
224f29dbc25Smrg# Sed substitution to delay expansion of an escaped shell variable in a
225f29dbc25Smrg# double_quote_subst'ed string.
226f29dbc25Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
227f29dbc25Smrg
228f29dbc25Smrg# Sed substitution to delay expansion of an escaped single quote.
229f29dbc25Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
230f29dbc25Smrg
231f29dbc25Smrg# Sed substitution to avoid accidental globbing in evaled expressions
232f29dbc25Smrgno_glob_subst='s/\*/\\\*/g'
233f29dbc25Smrg
234f29dbc25Smrg# Global variables:
235f29dbc25Smrgofile=libtool
236f29dbc25Smrgcan_build_shared=yes
237f29dbc25Smrg
238f29dbc25Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
239f29dbc25Smrg# which needs '.lib').
240f29dbc25Smrglibext=a
241f29dbc25Smrg
242f29dbc25Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
243f29dbc25Smrg
244f29dbc25Smrgold_CC="$CC"
245f29dbc25Smrgold_CFLAGS="$CFLAGS"
246f29dbc25Smrg
247f29dbc25Smrg# Set sane defaults for various variables
248f29dbc25Smrgtest -z "$CC" && CC=cc
249f29dbc25Smrgtest -z "$LTCC" && LTCC=$CC
250f29dbc25Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
251f29dbc25Smrgtest -z "$LD" && LD=ld
252f29dbc25Smrgtest -z "$ac_objext" && ac_objext=o
253f29dbc25Smrg
254f29dbc25Smrg_LT_CC_BASENAME([$compiler])
255f29dbc25Smrg
256f29dbc25Smrg# Only perform the check for file, if the check method requires it
257f29dbc25Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
258f29dbc25Smrgcase $deplibs_check_method in
259f29dbc25Smrgfile_magic*)
260f29dbc25Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
261f29dbc25Smrg    _LT_PATH_MAGIC
262f29dbc25Smrg  fi
263f29dbc25Smrg  ;;
264f29dbc25Smrgesac
265f29dbc25Smrg
266f29dbc25Smrg# Use C for the default configuration in the libtool script
267f29dbc25SmrgLT_SUPPORTED_TAG([CC])
268f29dbc25Smrg_LT_LANG_C_CONFIG
269f29dbc25Smrg_LT_LANG_DEFAULT_CONFIG
270f29dbc25Smrg_LT_CONFIG_COMMANDS
271f29dbc25Smrg])# _LT_SETUP
272f29dbc25Smrg
273f29dbc25Smrg
274f29dbc25Smrg# _LT_PROG_LTMAIN
275f29dbc25Smrg# ---------------
276f29dbc25Smrg# Note that this code is called both from `configure', and `config.status'
277f29dbc25Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
278f29dbc25Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
279f29dbc25Smrg# so we pass a copy along to make sure it has a sensible value anyway.
280f29dbc25Smrgm4_defun([_LT_PROG_LTMAIN],
281f29dbc25Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
282f29dbc25Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
283f29dbc25Smrgltmain="$ac_aux_dir/ltmain.sh"
284f29dbc25Smrg])# _LT_PROG_LTMAIN
285f29dbc25Smrg
286f29dbc25Smrg
287f29dbc25Smrg
288f29dbc25Smrg# So that we can recreate a full libtool script including additional
289f29dbc25Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
290f29dbc25Smrg# in macros and then make a single call at the end using the `libtool'
291f29dbc25Smrg# label.
292f29dbc25Smrg
293f29dbc25Smrg
294f29dbc25Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
295f29dbc25Smrg# ----------------------------------------
296f29dbc25Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
297f29dbc25Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
298f29dbc25Smrg[m4_ifval([$1],
299f29dbc25Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
300f29dbc25Smrg                     [$1
301f29dbc25Smrg])])])
302f29dbc25Smrg
303f29dbc25Smrg# Initialize.
304f29dbc25Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
305f29dbc25Smrg
306f29dbc25Smrg
307f29dbc25Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
308f29dbc25Smrg# ------------------------------
309f29dbc25Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
310f29dbc25Smrgm4_define([_LT_CONFIG_LIBTOOL],
311f29dbc25Smrg[m4_ifval([$1],
312f29dbc25Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
313f29dbc25Smrg                     [$1
314f29dbc25Smrg])])])
315f29dbc25Smrg
316f29dbc25Smrg# Initialize.
317f29dbc25Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
318f29dbc25Smrg
319f29dbc25Smrg
320f29dbc25Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
321f29dbc25Smrg# -----------------------------------------------------
322f29dbc25Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
323f29dbc25Smrg[_LT_CONFIG_LIBTOOL([$1])
324f29dbc25Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
325f29dbc25Smrg])
326f29dbc25Smrg
327f29dbc25Smrg
328f29dbc25Smrg# _LT_FORMAT_COMMENT([COMMENT])
329f29dbc25Smrg# -----------------------------
330f29dbc25Smrg# Add leading comment marks to the start of each line, and a trailing
331f29dbc25Smrg# full-stop to the whole comment if one is not present already.
332f29dbc25Smrgm4_define([_LT_FORMAT_COMMENT],
333f29dbc25Smrg[m4_ifval([$1], [
334f29dbc25Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
335f29dbc25Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
336f29dbc25Smrg)])
337f29dbc25Smrg
338f29dbc25Smrg
339f29dbc25Smrg
340f29dbc25Smrg
341f29dbc25Smrg
342f29dbc25Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
343f29dbc25Smrg# -------------------------------------------------------------------
344f29dbc25Smrg# CONFIGNAME is the name given to the value in the libtool script.
345f29dbc25Smrg# VARNAME is the (base) name used in the configure script.
346f29dbc25Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
347f29dbc25Smrg# VARNAME.  Any other value will be used directly.
348f29dbc25Smrgm4_define([_LT_DECL],
349f29dbc25Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
350f29dbc25Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
351f29dbc25Smrg	[m4_ifval([$1], [$1], [$2])])
352f29dbc25Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
353f29dbc25Smrg    m4_ifval([$4],
354f29dbc25Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
355f29dbc25Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
356f29dbc25Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
357f29dbc25Smrg])
358f29dbc25Smrg
359f29dbc25Smrg
360f29dbc25Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
361f29dbc25Smrg# --------------------------------------------------------
362f29dbc25Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
363f29dbc25Smrg
364f29dbc25Smrg
365f29dbc25Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
366f29dbc25Smrg# ------------------------------------------------
367f29dbc25Smrgm4_define([lt_decl_tag_varnames],
368f29dbc25Smrg[_lt_decl_filter([tagged?], [yes], $@)])
369f29dbc25Smrg
370f29dbc25Smrg
371f29dbc25Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
372f29dbc25Smrg# ---------------------------------------------------------
373f29dbc25Smrgm4_define([_lt_decl_filter],
374f29dbc25Smrg[m4_case([$#],
375f29dbc25Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
376f29dbc25Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
377f29dbc25Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
378f29dbc25Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
379f29dbc25Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
380f29dbc25Smrg])
381f29dbc25Smrg
382f29dbc25Smrg
383f29dbc25Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
384f29dbc25Smrg# --------------------------------------------------
385f29dbc25Smrgm4_define([lt_decl_quote_varnames],
386f29dbc25Smrg[_lt_decl_filter([value], [1], $@)])
387f29dbc25Smrg
388f29dbc25Smrg
389f29dbc25Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
390f29dbc25Smrg# ---------------------------------------------------
391f29dbc25Smrgm4_define([lt_decl_dquote_varnames],
392f29dbc25Smrg[_lt_decl_filter([value], [2], $@)])
393f29dbc25Smrg
394f29dbc25Smrg
395f29dbc25Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
396f29dbc25Smrg# ---------------------------------------------------
397f29dbc25Smrgm4_define([lt_decl_varnames_tagged],
398f29dbc25Smrg[m4_assert([$# <= 2])dnl
399f29dbc25Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
400f29dbc25Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
401f29dbc25Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
402f29dbc25Smrgm4_define([_lt_decl_varnames_tagged],
403f29dbc25Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
404f29dbc25Smrg
405f29dbc25Smrg
406f29dbc25Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
407f29dbc25Smrg# ------------------------------------------------
408f29dbc25Smrgm4_define([lt_decl_all_varnames],
409f29dbc25Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
410f29dbc25Smrg     m4_if([$2], [],
411f29dbc25Smrg	   m4_quote(lt_decl_varnames),
412f29dbc25Smrg	m4_quote(m4_shift($@))))[]dnl
413f29dbc25Smrg])
414f29dbc25Smrgm4_define([_lt_decl_all_varnames],
415f29dbc25Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
416f29dbc25Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
417f29dbc25Smrg])
418f29dbc25Smrg
419f29dbc25Smrg
420f29dbc25Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
421f29dbc25Smrg# ------------------------------------
422f29dbc25Smrg# Quote a variable value, and forward it to `config.status' so that its
423f29dbc25Smrg# declaration there will have the same value as in `configure'.  VARNAME
424f29dbc25Smrg# must have a single quote delimited value for this to work.
425f29dbc25Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
426f29dbc25Smrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
427f29dbc25Smrg
428f29dbc25Smrg
429f29dbc25Smrg# _LT_CONFIG_STATUS_DECLARATIONS
430f29dbc25Smrg# ------------------------------
431f29dbc25Smrg# We delimit libtool config variables with single quotes, so when
432f29dbc25Smrg# we write them to config.status, we have to be sure to quote all
433f29dbc25Smrg# embedded single quotes properly.  In configure, this macro expands
434f29dbc25Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
435f29dbc25Smrg#
436f29dbc25Smrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
437f29dbc25Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
438f29dbc25Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
439f29dbc25Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440f29dbc25Smrg
441f29dbc25Smrg
442f29dbc25Smrg# _LT_LIBTOOL_TAGS
443f29dbc25Smrg# ----------------
444f29dbc25Smrg# Output comment and list of tags supported by the script
445f29dbc25Smrgm4_defun([_LT_LIBTOOL_TAGS],
446f29dbc25Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
447f29dbc25Smrgavailable_tags="_LT_TAGS"dnl
448f29dbc25Smrg])
449f29dbc25Smrg
450f29dbc25Smrg
451f29dbc25Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
452f29dbc25Smrg# -----------------------------------
453f29dbc25Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
454f29dbc25Smrg# expand to a commented shell variable setting:
455f29dbc25Smrg#
456f29dbc25Smrg#    # Some comment about what VAR is for.
457f29dbc25Smrg#    visible_name=$lt_internal_name
458f29dbc25Smrgm4_define([_LT_LIBTOOL_DECLARE],
459f29dbc25Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
460f29dbc25Smrg					   [description])))[]dnl
461f29dbc25Smrgm4_pushdef([_libtool_name],
462f29dbc25Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
463f29dbc25Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
464f29dbc25Smrg    [0], [_libtool_name=[$]$1],
465f29dbc25Smrg    [1], [_libtool_name=$lt_[]$1],
466f29dbc25Smrg    [2], [_libtool_name=$lt_[]$1],
467f29dbc25Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
468f29dbc25Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
469f29dbc25Smrg])
470f29dbc25Smrg
471f29dbc25Smrg
472f29dbc25Smrg# _LT_LIBTOOL_CONFIG_VARS
473f29dbc25Smrg# -----------------------
474f29dbc25Smrg# Produce commented declarations of non-tagged libtool config variables
475f29dbc25Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
476f29dbc25Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
477f29dbc25Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
478f29dbc25Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
479f29dbc25Smrg[m4_foreach([_lt_var],
480f29dbc25Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
481f29dbc25Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
482f29dbc25Smrg
483f29dbc25Smrg
484f29dbc25Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
485f29dbc25Smrg# -------------------------
486f29dbc25Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
487f29dbc25Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
488f29dbc25Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
489f29dbc25Smrg
490f29dbc25Smrg
491f29dbc25Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
492f29dbc25Smrg# ------------------------------
493f29dbc25Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
494f29dbc25Smrg
495f29dbc25Smrg
496f29dbc25Smrg# _LT_CONFIG_COMMANDS
497f29dbc25Smrg# -------------------
498f29dbc25Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
499f29dbc25Smrg# variables for single and double quote escaping we saved from calls
500f29dbc25Smrg# to _LT_DECL, we can put quote escaped variables declarations
501f29dbc25Smrg# into `config.status', and then the shell code to quote escape them in
502f29dbc25Smrg# for loops in `config.status'.  Finally, any additional code accumulated
503f29dbc25Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
504f29dbc25Smrgm4_defun([_LT_CONFIG_COMMANDS],
505f29dbc25Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
506f29dbc25Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
507f29dbc25Smrg	dnl instead of duplicating it all over again into config.status,
508f29dbc25Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
509f29dbc25Smrg	dnl needs to know what name is stored there:
510f29dbc25Smrg        [AC_CONFIG_COMMANDS([libtool],
511f29dbc25Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
512f29dbc25Smrg    dnl If the libtool generation code is destined for config.status,
513f29dbc25Smrg    dnl expand the accumulated commands and init code now:
514f29dbc25Smrg    [AC_CONFIG_COMMANDS([libtool],
515f29dbc25Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
516f29dbc25Smrg])#_LT_CONFIG_COMMANDS
517f29dbc25Smrg
518f29dbc25Smrg
519f29dbc25Smrg# Initialize.
520f29dbc25Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
521f29dbc25Smrg[
522f29dbc25Smrg
523f29dbc25Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
524f29dbc25Smrg# if CDPATH is set.
525f29dbc25Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
526f29dbc25Smrg
527f29dbc25Smrgsed_quote_subst='$sed_quote_subst'
528f29dbc25Smrgdouble_quote_subst='$double_quote_subst'
529f29dbc25Smrgdelay_variable_subst='$delay_variable_subst'
530f29dbc25Smrg_LT_CONFIG_STATUS_DECLARATIONS
531f29dbc25SmrgLTCC='$LTCC'
532f29dbc25SmrgLTCFLAGS='$LTCFLAGS'
533f29dbc25Smrgcompiler='$compiler_DEFAULT'
534f29dbc25Smrg
535f29dbc25Smrg# Quote evaled strings.
536f29dbc25Smrgfor var in lt_decl_all_varnames([[ \
537f29dbc25Smrg]], lt_decl_quote_varnames); do
538f29dbc25Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
539f29dbc25Smrg    *[[\\\\\\\`\\"\\\$]]*)
540f29dbc25Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
541f29dbc25Smrg      ;;
542f29dbc25Smrg    *)
543f29dbc25Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
544f29dbc25Smrg      ;;
545f29dbc25Smrg    esac
546f29dbc25Smrgdone
547f29dbc25Smrg
548f29dbc25Smrg# Double-quote double-evaled strings.
549f29dbc25Smrgfor var in lt_decl_all_varnames([[ \
550f29dbc25Smrg]], lt_decl_dquote_varnames); do
551f29dbc25Smrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
552f29dbc25Smrg    *[[\\\\\\\`\\"\\\$]]*)
553f29dbc25Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
554f29dbc25Smrg      ;;
555f29dbc25Smrg    *)
556f29dbc25Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
557f29dbc25Smrg      ;;
558f29dbc25Smrg    esac
559f29dbc25Smrgdone
560f29dbc25Smrg
561f29dbc25Smrg# Fix-up fallback echo if it was mangled by the above quoting rules.
562f29dbc25Smrgcase \$lt_ECHO in
563f29dbc25Smrg*'\\\[$]0 --fallback-echo"')dnl "
564f29dbc25Smrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
565f29dbc25Smrg  ;;
566f29dbc25Smrgesac
567f29dbc25Smrg
568f29dbc25Smrg_LT_OUTPUT_LIBTOOL_INIT
569f29dbc25Smrg])
570f29dbc25Smrg
571f29dbc25Smrg
572f29dbc25Smrg# LT_OUTPUT
573f29dbc25Smrg# ---------
574f29dbc25Smrg# This macro allows early generation of the libtool script (before
575f29dbc25Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
576f29dbc25Smrg# tests.
577f29dbc25SmrgAC_DEFUN([LT_OUTPUT],
578f29dbc25Smrg[: ${CONFIG_LT=./config.lt}
579f29dbc25SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
580f29dbc25Smrgcat >"$CONFIG_LT" <<_LTEOF
581f29dbc25Smrg#! $SHELL
582f29dbc25Smrg# Generated by $as_me.
583f29dbc25Smrg# Run this file to recreate a libtool stub with the current configuration.
584f29dbc25Smrg
585f29dbc25Smrglt_cl_silent=false
586f29dbc25SmrgSHELL=\${CONFIG_SHELL-$SHELL}
587f29dbc25Smrg_LTEOF
588f29dbc25Smrg
589f29dbc25Smrgcat >>"$CONFIG_LT" <<\_LTEOF
590f29dbc25SmrgAS_SHELL_SANITIZE
591f29dbc25Smrg_AS_PREPARE
592f29dbc25Smrg
593f29dbc25Smrgexec AS_MESSAGE_FD>&1
594f29dbc25Smrgexec AS_MESSAGE_LOG_FD>>config.log
595f29dbc25Smrg{
596f29dbc25Smrg  echo
597f29dbc25Smrg  AS_BOX([Running $as_me.])
598f29dbc25Smrg} >&AS_MESSAGE_LOG_FD
599f29dbc25Smrg
600f29dbc25Smrglt_cl_help="\
601f29dbc25Smrg\`$as_me' creates a local libtool stub from the current configuration,
602f29dbc25Smrgfor use in further configure time tests before the real libtool is
603f29dbc25Smrggenerated.
604f29dbc25Smrg
605f29dbc25SmrgUsage: $[0] [[OPTIONS]]
606f29dbc25Smrg
607f29dbc25Smrg  -h, --help      print this help, then exit
608f29dbc25Smrg  -V, --version   print version number, then exit
609f29dbc25Smrg  -q, --quiet     do not print progress messages
610f29dbc25Smrg  -d, --debug     don't remove temporary files
611f29dbc25Smrg
612f29dbc25SmrgReport bugs to <bug-libtool@gnu.org>."
613f29dbc25Smrg
614f29dbc25Smrglt_cl_version="\
615f29dbc25Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
616f29dbc25Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
617f29dbc25Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
618f29dbc25Smrg
619f29dbc25SmrgCopyright (C) 2008 Free Software Foundation, Inc.
620f29dbc25SmrgThis config.lt script is free software; the Free Software Foundation
621f29dbc25Smrggives unlimited permision to copy, distribute and modify it."
622f29dbc25Smrg
623f29dbc25Smrgwhile test $[#] != 0
624f29dbc25Smrgdo
625f29dbc25Smrg  case $[1] in
626f29dbc25Smrg    --version | --v* | -V )
627f29dbc25Smrg      echo "$lt_cl_version"; exit 0 ;;
628f29dbc25Smrg    --help | --h* | -h )
629f29dbc25Smrg      echo "$lt_cl_help"; exit 0 ;;
630f29dbc25Smrg    --debug | --d* | -d )
631f29dbc25Smrg      debug=: ;;
632f29dbc25Smrg    --quiet | --q* | --silent | --s* | -q )
633f29dbc25Smrg      lt_cl_silent=: ;;
634f29dbc25Smrg
635f29dbc25Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
636f29dbc25SmrgTry \`$[0] --help' for more information.]) ;;
637f29dbc25Smrg
638f29dbc25Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
639f29dbc25SmrgTry \`$[0] --help' for more information.]) ;;
640f29dbc25Smrg  esac
641f29dbc25Smrg  shift
642f29dbc25Smrgdone
643f29dbc25Smrg
644f29dbc25Smrgif $lt_cl_silent; then
645f29dbc25Smrg  exec AS_MESSAGE_FD>/dev/null
646f29dbc25Smrgfi
647f29dbc25Smrg_LTEOF
648f29dbc25Smrg
649f29dbc25Smrgcat >>"$CONFIG_LT" <<_LTEOF
650f29dbc25Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
651f29dbc25Smrg_LTEOF
652f29dbc25Smrg
653f29dbc25Smrgcat >>"$CONFIG_LT" <<\_LTEOF
654f29dbc25SmrgAC_MSG_NOTICE([creating $ofile])
655f29dbc25Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
656f29dbc25SmrgAS_EXIT(0)
657f29dbc25Smrg_LTEOF
658f29dbc25Smrgchmod +x "$CONFIG_LT"
659f29dbc25Smrg
660f29dbc25Smrg# configure is writing to config.log, but config.lt does its own redirection,
661f29dbc25Smrg# appending to config.log, which fails on DOS, as config.log is still kept
662f29dbc25Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
663f29dbc25Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
664f29dbc25Smrgif test "$no_create" != yes; then
665f29dbc25Smrg  lt_cl_success=:
666f29dbc25Smrg  test "$silent" = yes &&
667f29dbc25Smrg    lt_config_lt_args="$lt_config_lt_args --quiet"
668f29dbc25Smrg  exec AS_MESSAGE_LOG_FD>/dev/null
669f29dbc25Smrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
670f29dbc25Smrg  exec AS_MESSAGE_LOG_FD>>config.log
671f29dbc25Smrg  $lt_cl_success || AS_EXIT(1)
672f29dbc25Smrgfi
673f29dbc25Smrg])# LT_OUTPUT
674f29dbc25Smrg
675f29dbc25Smrg
676f29dbc25Smrg# _LT_CONFIG(TAG)
677f29dbc25Smrg# ---------------
678f29dbc25Smrg# If TAG is the built-in tag, create an initial libtool script with a
679f29dbc25Smrg# default configuration from the untagged config vars.  Otherwise add code
680f29dbc25Smrg# to config.status for appending the configuration named by TAG from the
681f29dbc25Smrg# matching tagged config vars.
682f29dbc25Smrgm4_defun([_LT_CONFIG],
683f29dbc25Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
684f29dbc25Smrg_LT_CONFIG_SAVE_COMMANDS([
685f29dbc25Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
686f29dbc25Smrg  m4_if(_LT_TAG, [C], [
687f29dbc25Smrg    # See if we are running on zsh, and set the options which allow our
688f29dbc25Smrg    # commands through without removal of \ escapes.
689f29dbc25Smrg    if test -n "${ZSH_VERSION+set}" ; then
690f29dbc25Smrg      setopt NO_GLOB_SUBST
691f29dbc25Smrg    fi
692f29dbc25Smrg
693f29dbc25Smrg    cfgfile="${ofile}T"
694f29dbc25Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
695f29dbc25Smrg    $RM "$cfgfile"
696f29dbc25Smrg
697f29dbc25Smrg    cat <<_LT_EOF >> "$cfgfile"
698f29dbc25Smrg#! $SHELL
699f29dbc25Smrg
700f29dbc25Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
701f29dbc25Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
702f29dbc25Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
703f29dbc25Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
704f29dbc25Smrg#
705f29dbc25Smrg_LT_COPYING
706f29dbc25Smrg_LT_LIBTOOL_TAGS
707f29dbc25Smrg
708f29dbc25Smrg# ### BEGIN LIBTOOL CONFIG
709f29dbc25Smrg_LT_LIBTOOL_CONFIG_VARS
710f29dbc25Smrg_LT_LIBTOOL_TAG_VARS
711f29dbc25Smrg# ### END LIBTOOL CONFIG
712f29dbc25Smrg
713f29dbc25Smrg_LT_EOF
714f29dbc25Smrg
715f29dbc25Smrg  case $host_os in
716f29dbc25Smrg  aix3*)
717f29dbc25Smrg    cat <<\_LT_EOF >> "$cfgfile"
718f29dbc25Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
719f29dbc25Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
720f29dbc25Smrg# vanish in a puff of smoke.
721f29dbc25Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
722f29dbc25Smrg  COLLECT_NAMES=
723f29dbc25Smrg  export COLLECT_NAMES
724f29dbc25Smrgfi
725f29dbc25Smrg_LT_EOF
726f29dbc25Smrg    ;;
727f29dbc25Smrg  esac
728f29dbc25Smrg
729f29dbc25Smrg  _LT_PROG_LTMAIN
730f29dbc25Smrg
731f29dbc25Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
732f29dbc25Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
733f29dbc25Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
734f29dbc25Smrg  # is reportedly fixed, but why not run on old versions too?
735f29dbc25Smrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
736f29dbc25Smrg    || (rm -f "$cfgfile"; exit 1)
737f29dbc25Smrg
738f29dbc25Smrg  _LT_PROG_XSI_SHELLFNS
739f29dbc25Smrg
740f29dbc25Smrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
741f29dbc25Smrg    || (rm -f "$cfgfile"; exit 1)
742f29dbc25Smrg
743f29dbc25Smrg  mv -f "$cfgfile" "$ofile" ||
744f29dbc25Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
745f29dbc25Smrg  chmod +x "$ofile"
746f29dbc25Smrg],
747f29dbc25Smrg[cat <<_LT_EOF >> "$ofile"
748f29dbc25Smrg
749f29dbc25Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
750f29dbc25Smrgdnl in a comment (ie after a #).
751f29dbc25Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
752f29dbc25Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
753f29dbc25Smrg# ### END LIBTOOL TAG CONFIG: $1
754f29dbc25Smrg_LT_EOF
755f29dbc25Smrg])dnl /m4_if
756f29dbc25Smrg],
757f29dbc25Smrg[m4_if([$1], [], [
758f29dbc25Smrg    PACKAGE='$PACKAGE'
759f29dbc25Smrg    VERSION='$VERSION'
760f29dbc25Smrg    TIMESTAMP='$TIMESTAMP'
761f29dbc25Smrg    RM='$RM'
762f29dbc25Smrg    ofile='$ofile'], [])
763f29dbc25Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
764f29dbc25Smrg])# _LT_CONFIG
765f29dbc25Smrg
766f29dbc25Smrg
767f29dbc25Smrg# LT_SUPPORTED_TAG(TAG)
768f29dbc25Smrg# ---------------------
769f29dbc25Smrg# Trace this macro to discover what tags are supported by the libtool
770f29dbc25Smrg# --tag option, using:
771f29dbc25Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
772f29dbc25SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
773f29dbc25Smrg
774f29dbc25Smrg
775f29dbc25Smrg# C support is built-in for now
776f29dbc25Smrgm4_define([_LT_LANG_C_enabled], [])
777f29dbc25Smrgm4_define([_LT_TAGS], [])
778f29dbc25Smrg
779f29dbc25Smrg
780f29dbc25Smrg# LT_LANG(LANG)
781f29dbc25Smrg# -------------
782f29dbc25Smrg# Enable libtool support for the given language if not already enabled.
783f29dbc25SmrgAC_DEFUN([LT_LANG],
784f29dbc25Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
785f29dbc25Smrgm4_case([$1],
786f29dbc25Smrg  [C],			[_LT_LANG(C)],
787f29dbc25Smrg  [C++],		[_LT_LANG(CXX)],
788f29dbc25Smrg  [Java],		[_LT_LANG(GCJ)],
789f29dbc25Smrg  [Fortran 77],		[_LT_LANG(F77)],
790f29dbc25Smrg  [Fortran],		[_LT_LANG(FC)],
791f29dbc25Smrg  [Windows Resource],	[_LT_LANG(RC)],
792f29dbc25Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
793f29dbc25Smrg    [_LT_LANG($1)],
794f29dbc25Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
795f29dbc25Smrg])# LT_LANG
796f29dbc25Smrg
797f29dbc25Smrg
798f29dbc25Smrg# _LT_LANG(LANGNAME)
799f29dbc25Smrg# ------------------
800f29dbc25Smrgm4_defun([_LT_LANG],
801f29dbc25Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
802f29dbc25Smrg  [LT_SUPPORTED_TAG([$1])dnl
803f29dbc25Smrg  m4_append([_LT_TAGS], [$1 ])dnl
804f29dbc25Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
805f29dbc25Smrg  _LT_LANG_$1_CONFIG($1)])dnl
806f29dbc25Smrg])# _LT_LANG
807f29dbc25Smrg
808f29dbc25Smrg
809f29dbc25Smrg# _LT_LANG_DEFAULT_CONFIG
810f29dbc25Smrg# -----------------------
811f29dbc25Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
812f29dbc25Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
813f29dbc25Smrg  [LT_LANG(CXX)],
814f29dbc25Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
815f29dbc25Smrg
816f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
817f29dbc25Smrg  [LT_LANG(F77)],
818f29dbc25Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
819f29dbc25Smrg
820f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
821f29dbc25Smrg  [LT_LANG(FC)],
822f29dbc25Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
823f29dbc25Smrg
824f29dbc25Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
825f29dbc25Smrgdnl pulling things in needlessly.
826f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
827f29dbc25Smrg  [LT_LANG(GCJ)],
828f29dbc25Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
829f29dbc25Smrg    [LT_LANG(GCJ)],
830f29dbc25Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
831f29dbc25Smrg      [LT_LANG(GCJ)],
832f29dbc25Smrg      [m4_ifdef([AC_PROG_GCJ],
833f29dbc25Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
834f29dbc25Smrg       m4_ifdef([A][M_PROG_GCJ],
835f29dbc25Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
836f29dbc25Smrg       m4_ifdef([LT_PROG_GCJ],
837f29dbc25Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
838f29dbc25Smrg
839f29dbc25SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
840f29dbc25Smrg  [LT_LANG(RC)],
841f29dbc25Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
842f29dbc25Smrg])# _LT_LANG_DEFAULT_CONFIG
843f29dbc25Smrg
844f29dbc25Smrg# Obsolete macros:
845f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
846f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
847f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
848f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
849f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
850f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
851f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
852f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
853f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
854f29dbc25Smrg
855f29dbc25Smrg
856f29dbc25Smrg# _LT_TAG_COMPILER
857f29dbc25Smrg# ----------------
858f29dbc25Smrgm4_defun([_LT_TAG_COMPILER],
859f29dbc25Smrg[AC_REQUIRE([AC_PROG_CC])dnl
860f29dbc25Smrg
861f29dbc25Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
862f29dbc25Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
863f29dbc25Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
864f29dbc25Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
865f29dbc25Smrg
866f29dbc25Smrg# If no C compiler was specified, use CC.
867f29dbc25SmrgLTCC=${LTCC-"$CC"}
868f29dbc25Smrg
869f29dbc25Smrg# If no C compiler flags were specified, use CFLAGS.
870f29dbc25SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
871f29dbc25Smrg
872f29dbc25Smrg# Allow CC to be a program name with arguments.
873f29dbc25Smrgcompiler=$CC
874f29dbc25Smrg])# _LT_TAG_COMPILER
875f29dbc25Smrg
876f29dbc25Smrg
877f29dbc25Smrg# _LT_COMPILER_BOILERPLATE
878f29dbc25Smrg# ------------------------
879f29dbc25Smrg# Check for compiler boilerplate output or warnings with
880f29dbc25Smrg# the simple compiler test code.
881f29dbc25Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
882f29dbc25Smrg[m4_require([_LT_DECL_SED])dnl
883f29dbc25Smrgac_outfile=conftest.$ac_objext
884f29dbc25Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
885f29dbc25Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
886f29dbc25Smrg_lt_compiler_boilerplate=`cat conftest.err`
887f29dbc25Smrg$RM conftest*
888f29dbc25Smrg])# _LT_COMPILER_BOILERPLATE
889f29dbc25Smrg
890f29dbc25Smrg
891f29dbc25Smrg# _LT_LINKER_BOILERPLATE
892f29dbc25Smrg# ----------------------
893f29dbc25Smrg# Check for linker boilerplate output or warnings with
894f29dbc25Smrg# the simple link test code.
895f29dbc25Smrgm4_defun([_LT_LINKER_BOILERPLATE],
896f29dbc25Smrg[m4_require([_LT_DECL_SED])dnl
897f29dbc25Smrgac_outfile=conftest.$ac_objext
898f29dbc25Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
899f29dbc25Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
900f29dbc25Smrg_lt_linker_boilerplate=`cat conftest.err`
901f29dbc25Smrg$RM -r conftest*
902f29dbc25Smrg])# _LT_LINKER_BOILERPLATE
903f29dbc25Smrg
904f29dbc25Smrg# _LT_REQUIRED_DARWIN_CHECKS
905f29dbc25Smrg# -------------------------
906f29dbc25Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
907f29dbc25Smrg  case $host_os in
908f29dbc25Smrg    rhapsody* | darwin*)
909f29dbc25Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
910f29dbc25Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
911f29dbc25Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
912f29dbc25Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
913f29dbc25Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
914f29dbc25Smrg    _LT_DECL([], [DSYMUTIL], [1],
915f29dbc25Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
916f29dbc25Smrg    _LT_DECL([], [NMEDIT], [1],
917f29dbc25Smrg      [Tool to change global to local symbols on Mac OS X])
918f29dbc25Smrg    _LT_DECL([], [LIPO], [1],
919f29dbc25Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
920f29dbc25Smrg    _LT_DECL([], [OTOOL], [1],
921f29dbc25Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
922f29dbc25Smrg    _LT_DECL([], [OTOOL64], [1],
923f29dbc25Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
924f29dbc25Smrg
925f29dbc25Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
926f29dbc25Smrg      [lt_cv_apple_cc_single_mod=no
927f29dbc25Smrg      if test -z "${LT_MULTI_MODULE}"; then
928f29dbc25Smrg	# By default we will add the -single_module flag. You can override
929f29dbc25Smrg	# by either setting the environment variable LT_MULTI_MODULE
930f29dbc25Smrg	# non-empty at configure time, or by adding -multi_module to the
931f29dbc25Smrg	# link flags.
932f29dbc25Smrg	rm -rf libconftest.dylib*
933f29dbc25Smrg	echo "int foo(void){return 1;}" > conftest.c
934f29dbc25Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
935f29dbc25Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
936f29dbc25Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
937f29dbc25Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
938f29dbc25Smrg        _lt_result=$?
939f29dbc25Smrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
940f29dbc25Smrg	  lt_cv_apple_cc_single_mod=yes
941f29dbc25Smrg	else
942f29dbc25Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
943f29dbc25Smrg	fi
944f29dbc25Smrg	rm -rf libconftest.dylib*
945f29dbc25Smrg	rm -f conftest.*
946f29dbc25Smrg      fi])
947f29dbc25Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
948f29dbc25Smrg      [lt_cv_ld_exported_symbols_list],
949f29dbc25Smrg      [lt_cv_ld_exported_symbols_list=no
950f29dbc25Smrg      save_LDFLAGS=$LDFLAGS
951f29dbc25Smrg      echo "_main" > conftest.sym
952f29dbc25Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
953f29dbc25Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
954f29dbc25Smrg	[lt_cv_ld_exported_symbols_list=yes],
955f29dbc25Smrg	[lt_cv_ld_exported_symbols_list=no])
956f29dbc25Smrg	LDFLAGS="$save_LDFLAGS"
957f29dbc25Smrg    ])
958f29dbc25Smrg    case $host_os in
959f29dbc25Smrg    rhapsody* | darwin1.[[012]])
960f29dbc25Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
961f29dbc25Smrg    darwin1.*)
962f29dbc25Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
963f29dbc25Smrg    darwin*) # darwin 5.x on
964f29dbc25Smrg      # if running on 10.5 or later, the deployment target defaults
965f29dbc25Smrg      # to the OS version, if on x86, and 10.4, the deployment
966f29dbc25Smrg      # target defaults to 10.4. Don't you love it?
967f29dbc25Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
968f29dbc25Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
969f29dbc25Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
970f29dbc25Smrg	10.[[012]]*)
971f29dbc25Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
972f29dbc25Smrg	10.*)
973f29dbc25Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
974f29dbc25Smrg      esac
975f29dbc25Smrg    ;;
976f29dbc25Smrg  esac
977f29dbc25Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
978f29dbc25Smrg      _lt_dar_single_mod='$single_module'
979f29dbc25Smrg    fi
980f29dbc25Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
981f29dbc25Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
982f29dbc25Smrg    else
983f29dbc25Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
984f29dbc25Smrg    fi
985f29dbc25Smrg    if test "$DSYMUTIL" != ":"; then
986f29dbc25Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
987f29dbc25Smrg    else
988f29dbc25Smrg      _lt_dsymutil=
989f29dbc25Smrg    fi
990f29dbc25Smrg    ;;
991f29dbc25Smrg  esac
992f29dbc25Smrg])
993f29dbc25Smrg
994f29dbc25Smrg
995f29dbc25Smrg# _LT_DARWIN_LINKER_FEATURES
996f29dbc25Smrg# --------------------------
997f29dbc25Smrg# Checks for linker and compiler features on darwin
998f29dbc25Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
999f29dbc25Smrg[
1000f29dbc25Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1001f29dbc25Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1002f29dbc25Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1003f29dbc25Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1004f29dbc25Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1005f29dbc25Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1006f29dbc25Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1007f29dbc25Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1008f29dbc25Smrg  case $cc_basename in
1009f29dbc25Smrg     ifort*) _lt_dar_can_shared=yes ;;
1010f29dbc25Smrg     *) _lt_dar_can_shared=$GCC ;;
1011f29dbc25Smrg  esac
1012f29dbc25Smrg  if test "$_lt_dar_can_shared" = "yes"; then
1013f29dbc25Smrg    output_verbose_link_cmd=echo
1014f29dbc25Smrg    _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}"
1015f29dbc25Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1016f29dbc25Smrg    _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}"
1017f29dbc25Smrg    _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}"
1018f29dbc25Smrg    m4_if([$1], [CXX],
1019f29dbc25Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1020f29dbc25Smrg      _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}"
1021f29dbc25Smrg      _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}"
1022f29dbc25Smrg    fi
1023f29dbc25Smrg],[])
1024f29dbc25Smrg  else
1025f29dbc25Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1026f29dbc25Smrg  fi
1027f29dbc25Smrg])
1028f29dbc25Smrg
1029f29dbc25Smrg# _LT_SYS_MODULE_PATH_AIX
1030f29dbc25Smrg# -----------------------
1031f29dbc25Smrg# Links a minimal program and checks the executable
1032f29dbc25Smrg# for the system default hardcoded library path. In most cases,
1033f29dbc25Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1034f29dbc25Smrg# the location of the communication and MPI libs are included too.
1035f29dbc25Smrg# If we don't find anything, use the default library path according
1036f29dbc25Smrg# to the aix ld manual.
1037f29dbc25Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1038f29dbc25Smrg[m4_require([_LT_DECL_SED])dnl
1039f29dbc25SmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
1040f29dbc25Smrglt_aix_libpath_sed='
1041f29dbc25Smrg    /Import File Strings/,/^$/ {
1042f29dbc25Smrg	/^0/ {
1043f29dbc25Smrg	    s/^0  *\(.*\)$/\1/
1044f29dbc25Smrg	    p
1045f29dbc25Smrg	}
1046f29dbc25Smrg    }'
1047f29dbc25Smrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1048f29dbc25Smrg# Check for a 64-bit object if we didn't find anything.
1049f29dbc25Smrgif test -z "$aix_libpath"; then
1050f29dbc25Smrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1051f29dbc25Smrgfi],[])
1052f29dbc25Smrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1053f29dbc25Smrg])# _LT_SYS_MODULE_PATH_AIX
1054f29dbc25Smrg
1055f29dbc25Smrg
1056f29dbc25Smrg# _LT_SHELL_INIT(ARG)
1057f29dbc25Smrg# -------------------
1058f29dbc25Smrgm4_define([_LT_SHELL_INIT],
1059f29dbc25Smrg[ifdef([AC_DIVERSION_NOTICE],
1060f29dbc25Smrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1061f29dbc25Smrg	 [AC_DIVERT_PUSH(NOTICE)])
1062f29dbc25Smrg$1
1063f29dbc25SmrgAC_DIVERT_POP
1064f29dbc25Smrg])# _LT_SHELL_INIT
1065f29dbc25Smrg
1066f29dbc25Smrg
1067f29dbc25Smrg# _LT_PROG_ECHO_BACKSLASH
1068f29dbc25Smrg# -----------------------
1069f29dbc25Smrg# Add some code to the start of the generated configure script which
1070f29dbc25Smrg# will find an echo command which doesn't interpret backslashes.
1071f29dbc25Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1072f29dbc25Smrg[_LT_SHELL_INIT([
1073f29dbc25Smrg# Check that we are running under the correct shell.
1074f29dbc25SmrgSHELL=${CONFIG_SHELL-/bin/sh}
1075f29dbc25Smrg
1076f29dbc25Smrgcase X$lt_ECHO in
1077f29dbc25SmrgX*--fallback-echo)
1078f29dbc25Smrg  # Remove one level of quotation (which was required for Make).
1079f29dbc25Smrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1080f29dbc25Smrg  ;;
1081f29dbc25Smrgesac
1082f29dbc25Smrg
1083f29dbc25SmrgECHO=${lt_ECHO-echo}
1084f29dbc25Smrgif test "X[$]1" = X--no-reexec; then
1085f29dbc25Smrg  # Discard the --no-reexec flag, and continue.
1086f29dbc25Smrg  shift
1087f29dbc25Smrgelif test "X[$]1" = X--fallback-echo; then
1088f29dbc25Smrg  # Avoid inline document here, it may be left over
1089f29dbc25Smrg  :
1090f29dbc25Smrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1091f29dbc25Smrg  # Yippee, $ECHO works!
1092f29dbc25Smrg  :
1093f29dbc25Smrgelse
1094f29dbc25Smrg  # Restart under the correct shell.
1095f29dbc25Smrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1096f29dbc25Smrgfi
1097f29dbc25Smrg
1098f29dbc25Smrgif test "X[$]1" = X--fallback-echo; then
1099f29dbc25Smrg  # used as fallback echo
1100f29dbc25Smrg  shift
1101f29dbc25Smrg  cat <<_LT_EOF
1102f29dbc25Smrg[$]*
1103f29dbc25Smrg_LT_EOF
1104f29dbc25Smrg  exit 0
1105f29dbc25Smrgfi
1106f29dbc25Smrg
1107f29dbc25Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1108f29dbc25Smrg# if CDPATH is set.
1109f29dbc25Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1110f29dbc25Smrg
1111f29dbc25Smrgif test -z "$lt_ECHO"; then
1112f29dbc25Smrg  if test "X${echo_test_string+set}" != Xset; then
1113f29dbc25Smrg    # find a string as large as possible, as long as the shell can cope with it
1114f29dbc25Smrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1115f29dbc25Smrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1116f29dbc25Smrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1117f29dbc25Smrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1118f29dbc25Smrg      then
1119f29dbc25Smrg        break
1120f29dbc25Smrg      fi
1121f29dbc25Smrg    done
1122f29dbc25Smrg  fi
1123f29dbc25Smrg
1124f29dbc25Smrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1125f29dbc25Smrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1126f29dbc25Smrg     test "X$echo_testing_string" = "X$echo_test_string"; then
1127f29dbc25Smrg    :
1128f29dbc25Smrg  else
1129f29dbc25Smrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
1130f29dbc25Smrg    # backslashes.  This makes it impossible to quote backslashes using
1131f29dbc25Smrg    #   echo "$something" | sed 's/\\/\\\\/g'
1132f29dbc25Smrg    #
1133f29dbc25Smrg    # So, first we look for a working echo in the user's PATH.
1134f29dbc25Smrg
1135f29dbc25Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1136f29dbc25Smrg    for dir in $PATH /usr/ucb; do
1137f29dbc25Smrg      IFS="$lt_save_ifs"
1138f29dbc25Smrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1139f29dbc25Smrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1140f29dbc25Smrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1141f29dbc25Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1142f29dbc25Smrg        ECHO="$dir/echo"
1143f29dbc25Smrg        break
1144f29dbc25Smrg      fi
1145f29dbc25Smrg    done
1146f29dbc25Smrg    IFS="$lt_save_ifs"
1147f29dbc25Smrg
1148f29dbc25Smrg    if test "X$ECHO" = Xecho; then
1149f29dbc25Smrg      # We didn't find a better echo, so look for alternatives.
1150f29dbc25Smrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1151f29dbc25Smrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1152f29dbc25Smrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1153f29dbc25Smrg        # This shell has a builtin print -r that does the trick.
1154f29dbc25Smrg        ECHO='print -r'
1155f29dbc25Smrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1156f29dbc25Smrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
1157f29dbc25Smrg        # If we have ksh, try running configure again with it.
1158f29dbc25Smrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1159f29dbc25Smrg        export ORIGINAL_CONFIG_SHELL
1160f29dbc25Smrg        CONFIG_SHELL=/bin/ksh
1161f29dbc25Smrg        export CONFIG_SHELL
1162f29dbc25Smrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1163f29dbc25Smrg      else
1164f29dbc25Smrg        # Try using printf.
1165f29dbc25Smrg        ECHO='printf %s\n'
1166f29dbc25Smrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1167f29dbc25Smrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1168f29dbc25Smrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1169f29dbc25Smrg	  # Cool, printf works
1170f29dbc25Smrg	  :
1171f29dbc25Smrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1172f29dbc25Smrg	     test "X$echo_testing_string" = 'X\t' &&
1173f29dbc25Smrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1174f29dbc25Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1175f29dbc25Smrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1176f29dbc25Smrg	  export CONFIG_SHELL
1177f29dbc25Smrg	  SHELL="$CONFIG_SHELL"
1178f29dbc25Smrg	  export SHELL
1179f29dbc25Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1180f29dbc25Smrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1181f29dbc25Smrg	     test "X$echo_testing_string" = 'X\t' &&
1182f29dbc25Smrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1183f29dbc25Smrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1184f29dbc25Smrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1185f29dbc25Smrg        else
1186f29dbc25Smrg	  # maybe with a smaller string...
1187f29dbc25Smrg	  prev=:
1188f29dbc25Smrg
1189f29dbc25Smrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1190f29dbc25Smrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1191f29dbc25Smrg	    then
1192f29dbc25Smrg	      break
1193f29dbc25Smrg	    fi
1194f29dbc25Smrg	    prev="$cmd"
1195f29dbc25Smrg	  done
1196f29dbc25Smrg
1197f29dbc25Smrg	  if test "$prev" != 'sed 50q "[$]0"'; then
1198f29dbc25Smrg	    echo_test_string=`eval $prev`
1199f29dbc25Smrg	    export echo_test_string
1200f29dbc25Smrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1201f29dbc25Smrg	  else
1202f29dbc25Smrg	    # Oops.  We lost completely, so just stick with echo.
1203f29dbc25Smrg	    ECHO=echo
1204f29dbc25Smrg	  fi
1205f29dbc25Smrg        fi
1206f29dbc25Smrg      fi
1207f29dbc25Smrg    fi
1208f29dbc25Smrg  fi
1209f29dbc25Smrgfi
1210f29dbc25Smrg
1211f29dbc25Smrg# Copy echo and quote the copy suitably for passing to libtool from
1212f29dbc25Smrg# the Makefile, instead of quoting the original, which is used later.
1213f29dbc25Smrglt_ECHO=$ECHO
1214f29dbc25Smrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1215f29dbc25Smrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
1216f29dbc25Smrgfi
1217f29dbc25Smrg
1218f29dbc25SmrgAC_SUBST(lt_ECHO)
1219f29dbc25Smrg])
1220f29dbc25Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1221f29dbc25Smrg_LT_DECL([], [ECHO], [1],
1222f29dbc25Smrg    [An echo program that does not interpret backslashes])
1223f29dbc25Smrg])# _LT_PROG_ECHO_BACKSLASH
1224f29dbc25Smrg
1225f29dbc25Smrg
1226f29dbc25Smrg# _LT_ENABLE_LOCK
1227f29dbc25Smrg# ---------------
1228f29dbc25Smrgm4_defun([_LT_ENABLE_LOCK],
1229f29dbc25Smrg[AC_ARG_ENABLE([libtool-lock],
1230f29dbc25Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1231f29dbc25Smrg    [avoid locking (might break parallel builds)])])
1232f29dbc25Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233f29dbc25Smrg
1234f29dbc25Smrg# Some flags need to be propagated to the compiler or linker for good
1235f29dbc25Smrg# libtool support.
1236f29dbc25Smrgcase $host in
1237f29dbc25Smrgia64-*-hpux*)
1238f29dbc25Smrg  # Find out which ABI we are using.
1239f29dbc25Smrg  echo 'int i;' > conftest.$ac_ext
1240f29dbc25Smrg  if AC_TRY_EVAL(ac_compile); then
1241f29dbc25Smrg    case `/usr/bin/file conftest.$ac_objext` in
1242f29dbc25Smrg      *ELF-32*)
1243f29dbc25Smrg	HPUX_IA64_MODE="32"
1244f29dbc25Smrg	;;
1245f29dbc25Smrg      *ELF-64*)
1246f29dbc25Smrg	HPUX_IA64_MODE="64"
1247f29dbc25Smrg	;;
1248f29dbc25Smrg    esac
1249f29dbc25Smrg  fi
1250f29dbc25Smrg  rm -rf conftest*
1251f29dbc25Smrg  ;;
1252f29dbc25Smrg*-*-irix6*)
1253f29dbc25Smrg  # Find out which ABI we are using.
1254f29dbc25Smrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1255f29dbc25Smrg  if AC_TRY_EVAL(ac_compile); then
1256f29dbc25Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1257f29dbc25Smrg      case `/usr/bin/file conftest.$ac_objext` in
1258f29dbc25Smrg	*32-bit*)
1259f29dbc25Smrg	  LD="${LD-ld} -melf32bsmip"
1260f29dbc25Smrg	  ;;
1261f29dbc25Smrg	*N32*)
1262f29dbc25Smrg	  LD="${LD-ld} -melf32bmipn32"
1263f29dbc25Smrg	  ;;
1264f29dbc25Smrg	*64-bit*)
1265f29dbc25Smrg	  LD="${LD-ld} -melf64bmip"
1266f29dbc25Smrg	;;
1267f29dbc25Smrg      esac
1268f29dbc25Smrg    else
1269f29dbc25Smrg      case `/usr/bin/file conftest.$ac_objext` in
1270f29dbc25Smrg	*32-bit*)
1271f29dbc25Smrg	  LD="${LD-ld} -32"
1272f29dbc25Smrg	  ;;
1273f29dbc25Smrg	*N32*)
1274f29dbc25Smrg	  LD="${LD-ld} -n32"
1275f29dbc25Smrg	  ;;
1276f29dbc25Smrg	*64-bit*)
1277f29dbc25Smrg	  LD="${LD-ld} -64"
1278f29dbc25Smrg	  ;;
1279f29dbc25Smrg      esac
1280f29dbc25Smrg    fi
1281f29dbc25Smrg  fi
1282f29dbc25Smrg  rm -rf conftest*
1283f29dbc25Smrg  ;;
1284f29dbc25Smrg
1285f29dbc25Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1286f29dbc25Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1287f29dbc25Smrg  # Find out which ABI we are using.
1288f29dbc25Smrg  echo 'int i;' > conftest.$ac_ext
1289f29dbc25Smrg  if AC_TRY_EVAL(ac_compile); then
1290f29dbc25Smrg    case `/usr/bin/file conftest.o` in
1291f29dbc25Smrg      *32-bit*)
1292f29dbc25Smrg	case $host in
1293f29dbc25Smrg	  x86_64-*kfreebsd*-gnu)
1294f29dbc25Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1295f29dbc25Smrg	    ;;
1296f29dbc25Smrg	  x86_64-*linux*)
1297f29dbc25Smrg	    LD="${LD-ld} -m elf_i386"
1298f29dbc25Smrg	    ;;
1299f29dbc25Smrg	  ppc64-*linux*|powerpc64-*linux*)
1300f29dbc25Smrg	    LD="${LD-ld} -m elf32ppclinux"
1301f29dbc25Smrg	    ;;
1302f29dbc25Smrg	  s390x-*linux*)
1303f29dbc25Smrg	    LD="${LD-ld} -m elf_s390"
1304f29dbc25Smrg	    ;;
1305f29dbc25Smrg	  sparc64-*linux*)
1306f29dbc25Smrg	    LD="${LD-ld} -m elf32_sparc"
1307f29dbc25Smrg	    ;;
1308f29dbc25Smrg	esac
1309f29dbc25Smrg	;;
1310f29dbc25Smrg      *64-bit*)
1311f29dbc25Smrg	case $host in
1312f29dbc25Smrg	  x86_64-*kfreebsd*-gnu)
1313f29dbc25Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1314f29dbc25Smrg	    ;;
1315f29dbc25Smrg	  x86_64-*linux*)
1316f29dbc25Smrg	    LD="${LD-ld} -m elf_x86_64"
1317f29dbc25Smrg	    ;;
1318f29dbc25Smrg	  ppc*-*linux*|powerpc*-*linux*)
1319f29dbc25Smrg	    LD="${LD-ld} -m elf64ppc"
1320f29dbc25Smrg	    ;;
1321f29dbc25Smrg	  s390*-*linux*|s390*-*tpf*)
1322f29dbc25Smrg	    LD="${LD-ld} -m elf64_s390"
1323f29dbc25Smrg	    ;;
1324f29dbc25Smrg	  sparc*-*linux*)
1325f29dbc25Smrg	    LD="${LD-ld} -m elf64_sparc"
1326f29dbc25Smrg	    ;;
1327f29dbc25Smrg	esac
1328f29dbc25Smrg	;;
1329f29dbc25Smrg    esac
1330f29dbc25Smrg  fi
1331f29dbc25Smrg  rm -rf conftest*
1332f29dbc25Smrg  ;;
1333f29dbc25Smrg
1334f29dbc25Smrg*-*-sco3.2v5*)
1335f29dbc25Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336f29dbc25Smrg  SAVE_CFLAGS="$CFLAGS"
1337f29dbc25Smrg  CFLAGS="$CFLAGS -belf"
1338f29dbc25Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339f29dbc25Smrg    [AC_LANG_PUSH(C)
1340f29dbc25Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1341f29dbc25Smrg     AC_LANG_POP])
1342f29dbc25Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1343f29dbc25Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1344f29dbc25Smrg    CFLAGS="$SAVE_CFLAGS"
1345f29dbc25Smrg  fi
1346f29dbc25Smrg  ;;
1347f29dbc25Smrgsparc*-*solaris*)
1348f29dbc25Smrg  # Find out which ABI we are using.
1349f29dbc25Smrg  echo 'int i;' > conftest.$ac_ext
1350f29dbc25Smrg  if AC_TRY_EVAL(ac_compile); then
1351f29dbc25Smrg    case `/usr/bin/file conftest.o` in
1352f29dbc25Smrg    *64-bit*)
1353f29dbc25Smrg      case $lt_cv_prog_gnu_ld in
1354f29dbc25Smrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
1355f29dbc25Smrg      *)
1356f29dbc25Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1357f29dbc25Smrg	  LD="${LD-ld} -64"
1358f29dbc25Smrg	fi
1359f29dbc25Smrg	;;
1360f29dbc25Smrg      esac
1361f29dbc25Smrg      ;;
1362f29dbc25Smrg    esac
1363f29dbc25Smrg  fi
1364f29dbc25Smrg  rm -rf conftest*
1365f29dbc25Smrg  ;;
1366f29dbc25Smrgesac
1367f29dbc25Smrg
1368f29dbc25Smrgneed_locks="$enable_libtool_lock"
1369f29dbc25Smrg])# _LT_ENABLE_LOCK
1370f29dbc25Smrg
1371f29dbc25Smrg
1372f29dbc25Smrg# _LT_CMD_OLD_ARCHIVE
1373f29dbc25Smrg# -------------------
1374f29dbc25Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1375f29dbc25Smrg[AC_CHECK_TOOL(AR, ar, false)
1376f29dbc25Smrgtest -z "$AR" && AR=ar
1377f29dbc25Smrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1378f29dbc25Smrg_LT_DECL([], [AR], [1], [The archiver])
1379f29dbc25Smrg_LT_DECL([], [AR_FLAGS], [1])
1380f29dbc25Smrg
1381f29dbc25SmrgAC_CHECK_TOOL(STRIP, strip, :)
1382f29dbc25Smrgtest -z "$STRIP" && STRIP=:
1383f29dbc25Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1384f29dbc25Smrg
1385f29dbc25SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1386f29dbc25Smrgtest -z "$RANLIB" && RANLIB=:
1387f29dbc25Smrg_LT_DECL([], [RANLIB], [1],
1388f29dbc25Smrg    [Commands used to install an old-style archive])
1389f29dbc25Smrg
1390f29dbc25Smrg# Determine commands to create old-style static archives.
1391f29dbc25Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1392f29dbc25Smrgold_postinstall_cmds='chmod 644 $oldlib'
1393f29dbc25Smrgold_postuninstall_cmds=
1394f29dbc25Smrg
1395f29dbc25Smrgif test -n "$RANLIB"; then
1396f29dbc25Smrg  case $host_os in
1397f29dbc25Smrg  openbsd*)
1398f29dbc25Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1399f29dbc25Smrg    ;;
1400f29dbc25Smrg  *)
1401f29dbc25Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1402f29dbc25Smrg    ;;
1403f29dbc25Smrg  esac
1404f29dbc25Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
1405f29dbc25Smrgfi
1406f29dbc25Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1407f29dbc25Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1408f29dbc25Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1409f29dbc25Smrg    [Commands used to build an old-style archive])
1410f29dbc25Smrg])# _LT_CMD_OLD_ARCHIVE
1411f29dbc25Smrg
1412f29dbc25Smrg
1413f29dbc25Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1414f29dbc25Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1415f29dbc25Smrg# ----------------------------------------------------------------
1416f29dbc25Smrg# Check whether the given compiler option works
1417f29dbc25SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1418f29dbc25Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1419f29dbc25Smrgm4_require([_LT_DECL_SED])dnl
1420f29dbc25SmrgAC_CACHE_CHECK([$1], [$2],
1421f29dbc25Smrg  [$2=no
1422f29dbc25Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1423f29dbc25Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1424f29dbc25Smrg   lt_compiler_flag="$3"
1425f29dbc25Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1426f29dbc25Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1427f29dbc25Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1428f29dbc25Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1429f29dbc25Smrg   # The option is referenced via a variable to avoid confusing sed.
1430f29dbc25Smrg   lt_compile=`echo "$ac_compile" | $SED \
1431f29dbc25Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1432f29dbc25Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1433f29dbc25Smrg   -e 's:$: $lt_compiler_flag:'`
1434f29dbc25Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1435f29dbc25Smrg   (eval "$lt_compile" 2>conftest.err)
1436f29dbc25Smrg   ac_status=$?
1437f29dbc25Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1438f29dbc25Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1439f29dbc25Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1440f29dbc25Smrg     # The compiler can only warn and ignore the option if not recognized
1441f29dbc25Smrg     # So say no if there are warnings other than the usual output.
1442f29dbc25Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1443f29dbc25Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1444f29dbc25Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1445f29dbc25Smrg       $2=yes
1446f29dbc25Smrg     fi
1447f29dbc25Smrg   fi
1448f29dbc25Smrg   $RM conftest*
1449f29dbc25Smrg])
1450f29dbc25Smrg
1451f29dbc25Smrgif test x"[$]$2" = xyes; then
1452f29dbc25Smrg    m4_if([$5], , :, [$5])
1453f29dbc25Smrgelse
1454f29dbc25Smrg    m4_if([$6], , :, [$6])
1455f29dbc25Smrgfi
1456f29dbc25Smrg])# _LT_COMPILER_OPTION
1457f29dbc25Smrg
1458f29dbc25Smrg# Old name:
1459f29dbc25SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1460f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
1461f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1462f29dbc25Smrg
1463f29dbc25Smrg
1464f29dbc25Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1465f29dbc25Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1466f29dbc25Smrg# ----------------------------------------------------
1467f29dbc25Smrg# Check whether the given linker option works
1468f29dbc25SmrgAC_DEFUN([_LT_LINKER_OPTION],
1469f29dbc25Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1470f29dbc25Smrgm4_require([_LT_DECL_SED])dnl
1471f29dbc25SmrgAC_CACHE_CHECK([$1], [$2],
1472f29dbc25Smrg  [$2=no
1473f29dbc25Smrg   save_LDFLAGS="$LDFLAGS"
1474f29dbc25Smrg   LDFLAGS="$LDFLAGS $3"
1475f29dbc25Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1476f29dbc25Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1477f29dbc25Smrg     # The linker can only warn and ignore the option if not recognized
1478f29dbc25Smrg     # So say no if there are warnings
1479f29dbc25Smrg     if test -s conftest.err; then
1480f29dbc25Smrg       # Append any errors to the config.log.
1481f29dbc25Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1482f29dbc25Smrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1483f29dbc25Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1484f29dbc25Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1485f29dbc25Smrg         $2=yes
1486f29dbc25Smrg       fi
1487f29dbc25Smrg     else
1488f29dbc25Smrg       $2=yes
1489f29dbc25Smrg     fi
1490f29dbc25Smrg   fi
1491f29dbc25Smrg   $RM -r conftest*
1492f29dbc25Smrg   LDFLAGS="$save_LDFLAGS"
1493f29dbc25Smrg])
1494f29dbc25Smrg
1495f29dbc25Smrgif test x"[$]$2" = xyes; then
1496f29dbc25Smrg    m4_if([$4], , :, [$4])
1497f29dbc25Smrgelse
1498f29dbc25Smrg    m4_if([$5], , :, [$5])
1499f29dbc25Smrgfi
1500f29dbc25Smrg])# _LT_LINKER_OPTION
1501f29dbc25Smrg
1502f29dbc25Smrg# Old name:
1503f29dbc25SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1504f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
1505f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1506f29dbc25Smrg
1507f29dbc25Smrg
1508f29dbc25Smrg# LT_CMD_MAX_LEN
1509f29dbc25Smrg#---------------
1510f29dbc25SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1511f29dbc25Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1512f29dbc25Smrg# find the maximum length of command line arguments
1513f29dbc25SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1514f29dbc25SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1515f29dbc25Smrg  i=0
1516f29dbc25Smrg  teststring="ABCD"
1517f29dbc25Smrg
1518f29dbc25Smrg  case $build_os in
1519f29dbc25Smrg  msdosdjgpp*)
1520f29dbc25Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1521f29dbc25Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1522f29dbc25Smrg    # during glob expansion).  Even if it were fixed, the result of this
1523f29dbc25Smrg    # check would be larger than it should be.
1524f29dbc25Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1525f29dbc25Smrg    ;;
1526f29dbc25Smrg
1527f29dbc25Smrg  gnu*)
1528f29dbc25Smrg    # Under GNU Hurd, this test is not required because there is
1529f29dbc25Smrg    # no limit to the length of command line arguments.
1530f29dbc25Smrg    # Libtool will interpret -1 as no limit whatsoever
1531f29dbc25Smrg    lt_cv_sys_max_cmd_len=-1;
1532f29dbc25Smrg    ;;
1533f29dbc25Smrg
1534f29dbc25Smrg  cygwin* | mingw* | cegcc*)
1535f29dbc25Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1536f29dbc25Smrg    # about 5 minutes as the teststring grows exponentially.
1537f29dbc25Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1538f29dbc25Smrg    # you end up with a "frozen" computer, even though with patience
1539f29dbc25Smrg    # the test eventually succeeds (with a max line length of 256k).
1540f29dbc25Smrg    # Instead, let's just punt: use the minimum linelength reported by
1541f29dbc25Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1542f29dbc25Smrg    lt_cv_sys_max_cmd_len=8192;
1543f29dbc25Smrg    ;;
1544f29dbc25Smrg
1545f29dbc25Smrg  amigaos*)
1546f29dbc25Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1547f29dbc25Smrg    # So we just punt and use a minimum line length of 8192.
1548f29dbc25Smrg    lt_cv_sys_max_cmd_len=8192;
1549f29dbc25Smrg    ;;
1550f29dbc25Smrg
1551f29dbc25Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1552f29dbc25Smrg    # This has been around since 386BSD, at least.  Likely further.
1553f29dbc25Smrg    if test -x /sbin/sysctl; then
1554f29dbc25Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1555f29dbc25Smrg    elif test -x /usr/sbin/sysctl; then
1556f29dbc25Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1557f29dbc25Smrg    else
1558f29dbc25Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1559f29dbc25Smrg    fi
1560f29dbc25Smrg    # And add a safety zone
1561f29dbc25Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1562f29dbc25Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1563f29dbc25Smrg    ;;
1564f29dbc25Smrg
1565f29dbc25Smrg  interix*)
1566f29dbc25Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1567f29dbc25Smrg    lt_cv_sys_max_cmd_len=196608
1568f29dbc25Smrg    ;;
1569f29dbc25Smrg
1570f29dbc25Smrg  osf*)
1571f29dbc25Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1572f29dbc25Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1573f29dbc25Smrg    # nice to cause kernel panics so lets avoid the loop below.
1574f29dbc25Smrg    # First set a reasonable default.
1575f29dbc25Smrg    lt_cv_sys_max_cmd_len=16384
1576f29dbc25Smrg    #
1577f29dbc25Smrg    if test -x /sbin/sysconfig; then
1578f29dbc25Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1579f29dbc25Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1580f29dbc25Smrg      esac
1581f29dbc25Smrg    fi
1582f29dbc25Smrg    ;;
1583f29dbc25Smrg  sco3.2v5*)
1584f29dbc25Smrg    lt_cv_sys_max_cmd_len=102400
1585f29dbc25Smrg    ;;
1586f29dbc25Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1587f29dbc25Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1588f29dbc25Smrg    if test -n "$kargmax"; then
1589f29dbc25Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1590f29dbc25Smrg    else
1591f29dbc25Smrg      lt_cv_sys_max_cmd_len=32768
1592f29dbc25Smrg    fi
1593f29dbc25Smrg    ;;
1594f29dbc25Smrg  *)
1595f29dbc25Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1596f29dbc25Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1597f29dbc25Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1598f29dbc25Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1599f29dbc25Smrg    else
1600f29dbc25Smrg      # Make teststring a little bigger before we do anything with it.
1601f29dbc25Smrg      # a 1K string should be a reasonable start.
1602f29dbc25Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1603f29dbc25Smrg        teststring=$teststring$teststring
1604f29dbc25Smrg      done
1605f29dbc25Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1606f29dbc25Smrg      # If test is not a shell built-in, we'll probably end up computing a
1607f29dbc25Smrg      # maximum length that is only half of the actual maximum length, but
1608f29dbc25Smrg      # we can't tell.
1609f29dbc25Smrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1610f29dbc25Smrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1611f29dbc25Smrg	      test $i != 17 # 1/2 MB should be enough
1612f29dbc25Smrg      do
1613f29dbc25Smrg        i=`expr $i + 1`
1614f29dbc25Smrg        teststring=$teststring$teststring
1615f29dbc25Smrg      done
1616f29dbc25Smrg      # Only check the string length outside the loop.
1617f29dbc25Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1618f29dbc25Smrg      teststring=
1619f29dbc25Smrg      # Add a significant safety factor because C++ compilers can tack on
1620f29dbc25Smrg      # massive amounts of additional arguments before passing them to the
1621f29dbc25Smrg      # linker.  It appears as though 1/2 is a usable value.
1622f29dbc25Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1623f29dbc25Smrg    fi
1624f29dbc25Smrg    ;;
1625f29dbc25Smrg  esac
1626f29dbc25Smrg])
1627f29dbc25Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1628f29dbc25Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1629f29dbc25Smrgelse
1630f29dbc25Smrg  AC_MSG_RESULT(none)
1631f29dbc25Smrgfi
1632f29dbc25Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1633f29dbc25Smrg_LT_DECL([], [max_cmd_len], [0],
1634f29dbc25Smrg    [What is the maximum length of a command?])
1635f29dbc25Smrg])# LT_CMD_MAX_LEN
1636f29dbc25Smrg
1637f29dbc25Smrg# Old name:
1638f29dbc25SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1639f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
1640f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1641f29dbc25Smrg
1642f29dbc25Smrg
1643f29dbc25Smrg# _LT_HEADER_DLFCN
1644f29dbc25Smrg# ----------------
1645f29dbc25Smrgm4_defun([_LT_HEADER_DLFCN],
1646f29dbc25Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1647f29dbc25Smrg])# _LT_HEADER_DLFCN
1648f29dbc25Smrg
1649f29dbc25Smrg
1650f29dbc25Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1651f29dbc25Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1652f29dbc25Smrg# ----------------------------------------------------------------
1653f29dbc25Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1654f29dbc25Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1655f29dbc25Smrgif test "$cross_compiling" = yes; then :
1656f29dbc25Smrg  [$4]
1657f29dbc25Smrgelse
1658f29dbc25Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1659f29dbc25Smrg  lt_status=$lt_dlunknown
1660f29dbc25Smrg  cat > conftest.$ac_ext <<_LT_EOF
1661f29dbc25Smrg[#line __oline__ "configure"
1662f29dbc25Smrg#include "confdefs.h"
1663f29dbc25Smrg
1664f29dbc25Smrg#if HAVE_DLFCN_H
1665f29dbc25Smrg#include <dlfcn.h>
1666f29dbc25Smrg#endif
1667f29dbc25Smrg
1668f29dbc25Smrg#include <stdio.h>
1669f29dbc25Smrg
1670f29dbc25Smrg#ifdef RTLD_GLOBAL
1671f29dbc25Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1672f29dbc25Smrg#else
1673f29dbc25Smrg#  ifdef DL_GLOBAL
1674f29dbc25Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1675f29dbc25Smrg#  else
1676f29dbc25Smrg#    define LT_DLGLOBAL		0
1677f29dbc25Smrg#  endif
1678f29dbc25Smrg#endif
1679f29dbc25Smrg
1680f29dbc25Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1681f29dbc25Smrg   find out it does not work in some platform. */
1682f29dbc25Smrg#ifndef LT_DLLAZY_OR_NOW
1683f29dbc25Smrg#  ifdef RTLD_LAZY
1684f29dbc25Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1685f29dbc25Smrg#  else
1686f29dbc25Smrg#    ifdef DL_LAZY
1687f29dbc25Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1688f29dbc25Smrg#    else
1689f29dbc25Smrg#      ifdef RTLD_NOW
1690f29dbc25Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1691f29dbc25Smrg#      else
1692f29dbc25Smrg#        ifdef DL_NOW
1693f29dbc25Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1694f29dbc25Smrg#        else
1695f29dbc25Smrg#          define LT_DLLAZY_OR_NOW	0
1696f29dbc25Smrg#        endif
1697f29dbc25Smrg#      endif
1698f29dbc25Smrg#    endif
1699f29dbc25Smrg#  endif
1700f29dbc25Smrg#endif
1701f29dbc25Smrg
1702f29dbc25Smrgvoid fnord() { int i=42;}
1703f29dbc25Smrgint main ()
1704f29dbc25Smrg{
1705f29dbc25Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1706f29dbc25Smrg  int status = $lt_dlunknown;
1707f29dbc25Smrg
1708f29dbc25Smrg  if (self)
1709f29dbc25Smrg    {
1710f29dbc25Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1711f29dbc25Smrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1712f29dbc25Smrg      /* dlclose (self); */
1713f29dbc25Smrg    }
1714f29dbc25Smrg  else
1715f29dbc25Smrg    puts (dlerror ());
1716f29dbc25Smrg
1717f29dbc25Smrg  return status;
1718f29dbc25Smrg}]
1719f29dbc25Smrg_LT_EOF
1720f29dbc25Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1721f29dbc25Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1722f29dbc25Smrg    lt_status=$?
1723f29dbc25Smrg    case x$lt_status in
1724f29dbc25Smrg      x$lt_dlno_uscore) $1 ;;
1725f29dbc25Smrg      x$lt_dlneed_uscore) $2 ;;
1726f29dbc25Smrg      x$lt_dlunknown|x*) $3 ;;
1727f29dbc25Smrg    esac
1728f29dbc25Smrg  else :
1729f29dbc25Smrg    # compilation failed
1730f29dbc25Smrg    $3
1731f29dbc25Smrg  fi
1732f29dbc25Smrgfi
1733f29dbc25Smrgrm -fr conftest*
1734f29dbc25Smrg])# _LT_TRY_DLOPEN_SELF
1735f29dbc25Smrg
1736f29dbc25Smrg
1737f29dbc25Smrg# LT_SYS_DLOPEN_SELF
1738f29dbc25Smrg# ------------------
1739f29dbc25SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1740f29dbc25Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1741f29dbc25Smrgif test "x$enable_dlopen" != xyes; then
1742f29dbc25Smrg  enable_dlopen=unknown
1743f29dbc25Smrg  enable_dlopen_self=unknown
1744f29dbc25Smrg  enable_dlopen_self_static=unknown
1745f29dbc25Smrgelse
1746f29dbc25Smrg  lt_cv_dlopen=no
1747f29dbc25Smrg  lt_cv_dlopen_libs=
1748f29dbc25Smrg
1749f29dbc25Smrg  case $host_os in
1750f29dbc25Smrg  beos*)
1751f29dbc25Smrg    lt_cv_dlopen="load_add_on"
1752f29dbc25Smrg    lt_cv_dlopen_libs=
1753f29dbc25Smrg    lt_cv_dlopen_self=yes
1754f29dbc25Smrg    ;;
1755f29dbc25Smrg
1756f29dbc25Smrg  mingw* | pw32* | cegcc*)
1757f29dbc25Smrg    lt_cv_dlopen="LoadLibrary"
1758f29dbc25Smrg    lt_cv_dlopen_libs=
1759f29dbc25Smrg    ;;
1760f29dbc25Smrg
1761f29dbc25Smrg  cygwin*)
1762f29dbc25Smrg    lt_cv_dlopen="dlopen"
1763f29dbc25Smrg    lt_cv_dlopen_libs=
1764f29dbc25Smrg    ;;
1765f29dbc25Smrg
1766f29dbc25Smrg  darwin*)
1767f29dbc25Smrg  # if libdl is installed we need to link against it
1768f29dbc25Smrg    AC_CHECK_LIB([dl], [dlopen],
1769f29dbc25Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1770f29dbc25Smrg    lt_cv_dlopen="dyld"
1771f29dbc25Smrg    lt_cv_dlopen_libs=
1772f29dbc25Smrg    lt_cv_dlopen_self=yes
1773f29dbc25Smrg    ])
1774f29dbc25Smrg    ;;
1775f29dbc25Smrg
1776f29dbc25Smrg  *)
1777f29dbc25Smrg    AC_CHECK_FUNC([shl_load],
1778f29dbc25Smrg	  [lt_cv_dlopen="shl_load"],
1779f29dbc25Smrg      [AC_CHECK_LIB([dld], [shl_load],
1780f29dbc25Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1781f29dbc25Smrg	[AC_CHECK_FUNC([dlopen],
1782f29dbc25Smrg	      [lt_cv_dlopen="dlopen"],
1783f29dbc25Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1784f29dbc25Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1785f29dbc25Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1786f29dbc25Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1787f29dbc25Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1788f29dbc25Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1789f29dbc25Smrg	      ])
1790f29dbc25Smrg	    ])
1791f29dbc25Smrg	  ])
1792f29dbc25Smrg	])
1793f29dbc25Smrg      ])
1794f29dbc25Smrg    ;;
1795f29dbc25Smrg  esac
1796f29dbc25Smrg
1797f29dbc25Smrg  if test "x$lt_cv_dlopen" != xno; then
1798f29dbc25Smrg    enable_dlopen=yes
1799f29dbc25Smrg  else
1800f29dbc25Smrg    enable_dlopen=no
1801f29dbc25Smrg  fi
1802f29dbc25Smrg
1803f29dbc25Smrg  case $lt_cv_dlopen in
1804f29dbc25Smrg  dlopen)
1805f29dbc25Smrg    save_CPPFLAGS="$CPPFLAGS"
1806f29dbc25Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1807f29dbc25Smrg
1808f29dbc25Smrg    save_LDFLAGS="$LDFLAGS"
1809f29dbc25Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1810f29dbc25Smrg
1811f29dbc25Smrg    save_LIBS="$LIBS"
1812f29dbc25Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1813f29dbc25Smrg
1814f29dbc25Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1815f29dbc25Smrg	  lt_cv_dlopen_self, [dnl
1816f29dbc25Smrg	  _LT_TRY_DLOPEN_SELF(
1817f29dbc25Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1818f29dbc25Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1819f29dbc25Smrg    ])
1820f29dbc25Smrg
1821f29dbc25Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1822f29dbc25Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1823f29dbc25Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1824f29dbc25Smrg	  lt_cv_dlopen_self_static, [dnl
1825f29dbc25Smrg	  _LT_TRY_DLOPEN_SELF(
1826f29dbc25Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1827f29dbc25Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1828f29dbc25Smrg      ])
1829f29dbc25Smrg    fi
1830f29dbc25Smrg
1831f29dbc25Smrg    CPPFLAGS="$save_CPPFLAGS"
1832f29dbc25Smrg    LDFLAGS="$save_LDFLAGS"
1833f29dbc25Smrg    LIBS="$save_LIBS"
1834f29dbc25Smrg    ;;
1835f29dbc25Smrg  esac
1836f29dbc25Smrg
1837f29dbc25Smrg  case $lt_cv_dlopen_self in
1838f29dbc25Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1839f29dbc25Smrg  *) enable_dlopen_self=unknown ;;
1840f29dbc25Smrg  esac
1841f29dbc25Smrg
1842f29dbc25Smrg  case $lt_cv_dlopen_self_static in
1843f29dbc25Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1844f29dbc25Smrg  *) enable_dlopen_self_static=unknown ;;
1845f29dbc25Smrg  esac
1846f29dbc25Smrgfi
1847f29dbc25Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1848f29dbc25Smrg	 [Whether dlopen is supported])
1849f29dbc25Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1850f29dbc25Smrg	 [Whether dlopen of programs is supported])
1851f29dbc25Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1852f29dbc25Smrg	 [Whether dlopen of statically linked programs is supported])
1853f29dbc25Smrg])# LT_SYS_DLOPEN_SELF
1854f29dbc25Smrg
1855f29dbc25Smrg# Old name:
1856f29dbc25SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1857f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
1858f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1859f29dbc25Smrg
1860f29dbc25Smrg
1861f29dbc25Smrg# _LT_COMPILER_C_O([TAGNAME])
1862f29dbc25Smrg# ---------------------------
1863f29dbc25Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1864f29dbc25Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1865f29dbc25Smrgm4_defun([_LT_COMPILER_C_O],
1866f29dbc25Smrg[m4_require([_LT_DECL_SED])dnl
1867f29dbc25Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1868f29dbc25Smrgm4_require([_LT_TAG_COMPILER])dnl
1869f29dbc25SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1870f29dbc25Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1871f29dbc25Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1872f29dbc25Smrg   $RM -r conftest 2>/dev/null
1873f29dbc25Smrg   mkdir conftest
1874f29dbc25Smrg   cd conftest
1875f29dbc25Smrg   mkdir out
1876f29dbc25Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1877f29dbc25Smrg
1878f29dbc25Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1879f29dbc25Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1880f29dbc25Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1881f29dbc25Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1882f29dbc25Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1883f29dbc25Smrg   lt_compile=`echo "$ac_compile" | $SED \
1884f29dbc25Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1885f29dbc25Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1886f29dbc25Smrg   -e 's:$: $lt_compiler_flag:'`
1887f29dbc25Smrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1888f29dbc25Smrg   (eval "$lt_compile" 2>out/conftest.err)
1889f29dbc25Smrg   ac_status=$?
1890f29dbc25Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1891f29dbc25Smrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1892f29dbc25Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1893f29dbc25Smrg   then
1894f29dbc25Smrg     # The compiler can only warn and ignore the option if not recognized
1895f29dbc25Smrg     # So say no if there are warnings
1896f29dbc25Smrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1897f29dbc25Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1898f29dbc25Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1899f29dbc25Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1900f29dbc25Smrg     fi
1901f29dbc25Smrg   fi
1902f29dbc25Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1903f29dbc25Smrg   $RM conftest*
1904f29dbc25Smrg   # SGI C++ compiler will create directory out/ii_files/ for
1905f29dbc25Smrg   # template instantiation
1906f29dbc25Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1907f29dbc25Smrg   $RM out/* && rmdir out
1908f29dbc25Smrg   cd ..
1909f29dbc25Smrg   $RM -r conftest
1910f29dbc25Smrg   $RM conftest*
1911f29dbc25Smrg])
1912f29dbc25Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1913f29dbc25Smrg	[Does compiler simultaneously support -c and -o options?])
1914f29dbc25Smrg])# _LT_COMPILER_C_O
1915f29dbc25Smrg
1916f29dbc25Smrg
1917f29dbc25Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1918f29dbc25Smrg# ----------------------------------
1919f29dbc25Smrg# Check to see if we can do hard links to lock some files if needed
1920f29dbc25Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1921f29dbc25Smrg[m4_require([_LT_ENABLE_LOCK])dnl
1922f29dbc25Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1923f29dbc25Smrg_LT_COMPILER_C_O([$1])
1924f29dbc25Smrg
1925f29dbc25Smrghard_links="nottested"
1926f29dbc25Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1927f29dbc25Smrg  # do not overwrite the value of need_locks provided by the user
1928f29dbc25Smrg  AC_MSG_CHECKING([if we can lock with hard links])
1929f29dbc25Smrg  hard_links=yes
1930f29dbc25Smrg  $RM conftest*
1931f29dbc25Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1932f29dbc25Smrg  touch conftest.a
1933f29dbc25Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1934f29dbc25Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1935f29dbc25Smrg  AC_MSG_RESULT([$hard_links])
1936f29dbc25Smrg  if test "$hard_links" = no; then
1937f29dbc25Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1938f29dbc25Smrg    need_locks=warn
1939f29dbc25Smrg  fi
1940f29dbc25Smrgelse
1941f29dbc25Smrg  need_locks=no
1942f29dbc25Smrgfi
1943f29dbc25Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1944f29dbc25Smrg])# _LT_COMPILER_FILE_LOCKS
1945f29dbc25Smrg
1946f29dbc25Smrg
1947f29dbc25Smrg# _LT_CHECK_OBJDIR
1948f29dbc25Smrg# ----------------
1949f29dbc25Smrgm4_defun([_LT_CHECK_OBJDIR],
1950f29dbc25Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1951f29dbc25Smrg[rm -f .libs 2>/dev/null
1952f29dbc25Smrgmkdir .libs 2>/dev/null
1953f29dbc25Smrgif test -d .libs; then
1954f29dbc25Smrg  lt_cv_objdir=.libs
1955f29dbc25Smrgelse
1956f29dbc25Smrg  # MS-DOS does not allow filenames that begin with a dot.
1957f29dbc25Smrg  lt_cv_objdir=_libs
1958f29dbc25Smrgfi
1959f29dbc25Smrgrmdir .libs 2>/dev/null])
1960f29dbc25Smrgobjdir=$lt_cv_objdir
1961f29dbc25Smrg_LT_DECL([], [objdir], [0],
1962f29dbc25Smrg         [The name of the directory that contains temporary libtool files])dnl
1963f29dbc25Smrgm4_pattern_allow([LT_OBJDIR])dnl
1964f29dbc25SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1965f29dbc25Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
1966f29dbc25Smrg])# _LT_CHECK_OBJDIR
1967f29dbc25Smrg
1968f29dbc25Smrg
1969f29dbc25Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1970f29dbc25Smrg# --------------------------------------
1971f29dbc25Smrg# Check hardcoding attributes.
1972f29dbc25Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1973f29dbc25Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1974f29dbc25Smrg_LT_TAGVAR(hardcode_action, $1)=
1975f29dbc25Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1976f29dbc25Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1977f29dbc25Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1978f29dbc25Smrg
1979f29dbc25Smrg  # We can hardcode non-existent directories.
1980f29dbc25Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1981f29dbc25Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1982f29dbc25Smrg     # have to relink, otherwise we might link with an installed library
1983f29dbc25Smrg     # when we should be linking with a yet-to-be-installed one
1984f29dbc25Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1985f29dbc25Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1986f29dbc25Smrg    # Linking always hardcodes the temporary library directory.
1987f29dbc25Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
1988f29dbc25Smrg  else
1989f29dbc25Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1990f29dbc25Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1991f29dbc25Smrg  fi
1992f29dbc25Smrgelse
1993f29dbc25Smrg  # We cannot hardcode anything, or else we can only hardcode existing
1994f29dbc25Smrg  # directories.
1995f29dbc25Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
1996f29dbc25Smrgfi
1997f29dbc25SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1998f29dbc25Smrg
1999f29dbc25Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2000f29dbc25Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2001f29dbc25Smrg  # Fast installation is not supported
2002f29dbc25Smrg  enable_fast_install=no
2003f29dbc25Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2004f29dbc25Smrg     test "$enable_shared" = no; then
2005f29dbc25Smrg  # Fast installation is not necessary
2006f29dbc25Smrg  enable_fast_install=needless
2007f29dbc25Smrgfi
2008f29dbc25Smrg_LT_TAGDECL([], [hardcode_action], [0],
2009f29dbc25Smrg    [How to hardcode a shared library path into an executable])
2010f29dbc25Smrg])# _LT_LINKER_HARDCODE_LIBPATH
2011f29dbc25Smrg
2012f29dbc25Smrg
2013f29dbc25Smrg# _LT_CMD_STRIPLIB
2014f29dbc25Smrg# ----------------
2015f29dbc25Smrgm4_defun([_LT_CMD_STRIPLIB],
2016f29dbc25Smrg[m4_require([_LT_DECL_EGREP])
2017f29dbc25Smrgstriplib=
2018f29dbc25Smrgold_striplib=
2019f29dbc25SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2020f29dbc25Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2021f29dbc25Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2022f29dbc25Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2023f29dbc25Smrg  AC_MSG_RESULT([yes])
2024f29dbc25Smrgelse
2025f29dbc25Smrg# FIXME - insert some real tests, host_os isn't really good enough
2026f29dbc25Smrg  case $host_os in
2027f29dbc25Smrg  darwin*)
2028f29dbc25Smrg    if test -n "$STRIP" ; then
2029f29dbc25Smrg      striplib="$STRIP -x"
2030f29dbc25Smrg      old_striplib="$STRIP -S"
2031f29dbc25Smrg      AC_MSG_RESULT([yes])
2032f29dbc25Smrg    else
2033f29dbc25Smrg      AC_MSG_RESULT([no])
2034f29dbc25Smrg    fi
2035f29dbc25Smrg    ;;
2036f29dbc25Smrg  *)
2037f29dbc25Smrg    AC_MSG_RESULT([no])
2038f29dbc25Smrg    ;;
2039f29dbc25Smrg  esac
2040f29dbc25Smrgfi
2041f29dbc25Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2042f29dbc25Smrg_LT_DECL([], [striplib], [1])
2043f29dbc25Smrg])# _LT_CMD_STRIPLIB
2044f29dbc25Smrg
2045f29dbc25Smrg
2046f29dbc25Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2047f29dbc25Smrg# -----------------------------
2048f29dbc25Smrg# PORTME Fill in your ld.so characteristics
2049f29dbc25Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2050f29dbc25Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2051f29dbc25Smrgm4_require([_LT_DECL_EGREP])dnl
2052f29dbc25Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2053f29dbc25Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2054f29dbc25Smrgm4_require([_LT_DECL_SED])dnl
2055f29dbc25SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2056f29dbc25Smrgm4_if([$1],
2057f29dbc25Smrg	[], [
2058f29dbc25Smrgif test "$GCC" = yes; then
2059f29dbc25Smrg  case $host_os in
2060f29dbc25Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2061f29dbc25Smrg    *) lt_awk_arg="/^libraries:/" ;;
2062f29dbc25Smrg  esac
2063f29dbc25Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2064f29dbc25Smrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2065f29dbc25Smrg    # if the path contains ";" then we assume it to be the separator
2066f29dbc25Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2067f29dbc25Smrg    # assumed that no part of a normal pathname contains ";" but that should
2068f29dbc25Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2069f29dbc25Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2070f29dbc25Smrg  else
2071f29dbc25Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2072f29dbc25Smrg  fi
2073f29dbc25Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2074f29dbc25Smrg  # and add multilib dir if necessary.
2075f29dbc25Smrg  lt_tmp_lt_search_path_spec=
2076f29dbc25Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2077f29dbc25Smrg  for lt_sys_path in $lt_search_path_spec; do
2078f29dbc25Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2079f29dbc25Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2080f29dbc25Smrg    else
2081f29dbc25Smrg      test -d "$lt_sys_path" && \
2082f29dbc25Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2083f29dbc25Smrg    fi
2084f29dbc25Smrg  done
2085f29dbc25Smrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2086f29dbc25SmrgBEGIN {RS=" "; FS="/|\n";} {
2087f29dbc25Smrg  lt_foo="";
2088f29dbc25Smrg  lt_count=0;
2089f29dbc25Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2090f29dbc25Smrg    if ($lt_i != "" && $lt_i != ".") {
2091f29dbc25Smrg      if ($lt_i == "..") {
2092f29dbc25Smrg        lt_count++;
2093f29dbc25Smrg      } else {
2094f29dbc25Smrg        if (lt_count == 0) {
2095f29dbc25Smrg          lt_foo="/" $lt_i lt_foo;
2096f29dbc25Smrg        } else {
2097f29dbc25Smrg          lt_count--;
2098f29dbc25Smrg        }
2099f29dbc25Smrg      }
2100f29dbc25Smrg    }
2101f29dbc25Smrg  }
2102f29dbc25Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2103f29dbc25Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2104f29dbc25Smrg}'`
2105f29dbc25Smrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2106f29dbc25Smrgelse
2107f29dbc25Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2108f29dbc25Smrgfi])
2109f29dbc25Smrglibrary_names_spec=
2110f29dbc25Smrglibname_spec='lib$name'
2111f29dbc25Smrgsoname_spec=
2112f29dbc25Smrgshrext_cmds=".so"
2113f29dbc25Smrgpostinstall_cmds=
2114f29dbc25Smrgpostuninstall_cmds=
2115f29dbc25Smrgfinish_cmds=
2116f29dbc25Smrgfinish_eval=
2117f29dbc25Smrgshlibpath_var=
2118f29dbc25Smrgshlibpath_overrides_runpath=unknown
2119f29dbc25Smrgversion_type=none
2120f29dbc25Smrgdynamic_linker="$host_os ld.so"
2121f29dbc25Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2122f29dbc25Smrgneed_lib_prefix=unknown
2123f29dbc25Smrghardcode_into_libs=no
2124f29dbc25Smrg
2125f29dbc25Smrg# when you set need_version to no, make sure it does not cause -set_version
2126f29dbc25Smrg# flags to be left without arguments
2127f29dbc25Smrgneed_version=unknown
2128f29dbc25Smrg
2129f29dbc25Smrgcase $host_os in
2130f29dbc25Smrgaix3*)
2131f29dbc25Smrg  version_type=linux
2132f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2133f29dbc25Smrg  shlibpath_var=LIBPATH
2134f29dbc25Smrg
2135f29dbc25Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2136f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2137f29dbc25Smrg  ;;
2138f29dbc25Smrg
2139f29dbc25Smrgaix[[4-9]]*)
2140f29dbc25Smrg  version_type=linux
2141f29dbc25Smrg  need_lib_prefix=no
2142f29dbc25Smrg  need_version=no
2143f29dbc25Smrg  hardcode_into_libs=yes
2144f29dbc25Smrg  if test "$host_cpu" = ia64; then
2145f29dbc25Smrg    # AIX 5 supports IA64
2146f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2147f29dbc25Smrg    shlibpath_var=LD_LIBRARY_PATH
2148f29dbc25Smrg  else
2149f29dbc25Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2150f29dbc25Smrg    # for dependence libraries.  The import file would start with
2151f29dbc25Smrg    # the line `#! .'.  This would cause the generated library to
2152f29dbc25Smrg    # depend on `.', always an invalid library.  This was fixed in
2153f29dbc25Smrg    # development snapshots of GCC prior to 3.0.
2154f29dbc25Smrg    case $host_os in
2155f29dbc25Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2156f29dbc25Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2157f29dbc25Smrg	   echo ' yes '
2158f29dbc25Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2159f29dbc25Smrg	:
2160f29dbc25Smrg      else
2161f29dbc25Smrg	can_build_shared=no
2162f29dbc25Smrg      fi
2163f29dbc25Smrg      ;;
2164f29dbc25Smrg    esac
2165f29dbc25Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2166f29dbc25Smrg    # soname into executable. Probably we can add versioning support to
2167f29dbc25Smrg    # collect2, so additional links can be useful in future.
2168f29dbc25Smrg    if test "$aix_use_runtimelinking" = yes; then
2169f29dbc25Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2170f29dbc25Smrg      # instead of lib<name>.a to let people know that these are not
2171f29dbc25Smrg      # typical AIX shared libraries.
2172f29dbc25Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2173f29dbc25Smrg    else
2174f29dbc25Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2175f29dbc25Smrg      # and later when we are not doing run time linking.
2176f29dbc25Smrg      library_names_spec='${libname}${release}.a $libname.a'
2177f29dbc25Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2178f29dbc25Smrg    fi
2179f29dbc25Smrg    shlibpath_var=LIBPATH
2180f29dbc25Smrg  fi
2181f29dbc25Smrg  ;;
2182f29dbc25Smrg
2183f29dbc25Smrgamigaos*)
2184f29dbc25Smrg  case $host_cpu in
2185f29dbc25Smrg  powerpc)
2186f29dbc25Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2187f29dbc25Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2188f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2189f29dbc25Smrg    ;;
2190f29dbc25Smrg  m68k)
2191f29dbc25Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2192f29dbc25Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2193f29dbc25Smrg    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'
2194f29dbc25Smrg    ;;
2195f29dbc25Smrg  esac
2196f29dbc25Smrg  ;;
2197f29dbc25Smrg
2198f29dbc25Smrgbeos*)
2199f29dbc25Smrg  library_names_spec='${libname}${shared_ext}'
2200f29dbc25Smrg  dynamic_linker="$host_os ld.so"
2201f29dbc25Smrg  shlibpath_var=LIBRARY_PATH
2202f29dbc25Smrg  ;;
2203f29dbc25Smrg
2204f29dbc25Smrgbsdi[[45]]*)
2205f29dbc25Smrg  version_type=linux
2206f29dbc25Smrg  need_version=no
2207f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2208f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2209f29dbc25Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2210f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2211f29dbc25Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2212f29dbc25Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2213f29dbc25Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2214f29dbc25Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2215f29dbc25Smrg  # libtool to hard-code these into programs
2216f29dbc25Smrg  ;;
2217f29dbc25Smrg
2218f29dbc25Smrgcygwin* | mingw* | pw32* | cegcc*)
2219f29dbc25Smrg  version_type=windows
2220f29dbc25Smrg  shrext_cmds=".dll"
2221f29dbc25Smrg  need_version=no
2222f29dbc25Smrg  need_lib_prefix=no
2223f29dbc25Smrg
2224f29dbc25Smrg  case $GCC,$host_os in
2225f29dbc25Smrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2226f29dbc25Smrg    library_names_spec='$libname.dll.a'
2227f29dbc25Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2228f29dbc25Smrg    postinstall_cmds='base_file=`basename \${file}`~
2229f29dbc25Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2230f29dbc25Smrg      dldir=$destdir/`dirname \$dlpath`~
2231f29dbc25Smrg      test -d \$dldir || mkdir -p \$dldir~
2232f29dbc25Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2233f29dbc25Smrg      chmod a+x \$dldir/$dlname~
2234f29dbc25Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2235f29dbc25Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2236f29dbc25Smrg      fi'
2237f29dbc25Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2238f29dbc25Smrg      dlpath=$dir/\$dldll~
2239f29dbc25Smrg       $RM \$dlpath'
2240f29dbc25Smrg    shlibpath_overrides_runpath=yes
2241f29dbc25Smrg
2242f29dbc25Smrg    case $host_os in
2243f29dbc25Smrg    cygwin*)
2244f29dbc25Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2245f29dbc25Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2246f29dbc25Smrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
2247f29dbc25Smrg      ;;
2248f29dbc25Smrg    mingw* | cegcc*)
2249f29dbc25Smrg      # MinGW DLLs use traditional 'lib' prefix
2250f29dbc25Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2251f29dbc25Smrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2252f29dbc25Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2253f29dbc25Smrg        # It is most probably a Windows format PATH printed by
2254f29dbc25Smrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
2255f29dbc25Smrg        # path with ; separators, and with drive letters. We can handle the
2256f29dbc25Smrg        # drive letters (cygwin fileutils understands them), so leave them,
2257f29dbc25Smrg        # especially as we might pass files found there to a mingw objdump,
2258f29dbc25Smrg        # which wouldn't understand a cygwinified path. Ahh.
2259f29dbc25Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2260f29dbc25Smrg      else
2261f29dbc25Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2262f29dbc25Smrg      fi
2263f29dbc25Smrg      ;;
2264f29dbc25Smrg    pw32*)
2265f29dbc25Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2266f29dbc25Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2267f29dbc25Smrg      ;;
2268f29dbc25Smrg    esac
2269f29dbc25Smrg    ;;
2270f29dbc25Smrg
2271f29dbc25Smrg  *)
2272f29dbc25Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2273f29dbc25Smrg    ;;
2274f29dbc25Smrg  esac
2275f29dbc25Smrg  dynamic_linker='Win32 ld.exe'
2276f29dbc25Smrg  # FIXME: first we should search . and the directory the executable is in
2277f29dbc25Smrg  shlibpath_var=PATH
2278f29dbc25Smrg  ;;
2279f29dbc25Smrg
2280f29dbc25Smrgdarwin* | rhapsody*)
2281f29dbc25Smrg  dynamic_linker="$host_os dyld"
2282f29dbc25Smrg  version_type=darwin
2283f29dbc25Smrg  need_lib_prefix=no
2284f29dbc25Smrg  need_version=no
2285f29dbc25Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2286f29dbc25Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2287f29dbc25Smrg  shlibpath_overrides_runpath=yes
2288f29dbc25Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2289f29dbc25Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2290f29dbc25Smrgm4_if([$1], [],[
2291f29dbc25Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2292f29dbc25Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2293f29dbc25Smrg  ;;
2294f29dbc25Smrg
2295f29dbc25Smrgdgux*)
2296f29dbc25Smrg  version_type=linux
2297f29dbc25Smrg  need_lib_prefix=no
2298f29dbc25Smrg  need_version=no
2299f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2300f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2301f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2302f29dbc25Smrg  ;;
2303f29dbc25Smrg
2304f29dbc25Smrgfreebsd1*)
2305f29dbc25Smrg  dynamic_linker=no
2306f29dbc25Smrg  ;;
2307f29dbc25Smrg
2308f29dbc25Smrgfreebsd* | dragonfly*)
2309f29dbc25Smrg  # DragonFly does not have aout.  When/if they implement a new
2310f29dbc25Smrg  # versioning mechanism, adjust this.
2311f29dbc25Smrg  if test -x /usr/bin/objformat; then
2312f29dbc25Smrg    objformat=`/usr/bin/objformat`
2313f29dbc25Smrg  else
2314f29dbc25Smrg    case $host_os in
2315f29dbc25Smrg    freebsd[[123]]*) objformat=aout ;;
2316f29dbc25Smrg    *) objformat=elf ;;
2317f29dbc25Smrg    esac
2318f29dbc25Smrg  fi
2319f29dbc25Smrg  version_type=freebsd-$objformat
2320f29dbc25Smrg  case $version_type in
2321f29dbc25Smrg    freebsd-elf*)
2322f29dbc25Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2323f29dbc25Smrg      need_version=no
2324f29dbc25Smrg      need_lib_prefix=no
2325f29dbc25Smrg      ;;
2326f29dbc25Smrg    freebsd-*)
2327f29dbc25Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2328f29dbc25Smrg      need_version=yes
2329f29dbc25Smrg      ;;
2330f29dbc25Smrg  esac
2331f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2332f29dbc25Smrg  case $host_os in
2333f29dbc25Smrg  freebsd2*)
2334f29dbc25Smrg    shlibpath_overrides_runpath=yes
2335f29dbc25Smrg    ;;
2336f29dbc25Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2337f29dbc25Smrg    shlibpath_overrides_runpath=yes
2338f29dbc25Smrg    hardcode_into_libs=yes
2339f29dbc25Smrg    ;;
2340f29dbc25Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2341f29dbc25Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2342f29dbc25Smrg    shlibpath_overrides_runpath=no
2343f29dbc25Smrg    hardcode_into_libs=yes
2344f29dbc25Smrg    ;;
2345f29dbc25Smrg  *) # from 4.6 on, and DragonFly
2346f29dbc25Smrg    shlibpath_overrides_runpath=yes
2347f29dbc25Smrg    hardcode_into_libs=yes
2348f29dbc25Smrg    ;;
2349f29dbc25Smrg  esac
2350f29dbc25Smrg  ;;
2351f29dbc25Smrg
2352f29dbc25Smrggnu*)
2353f29dbc25Smrg  version_type=linux
2354f29dbc25Smrg  need_lib_prefix=no
2355f29dbc25Smrg  need_version=no
2356f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2357f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2358f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2359f29dbc25Smrg  hardcode_into_libs=yes
2360f29dbc25Smrg  ;;
2361f29dbc25Smrg
2362f29dbc25Smrghpux9* | hpux10* | hpux11*)
2363f29dbc25Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2364f29dbc25Smrg  # link against other versions.
2365f29dbc25Smrg  version_type=sunos
2366f29dbc25Smrg  need_lib_prefix=no
2367f29dbc25Smrg  need_version=no
2368f29dbc25Smrg  case $host_cpu in
2369f29dbc25Smrg  ia64*)
2370f29dbc25Smrg    shrext_cmds='.so'
2371f29dbc25Smrg    hardcode_into_libs=yes
2372f29dbc25Smrg    dynamic_linker="$host_os dld.so"
2373f29dbc25Smrg    shlibpath_var=LD_LIBRARY_PATH
2374f29dbc25Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2375f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2376f29dbc25Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2377f29dbc25Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2378f29dbc25Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2379f29dbc25Smrg    else
2380f29dbc25Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2381f29dbc25Smrg    fi
2382f29dbc25Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2383f29dbc25Smrg    ;;
2384f29dbc25Smrg  hppa*64*)
2385f29dbc25Smrg    shrext_cmds='.sl'
2386f29dbc25Smrg    hardcode_into_libs=yes
2387f29dbc25Smrg    dynamic_linker="$host_os dld.sl"
2388f29dbc25Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2389f29dbc25Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2390f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2391f29dbc25Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2392f29dbc25Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2393f29dbc25Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2394f29dbc25Smrg    ;;
2395f29dbc25Smrg  *)
2396f29dbc25Smrg    shrext_cmds='.sl'
2397f29dbc25Smrg    dynamic_linker="$host_os dld.sl"
2398f29dbc25Smrg    shlibpath_var=SHLIB_PATH
2399f29dbc25Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2400f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2401f29dbc25Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2402f29dbc25Smrg    ;;
2403f29dbc25Smrg  esac
2404f29dbc25Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2405f29dbc25Smrg  postinstall_cmds='chmod 555 $lib'
2406f29dbc25Smrg  ;;
2407f29dbc25Smrg
2408f29dbc25Smrginterix[[3-9]]*)
2409f29dbc25Smrg  version_type=linux
2410f29dbc25Smrg  need_lib_prefix=no
2411f29dbc25Smrg  need_version=no
2412f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2413f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2414f29dbc25Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2415f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2416f29dbc25Smrg  shlibpath_overrides_runpath=no
2417f29dbc25Smrg  hardcode_into_libs=yes
2418f29dbc25Smrg  ;;
2419f29dbc25Smrg
2420f29dbc25Smrgirix5* | irix6* | nonstopux*)
2421f29dbc25Smrg  case $host_os in
2422f29dbc25Smrg    nonstopux*) version_type=nonstopux ;;
2423f29dbc25Smrg    *)
2424f29dbc25Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2425f29dbc25Smrg		version_type=linux
2426f29dbc25Smrg	else
2427f29dbc25Smrg		version_type=irix
2428f29dbc25Smrg	fi ;;
2429f29dbc25Smrg  esac
2430f29dbc25Smrg  need_lib_prefix=no
2431f29dbc25Smrg  need_version=no
2432f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2433f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2434f29dbc25Smrg  case $host_os in
2435f29dbc25Smrg  irix5* | nonstopux*)
2436f29dbc25Smrg    libsuff= shlibsuff=
2437f29dbc25Smrg    ;;
2438f29dbc25Smrg  *)
2439f29dbc25Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2440f29dbc25Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2441f29dbc25Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2442f29dbc25Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2443f29dbc25Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2444f29dbc25Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2445f29dbc25Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2446f29dbc25Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2447f29dbc25Smrg    esac
2448f29dbc25Smrg    ;;
2449f29dbc25Smrg  esac
2450f29dbc25Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2451f29dbc25Smrg  shlibpath_overrides_runpath=no
2452f29dbc25Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2453f29dbc25Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2454f29dbc25Smrg  hardcode_into_libs=yes
2455f29dbc25Smrg  ;;
2456f29dbc25Smrg
2457f29dbc25Smrg# No shared lib support for Linux oldld, aout, or coff.
2458f29dbc25Smrglinux*oldld* | linux*aout* | linux*coff*)
2459f29dbc25Smrg  dynamic_linker=no
2460f29dbc25Smrg  ;;
2461f29dbc25Smrg
2462f29dbc25Smrg# This must be Linux ELF.
2463f29dbc25Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
2464f29dbc25Smrg  version_type=linux
2465f29dbc25Smrg  need_lib_prefix=no
2466f29dbc25Smrg  need_version=no
2467f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2468f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2469f29dbc25Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2470f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2471f29dbc25Smrg  shlibpath_overrides_runpath=no
2472f29dbc25Smrg  # Some binutils ld are patched to set DT_RUNPATH
2473f29dbc25Smrg  save_LDFLAGS=$LDFLAGS
2474f29dbc25Smrg  save_libdir=$libdir
2475f29dbc25Smrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2476f29dbc25Smrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2477f29dbc25Smrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2478f29dbc25Smrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2479f29dbc25Smrg       [shlibpath_overrides_runpath=yes])])
2480f29dbc25Smrg  LDFLAGS=$save_LDFLAGS
2481f29dbc25Smrg  libdir=$save_libdir
2482f29dbc25Smrg
2483f29dbc25Smrg  # This implies no fast_install, which is unacceptable.
2484f29dbc25Smrg  # Some rework will be needed to allow for fast_install
2485f29dbc25Smrg  # before this can be enabled.
2486f29dbc25Smrg  hardcode_into_libs=yes
2487f29dbc25Smrg
2488f29dbc25Smrg  # Append ld.so.conf contents to the search path
2489f29dbc25Smrg  if test -f /etc/ld.so.conf; then
2490f29dbc25Smrg    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' ' '`
2491f29dbc25Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2492f29dbc25Smrg  fi
2493f29dbc25Smrg
2494f29dbc25Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2495f29dbc25Smrg  # powerpc, because MkLinux only supported shared libraries with the
2496f29dbc25Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2497f29dbc25Smrg  # most powerpc-linux boxes support dynamic linking these days and
2498f29dbc25Smrg  # people can always --disable-shared, the test was removed, and we
2499f29dbc25Smrg  # assume the GNU/Linux dynamic linker is in use.
2500f29dbc25Smrg  dynamic_linker='GNU/Linux ld.so'
2501f29dbc25Smrg  ;;
2502f29dbc25Smrg
2503f29dbc25Smrgnetbsdelf*-gnu)
2504f29dbc25Smrg  version_type=linux
2505f29dbc25Smrg  need_lib_prefix=no
2506f29dbc25Smrg  need_version=no
2507f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2508f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2509f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2510f29dbc25Smrg  shlibpath_overrides_runpath=no
2511f29dbc25Smrg  hardcode_into_libs=yes
2512f29dbc25Smrg  dynamic_linker='NetBSD ld.elf_so'
2513f29dbc25Smrg  ;;
2514f29dbc25Smrg
2515f29dbc25Smrgnetbsd*)
2516f29dbc25Smrg  version_type=sunos
2517f29dbc25Smrg  need_lib_prefix=no
2518f29dbc25Smrg  need_version=no
2519f29dbc25Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2520f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2521f29dbc25Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2522f29dbc25Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2523f29dbc25Smrg  else
2524f29dbc25Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2525f29dbc25Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2526f29dbc25Smrg    dynamic_linker='NetBSD ld.elf_so'
2527f29dbc25Smrg  fi
2528f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2529f29dbc25Smrg  shlibpath_overrides_runpath=yes
2530f29dbc25Smrg  hardcode_into_libs=yes
2531f29dbc25Smrg  ;;
2532f29dbc25Smrg
2533f29dbc25Smrgnewsos6)
2534f29dbc25Smrg  version_type=linux
2535f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2536f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2537f29dbc25Smrg  shlibpath_overrides_runpath=yes
2538f29dbc25Smrg  ;;
2539f29dbc25Smrg
2540f29dbc25Smrg*nto* | *qnx*)
2541f29dbc25Smrg  version_type=qnx
2542f29dbc25Smrg  need_lib_prefix=no
2543f29dbc25Smrg  need_version=no
2544f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2545f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2546f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2547f29dbc25Smrg  shlibpath_overrides_runpath=no
2548f29dbc25Smrg  hardcode_into_libs=yes
2549f29dbc25Smrg  dynamic_linker='ldqnx.so'
2550f29dbc25Smrg  ;;
2551f29dbc25Smrg
2552f29dbc25Smrgopenbsd*)
2553f29dbc25Smrg  version_type=sunos
2554f29dbc25Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2555f29dbc25Smrg  need_lib_prefix=no
2556f29dbc25Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2557f29dbc25Smrg  case $host_os in
2558f29dbc25Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2559f29dbc25Smrg    *)				need_version=no  ;;
2560f29dbc25Smrg  esac
2561f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2562f29dbc25Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2563f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2564f29dbc25Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2565f29dbc25Smrg    case $host_os in
2566f29dbc25Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2567f29dbc25Smrg	shlibpath_overrides_runpath=no
2568f29dbc25Smrg	;;
2569f29dbc25Smrg      *)
2570f29dbc25Smrg	shlibpath_overrides_runpath=yes
2571f29dbc25Smrg	;;
2572f29dbc25Smrg      esac
2573f29dbc25Smrg  else
2574f29dbc25Smrg    shlibpath_overrides_runpath=yes
2575f29dbc25Smrg  fi
2576f29dbc25Smrg  ;;
2577f29dbc25Smrg
2578f29dbc25Smrgos2*)
2579f29dbc25Smrg  libname_spec='$name'
2580f29dbc25Smrg  shrext_cmds=".dll"
2581f29dbc25Smrg  need_lib_prefix=no
2582f29dbc25Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2583f29dbc25Smrg  dynamic_linker='OS/2 ld.exe'
2584f29dbc25Smrg  shlibpath_var=LIBPATH
2585f29dbc25Smrg  ;;
2586f29dbc25Smrg
2587f29dbc25Smrgosf3* | osf4* | osf5*)
2588f29dbc25Smrg  version_type=osf
2589f29dbc25Smrg  need_lib_prefix=no
2590f29dbc25Smrg  need_version=no
2591f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2592f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2593f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2594f29dbc25Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2595f29dbc25Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2596f29dbc25Smrg  ;;
2597f29dbc25Smrg
2598f29dbc25Smrgrdos*)
2599f29dbc25Smrg  dynamic_linker=no
2600f29dbc25Smrg  ;;
2601f29dbc25Smrg
2602f29dbc25Smrgsolaris*)
2603f29dbc25Smrg  version_type=linux
2604f29dbc25Smrg  need_lib_prefix=no
2605f29dbc25Smrg  need_version=no
2606f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2607f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2608f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2609f29dbc25Smrg  shlibpath_overrides_runpath=yes
2610f29dbc25Smrg  hardcode_into_libs=yes
2611f29dbc25Smrg  # ldd complains unless libraries are executable
2612f29dbc25Smrg  postinstall_cmds='chmod +x $lib'
2613f29dbc25Smrg  ;;
2614f29dbc25Smrg
2615f29dbc25Smrgsunos4*)
2616f29dbc25Smrg  version_type=sunos
2617f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2618f29dbc25Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2619f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2620f29dbc25Smrg  shlibpath_overrides_runpath=yes
2621f29dbc25Smrg  if test "$with_gnu_ld" = yes; then
2622f29dbc25Smrg    need_lib_prefix=no
2623f29dbc25Smrg  fi
2624f29dbc25Smrg  need_version=yes
2625f29dbc25Smrg  ;;
2626f29dbc25Smrg
2627f29dbc25Smrgsysv4 | sysv4.3*)
2628f29dbc25Smrg  version_type=linux
2629f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2630f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2631f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2632f29dbc25Smrg  case $host_vendor in
2633f29dbc25Smrg    sni)
2634f29dbc25Smrg      shlibpath_overrides_runpath=no
2635f29dbc25Smrg      need_lib_prefix=no
2636f29dbc25Smrg      runpath_var=LD_RUN_PATH
2637f29dbc25Smrg      ;;
2638f29dbc25Smrg    siemens)
2639f29dbc25Smrg      need_lib_prefix=no
2640f29dbc25Smrg      ;;
2641f29dbc25Smrg    motorola)
2642f29dbc25Smrg      need_lib_prefix=no
2643f29dbc25Smrg      need_version=no
2644f29dbc25Smrg      shlibpath_overrides_runpath=no
2645f29dbc25Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2646f29dbc25Smrg      ;;
2647f29dbc25Smrg  esac
2648f29dbc25Smrg  ;;
2649f29dbc25Smrg
2650f29dbc25Smrgsysv4*MP*)
2651f29dbc25Smrg  if test -d /usr/nec ;then
2652f29dbc25Smrg    version_type=linux
2653f29dbc25Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2654f29dbc25Smrg    soname_spec='$libname${shared_ext}.$major'
2655f29dbc25Smrg    shlibpath_var=LD_LIBRARY_PATH
2656f29dbc25Smrg  fi
2657f29dbc25Smrg  ;;
2658f29dbc25Smrg
2659f29dbc25Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2660f29dbc25Smrg  version_type=freebsd-elf
2661f29dbc25Smrg  need_lib_prefix=no
2662f29dbc25Smrg  need_version=no
2663f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2664f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2665f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2666f29dbc25Smrg  shlibpath_overrides_runpath=yes
2667f29dbc25Smrg  hardcode_into_libs=yes
2668f29dbc25Smrg  if test "$with_gnu_ld" = yes; then
2669f29dbc25Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2670f29dbc25Smrg  else
2671f29dbc25Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2672f29dbc25Smrg    case $host_os in
2673f29dbc25Smrg      sco3.2v5*)
2674f29dbc25Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2675f29dbc25Smrg	;;
2676f29dbc25Smrg    esac
2677f29dbc25Smrg  fi
2678f29dbc25Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2679f29dbc25Smrg  ;;
2680f29dbc25Smrg
2681f29dbc25Smrgtpf*)
2682f29dbc25Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2683f29dbc25Smrg  version_type=linux
2684f29dbc25Smrg  need_lib_prefix=no
2685f29dbc25Smrg  need_version=no
2686f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2687f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2688f29dbc25Smrg  shlibpath_overrides_runpath=no
2689f29dbc25Smrg  hardcode_into_libs=yes
2690f29dbc25Smrg  ;;
2691f29dbc25Smrg
2692f29dbc25Smrguts4*)
2693f29dbc25Smrg  version_type=linux
2694f29dbc25Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2695f29dbc25Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2696f29dbc25Smrg  shlibpath_var=LD_LIBRARY_PATH
2697f29dbc25Smrg  ;;
2698f29dbc25Smrg
2699f29dbc25Smrg*)
2700f29dbc25Smrg  dynamic_linker=no
2701f29dbc25Smrg  ;;
2702f29dbc25Smrgesac
2703f29dbc25SmrgAC_MSG_RESULT([$dynamic_linker])
2704f29dbc25Smrgtest "$dynamic_linker" = no && can_build_shared=no
2705f29dbc25Smrg
2706f29dbc25Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2707f29dbc25Smrgif test "$GCC" = yes; then
2708f29dbc25Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2709f29dbc25Smrgfi
2710f29dbc25Smrg
2711f29dbc25Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2712f29dbc25Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2713f29dbc25Smrgfi
2714f29dbc25Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2715f29dbc25Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2716f29dbc25Smrgfi
2717f29dbc25Smrg
2718f29dbc25Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2719f29dbc25Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2720f29dbc25Smrg    restored at link time])
2721f29dbc25Smrg_LT_DECL([], [need_lib_prefix], [0],
2722f29dbc25Smrg    [Do we need the "lib" prefix for modules?])
2723f29dbc25Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2724f29dbc25Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2725f29dbc25Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2726f29dbc25Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2727f29dbc25Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2728f29dbc25Smrg    [Is shlibpath searched before the hard-coded library search path?])
2729f29dbc25Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2730f29dbc25Smrg_LT_DECL([], [library_names_spec], [1],
2731f29dbc25Smrg    [[List of archive names.  First name is the real one, the rest are links.
2732f29dbc25Smrg    The last name is the one that the linker finds with -lNAME]])
2733f29dbc25Smrg_LT_DECL([], [soname_spec], [1],
2734f29dbc25Smrg    [[The coded name of the library, if different from the real name]])
2735f29dbc25Smrg_LT_DECL([], [postinstall_cmds], [2],
2736f29dbc25Smrg    [Command to use after installation of a shared archive])
2737f29dbc25Smrg_LT_DECL([], [postuninstall_cmds], [2],
2738f29dbc25Smrg    [Command to use after uninstallation of a shared archive])
2739f29dbc25Smrg_LT_DECL([], [finish_cmds], [2],
2740f29dbc25Smrg    [Commands used to finish a libtool library installation in a directory])
2741f29dbc25Smrg_LT_DECL([], [finish_eval], [1],
2742f29dbc25Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2743f29dbc25Smrg    not shown]])
2744f29dbc25Smrg_LT_DECL([], [hardcode_into_libs], [0],
2745f29dbc25Smrg    [Whether we should hardcode library paths into libraries])
2746f29dbc25Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2747f29dbc25Smrg    [Compile-time system search path for libraries])
2748f29dbc25Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2749f29dbc25Smrg    [Run-time system search path for libraries])
2750f29dbc25Smrg])# _LT_SYS_DYNAMIC_LINKER
2751f29dbc25Smrg
2752f29dbc25Smrg
2753f29dbc25Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
2754f29dbc25Smrg# --------------------------
2755f29dbc25Smrg# find a file program which can recognize shared library
2756f29dbc25SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2757f29dbc25Smrg[m4_require([_LT_DECL_EGREP])dnl
2758f29dbc25SmrgAC_MSG_CHECKING([for $1])
2759f29dbc25SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2760f29dbc25Smrg[case $MAGIC_CMD in
2761f29dbc25Smrg[[\\/*] |  ?:[\\/]*])
2762f29dbc25Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2763f29dbc25Smrg  ;;
2764f29dbc25Smrg*)
2765f29dbc25Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2766f29dbc25Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2767f29dbc25Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2768f29dbc25Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2769f29dbc25Smrgdnl not every word.  This closes a longstanding sh security hole.
2770f29dbc25Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2771f29dbc25Smrg  for ac_dir in $ac_dummy; do
2772f29dbc25Smrg    IFS="$lt_save_ifs"
2773f29dbc25Smrg    test -z "$ac_dir" && ac_dir=.
2774f29dbc25Smrg    if test -f $ac_dir/$1; then
2775f29dbc25Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2776f29dbc25Smrg      if test -n "$file_magic_test_file"; then
2777f29dbc25Smrg	case $deplibs_check_method in
2778f29dbc25Smrg	"file_magic "*)
2779f29dbc25Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2780f29dbc25Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2781f29dbc25Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2782f29dbc25Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2783f29dbc25Smrg	    :
2784f29dbc25Smrg	  else
2785f29dbc25Smrg	    cat <<_LT_EOF 1>&2
2786f29dbc25Smrg
2787f29dbc25Smrg*** Warning: the command libtool uses to detect shared libraries,
2788f29dbc25Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2789f29dbc25Smrg*** The result is that libtool may fail to recognize shared libraries
2790f29dbc25Smrg*** as such.  This will affect the creation of libtool libraries that
2791f29dbc25Smrg*** depend on shared libraries, but programs linked with such libtool
2792f29dbc25Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2793f29dbc25Smrg*** may want to report the problem to your system manager and/or to
2794f29dbc25Smrg*** bug-libtool@gnu.org
2795f29dbc25Smrg
2796f29dbc25Smrg_LT_EOF
2797f29dbc25Smrg	  fi ;;
2798f29dbc25Smrg	esac
2799f29dbc25Smrg      fi
2800f29dbc25Smrg      break
2801f29dbc25Smrg    fi
2802f29dbc25Smrg  done
2803f29dbc25Smrg  IFS="$lt_save_ifs"
2804f29dbc25Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2805f29dbc25Smrg  ;;
2806f29dbc25Smrgesac])
2807f29dbc25SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2808f29dbc25Smrgif test -n "$MAGIC_CMD"; then
2809f29dbc25Smrg  AC_MSG_RESULT($MAGIC_CMD)
2810f29dbc25Smrgelse
2811f29dbc25Smrg  AC_MSG_RESULT(no)
2812f29dbc25Smrgfi
2813f29dbc25Smrg_LT_DECL([], [MAGIC_CMD], [0],
2814f29dbc25Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2815f29dbc25Smrg])# _LT_PATH_TOOL_PREFIX
2816f29dbc25Smrg
2817f29dbc25Smrg# Old name:
2818f29dbc25SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2819f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
2820f29dbc25Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2821f29dbc25Smrg
2822f29dbc25Smrg
2823f29dbc25Smrg# _LT_PATH_MAGIC
2824f29dbc25Smrg# --------------
2825f29dbc25Smrg# find a file program which can recognize a shared library
2826f29dbc25Smrgm4_defun([_LT_PATH_MAGIC],
2827f29dbc25Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2828f29dbc25Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2829f29dbc25Smrg  if test -n "$ac_tool_prefix"; then
2830f29dbc25Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
2831f29dbc25Smrg  else
2832f29dbc25Smrg    MAGIC_CMD=:
2833f29dbc25Smrg  fi
2834f29dbc25Smrgfi
2835f29dbc25Smrg])# _LT_PATH_MAGIC
2836f29dbc25Smrg
2837f29dbc25Smrg
2838f29dbc25Smrg# LT_PATH_LD
2839f29dbc25Smrg# ----------
2840f29dbc25Smrg# find the pathname to the GNU or non-GNU linker
2841f29dbc25SmrgAC_DEFUN([LT_PATH_LD],
2842f29dbc25Smrg[AC_REQUIRE([AC_PROG_CC])dnl
2843f29dbc25SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2844f29dbc25SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2845f29dbc25Smrgm4_require([_LT_DECL_SED])dnl
2846f29dbc25Smrgm4_require([_LT_DECL_EGREP])dnl
2847f29dbc25Smrg
2848f29dbc25SmrgAC_ARG_WITH([gnu-ld],
2849f29dbc25Smrg    [AS_HELP_STRING([--with-gnu-ld],
2850f29dbc25Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2851f29dbc25Smrg    [test "$withval" = no || with_gnu_ld=yes],
2852f29dbc25Smrg    [with_gnu_ld=no])dnl
2853f29dbc25Smrg
2854f29dbc25Smrgac_prog=ld
2855f29dbc25Smrgif test "$GCC" = yes; then
2856f29dbc25Smrg  # Check if gcc -print-prog-name=ld gives a path.
2857f29dbc25Smrg  AC_MSG_CHECKING([for ld used by $CC])
2858f29dbc25Smrg  case $host in
2859f29dbc25Smrg  *-*-mingw*)
2860f29dbc25Smrg    # gcc leaves a trailing carriage return which upsets mingw
2861f29dbc25Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2862f29dbc25Smrg  *)
2863f29dbc25Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2864f29dbc25Smrg  esac
2865f29dbc25Smrg  case $ac_prog in
2866f29dbc25Smrg    # Accept absolute paths.
2867f29dbc25Smrg    [[\\/]]* | ?:[[\\/]]*)
2868f29dbc25Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2869f29dbc25Smrg      # Canonicalize the pathname of ld
2870f29dbc25Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2871f29dbc25Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2872f29dbc25Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2873f29dbc25Smrg      done
2874f29dbc25Smrg      test -z "$LD" && LD="$ac_prog"
2875f29dbc25Smrg      ;;
2876f29dbc25Smrg  "")
2877f29dbc25Smrg    # If it fails, then pretend we aren't using GCC.
2878f29dbc25Smrg    ac_prog=ld
2879f29dbc25Smrg    ;;
2880f29dbc25Smrg  *)
2881f29dbc25Smrg    # If it is relative, then search for the first ld in PATH.
2882f29dbc25Smrg    with_gnu_ld=unknown
2883f29dbc25Smrg    ;;
2884f29dbc25Smrg  esac
2885f29dbc25Smrgelif test "$with_gnu_ld" = yes; then
2886f29dbc25Smrg  AC_MSG_CHECKING([for GNU ld])
2887f29dbc25Smrgelse
2888f29dbc25Smrg  AC_MSG_CHECKING([for non-GNU ld])
2889f29dbc25Smrgfi
2890f29dbc25SmrgAC_CACHE_VAL(lt_cv_path_LD,
2891f29dbc25Smrg[if test -z "$LD"; then
2892f29dbc25Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2893f29dbc25Smrg  for ac_dir in $PATH; do
2894f29dbc25Smrg    IFS="$lt_save_ifs"
2895f29dbc25Smrg    test -z "$ac_dir" && ac_dir=.
2896f29dbc25Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2897f29dbc25Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2898f29dbc25Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2899f29dbc25Smrg      # but apparently some variants of GNU ld only accept -v.
2900f29dbc25Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2901f29dbc25Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2902f29dbc25Smrg      *GNU* | *'with BFD'*)
2903f29dbc25Smrg	test "$with_gnu_ld" != no && break
2904f29dbc25Smrg	;;
2905f29dbc25Smrg      *)
2906f29dbc25Smrg	test "$with_gnu_ld" != yes && break
2907f29dbc25Smrg	;;
2908f29dbc25Smrg      esac
2909f29dbc25Smrg    fi
2910f29dbc25Smrg  done
2911f29dbc25Smrg  IFS="$lt_save_ifs"
2912f29dbc25Smrgelse
2913f29dbc25Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2914f29dbc25Smrgfi])
2915f29dbc25SmrgLD="$lt_cv_path_LD"
2916f29dbc25Smrgif test -n "$LD"; then
2917f29dbc25Smrg  AC_MSG_RESULT($LD)
2918f29dbc25Smrgelse
2919f29dbc25Smrg  AC_MSG_RESULT(no)
2920f29dbc25Smrgfi
2921f29dbc25Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2922f29dbc25Smrg_LT_PATH_LD_GNU
2923f29dbc25SmrgAC_SUBST([LD])
2924f29dbc25Smrg
2925f29dbc25Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2926f29dbc25Smrg])# LT_PATH_LD
2927f29dbc25Smrg
2928f29dbc25Smrg# Old names:
2929f29dbc25SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2930f29dbc25SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2931f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
2932f29dbc25Smrgdnl AC_DEFUN([AM_PROG_LD], [])
2933f29dbc25Smrgdnl AC_DEFUN([AC_PROG_LD], [])
2934f29dbc25Smrg
2935f29dbc25Smrg
2936f29dbc25Smrg# _LT_PATH_LD_GNU
2937f29dbc25Smrg#- --------------
2938f29dbc25Smrgm4_defun([_LT_PATH_LD_GNU],
2939f29dbc25Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2940f29dbc25Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2941f29dbc25Smrgcase `$LD -v 2>&1 </dev/null` in
2942f29dbc25Smrg*GNU* | *'with BFD'*)
2943f29dbc25Smrg  lt_cv_prog_gnu_ld=yes
2944f29dbc25Smrg  ;;
2945f29dbc25Smrg*)
2946f29dbc25Smrg  lt_cv_prog_gnu_ld=no
2947f29dbc25Smrg  ;;
2948f29dbc25Smrgesac])
2949f29dbc25Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2950f29dbc25Smrg])# _LT_PATH_LD_GNU
2951f29dbc25Smrg
2952f29dbc25Smrg
2953f29dbc25Smrg# _LT_CMD_RELOAD
2954f29dbc25Smrg# --------------
2955f29dbc25Smrg# find reload flag for linker
2956f29dbc25Smrg#   -- PORTME Some linkers may need a different reload flag.
2957f29dbc25Smrgm4_defun([_LT_CMD_RELOAD],
2958f29dbc25Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
2959f29dbc25Smrg  lt_cv_ld_reload_flag,
2960f29dbc25Smrg  [lt_cv_ld_reload_flag='-r'])
2961f29dbc25Smrgreload_flag=$lt_cv_ld_reload_flag
2962f29dbc25Smrgcase $reload_flag in
2963f29dbc25Smrg"" | " "*) ;;
2964f29dbc25Smrg*) reload_flag=" $reload_flag" ;;
2965f29dbc25Smrgesac
2966f29dbc25Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2967f29dbc25Smrgcase $host_os in
2968f29dbc25Smrg  darwin*)
2969f29dbc25Smrg    if test "$GCC" = yes; then
2970f29dbc25Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2971f29dbc25Smrg    else
2972f29dbc25Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2973f29dbc25Smrg    fi
2974f29dbc25Smrg    ;;
2975f29dbc25Smrgesac
2976f29dbc25Smrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2977f29dbc25Smrg_LT_DECL([], [reload_cmds], [2])dnl
2978f29dbc25Smrg])# _LT_CMD_RELOAD
2979f29dbc25Smrg
2980f29dbc25Smrg
2981f29dbc25Smrg# _LT_CHECK_MAGIC_METHOD
2982f29dbc25Smrg# ----------------------
2983f29dbc25Smrg# how to check for library dependencies
2984f29dbc25Smrg#  -- PORTME fill in with the dynamic library characteristics
2985f29dbc25Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
2986f29dbc25Smrg[m4_require([_LT_DECL_EGREP])
2987f29dbc25Smrgm4_require([_LT_DECL_OBJDUMP])
2988f29dbc25SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
2989f29dbc25Smrglt_cv_deplibs_check_method,
2990f29dbc25Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2991f29dbc25Smrglt_cv_file_magic_test_file=
2992f29dbc25Smrglt_cv_deplibs_check_method='unknown'
2993f29dbc25Smrg# Need to set the preceding variable on all platforms that support
2994f29dbc25Smrg# interlibrary dependencies.
2995f29dbc25Smrg# 'none' -- dependencies not supported.
2996f29dbc25Smrg# `unknown' -- same as none, but documents that we really don't know.
2997f29dbc25Smrg# 'pass_all' -- all dependencies passed with no checks.
2998f29dbc25Smrg# 'test_compile' -- check by making test program.
2999f29dbc25Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3000f29dbc25Smrg# which responds to the $file_magic_cmd with a given extended regex.
3001f29dbc25Smrg# If you have `file' or equivalent on your system and you're not sure
3002f29dbc25Smrg# whether `pass_all' will *always* work, you probably want this one.
3003f29dbc25Smrg
3004f29dbc25Smrgcase $host_os in
3005f29dbc25Smrgaix[[4-9]]*)
3006f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3007f29dbc25Smrg  ;;
3008f29dbc25Smrg
3009f29dbc25Smrgbeos*)
3010f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3011f29dbc25Smrg  ;;
3012f29dbc25Smrg
3013f29dbc25Smrgbsdi[[45]]*)
3014f29dbc25Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3015f29dbc25Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3016f29dbc25Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3017f29dbc25Smrg  ;;
3018f29dbc25Smrg
3019f29dbc25Smrgcygwin*)
3020f29dbc25Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3021f29dbc25Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3022f29dbc25Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3023f29dbc25Smrg  ;;
3024f29dbc25Smrg
3025f29dbc25Smrgmingw* | pw32*)
3026f29dbc25Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3027f29dbc25Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3028f29dbc25Smrg  # unless we find 'file', for example because we are cross-compiling.
3029f29dbc25Smrg  if ( file / ) >/dev/null 2>&1; then
3030f29dbc25Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3031f29dbc25Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3032f29dbc25Smrg  else
3033f29dbc25Smrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3034f29dbc25Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3035f29dbc25Smrg  fi
3036f29dbc25Smrg  ;;
3037f29dbc25Smrg
3038f29dbc25Smrgcegcc)
3039f29dbc25Smrg  # use the weaker test based on 'objdump'. See mingw*.
3040f29dbc25Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3041f29dbc25Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3042f29dbc25Smrg  ;;
3043f29dbc25Smrg
3044f29dbc25Smrgdarwin* | rhapsody*)
3045f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3046f29dbc25Smrg  ;;
3047f29dbc25Smrg
3048f29dbc25Smrgfreebsd* | dragonfly*)
3049f29dbc25Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3050f29dbc25Smrg    case $host_cpu in
3051f29dbc25Smrg    i*86 )
3052f29dbc25Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3053f29dbc25Smrg      # Let's accept both of them until this is cleared up.
3054f29dbc25Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3055f29dbc25Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3056f29dbc25Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3057f29dbc25Smrg      ;;
3058f29dbc25Smrg    esac
3059f29dbc25Smrg  else
3060f29dbc25Smrg    lt_cv_deplibs_check_method=pass_all
3061f29dbc25Smrg  fi
3062f29dbc25Smrg  ;;
3063f29dbc25Smrg
3064f29dbc25Smrggnu*)
3065f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3066f29dbc25Smrg  ;;
3067f29dbc25Smrg
3068f29dbc25Smrghpux10.20* | hpux11*)
3069f29dbc25Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3070f29dbc25Smrg  case $host_cpu in
3071f29dbc25Smrg  ia64*)
3072f29dbc25Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3073f29dbc25Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3074f29dbc25Smrg    ;;
3075f29dbc25Smrg  hppa*64*)
3076f29dbc25Smrg    [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]']
3077f29dbc25Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3078f29dbc25Smrg    ;;
3079f29dbc25Smrg  *)
3080f29dbc25Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3081f29dbc25Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3082f29dbc25Smrg    ;;
3083f29dbc25Smrg  esac
3084f29dbc25Smrg  ;;
3085f29dbc25Smrg
3086f29dbc25Smrginterix[[3-9]]*)
3087f29dbc25Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3088f29dbc25Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3089f29dbc25Smrg  ;;
3090f29dbc25Smrg
3091f29dbc25Smrgirix5* | irix6* | nonstopux*)
3092f29dbc25Smrg  case $LD in
3093f29dbc25Smrg  *-32|*"-32 ") libmagic=32-bit;;
3094f29dbc25Smrg  *-n32|*"-n32 ") libmagic=N32;;
3095f29dbc25Smrg  *-64|*"-64 ") libmagic=64-bit;;
3096f29dbc25Smrg  *) libmagic=never-match;;
3097f29dbc25Smrg  esac
3098f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3099f29dbc25Smrg  ;;
3100f29dbc25Smrg
3101f29dbc25Smrg# This must be Linux ELF.
3102f29dbc25Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3103f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3104f29dbc25Smrg  ;;
3105f29dbc25Smrg
3106f29dbc25Smrgnetbsd* | netbsdelf*-gnu)
3107f29dbc25Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3108f29dbc25Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3109f29dbc25Smrg  else
3110f29dbc25Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3111f29dbc25Smrg  fi
3112f29dbc25Smrg  ;;
3113f29dbc25Smrg
3114f29dbc25Smrgnewos6*)
3115f29dbc25Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3116f29dbc25Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3117f29dbc25Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3118f29dbc25Smrg  ;;
3119f29dbc25Smrg
3120f29dbc25Smrg*nto* | *qnx*)
3121f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3122f29dbc25Smrg  ;;
3123f29dbc25Smrg
3124f29dbc25Smrgopenbsd*)
3125f29dbc25Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3126f29dbc25Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3127f29dbc25Smrg  else
3128f29dbc25Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3129f29dbc25Smrg  fi
3130f29dbc25Smrg  ;;
3131f29dbc25Smrg
3132f29dbc25Smrgosf3* | osf4* | osf5*)
3133f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3134f29dbc25Smrg  ;;
3135f29dbc25Smrg
3136f29dbc25Smrgrdos*)
3137f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3138f29dbc25Smrg  ;;
3139f29dbc25Smrg
3140f29dbc25Smrgsolaris*)
3141f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3142f29dbc25Smrg  ;;
3143f29dbc25Smrg
3144f29dbc25Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3145f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3146f29dbc25Smrg  ;;
3147f29dbc25Smrg
3148f29dbc25Smrgsysv4 | sysv4.3*)
3149f29dbc25Smrg  case $host_vendor in
3150f29dbc25Smrg  motorola)
3151f29dbc25Smrg    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]]'
3152f29dbc25Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3153f29dbc25Smrg    ;;
3154f29dbc25Smrg  ncr)
3155f29dbc25Smrg    lt_cv_deplibs_check_method=pass_all
3156f29dbc25Smrg    ;;
3157f29dbc25Smrg  sequent)
3158f29dbc25Smrg    lt_cv_file_magic_cmd='/bin/file'
3159f29dbc25Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3160f29dbc25Smrg    ;;
3161f29dbc25Smrg  sni)
3162f29dbc25Smrg    lt_cv_file_magic_cmd='/bin/file'
3163f29dbc25Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3164f29dbc25Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3165f29dbc25Smrg    ;;
3166f29dbc25Smrg  siemens)
3167f29dbc25Smrg    lt_cv_deplibs_check_method=pass_all
3168f29dbc25Smrg    ;;
3169f29dbc25Smrg  pc)
3170f29dbc25Smrg    lt_cv_deplibs_check_method=pass_all
3171f29dbc25Smrg    ;;
3172f29dbc25Smrg  esac
3173f29dbc25Smrg  ;;
3174f29dbc25Smrg
3175f29dbc25Smrgtpf*)
3176f29dbc25Smrg  lt_cv_deplibs_check_method=pass_all
3177f29dbc25Smrg  ;;
3178f29dbc25Smrgesac
3179f29dbc25Smrg])
3180f29dbc25Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3181f29dbc25Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3182f29dbc25Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3183f29dbc25Smrg
3184f29dbc25Smrg_LT_DECL([], [deplibs_check_method], [1],
3185f29dbc25Smrg    [Method to check whether dependent libraries are shared objects])
3186f29dbc25Smrg_LT_DECL([], [file_magic_cmd], [1],
3187f29dbc25Smrg    [Command to use when deplibs_check_method == "file_magic"])
3188f29dbc25Smrg])# _LT_CHECK_MAGIC_METHOD
3189f29dbc25Smrg
3190f29dbc25Smrg
3191f29dbc25Smrg# LT_PATH_NM
3192f29dbc25Smrg# ----------
3193f29dbc25Smrg# find the pathname to a BSD- or MS-compatible name lister
3194f29dbc25SmrgAC_DEFUN([LT_PATH_NM],
3195f29dbc25Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3196f29dbc25SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3197f29dbc25Smrg[if test -n "$NM"; then
3198f29dbc25Smrg  # Let the user override the test.
3199f29dbc25Smrg  lt_cv_path_NM="$NM"
3200f29dbc25Smrgelse
3201f29dbc25Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3202f29dbc25Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3203f29dbc25Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3204f29dbc25Smrg  fi
3205f29dbc25Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3206f29dbc25Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3207f29dbc25Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3208f29dbc25Smrg      IFS="$lt_save_ifs"
3209f29dbc25Smrg      test -z "$ac_dir" && ac_dir=.
3210f29dbc25Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3211f29dbc25Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3212f29dbc25Smrg	# Check to see if the nm accepts a BSD-compat flag.
3213f29dbc25Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3214f29dbc25Smrg	#   nm: unknown option "B" ignored
3215f29dbc25Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3216f29dbc25Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3217f29dbc25Smrg	*/dev/null* | *'Invalid file or object type'*)
3218f29dbc25Smrg	  lt_cv_path_NM="$tmp_nm -B"
3219f29dbc25Smrg	  break
3220f29dbc25Smrg	  ;;
3221f29dbc25Smrg	*)
3222f29dbc25Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3223f29dbc25Smrg	  */dev/null*)
3224f29dbc25Smrg	    lt_cv_path_NM="$tmp_nm -p"
3225f29dbc25Smrg	    break
3226f29dbc25Smrg	    ;;
3227f29dbc25Smrg	  *)
3228f29dbc25Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3229f29dbc25Smrg	    continue # so that we can try to find one that supports BSD flags
3230f29dbc25Smrg	    ;;
3231f29dbc25Smrg	  esac
3232f29dbc25Smrg	  ;;
3233f29dbc25Smrg	esac
3234f29dbc25Smrg      fi
3235f29dbc25Smrg    done
3236f29dbc25Smrg    IFS="$lt_save_ifs"
3237f29dbc25Smrg  done
3238f29dbc25Smrg  : ${lt_cv_path_NM=no}
3239f29dbc25Smrgfi])
3240f29dbc25Smrgif test "$lt_cv_path_NM" != "no"; then
3241f29dbc25Smrg  NM="$lt_cv_path_NM"
3242f29dbc25Smrgelse
3243f29dbc25Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3244f29dbc25Smrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3245f29dbc25Smrg  AC_SUBST([DUMPBIN])
3246f29dbc25Smrg  if test "$DUMPBIN" != ":"; then
3247f29dbc25Smrg    NM="$DUMPBIN"
3248f29dbc25Smrg  fi
3249f29dbc25Smrgfi
3250f29dbc25Smrgtest -z "$NM" && NM=nm
3251f29dbc25SmrgAC_SUBST([NM])
3252f29dbc25Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3253f29dbc25Smrg
3254f29dbc25SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3255f29dbc25Smrg  [lt_cv_nm_interface="BSD nm"
3256f29dbc25Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3257f29dbc25Smrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3258f29dbc25Smrg  (eval "$ac_compile" 2>conftest.err)
3259f29dbc25Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3260f29dbc25Smrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3261f29dbc25Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3262f29dbc25Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3263f29dbc25Smrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3264f29dbc25Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3265f29dbc25Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3266f29dbc25Smrg    lt_cv_nm_interface="MS dumpbin"
3267f29dbc25Smrg  fi
3268f29dbc25Smrg  rm -f conftest*])
3269f29dbc25Smrg])# LT_PATH_NM
3270f29dbc25Smrg
3271f29dbc25Smrg# Old names:
3272f29dbc25SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3273f29dbc25SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3274f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
3275f29dbc25Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3276f29dbc25Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3277f29dbc25Smrg
3278f29dbc25Smrg
3279f29dbc25Smrg# LT_LIB_M
3280f29dbc25Smrg# --------
3281f29dbc25Smrg# check for math library
3282f29dbc25SmrgAC_DEFUN([LT_LIB_M],
3283f29dbc25Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3284f29dbc25SmrgLIBM=
3285f29dbc25Smrgcase $host in
3286f29dbc25Smrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3287f29dbc25Smrg  # These system don't have libm, or don't need it
3288f29dbc25Smrg  ;;
3289f29dbc25Smrg*-ncr-sysv4.3*)
3290f29dbc25Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3291f29dbc25Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3292f29dbc25Smrg  ;;
3293f29dbc25Smrg*)
3294f29dbc25Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3295f29dbc25Smrg  ;;
3296f29dbc25Smrgesac
3297f29dbc25SmrgAC_SUBST([LIBM])
3298f29dbc25Smrg])# LT_LIB_M
3299f29dbc25Smrg
3300f29dbc25Smrg# Old name:
3301f29dbc25SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3302f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
3303f29dbc25Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3304f29dbc25Smrg
3305f29dbc25Smrg
3306f29dbc25Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3307f29dbc25Smrg# -------------------------------
3308f29dbc25Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3309f29dbc25Smrg[m4_require([_LT_TAG_COMPILER])dnl
3310f29dbc25Smrg
3311f29dbc25Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3312f29dbc25Smrg
3313f29dbc25Smrgif test "$GCC" = yes; then
3314f29dbc25Smrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3315f29dbc25Smrg
3316f29dbc25Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3317f29dbc25Smrg    lt_cv_prog_compiler_rtti_exceptions,
3318f29dbc25Smrg    [-fno-rtti -fno-exceptions], [],
3319f29dbc25Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3320f29dbc25Smrgfi
3321f29dbc25Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3322f29dbc25Smrg	[Compiler flag to turn off builtin functions])
3323f29dbc25Smrg])# _LT_COMPILER_NO_RTTI
3324f29dbc25Smrg
3325f29dbc25Smrg
3326f29dbc25Smrg# _LT_CMD_GLOBAL_SYMBOLS
3327f29dbc25Smrg# ----------------------
3328f29dbc25Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3329f29dbc25Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3330f29dbc25SmrgAC_REQUIRE([AC_PROG_CC])dnl
3331f29dbc25SmrgAC_REQUIRE([LT_PATH_NM])dnl
3332f29dbc25SmrgAC_REQUIRE([LT_PATH_LD])dnl
3333f29dbc25Smrgm4_require([_LT_DECL_SED])dnl
3334f29dbc25Smrgm4_require([_LT_DECL_EGREP])dnl
3335f29dbc25Smrgm4_require([_LT_TAG_COMPILER])dnl
3336f29dbc25Smrg
3337f29dbc25Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3338f29dbc25SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3339f29dbc25SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3340f29dbc25Smrg[
3341f29dbc25Smrg# These are sane defaults that work on at least a few old systems.
3342f29dbc25Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3343f29dbc25Smrg
3344f29dbc25Smrg# Character class describing NM global symbol codes.
3345f29dbc25Smrgsymcode='[[BCDEGRST]]'
3346f29dbc25Smrg
3347f29dbc25Smrg# Regexp to match symbols that can be accessed directly from C.
3348f29dbc25Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3349f29dbc25Smrg
3350f29dbc25Smrg# Define system-specific variables.
3351f29dbc25Smrgcase $host_os in
3352f29dbc25Smrgaix*)
3353f29dbc25Smrg  symcode='[[BCDT]]'
3354f29dbc25Smrg  ;;
3355f29dbc25Smrgcygwin* | mingw* | pw32* | cegcc*)
3356f29dbc25Smrg  symcode='[[ABCDGISTW]]'
3357f29dbc25Smrg  ;;
3358f29dbc25Smrghpux*)
3359f29dbc25Smrg  if test "$host_cpu" = ia64; then
3360f29dbc25Smrg    symcode='[[ABCDEGRST]]'
3361f29dbc25Smrg  fi
3362f29dbc25Smrg  ;;
3363f29dbc25Smrgirix* | nonstopux*)
3364f29dbc25Smrg  symcode='[[BCDEGRST]]'
3365f29dbc25Smrg  ;;
3366f29dbc25Smrgosf*)
3367f29dbc25Smrg  symcode='[[BCDEGQRST]]'
3368f29dbc25Smrg  ;;
3369f29dbc25Smrgsolaris*)
3370f29dbc25Smrg  symcode='[[BDRT]]'
3371f29dbc25Smrg  ;;
3372f29dbc25Smrgsco3.2v5*)
3373f29dbc25Smrg  symcode='[[DT]]'
3374f29dbc25Smrg  ;;
3375f29dbc25Smrgsysv4.2uw2*)
3376f29dbc25Smrg  symcode='[[DT]]'
3377f29dbc25Smrg  ;;
3378f29dbc25Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3379f29dbc25Smrg  symcode='[[ABDT]]'
3380f29dbc25Smrg  ;;
3381f29dbc25Smrgsysv4)
3382f29dbc25Smrg  symcode='[[DFNSTU]]'
3383f29dbc25Smrg  ;;
3384f29dbc25Smrgesac
3385f29dbc25Smrg
3386f29dbc25Smrg# If we're using GNU nm, then use its standard symbol codes.
3387f29dbc25Smrgcase `$NM -V 2>&1` in
3388f29dbc25Smrg*GNU* | *'with BFD'*)
3389f29dbc25Smrg  symcode='[[ABCDGIRSTW]]' ;;
3390f29dbc25Smrgesac
3391f29dbc25Smrg
3392f29dbc25Smrg# Transform an extracted symbol line into a proper C declaration.
3393f29dbc25Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3394f29dbc25Smrg# so use this general approach.
3395f29dbc25Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3396f29dbc25Smrg
3397f29dbc25Smrg# Transform an extracted symbol line into symbol name and symbol address
3398f29dbc25Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3399f29dbc25Smrglt_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'"
3400f29dbc25Smrg
3401f29dbc25Smrg# Handle CRLF in mingw tool chain
3402f29dbc25Smrgopt_cr=
3403f29dbc25Smrgcase $build_os in
3404f29dbc25Smrgmingw*)
3405f29dbc25Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3406f29dbc25Smrg  ;;
3407f29dbc25Smrgesac
3408f29dbc25Smrg
3409f29dbc25Smrg# Try without a prefix underscore, then with it.
3410f29dbc25Smrgfor ac_symprfx in "" "_"; do
3411f29dbc25Smrg
3412f29dbc25Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3413f29dbc25Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3414f29dbc25Smrg
3415f29dbc25Smrg  # Write the raw and C identifiers.
3416f29dbc25Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3417f29dbc25Smrg    # Fake it for dumpbin and say T for any non-static function
3418f29dbc25Smrg    # and D for any global variable.
3419f29dbc25Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3420f29dbc25Smrg    # which start with @ or ?.
3421f29dbc25Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3422f29dbc25Smrg"     {last_section=section; section=\$ 3};"\
3423f29dbc25Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3424f29dbc25Smrg"     \$ 0!~/External *\|/{next};"\
3425f29dbc25Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3426f29dbc25Smrg"     {if(hide[section]) next};"\
3427f29dbc25Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3428f29dbc25Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3429f29dbc25Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3430f29dbc25Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3431f29dbc25Smrg"     ' prfx=^$ac_symprfx]"
3432f29dbc25Smrg  else
3433f29dbc25Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3434f29dbc25Smrg  fi
3435f29dbc25Smrg
3436f29dbc25Smrg  # Check to see that the pipe works correctly.
3437f29dbc25Smrg  pipe_works=no
3438f29dbc25Smrg
3439f29dbc25Smrg  rm -f conftest*
3440f29dbc25Smrg  cat > conftest.$ac_ext <<_LT_EOF
3441f29dbc25Smrg#ifdef __cplusplus
3442f29dbc25Smrgextern "C" {
3443f29dbc25Smrg#endif
3444f29dbc25Smrgchar nm_test_var;
3445f29dbc25Smrgvoid nm_test_func(void);
3446f29dbc25Smrgvoid nm_test_func(void){}
3447f29dbc25Smrg#ifdef __cplusplus
3448f29dbc25Smrg}
3449f29dbc25Smrg#endif
3450f29dbc25Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3451f29dbc25Smrg_LT_EOF
3452f29dbc25Smrg
3453f29dbc25Smrg  if AC_TRY_EVAL(ac_compile); then
3454f29dbc25Smrg    # Now try to grab the symbols.
3455f29dbc25Smrg    nlist=conftest.nm
3456f29dbc25Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3457f29dbc25Smrg      # Try sorting and uniquifying the output.
3458f29dbc25Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3459f29dbc25Smrg	mv -f "$nlist"T "$nlist"
3460f29dbc25Smrg      else
3461f29dbc25Smrg	rm -f "$nlist"T
3462f29dbc25Smrg      fi
3463f29dbc25Smrg
3464f29dbc25Smrg      # Make sure that we snagged all the symbols we need.
3465f29dbc25Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3466f29dbc25Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3467f29dbc25Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3468f29dbc25Smrg#ifdef __cplusplus
3469f29dbc25Smrgextern "C" {
3470f29dbc25Smrg#endif
3471f29dbc25Smrg
3472f29dbc25Smrg_LT_EOF
3473f29dbc25Smrg	  # Now generate the symbol file.
3474f29dbc25Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3475f29dbc25Smrg
3476f29dbc25Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3477f29dbc25Smrg
3478f29dbc25Smrg/* The mapping between symbol names and symbols.  */
3479f29dbc25Smrgconst struct {
3480f29dbc25Smrg  const char *name;
3481f29dbc25Smrg  void       *address;
3482f29dbc25Smrg}
3483f29dbc25Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3484f29dbc25Smrg{
3485f29dbc25Smrg  { "@PROGRAM@", (void *) 0 },
3486f29dbc25Smrg_LT_EOF
3487f29dbc25Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3488f29dbc25Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3489f29dbc25Smrg  {0, (void *) 0}
3490f29dbc25Smrg};
3491f29dbc25Smrg
3492f29dbc25Smrg/* This works around a problem in FreeBSD linker */
3493f29dbc25Smrg#ifdef FREEBSD_WORKAROUND
3494f29dbc25Smrgstatic const void *lt_preloaded_setup() {
3495f29dbc25Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3496f29dbc25Smrg}
3497f29dbc25Smrg#endif
3498f29dbc25Smrg
3499f29dbc25Smrg#ifdef __cplusplus
3500f29dbc25Smrg}
3501f29dbc25Smrg#endif
3502f29dbc25Smrg_LT_EOF
3503f29dbc25Smrg	  # Now try linking the two files.
3504f29dbc25Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3505f29dbc25Smrg	  lt_save_LIBS="$LIBS"
3506f29dbc25Smrg	  lt_save_CFLAGS="$CFLAGS"
3507f29dbc25Smrg	  LIBS="conftstm.$ac_objext"
3508f29dbc25Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3509f29dbc25Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3510f29dbc25Smrg	    pipe_works=yes
3511f29dbc25Smrg	  fi
3512f29dbc25Smrg	  LIBS="$lt_save_LIBS"
3513f29dbc25Smrg	  CFLAGS="$lt_save_CFLAGS"
3514f29dbc25Smrg	else
3515f29dbc25Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3516f29dbc25Smrg	fi
3517f29dbc25Smrg      else
3518f29dbc25Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3519f29dbc25Smrg      fi
3520f29dbc25Smrg    else
3521f29dbc25Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3522f29dbc25Smrg    fi
3523f29dbc25Smrg  else
3524f29dbc25Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3525f29dbc25Smrg    cat conftest.$ac_ext >&5
3526f29dbc25Smrg  fi
3527f29dbc25Smrg  rm -rf conftest* conftst*
3528f29dbc25Smrg
3529f29dbc25Smrg  # Do not use the global_symbol_pipe unless it works.
3530f29dbc25Smrg  if test "$pipe_works" = yes; then
3531f29dbc25Smrg    break
3532f29dbc25Smrg  else
3533f29dbc25Smrg    lt_cv_sys_global_symbol_pipe=
3534f29dbc25Smrg  fi
3535f29dbc25Smrgdone
3536f29dbc25Smrg])
3537f29dbc25Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3538f29dbc25Smrg  lt_cv_sys_global_symbol_to_cdecl=
3539f29dbc25Smrgfi
3540f29dbc25Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3541f29dbc25Smrg  AC_MSG_RESULT(failed)
3542f29dbc25Smrgelse
3543f29dbc25Smrg  AC_MSG_RESULT(ok)
3544f29dbc25Smrgfi
3545f29dbc25Smrg
3546f29dbc25Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3547f29dbc25Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3548f29dbc25Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3549f29dbc25Smrg    [Transform the output of nm in a proper C declaration])
3550f29dbc25Smrg_LT_DECL([global_symbol_to_c_name_address],
3551f29dbc25Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3552f29dbc25Smrg    [Transform the output of nm in a C name address pair])
3553f29dbc25Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3554f29dbc25Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3555f29dbc25Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3556f29dbc25Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3557f29dbc25Smrg
3558f29dbc25Smrg
3559f29dbc25Smrg# _LT_COMPILER_PIC([TAGNAME])
3560f29dbc25Smrg# ---------------------------
3561f29dbc25Smrgm4_defun([_LT_COMPILER_PIC],
3562f29dbc25Smrg[m4_require([_LT_TAG_COMPILER])dnl
3563f29dbc25Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3564f29dbc25Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3565f29dbc25Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3566f29dbc25Smrg
3567f29dbc25SmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
3568f29dbc25Smrgm4_if([$1], [CXX], [
3569f29dbc25Smrg  # C++ specific cases for pic, static, wl, etc.
3570f29dbc25Smrg  if test "$GXX" = yes; then
3571f29dbc25Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3572f29dbc25Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3573f29dbc25Smrg
3574f29dbc25Smrg    case $host_os in
3575f29dbc25Smrg    aix*)
3576f29dbc25Smrg      # All AIX code is PIC.
3577f29dbc25Smrg      if test "$host_cpu" = ia64; then
3578f29dbc25Smrg	# AIX 5 now supports IA64 processor
3579f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3580f29dbc25Smrg      fi
3581f29dbc25Smrg      ;;
3582f29dbc25Smrg
3583f29dbc25Smrg    amigaos*)
3584f29dbc25Smrg      case $host_cpu in
3585f29dbc25Smrg      powerpc)
3586f29dbc25Smrg            # see comment about AmigaOS4 .so support
3587f29dbc25Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3588f29dbc25Smrg        ;;
3589f29dbc25Smrg      m68k)
3590f29dbc25Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3591f29dbc25Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3592f29dbc25Smrg            # like `-m68040'.
3593f29dbc25Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3594f29dbc25Smrg        ;;
3595f29dbc25Smrg      esac
3596f29dbc25Smrg      ;;
3597f29dbc25Smrg
3598f29dbc25Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3599f29dbc25Smrg      # PIC is the default for these OSes.
3600f29dbc25Smrg      ;;
3601f29dbc25Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3602f29dbc25Smrg      # This hack is so that the source file can tell whether it is being
3603f29dbc25Smrg      # built for inclusion in a dll (and should export symbols for example).
3604f29dbc25Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3605f29dbc25Smrg      # (--disable-auto-import) libraries
3606f29dbc25Smrg      m4_if([$1], [GCJ], [],
3607f29dbc25Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3608f29dbc25Smrg      ;;
3609f29dbc25Smrg    darwin* | rhapsody*)
3610f29dbc25Smrg      # PIC is the default on this platform
3611f29dbc25Smrg      # Common symbols not allowed in MH_DYLIB files
3612f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3613f29dbc25Smrg      ;;
3614f29dbc25Smrg    *djgpp*)
3615f29dbc25Smrg      # DJGPP does not support shared libraries at all
3616f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3617f29dbc25Smrg      ;;
3618f29dbc25Smrg    interix[[3-9]]*)
3619f29dbc25Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3620f29dbc25Smrg      # Instead, we relocate shared libraries at runtime.
3621f29dbc25Smrg      ;;
3622f29dbc25Smrg    sysv4*MP*)
3623f29dbc25Smrg      if test -d /usr/nec; then
3624f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3625f29dbc25Smrg      fi
3626f29dbc25Smrg      ;;
3627f29dbc25Smrg    hpux*)
3628f29dbc25Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3629f29dbc25Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3630f29dbc25Smrg      # sets the default TLS model and affects inlining.
3631f29dbc25Smrg      case $host_cpu in
3632f29dbc25Smrg      hppa*64*)
3633f29dbc25Smrg	;;
3634f29dbc25Smrg      *)
3635f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3636f29dbc25Smrg	;;
3637f29dbc25Smrg      esac
3638f29dbc25Smrg      ;;
3639f29dbc25Smrg    *qnx* | *nto*)
3640f29dbc25Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3641f29dbc25Smrg      # it will coredump.
3642f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3643f29dbc25Smrg      ;;
3644f29dbc25Smrg    *)
3645f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3646f29dbc25Smrg      ;;
3647f29dbc25Smrg    esac
3648f29dbc25Smrg  else
3649f29dbc25Smrg    case $host_os in
3650f29dbc25Smrg      aix[[4-9]]*)
3651f29dbc25Smrg	# All AIX code is PIC.
3652f29dbc25Smrg	if test "$host_cpu" = ia64; then
3653f29dbc25Smrg	  # AIX 5 now supports IA64 processor
3654f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3655f29dbc25Smrg	else
3656f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3657f29dbc25Smrg	fi
3658f29dbc25Smrg	;;
3659f29dbc25Smrg      chorus*)
3660f29dbc25Smrg	case $cc_basename in
3661f29dbc25Smrg	cxch68*)
3662f29dbc25Smrg	  # Green Hills C++ Compiler
3663f29dbc25Smrg	  # _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"
3664f29dbc25Smrg	  ;;
3665f29dbc25Smrg	esac
3666f29dbc25Smrg	;;
3667f29dbc25Smrg      dgux*)
3668f29dbc25Smrg	case $cc_basename in
3669f29dbc25Smrg	  ec++*)
3670f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3671f29dbc25Smrg	    ;;
3672f29dbc25Smrg	  ghcx*)
3673f29dbc25Smrg	    # Green Hills C++ Compiler
3674f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3675f29dbc25Smrg	    ;;
3676f29dbc25Smrg	  *)
3677f29dbc25Smrg	    ;;
3678f29dbc25Smrg	esac
3679f29dbc25Smrg	;;
3680f29dbc25Smrg      freebsd* | dragonfly*)
3681f29dbc25Smrg	# FreeBSD uses GNU C++
3682f29dbc25Smrg	;;
3683f29dbc25Smrg      hpux9* | hpux10* | hpux11*)
3684f29dbc25Smrg	case $cc_basename in
3685f29dbc25Smrg	  CC*)
3686f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3687f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3688f29dbc25Smrg	    if test "$host_cpu" != ia64; then
3689f29dbc25Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3690f29dbc25Smrg	    fi
3691f29dbc25Smrg	    ;;
3692f29dbc25Smrg	  aCC*)
3693f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3694f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3695f29dbc25Smrg	    case $host_cpu in
3696f29dbc25Smrg	    hppa*64*|ia64*)
3697f29dbc25Smrg	      # +Z the default
3698f29dbc25Smrg	      ;;
3699f29dbc25Smrg	    *)
3700f29dbc25Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3701f29dbc25Smrg	      ;;
3702f29dbc25Smrg	    esac
3703f29dbc25Smrg	    ;;
3704f29dbc25Smrg	  *)
3705f29dbc25Smrg	    ;;
3706f29dbc25Smrg	esac
3707f29dbc25Smrg	;;
3708f29dbc25Smrg      interix*)
3709f29dbc25Smrg	# This is c89, which is MS Visual C++ (no shared libs)
3710f29dbc25Smrg	# Anyone wants to do a port?
3711f29dbc25Smrg	;;
3712f29dbc25Smrg      irix5* | irix6* | nonstopux*)
3713f29dbc25Smrg	case $cc_basename in
3714f29dbc25Smrg	  CC*)
3715f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3716f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3717f29dbc25Smrg	    # CC pic flag -KPIC is the default.
3718f29dbc25Smrg	    ;;
3719f29dbc25Smrg	  *)
3720f29dbc25Smrg	    ;;
3721f29dbc25Smrg	esac
3722f29dbc25Smrg	;;
3723f29dbc25Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
3724f29dbc25Smrg	case $cc_basename in
3725f29dbc25Smrg	  KCC*)
3726f29dbc25Smrg	    # KAI C++ Compiler
3727f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3728f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3729f29dbc25Smrg	    ;;
3730f29dbc25Smrg	  ecpc* )
3731f29dbc25Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
3732f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3733f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3734f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3735f29dbc25Smrg	    ;;
3736f29dbc25Smrg	  icpc* )
3737f29dbc25Smrg	    # Intel C++, used to be incompatible with GCC.
3738f29dbc25Smrg	    # ICC 10 doesn't accept -KPIC any more.
3739f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3740f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3741f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3742f29dbc25Smrg	    ;;
3743f29dbc25Smrg	  pgCC* | pgcpp*)
3744f29dbc25Smrg	    # Portland Group C++ compiler
3745f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3746f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3747f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3748f29dbc25Smrg	    ;;
3749f29dbc25Smrg	  cxx*)
3750f29dbc25Smrg	    # Compaq C++
3751f29dbc25Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3752f29dbc25Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3753f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3754f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3755f29dbc25Smrg	    ;;
3756f29dbc25Smrg	  xlc* | xlC*)
3757f29dbc25Smrg	    # IBM XL 8.0 on PPC
3758f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3759f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3760f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3761f29dbc25Smrg	    ;;
3762f29dbc25Smrg	  *)
3763f29dbc25Smrg	    case `$CC -V 2>&1 | sed 5q` in
3764f29dbc25Smrg	    *Sun\ C*)
3765f29dbc25Smrg	      # Sun C++ 5.9
3766f29dbc25Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3767f29dbc25Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3768f29dbc25Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3769f29dbc25Smrg	      ;;
3770f29dbc25Smrg	    esac
3771f29dbc25Smrg	    ;;
3772f29dbc25Smrg	esac
3773f29dbc25Smrg	;;
3774f29dbc25Smrg      lynxos*)
3775f29dbc25Smrg	;;
3776f29dbc25Smrg      m88k*)
3777f29dbc25Smrg	;;
3778f29dbc25Smrg      mvs*)
3779f29dbc25Smrg	case $cc_basename in
3780f29dbc25Smrg	  cxx*)
3781f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3782f29dbc25Smrg	    ;;
3783f29dbc25Smrg	  *)
3784f29dbc25Smrg	    ;;
3785f29dbc25Smrg	esac
3786f29dbc25Smrg	;;
3787f29dbc25Smrg      netbsd* | netbsdelf*-gnu)
3788f29dbc25Smrg	;;
3789f29dbc25Smrg      *qnx* | *nto*)
3790f29dbc25Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
3791f29dbc25Smrg        # it will coredump.
3792f29dbc25Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3793f29dbc25Smrg        ;;
3794f29dbc25Smrg      osf3* | osf4* | osf5*)
3795f29dbc25Smrg	case $cc_basename in
3796f29dbc25Smrg	  KCC*)
3797f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3798f29dbc25Smrg	    ;;
3799f29dbc25Smrg	  RCC*)
3800f29dbc25Smrg	    # Rational C++ 2.4.1
3801f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3802f29dbc25Smrg	    ;;
3803f29dbc25Smrg	  cxx*)
3804f29dbc25Smrg	    # Digital/Compaq C++
3805f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3806f29dbc25Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3807f29dbc25Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3808f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3809f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3810f29dbc25Smrg	    ;;
3811f29dbc25Smrg	  *)
3812f29dbc25Smrg	    ;;
3813f29dbc25Smrg	esac
3814f29dbc25Smrg	;;
3815f29dbc25Smrg      psos*)
3816f29dbc25Smrg	;;
3817f29dbc25Smrg      solaris*)
3818f29dbc25Smrg	case $cc_basename in
3819f29dbc25Smrg	  CC*)
3820f29dbc25Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
3821f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3822f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3823f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3824f29dbc25Smrg	    ;;
3825f29dbc25Smrg	  gcx*)
3826f29dbc25Smrg	    # Green Hills C++ Compiler
3827f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3828f29dbc25Smrg	    ;;
3829f29dbc25Smrg	  *)
3830f29dbc25Smrg	    ;;
3831f29dbc25Smrg	esac
3832f29dbc25Smrg	;;
3833f29dbc25Smrg      sunos4*)
3834f29dbc25Smrg	case $cc_basename in
3835f29dbc25Smrg	  CC*)
3836f29dbc25Smrg	    # Sun C++ 4.x
3837f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3838f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3839f29dbc25Smrg	    ;;
3840f29dbc25Smrg	  lcc*)
3841f29dbc25Smrg	    # Lucid
3842f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3843f29dbc25Smrg	    ;;
3844f29dbc25Smrg	  *)
3845f29dbc25Smrg	    ;;
3846f29dbc25Smrg	esac
3847f29dbc25Smrg	;;
3848f29dbc25Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3849f29dbc25Smrg	case $cc_basename in
3850f29dbc25Smrg	  CC*)
3851f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3852f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3853f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3854f29dbc25Smrg	    ;;
3855f29dbc25Smrg	esac
3856f29dbc25Smrg	;;
3857f29dbc25Smrg      tandem*)
3858f29dbc25Smrg	case $cc_basename in
3859f29dbc25Smrg	  NCC*)
3860f29dbc25Smrg	    # NonStop-UX NCC 3.20
3861f29dbc25Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3862f29dbc25Smrg	    ;;
3863f29dbc25Smrg	  *)
3864f29dbc25Smrg	    ;;
3865f29dbc25Smrg	esac
3866f29dbc25Smrg	;;
3867f29dbc25Smrg      vxworks*)
3868f29dbc25Smrg	;;
3869f29dbc25Smrg      *)
3870f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3871f29dbc25Smrg	;;
3872f29dbc25Smrg    esac
3873f29dbc25Smrg  fi
3874f29dbc25Smrg],
3875f29dbc25Smrg[
3876f29dbc25Smrg  if test "$GCC" = yes; then
3877f29dbc25Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3878f29dbc25Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3879f29dbc25Smrg
3880f29dbc25Smrg    case $host_os in
3881f29dbc25Smrg      aix*)
3882f29dbc25Smrg      # All AIX code is PIC.
3883f29dbc25Smrg      if test "$host_cpu" = ia64; then
3884f29dbc25Smrg	# AIX 5 now supports IA64 processor
3885f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3886f29dbc25Smrg      fi
3887f29dbc25Smrg      ;;
3888f29dbc25Smrg
3889f29dbc25Smrg    amigaos*)
3890f29dbc25Smrg      case $host_cpu in
3891f29dbc25Smrg      powerpc)
3892f29dbc25Smrg            # see comment about AmigaOS4 .so support
3893f29dbc25Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3894f29dbc25Smrg        ;;
3895f29dbc25Smrg      m68k)
3896f29dbc25Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3897f29dbc25Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3898f29dbc25Smrg            # like `-m68040'.
3899f29dbc25Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3900f29dbc25Smrg        ;;
3901f29dbc25Smrg      esac
3902f29dbc25Smrg      ;;
3903f29dbc25Smrg
3904f29dbc25Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3905f29dbc25Smrg      # PIC is the default for these OSes.
3906f29dbc25Smrg      ;;
3907f29dbc25Smrg
3908f29dbc25Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3909f29dbc25Smrg      # This hack is so that the source file can tell whether it is being
3910f29dbc25Smrg      # built for inclusion in a dll (and should export symbols for example).
3911f29dbc25Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3912f29dbc25Smrg      # (--disable-auto-import) libraries
3913f29dbc25Smrg      m4_if([$1], [GCJ], [],
3914f29dbc25Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3915f29dbc25Smrg      ;;
3916f29dbc25Smrg
3917f29dbc25Smrg    darwin* | rhapsody*)
3918f29dbc25Smrg      # PIC is the default on this platform
3919f29dbc25Smrg      # Common symbols not allowed in MH_DYLIB files
3920f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3921f29dbc25Smrg      ;;
3922f29dbc25Smrg
3923f29dbc25Smrg    hpux*)
3924f29dbc25Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3925f29dbc25Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3926f29dbc25Smrg      # sets the default TLS model and affects inlining.
3927f29dbc25Smrg      case $host_cpu in
3928f29dbc25Smrg      hppa*64*)
3929f29dbc25Smrg	# +Z the default
3930f29dbc25Smrg	;;
3931f29dbc25Smrg      *)
3932f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3933f29dbc25Smrg	;;
3934f29dbc25Smrg      esac
3935f29dbc25Smrg      ;;
3936f29dbc25Smrg
3937f29dbc25Smrg    interix[[3-9]]*)
3938f29dbc25Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3939f29dbc25Smrg      # Instead, we relocate shared libraries at runtime.
3940f29dbc25Smrg      ;;
3941f29dbc25Smrg
3942f29dbc25Smrg    msdosdjgpp*)
3943f29dbc25Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
3944f29dbc25Smrg      # on systems that don't support them.
3945f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3946f29dbc25Smrg      enable_shared=no
3947f29dbc25Smrg      ;;
3948f29dbc25Smrg
3949f29dbc25Smrg    *nto* | *qnx*)
3950f29dbc25Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3951f29dbc25Smrg      # it will coredump.
3952f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3953f29dbc25Smrg      ;;
3954f29dbc25Smrg
3955f29dbc25Smrg    sysv4*MP*)
3956f29dbc25Smrg      if test -d /usr/nec; then
3957f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3958f29dbc25Smrg      fi
3959f29dbc25Smrg      ;;
3960f29dbc25Smrg
3961f29dbc25Smrg    *)
3962f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3963f29dbc25Smrg      ;;
3964f29dbc25Smrg    esac
3965f29dbc25Smrg  else
3966f29dbc25Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
3967f29dbc25Smrg    case $host_os in
3968f29dbc25Smrg    aix*)
3969f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3970f29dbc25Smrg      if test "$host_cpu" = ia64; then
3971f29dbc25Smrg	# AIX 5 now supports IA64 processor
3972f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3973f29dbc25Smrg      else
3974f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3975f29dbc25Smrg      fi
3976f29dbc25Smrg      ;;
3977f29dbc25Smrg
3978f29dbc25Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3979f29dbc25Smrg      # This hack is so that the source file can tell whether it is being
3980f29dbc25Smrg      # built for inclusion in a dll (and should export symbols for example).
3981f29dbc25Smrg      m4_if([$1], [GCJ], [],
3982f29dbc25Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3983f29dbc25Smrg      ;;
3984f29dbc25Smrg
3985f29dbc25Smrg    hpux9* | hpux10* | hpux11*)
3986f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3987f29dbc25Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3988f29dbc25Smrg      # not for PA HP-UX.
3989f29dbc25Smrg      case $host_cpu in
3990f29dbc25Smrg      hppa*64*|ia64*)
3991f29dbc25Smrg	# +Z the default
3992f29dbc25Smrg	;;
3993f29dbc25Smrg      *)
3994f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3995f29dbc25Smrg	;;
3996f29dbc25Smrg      esac
3997f29dbc25Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
3998f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3999f29dbc25Smrg      ;;
4000f29dbc25Smrg
4001f29dbc25Smrg    irix5* | irix6* | nonstopux*)
4002f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4003f29dbc25Smrg      # PIC (with -KPIC) is the default.
4004f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4005f29dbc25Smrg      ;;
4006f29dbc25Smrg
4007f29dbc25Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4008f29dbc25Smrg      case $cc_basename in
4009f29dbc25Smrg      # old Intel for x86_64 which still supported -KPIC.
4010f29dbc25Smrg      ecc*)
4011f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4012f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4013f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4014f29dbc25Smrg        ;;
4015f29dbc25Smrg      # icc used to be incompatible with GCC.
4016f29dbc25Smrg      # ICC 10 doesn't accept -KPIC any more.
4017f29dbc25Smrg      icc* | ifort*)
4018f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4019f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4020f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4021f29dbc25Smrg        ;;
4022f29dbc25Smrg      # Lahey Fortran 8.1.
4023f29dbc25Smrg      lf95*)
4024f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4025f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4026f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4027f29dbc25Smrg	;;
4028f29dbc25Smrg      pgcc* | pgf77* | pgf90* | pgf95*)
4029f29dbc25Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4030f29dbc25Smrg	# which looks to be a dead project)
4031f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4032f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4033f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4034f29dbc25Smrg        ;;
4035f29dbc25Smrg      ccc*)
4036f29dbc25Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4037f29dbc25Smrg        # All Alpha code is PIC.
4038f29dbc25Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4039f29dbc25Smrg        ;;
4040f29dbc25Smrg      xl*)
4041f29dbc25Smrg	# IBM XL C 8.0/Fortran 10.1 on PPC
4042f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4043f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4044f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4045f29dbc25Smrg	;;
4046f29dbc25Smrg      *)
4047f29dbc25Smrg	case `$CC -V 2>&1 | sed 5q` in
4048f29dbc25Smrg	*Sun\ C*)
4049f29dbc25Smrg	  # Sun C 5.9
4050f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4051f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4052f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4053f29dbc25Smrg	  ;;
4054f29dbc25Smrg	*Sun\ F*)
4055f29dbc25Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4056f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4057f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4058f29dbc25Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4059f29dbc25Smrg	  ;;
4060f29dbc25Smrg	esac
4061f29dbc25Smrg	;;
4062f29dbc25Smrg      esac
4063f29dbc25Smrg      ;;
4064f29dbc25Smrg
4065f29dbc25Smrg    newsos6)
4066f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4067f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4068f29dbc25Smrg      ;;
4069f29dbc25Smrg
4070f29dbc25Smrg    *nto* | *qnx*)
4071f29dbc25Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4072f29dbc25Smrg      # it will coredump.
4073f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4074f29dbc25Smrg      ;;
4075f29dbc25Smrg
4076f29dbc25Smrg    osf3* | osf4* | osf5*)
4077f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4078f29dbc25Smrg      # All OSF/1 code is PIC.
4079f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4080f29dbc25Smrg      ;;
4081f29dbc25Smrg
4082f29dbc25Smrg    rdos*)
4083f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4084f29dbc25Smrg      ;;
4085f29dbc25Smrg
4086f29dbc25Smrg    solaris*)
4087f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4088f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4089f29dbc25Smrg      case $cc_basename in
4090f29dbc25Smrg      f77* | f90* | f95*)
4091f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4092f29dbc25Smrg      *)
4093f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4094f29dbc25Smrg      esac
4095f29dbc25Smrg      ;;
4096f29dbc25Smrg
4097f29dbc25Smrg    sunos4*)
4098f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4099f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4100f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4101f29dbc25Smrg      ;;
4102f29dbc25Smrg
4103f29dbc25Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4104f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4105f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4106f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4107f29dbc25Smrg      ;;
4108f29dbc25Smrg
4109f29dbc25Smrg    sysv4*MP*)
4110f29dbc25Smrg      if test -d /usr/nec ;then
4111f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4112f29dbc25Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4113f29dbc25Smrg      fi
4114f29dbc25Smrg      ;;
4115f29dbc25Smrg
4116f29dbc25Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4117f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4118f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4119f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4120f29dbc25Smrg      ;;
4121f29dbc25Smrg
4122f29dbc25Smrg    unicos*)
4123f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4124f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4125f29dbc25Smrg      ;;
4126f29dbc25Smrg
4127f29dbc25Smrg    uts4*)
4128f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4129f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4130f29dbc25Smrg      ;;
4131f29dbc25Smrg
4132f29dbc25Smrg    *)
4133f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4134f29dbc25Smrg      ;;
4135f29dbc25Smrg    esac
4136f29dbc25Smrg  fi
4137f29dbc25Smrg])
4138f29dbc25Smrgcase $host_os in
4139f29dbc25Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4140f29dbc25Smrg  *djgpp*)
4141f29dbc25Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4142f29dbc25Smrg    ;;
4143f29dbc25Smrg  *)
4144f29dbc25Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4145f29dbc25Smrg    ;;
4146f29dbc25Smrgesac
4147f29dbc25SmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4148f29dbc25Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4149f29dbc25Smrg	[How to pass a linker flag through the compiler])
4150f29dbc25Smrg
4151f29dbc25Smrg#
4152f29dbc25Smrg# Check to make sure the PIC flag actually works.
4153f29dbc25Smrg#
4154f29dbc25Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4155f29dbc25Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4156f29dbc25Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4157f29dbc25Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4158f29dbc25Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4159f29dbc25Smrg     "" | " "*) ;;
4160f29dbc25Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4161f29dbc25Smrg     esac],
4162f29dbc25Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4163f29dbc25Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4164f29dbc25Smrgfi
4165f29dbc25Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4166f29dbc25Smrg	[Additional compiler flags for building library objects])
4167f29dbc25Smrg
4168f29dbc25Smrg#
4169f29dbc25Smrg# Check to make sure the static flag actually works.
4170f29dbc25Smrg#
4171f29dbc25Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4172f29dbc25Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4173f29dbc25Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4174f29dbc25Smrg  $lt_tmp_static_flag,
4175f29dbc25Smrg  [],
4176f29dbc25Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4177f29dbc25Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4178f29dbc25Smrg	[Compiler flag to prevent dynamic linking])
4179f29dbc25Smrg])# _LT_COMPILER_PIC
4180f29dbc25Smrg
4181f29dbc25Smrg
4182f29dbc25Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4183f29dbc25Smrg# ----------------------------
4184f29dbc25Smrg# See if the linker supports building shared libraries.
4185f29dbc25Smrgm4_defun([_LT_LINKER_SHLIBS],
4186f29dbc25Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4187f29dbc25SmrgAC_REQUIRE([LT_PATH_NM])dnl
4188f29dbc25Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4189f29dbc25Smrgm4_require([_LT_DECL_EGREP])dnl
4190f29dbc25Smrgm4_require([_LT_DECL_SED])dnl
4191f29dbc25Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4192f29dbc25Smrgm4_require([_LT_TAG_COMPILER])dnl
4193f29dbc25SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4194f29dbc25Smrgm4_if([$1], [CXX], [
4195f29dbc25Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4196f29dbc25Smrg  case $host_os in
4197f29dbc25Smrg  aix[[4-9]]*)
4198f29dbc25Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4199f29dbc25Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4200f29dbc25Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4201f29dbc25Smrg      _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'
4202f29dbc25Smrg    else
4203f29dbc25Smrg      _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'
4204f29dbc25Smrg    fi
4205f29dbc25Smrg    ;;
4206f29dbc25Smrg  pw32*)
4207f29dbc25Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4208f29dbc25Smrg  ;;
4209f29dbc25Smrg  cygwin* | mingw* | cegcc*)
4210f29dbc25Smrg    _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'
4211f29dbc25Smrg  ;;
4212f29dbc25Smrg  linux* | k*bsd*-gnu)
4213f29dbc25Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4214f29dbc25Smrg  ;;
4215f29dbc25Smrg  *)
4216f29dbc25Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4217f29dbc25Smrg  ;;
4218f29dbc25Smrg  esac
4219f29dbc25Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4220f29dbc25Smrg], [
4221f29dbc25Smrg  runpath_var=
4222f29dbc25Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4223f29dbc25Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4224f29dbc25Smrg  _LT_TAGVAR(archive_cmds, $1)=
4225f29dbc25Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4226f29dbc25Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4227f29dbc25Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4228f29dbc25Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4229f29dbc25Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4230f29dbc25Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4231f29dbc25Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4232f29dbc25Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4233f29dbc25Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4234f29dbc25Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4235f29dbc25Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4236f29dbc25Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4237f29dbc25Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4238f29dbc25Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4239f29dbc25Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4240f29dbc25Smrg  _LT_TAGVAR(module_cmds, $1)=
4241f29dbc25Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4242f29dbc25Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4243f29dbc25Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4244f29dbc25Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4245f29dbc25Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4246f29dbc25Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4247f29dbc25Smrg  # included in the symbol list
4248f29dbc25Smrg  _LT_TAGVAR(include_expsyms, $1)=
4249f29dbc25Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4250f29dbc25Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4251f29dbc25Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4252f29dbc25Smrg  # as well as any symbol that contains `d'.
4253f29dbc25Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4254f29dbc25Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4255f29dbc25Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4256f29dbc25Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4257f29dbc25Smrg  # rely on this symbol name, it's probably fine to never include it in
4258f29dbc25Smrg  # preloaded symbol tables.
4259f29dbc25Smrg  # Exclude shared library initialization/finalization symbols.
4260f29dbc25Smrgdnl Note also adjust exclude_expsyms for C++ above.
4261f29dbc25Smrg  extract_expsyms_cmds=
4262f29dbc25Smrg
4263f29dbc25Smrg  case $host_os in
4264f29dbc25Smrg  cygwin* | mingw* | pw32* | cegcc*)
4265f29dbc25Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4266f29dbc25Smrg    # When not using gcc, we currently assume that we are using
4267f29dbc25Smrg    # Microsoft Visual C++.
4268f29dbc25Smrg    if test "$GCC" != yes; then
4269f29dbc25Smrg      with_gnu_ld=no
4270f29dbc25Smrg    fi
4271f29dbc25Smrg    ;;
4272f29dbc25Smrg  interix*)
4273f29dbc25Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4274f29dbc25Smrg    with_gnu_ld=yes
4275f29dbc25Smrg    ;;
4276f29dbc25Smrg  openbsd*)
4277f29dbc25Smrg    with_gnu_ld=no
4278f29dbc25Smrg    ;;
4279f29dbc25Smrg  linux* | k*bsd*-gnu)
4280f29dbc25Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4281f29dbc25Smrg    ;;
4282f29dbc25Smrg  esac
4283f29dbc25Smrg
4284f29dbc25Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4285f29dbc25Smrg  if test "$with_gnu_ld" = yes; then
4286f29dbc25Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4287f29dbc25Smrg    wlarc='${wl}'
4288f29dbc25Smrg
4289f29dbc25Smrg    # Set some defaults for GNU ld with shared library support. These
4290f29dbc25Smrg    # are reset later if shared libraries are not supported. Putting them
4291f29dbc25Smrg    # here allows them to be overridden if necessary.
4292f29dbc25Smrg    runpath_var=LD_RUN_PATH
4293f29dbc25Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4294f29dbc25Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4295f29dbc25Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4296f29dbc25Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4297f29dbc25Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4298f29dbc25Smrg    else
4299f29dbc25Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4300f29dbc25Smrg    fi
4301f29dbc25Smrg    supports_anon_versioning=no
4302f29dbc25Smrg    case `$LD -v 2>&1` in
4303f29dbc25Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4304f29dbc25Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4305f29dbc25Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4306f29dbc25Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4307f29dbc25Smrg      *\ 2.11.*) ;; # other 2.11 versions
4308f29dbc25Smrg      *) supports_anon_versioning=yes ;;
4309f29dbc25Smrg    esac
4310f29dbc25Smrg
4311f29dbc25Smrg    # See if GNU ld supports shared libraries.
4312f29dbc25Smrg    case $host_os in
4313f29dbc25Smrg    aix[[3-9]]*)
4314f29dbc25Smrg      # On AIX/PPC, the GNU linker is very broken
4315f29dbc25Smrg      if test "$host_cpu" != ia64; then
4316f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4317f29dbc25Smrg	cat <<_LT_EOF 1>&2
4318f29dbc25Smrg
4319f29dbc25Smrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
4320f29dbc25Smrg*** to be unable to reliably create shared libraries on AIX.
4321f29dbc25Smrg*** Therefore, libtool is disabling shared libraries support.  If you
4322f29dbc25Smrg*** really care for shared libraries, you may want to modify your PATH
4323f29dbc25Smrg*** so that a non-GNU linker is found, and then restart.
4324f29dbc25Smrg
4325f29dbc25Smrg_LT_EOF
4326f29dbc25Smrg      fi
4327f29dbc25Smrg      ;;
4328f29dbc25Smrg
4329f29dbc25Smrg    amigaos*)
4330f29dbc25Smrg      case $host_cpu in
4331f29dbc25Smrg      powerpc)
4332f29dbc25Smrg            # see comment about AmigaOS4 .so support
4333f29dbc25Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4334f29dbc25Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4335f29dbc25Smrg        ;;
4336f29dbc25Smrg      m68k)
4337f29dbc25Smrg            _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)'
4338f29dbc25Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4339f29dbc25Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4340f29dbc25Smrg        ;;
4341f29dbc25Smrg      esac
4342f29dbc25Smrg      ;;
4343f29dbc25Smrg
4344f29dbc25Smrg    beos*)
4345f29dbc25Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4346f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4347f29dbc25Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4348f29dbc25Smrg	# support --undefined.  This deserves some investigation.  FIXME
4349f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4350f29dbc25Smrg      else
4351f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4352f29dbc25Smrg      fi
4353f29dbc25Smrg      ;;
4354f29dbc25Smrg
4355f29dbc25Smrg    cygwin* | mingw* | pw32* | cegcc*)
4356f29dbc25Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4357f29dbc25Smrg      # as there is no search path for DLLs.
4358f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4359f29dbc25Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4360f29dbc25Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4361f29dbc25Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4362f29dbc25Smrg      _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'
4363f29dbc25Smrg
4364f29dbc25Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4365f29dbc25Smrg        _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'
4366f29dbc25Smrg	# If the export-symbols file already is a .def file (1st line
4367f29dbc25Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4368f29dbc25Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4369f29dbc25Smrg	  cp $export_symbols $output_objdir/$soname.def;
4370f29dbc25Smrg	else
4371f29dbc25Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4372f29dbc25Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4373f29dbc25Smrg	fi~
4374f29dbc25Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4375f29dbc25Smrg      else
4376f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4377f29dbc25Smrg      fi
4378f29dbc25Smrg      ;;
4379f29dbc25Smrg
4380f29dbc25Smrg    interix[[3-9]]*)
4381f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4382f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4383f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4384f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4385f29dbc25Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4386f29dbc25Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4387f29dbc25Smrg      # default) and relocated if they conflict, which is a slow very memory
4388f29dbc25Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4389f29dbc25Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4390f29dbc25Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4391f29dbc25Smrg      _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'
4392f29dbc25Smrg      _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'
4393f29dbc25Smrg      ;;
4394f29dbc25Smrg
4395f29dbc25Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4396f29dbc25Smrg      tmp_diet=no
4397f29dbc25Smrg      if test "$host_os" = linux-dietlibc; then
4398f29dbc25Smrg	case $cc_basename in
4399f29dbc25Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4400f29dbc25Smrg	esac
4401f29dbc25Smrg      fi
4402f29dbc25Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4403f29dbc25Smrg	 && test "$tmp_diet" = no
4404f29dbc25Smrg      then
4405f29dbc25Smrg	tmp_addflag=
4406f29dbc25Smrg	tmp_sharedflag='-shared'
4407f29dbc25Smrg	case $cc_basename,$host_cpu in
4408f29dbc25Smrg        pgcc*)				# Portland Group C compiler
4409f29dbc25Smrg	  _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'
4410f29dbc25Smrg	  tmp_addflag=' $pic_flag'
4411f29dbc25Smrg	  ;;
4412f29dbc25Smrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
4413f29dbc25Smrg	  _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'
4414f29dbc25Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4415f29dbc25Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4416f29dbc25Smrg	  tmp_addflag=' -i_dynamic' ;;
4417f29dbc25Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4418f29dbc25Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4419f29dbc25Smrg	ifc* | ifort*)			# Intel Fortran compiler
4420f29dbc25Smrg	  tmp_addflag=' -nofor_main' ;;
4421f29dbc25Smrg	lf95*)				# Lahey Fortran 8.1
4422f29dbc25Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4423f29dbc25Smrg	  tmp_sharedflag='--shared' ;;
4424f29dbc25Smrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
4425f29dbc25Smrg	  tmp_sharedflag='-qmkshrobj'
4426f29dbc25Smrg	  tmp_addflag= ;;
4427f29dbc25Smrg	esac
4428f29dbc25Smrg	case `$CC -V 2>&1 | sed 5q` in
4429f29dbc25Smrg	*Sun\ C*)			# Sun C 5.9
4430f29dbc25Smrg	  _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'
4431f29dbc25Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4432f29dbc25Smrg	  tmp_sharedflag='-G' ;;
4433f29dbc25Smrg	*Sun\ F*)			# Sun Fortran 8.3
4434f29dbc25Smrg	  tmp_sharedflag='-G' ;;
4435f29dbc25Smrg	esac
4436f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4437f29dbc25Smrg
4438f29dbc25Smrg        if test "x$supports_anon_versioning" = xyes; then
4439f29dbc25Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4440f29dbc25Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4441f29dbc25Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4442f29dbc25Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4443f29dbc25Smrg        fi
4444f29dbc25Smrg
4445f29dbc25Smrg	case $cc_basename in
4446f29dbc25Smrg	xlf*)
4447f29dbc25Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4448f29dbc25Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4449f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4450f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4451f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4452f29dbc25Smrg	  if test "x$supports_anon_versioning" = xyes; then
4453f29dbc25Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4454f29dbc25Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4455f29dbc25Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4456f29dbc25Smrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4457f29dbc25Smrg	  fi
4458f29dbc25Smrg	  ;;
4459f29dbc25Smrg	esac
4460f29dbc25Smrg      else
4461f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4462f29dbc25Smrg      fi
4463f29dbc25Smrg      ;;
4464f29dbc25Smrg
4465f29dbc25Smrg    netbsd* | netbsdelf*-gnu)
4466f29dbc25Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4467f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4468f29dbc25Smrg	wlarc=
4469f29dbc25Smrg      else
4470f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4471f29dbc25Smrg	_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'
4472f29dbc25Smrg      fi
4473f29dbc25Smrg      ;;
4474f29dbc25Smrg
4475f29dbc25Smrg    solaris*)
4476f29dbc25Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4477f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4478f29dbc25Smrg	cat <<_LT_EOF 1>&2
4479f29dbc25Smrg
4480f29dbc25Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4481f29dbc25Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4482f29dbc25Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4483f29dbc25Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4484f29dbc25Smrg*** your PATH or compiler configuration so that the native linker is
4485f29dbc25Smrg*** used, and then restart.
4486f29dbc25Smrg
4487f29dbc25Smrg_LT_EOF
4488f29dbc25Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4489f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4490f29dbc25Smrg	_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'
4491f29dbc25Smrg      else
4492f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4493f29dbc25Smrg      fi
4494f29dbc25Smrg      ;;
4495f29dbc25Smrg
4496f29dbc25Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4497f29dbc25Smrg      case `$LD -v 2>&1` in
4498f29dbc25Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4499f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4500f29dbc25Smrg	cat <<_LT_EOF 1>&2
4501f29dbc25Smrg
4502f29dbc25Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4503f29dbc25Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4504f29dbc25Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4505f29dbc25Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4506f29dbc25Smrg*** your PATH or compiler configuration so that the native linker is
4507f29dbc25Smrg*** used, and then restart.
4508f29dbc25Smrg
4509f29dbc25Smrg_LT_EOF
4510f29dbc25Smrg	;;
4511f29dbc25Smrg	*)
4512f29dbc25Smrg	  # For security reasons, it is highly recommended that you always
4513f29dbc25Smrg	  # use absolute paths for naming shared libraries, and exclude the
4514f29dbc25Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4515f29dbc25Smrg	  # requires that you compile everything twice, which is a pain.
4516f29dbc25Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4517f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4518f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4519f29dbc25Smrg	    _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'
4520f29dbc25Smrg	  else
4521f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4522f29dbc25Smrg	  fi
4523f29dbc25Smrg	;;
4524f29dbc25Smrg      esac
4525f29dbc25Smrg      ;;
4526f29dbc25Smrg
4527f29dbc25Smrg    sunos4*)
4528f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4529f29dbc25Smrg      wlarc=
4530f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4531f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4532f29dbc25Smrg      ;;
4533f29dbc25Smrg
4534f29dbc25Smrg    *)
4535f29dbc25Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4536f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4537f29dbc25Smrg	_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'
4538f29dbc25Smrg      else
4539f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4540f29dbc25Smrg      fi
4541f29dbc25Smrg      ;;
4542f29dbc25Smrg    esac
4543f29dbc25Smrg
4544f29dbc25Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4545f29dbc25Smrg      runpath_var=
4546f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4547f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4548f29dbc25Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4549f29dbc25Smrg    fi
4550f29dbc25Smrg  else
4551f29dbc25Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4552f29dbc25Smrg    case $host_os in
4553f29dbc25Smrg    aix3*)
4554f29dbc25Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4555f29dbc25Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4556f29dbc25Smrg      _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'
4557f29dbc25Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4558f29dbc25Smrg      # are no directories specified by -L.
4559f29dbc25Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4560f29dbc25Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4561f29dbc25Smrg	# Neither direct hardcoding nor static linking is supported with a
4562f29dbc25Smrg	# broken collect2.
4563f29dbc25Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4564f29dbc25Smrg      fi
4565f29dbc25Smrg      ;;
4566f29dbc25Smrg
4567f29dbc25Smrg    aix[[4-9]]*)
4568f29dbc25Smrg      if test "$host_cpu" = ia64; then
4569f29dbc25Smrg	# On IA64, the linker does run time linking by default, so we don't
4570f29dbc25Smrg	# have to do anything special.
4571f29dbc25Smrg	aix_use_runtimelinking=no
4572f29dbc25Smrg	exp_sym_flag='-Bexport'
4573f29dbc25Smrg	no_entry_flag=""
4574f29dbc25Smrg      else
4575f29dbc25Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4576f29dbc25Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4577f29dbc25Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4578f29dbc25Smrg	  _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'
4579f29dbc25Smrg	else
4580f29dbc25Smrg	  _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'
4581f29dbc25Smrg	fi
4582f29dbc25Smrg	aix_use_runtimelinking=no
4583f29dbc25Smrg
4584f29dbc25Smrg	# Test if we are trying to use run time linking or normal
4585f29dbc25Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4586f29dbc25Smrg	# need to do runtime linking.
4587f29dbc25Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4588f29dbc25Smrg	  for ld_flag in $LDFLAGS; do
4589f29dbc25Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
4590f29dbc25Smrg	    aix_use_runtimelinking=yes
4591f29dbc25Smrg	    break
4592f29dbc25Smrg	  fi
4593f29dbc25Smrg	  done
4594f29dbc25Smrg	  ;;
4595f29dbc25Smrg	esac
4596f29dbc25Smrg
4597f29dbc25Smrg	exp_sym_flag='-bexport'
4598f29dbc25Smrg	no_entry_flag='-bnoentry'
4599f29dbc25Smrg      fi
4600f29dbc25Smrg
4601f29dbc25Smrg      # When large executables or shared objects are built, AIX ld can
4602f29dbc25Smrg      # have problems creating the table of contents.  If linking a library
4603f29dbc25Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
4604f29dbc25Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4605f29dbc25Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4606f29dbc25Smrg
4607f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)=''
4608f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4609f29dbc25Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4610f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4611f29dbc25Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4612f29dbc25Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4613f29dbc25Smrg
4614f29dbc25Smrg      if test "$GCC" = yes; then
4615f29dbc25Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4616f29dbc25Smrg	# We only want to do this on AIX 4.2 and lower, the check
4617f29dbc25Smrg	# below for broken collect2 doesn't work under 4.3+
4618f29dbc25Smrg	  collect2name=`${CC} -print-prog-name=collect2`
4619f29dbc25Smrg	  if test -f "$collect2name" &&
4620f29dbc25Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4621f29dbc25Smrg	  then
4622f29dbc25Smrg	  # We have reworked collect2
4623f29dbc25Smrg	  :
4624f29dbc25Smrg	  else
4625f29dbc25Smrg	  # We have old collect2
4626f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
4627f29dbc25Smrg	  # It fails to find uninstalled libraries when the uninstalled
4628f29dbc25Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
4629f29dbc25Smrg	  # to unsupported forces relinking
4630f29dbc25Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4631f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4632f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4633f29dbc25Smrg	  fi
4634f29dbc25Smrg	  ;;
4635f29dbc25Smrg	esac
4636f29dbc25Smrg	shared_flag='-shared'
4637f29dbc25Smrg	if test "$aix_use_runtimelinking" = yes; then
4638f29dbc25Smrg	  shared_flag="$shared_flag "'${wl}-G'
4639f29dbc25Smrg	fi
4640f29dbc25Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
4641f29dbc25Smrg      else
4642f29dbc25Smrg	# not using gcc
4643f29dbc25Smrg	if test "$host_cpu" = ia64; then
4644f29dbc25Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
4645f29dbc25Smrg	# chokes on -Wl,-G. The following line is correct:
4646f29dbc25Smrg	  shared_flag='-G'
4647f29dbc25Smrg	else
4648f29dbc25Smrg	  if test "$aix_use_runtimelinking" = yes; then
4649f29dbc25Smrg	    shared_flag='${wl}-G'
4650f29dbc25Smrg	  else
4651f29dbc25Smrg	    shared_flag='${wl}-bM:SRE'
4652f29dbc25Smrg	  fi
4653f29dbc25Smrg	fi
4654f29dbc25Smrg      fi
4655f29dbc25Smrg
4656f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4657f29dbc25Smrg      # It seems that -bexpall does not export symbols beginning with
4658f29dbc25Smrg      # underscore (_), so it is better to generate a list of symbols to export.
4659f29dbc25Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4660f29dbc25Smrg      if test "$aix_use_runtimelinking" = yes; then
4661f29dbc25Smrg	# Warning - without using the other runtime loading flags (-brtl),
4662f29dbc25Smrg	# -berok will link without error, but may produce a broken library.
4663f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4664f29dbc25Smrg        # Determine the default libpath from the value encoded in an
4665f29dbc25Smrg        # empty executable.
4666f29dbc25Smrg        _LT_SYS_MODULE_PATH_AIX
4667f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4668f29dbc25Smrg        _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"
4669f29dbc25Smrg      else
4670f29dbc25Smrg	if test "$host_cpu" = ia64; then
4671f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4672f29dbc25Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4673f29dbc25Smrg	  _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"
4674f29dbc25Smrg	else
4675f29dbc25Smrg	 # Determine the default libpath from the value encoded in an
4676f29dbc25Smrg	 # empty executable.
4677f29dbc25Smrg	 _LT_SYS_MODULE_PATH_AIX
4678f29dbc25Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4679f29dbc25Smrg	  # Warning - without using the other run time loading flags,
4680f29dbc25Smrg	  # -berok will link without error, but may produce a broken library.
4681f29dbc25Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4682f29dbc25Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4683f29dbc25Smrg	  # Exported symbols can be pulled into shared objects from archives
4684f29dbc25Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4685f29dbc25Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4686f29dbc25Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
4687f29dbc25Smrg	  _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'
4688f29dbc25Smrg	fi
4689f29dbc25Smrg      fi
4690f29dbc25Smrg      ;;
4691f29dbc25Smrg
4692f29dbc25Smrg    amigaos*)
4693f29dbc25Smrg      case $host_cpu in
4694f29dbc25Smrg      powerpc)
4695f29dbc25Smrg            # see comment about AmigaOS4 .so support
4696f29dbc25Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4697f29dbc25Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4698f29dbc25Smrg        ;;
4699f29dbc25Smrg      m68k)
4700f29dbc25Smrg            _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)'
4701f29dbc25Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4702f29dbc25Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4703f29dbc25Smrg        ;;
4704f29dbc25Smrg      esac
4705f29dbc25Smrg      ;;
4706f29dbc25Smrg
4707f29dbc25Smrg    bsdi[[45]]*)
4708f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4709f29dbc25Smrg      ;;
4710f29dbc25Smrg
4711f29dbc25Smrg    cygwin* | mingw* | pw32* | cegcc*)
4712f29dbc25Smrg      # When not using gcc, we currently assume that we are using
4713f29dbc25Smrg      # Microsoft Visual C++.
4714f29dbc25Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
4715f29dbc25Smrg      # no search path for DLLs.
4716f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4717f29dbc25Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4718f29dbc25Smrg      # Tell ltmain to make .lib files, not .a files.
4719f29dbc25Smrg      libext=lib
4720f29dbc25Smrg      # Tell ltmain to make .dll files, not .so files.
4721f29dbc25Smrg      shrext_cmds=".dll"
4722f29dbc25Smrg      # FIXME: Setting linknames here is a bad hack.
4723f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4724f29dbc25Smrg      # The linker will automatically build a .lib file if we build a DLL.
4725f29dbc25Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4726f29dbc25Smrg      # FIXME: Should let the user specify the lib program.
4727f29dbc25Smrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4728f29dbc25Smrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4729f29dbc25Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4730f29dbc25Smrg      ;;
4731f29dbc25Smrg
4732f29dbc25Smrg    darwin* | rhapsody*)
4733f29dbc25Smrg      _LT_DARWIN_LINKER_FEATURES($1)
4734f29dbc25Smrg      ;;
4735f29dbc25Smrg
4736f29dbc25Smrg    dgux*)
4737f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4738f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4739f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4740f29dbc25Smrg      ;;
4741f29dbc25Smrg
4742f29dbc25Smrg    freebsd1*)
4743f29dbc25Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
4744f29dbc25Smrg      ;;
4745f29dbc25Smrg
4746f29dbc25Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4747f29dbc25Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
4748f29dbc25Smrg    # does not break anything, and helps significantly (at the cost of a little
4749f29dbc25Smrg    # extra space).
4750f29dbc25Smrg    freebsd2.2*)
4751f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4752f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4753f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4754f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4755f29dbc25Smrg      ;;
4756f29dbc25Smrg
4757f29dbc25Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4758f29dbc25Smrg    freebsd2*)
4759f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4760f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4761f29dbc25Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4762f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4763f29dbc25Smrg      ;;
4764f29dbc25Smrg
4765f29dbc25Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4766f29dbc25Smrg    freebsd* | dragonfly*)
4767f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4768f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4769f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4770f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4771f29dbc25Smrg      ;;
4772f29dbc25Smrg
4773f29dbc25Smrg    hpux9*)
4774f29dbc25Smrg      if test "$GCC" = yes; then
4775f29dbc25Smrg	_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'
4776f29dbc25Smrg      else
4777f29dbc25Smrg	_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'
4778f29dbc25Smrg      fi
4779f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4780f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4781f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4782f29dbc25Smrg
4783f29dbc25Smrg      # hardcode_minus_L: Not really in the search PATH,
4784f29dbc25Smrg      # but as the default location of the library.
4785f29dbc25Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4786f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4787f29dbc25Smrg      ;;
4788f29dbc25Smrg
4789f29dbc25Smrg    hpux10*)
4790f29dbc25Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4791f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4792f29dbc25Smrg      else
4793f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4794f29dbc25Smrg      fi
4795f29dbc25Smrg      if test "$with_gnu_ld" = no; then
4796f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4797f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4798f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4799f29dbc25Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4800f29dbc25Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4801f29dbc25Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4802f29dbc25Smrg	# hardcode_minus_L: Not really in the search PATH,
4803f29dbc25Smrg	# but as the default location of the library.
4804f29dbc25Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
4805f29dbc25Smrg      fi
4806f29dbc25Smrg      ;;
4807f29dbc25Smrg
4808f29dbc25Smrg    hpux11*)
4809f29dbc25Smrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4810f29dbc25Smrg	case $host_cpu in
4811f29dbc25Smrg	hppa*64*)
4812f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4813f29dbc25Smrg	  ;;
4814f29dbc25Smrg	ia64*)
4815f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4816f29dbc25Smrg	  ;;
4817f29dbc25Smrg	*)
4818f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4819f29dbc25Smrg	  ;;
4820f29dbc25Smrg	esac
4821f29dbc25Smrg      else
4822f29dbc25Smrg	case $host_cpu in
4823f29dbc25Smrg	hppa*64*)
4824f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4825f29dbc25Smrg	  ;;
4826f29dbc25Smrg	ia64*)
4827f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4828f29dbc25Smrg	  ;;
4829f29dbc25Smrg	*)
4830f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4831f29dbc25Smrg	  ;;
4832f29dbc25Smrg	esac
4833f29dbc25Smrg      fi
4834f29dbc25Smrg      if test "$with_gnu_ld" = no; then
4835f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4836f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4837f29dbc25Smrg
4838f29dbc25Smrg	case $host_cpu in
4839f29dbc25Smrg	hppa*64*|ia64*)
4840f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
4841f29dbc25Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4842f29dbc25Smrg	  ;;
4843f29dbc25Smrg	*)
4844f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
4845f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4846f29dbc25Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4847f29dbc25Smrg
4848f29dbc25Smrg	  # hardcode_minus_L: Not really in the search PATH,
4849f29dbc25Smrg	  # but as the default location of the library.
4850f29dbc25Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4851f29dbc25Smrg	  ;;
4852f29dbc25Smrg	esac
4853f29dbc25Smrg      fi
4854f29dbc25Smrg      ;;
4855f29dbc25Smrg
4856f29dbc25Smrg    irix5* | irix6* | nonstopux*)
4857f29dbc25Smrg      if test "$GCC" = yes; then
4858f29dbc25Smrg	_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'
4859f29dbc25Smrg	# Try to use the -exported_symbol ld option, if it does not
4860f29dbc25Smrg	# work, assume that -exports_file does not work either and
4861f29dbc25Smrg	# implicitly export all symbols.
4862f29dbc25Smrg        save_LDFLAGS="$LDFLAGS"
4863f29dbc25Smrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4864f29dbc25Smrg        AC_LINK_IFELSE(int foo(void) {},
4865f29dbc25Smrg          _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'
4866f29dbc25Smrg        )
4867f29dbc25Smrg        LDFLAGS="$save_LDFLAGS"
4868f29dbc25Smrg      else
4869f29dbc25Smrg	_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'
4870f29dbc25Smrg	_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'
4871f29dbc25Smrg      fi
4872f29dbc25Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4873f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4874f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4875f29dbc25Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
4876f29dbc25Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4877f29dbc25Smrg      ;;
4878f29dbc25Smrg
4879f29dbc25Smrg    netbsd* | netbsdelf*-gnu)
4880f29dbc25Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4881f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4882f29dbc25Smrg      else
4883f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
4884f29dbc25Smrg      fi
4885f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4886f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4887f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4888f29dbc25Smrg      ;;
4889f29dbc25Smrg
4890f29dbc25Smrg    newsos6)
4891f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4892f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4893f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4894f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4895f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4896f29dbc25Smrg      ;;
4897f29dbc25Smrg
4898f29dbc25Smrg    *nto* | *qnx*)
4899f29dbc25Smrg      ;;
4900f29dbc25Smrg
4901f29dbc25Smrg    openbsd*)
4902f29dbc25Smrg      if test -f /usr/libexec/ld.so; then
4903f29dbc25Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4904f29dbc25Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4905f29dbc25Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4906f29dbc25Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4907f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4908f29dbc25Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4909f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4910f29dbc25Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4911f29dbc25Smrg	else
4912f29dbc25Smrg	  case $host_os in
4913f29dbc25Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4914f29dbc25Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4915f29dbc25Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4916f29dbc25Smrg	     ;;
4917f29dbc25Smrg	   *)
4918f29dbc25Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4919f29dbc25Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4920f29dbc25Smrg	     ;;
4921f29dbc25Smrg	  esac
4922f29dbc25Smrg	fi
4923f29dbc25Smrg      else
4924f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4925f29dbc25Smrg      fi
4926f29dbc25Smrg      ;;
4927f29dbc25Smrg
4928f29dbc25Smrg    os2*)
4929f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4930f29dbc25Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4931f29dbc25Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4932f29dbc25Smrg      _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'
4933f29dbc25Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4934f29dbc25Smrg      ;;
4935f29dbc25Smrg
4936f29dbc25Smrg    osf3*)
4937f29dbc25Smrg      if test "$GCC" = yes; then
4938f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4939f29dbc25Smrg	_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'
4940f29dbc25Smrg      else
4941f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4942f29dbc25Smrg	_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'
4943f29dbc25Smrg      fi
4944f29dbc25Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4945f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4946f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4947f29dbc25Smrg      ;;
4948f29dbc25Smrg
4949f29dbc25Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
4950f29dbc25Smrg      if test "$GCC" = yes; then
4951f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4952f29dbc25Smrg	_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'
4953f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4954f29dbc25Smrg      else
4955f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4956f29dbc25Smrg	_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'
4957f29dbc25Smrg	_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~
4958f29dbc25Smrg	$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'
4959f29dbc25Smrg
4960f29dbc25Smrg	# Both c and cxx compiler support -rpath directly
4961f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4962f29dbc25Smrg      fi
4963f29dbc25Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4964f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4965f29dbc25Smrg      ;;
4966f29dbc25Smrg
4967f29dbc25Smrg    solaris*)
4968f29dbc25Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4969f29dbc25Smrg      if test "$GCC" = yes; then
4970f29dbc25Smrg	wlarc='${wl}'
4971f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4972f29dbc25Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4973f29dbc25Smrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4974f29dbc25Smrg      else
4975f29dbc25Smrg	case `$CC -V 2>&1` in
4976f29dbc25Smrg	*"Compilers 5.0"*)
4977f29dbc25Smrg	  wlarc=''
4978f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4979f29dbc25Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4980f29dbc25Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4981f29dbc25Smrg	  ;;
4982f29dbc25Smrg	*)
4983f29dbc25Smrg	  wlarc='${wl}'
4984f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4985f29dbc25Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4986f29dbc25Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4987f29dbc25Smrg	  ;;
4988f29dbc25Smrg	esac
4989f29dbc25Smrg      fi
4990f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4991f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4992f29dbc25Smrg      case $host_os in
4993f29dbc25Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4994f29dbc25Smrg      *)
4995f29dbc25Smrg	# The compiler driver will combine and reorder linker options,
4996f29dbc25Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
4997f29dbc25Smrg	# but is careful enough not to reorder.
4998f29dbc25Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
4999f29dbc25Smrg	if test "$GCC" = yes; then
5000f29dbc25Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5001f29dbc25Smrg	else
5002f29dbc25Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5003f29dbc25Smrg	fi
5004f29dbc25Smrg	;;
5005f29dbc25Smrg      esac
5006f29dbc25Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5007f29dbc25Smrg      ;;
5008f29dbc25Smrg
5009f29dbc25Smrg    sunos4*)
5010f29dbc25Smrg      if test "x$host_vendor" = xsequent; then
5011f29dbc25Smrg	# Use $CC to link under sequent, because it throws in some extra .o
5012f29dbc25Smrg	# files that make .init and .fini sections work.
5013f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5014f29dbc25Smrg      else
5015f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5016f29dbc25Smrg      fi
5017f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5018f29dbc25Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5019f29dbc25Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5020f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5021f29dbc25Smrg      ;;
5022f29dbc25Smrg
5023f29dbc25Smrg    sysv4)
5024f29dbc25Smrg      case $host_vendor in
5025f29dbc25Smrg	sni)
5026f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5027f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5028f29dbc25Smrg	;;
5029f29dbc25Smrg	siemens)
5030f29dbc25Smrg	  ## LD is ld it makes a PLAMLIB
5031f29dbc25Smrg	  ## CC just makes a GrossModule.
5032f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5033f29dbc25Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5034f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5035f29dbc25Smrg        ;;
5036f29dbc25Smrg	motorola)
5037f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5038f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5039f29dbc25Smrg	;;
5040f29dbc25Smrg      esac
5041f29dbc25Smrg      runpath_var='LD_RUN_PATH'
5042f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5043f29dbc25Smrg      ;;
5044f29dbc25Smrg
5045f29dbc25Smrg    sysv4.3*)
5046f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5047f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5048f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5049f29dbc25Smrg      ;;
5050f29dbc25Smrg
5051f29dbc25Smrg    sysv4*MP*)
5052f29dbc25Smrg      if test -d /usr/nec; then
5053f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5054f29dbc25Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5055f29dbc25Smrg	runpath_var=LD_RUN_PATH
5056f29dbc25Smrg	hardcode_runpath_var=yes
5057f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5058f29dbc25Smrg      fi
5059f29dbc25Smrg      ;;
5060f29dbc25Smrg
5061f29dbc25Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5062f29dbc25Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5063f29dbc25Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5064f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5065f29dbc25Smrg      runpath_var='LD_RUN_PATH'
5066f29dbc25Smrg
5067f29dbc25Smrg      if test "$GCC" = yes; then
5068f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5069f29dbc25Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5070f29dbc25Smrg      else
5071f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5072f29dbc25Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5073f29dbc25Smrg      fi
5074f29dbc25Smrg      ;;
5075f29dbc25Smrg
5076f29dbc25Smrg    sysv5* | sco3.2v5* | sco5v6*)
5077f29dbc25Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5078f29dbc25Smrg      # link with -lc, and that would cause any symbols used from libc to
5079f29dbc25Smrg      # always be unresolved, which means just about no library would
5080f29dbc25Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5081f29dbc25Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5082f29dbc25Smrg      # as -z defs.
5083f29dbc25Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5084f29dbc25Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5085f29dbc25Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5086f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5087f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5088f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5089f29dbc25Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5090f29dbc25Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5091f29dbc25Smrg      runpath_var='LD_RUN_PATH'
5092f29dbc25Smrg
5093f29dbc25Smrg      if test "$GCC" = yes; then
5094f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5095f29dbc25Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5096f29dbc25Smrg      else
5097f29dbc25Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5098f29dbc25Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5099f29dbc25Smrg      fi
5100f29dbc25Smrg      ;;
5101f29dbc25Smrg
5102f29dbc25Smrg    uts4*)
5103f29dbc25Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5104f29dbc25Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5105f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5106f29dbc25Smrg      ;;
5107f29dbc25Smrg
5108f29dbc25Smrg    *)
5109f29dbc25Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5110f29dbc25Smrg      ;;
5111f29dbc25Smrg    esac
5112f29dbc25Smrg
5113f29dbc25Smrg    if test x$host_vendor = xsni; then
5114f29dbc25Smrg      case $host in
5115f29dbc25Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5116f29dbc25Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5117f29dbc25Smrg	;;
5118f29dbc25Smrg      esac
5119f29dbc25Smrg    fi
5120f29dbc25Smrg  fi
5121f29dbc25Smrg])
5122f29dbc25SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5123f29dbc25Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5124f29dbc25Smrg
5125f29dbc25Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5126f29dbc25Smrg
5127f29dbc25Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5128f29dbc25Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5129f29dbc25Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5130f29dbc25Smrg    [The commands to extract the exported symbol list from a shared archive])
5131f29dbc25Smrg
5132f29dbc25Smrg#
5133f29dbc25Smrg# Do we need to explicitly link libc?
5134f29dbc25Smrg#
5135f29dbc25Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5136f29dbc25Smrgx|xyes)
5137f29dbc25Smrg  # Assume -lc should be added
5138f29dbc25Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5139f29dbc25Smrg
5140f29dbc25Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5141f29dbc25Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5142f29dbc25Smrg    *'~'*)
5143f29dbc25Smrg      # FIXME: we may have to deal with multi-command sequences.
5144f29dbc25Smrg      ;;
5145f29dbc25Smrg    '$CC '*)
5146f29dbc25Smrg      # Test whether the compiler implicitly links with -lc since on some
5147f29dbc25Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5148f29dbc25Smrg      # to ld, don't add -lc before -lgcc.
5149f29dbc25Smrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5150f29dbc25Smrg      $RM conftest*
5151f29dbc25Smrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5152f29dbc25Smrg
5153f29dbc25Smrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5154f29dbc25Smrg        soname=conftest
5155f29dbc25Smrg        lib=conftest
5156f29dbc25Smrg        libobjs=conftest.$ac_objext
5157f29dbc25Smrg        deplibs=
5158f29dbc25Smrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5159f29dbc25Smrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5160f29dbc25Smrg        compiler_flags=-v
5161f29dbc25Smrg        linker_flags=-v
5162f29dbc25Smrg        verstring=
5163f29dbc25Smrg        output_objdir=.
5164f29dbc25Smrg        libname=conftest
5165f29dbc25Smrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5166f29dbc25Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=
5167f29dbc25Smrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5168f29dbc25Smrg        then
5169f29dbc25Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5170f29dbc25Smrg        else
5171f29dbc25Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5172f29dbc25Smrg        fi
5173f29dbc25Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5174f29dbc25Smrg      else
5175f29dbc25Smrg        cat conftest.err 1>&5
5176f29dbc25Smrg      fi
5177f29dbc25Smrg      $RM conftest*
5178f29dbc25Smrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5179f29dbc25Smrg      ;;
5180f29dbc25Smrg    esac
5181f29dbc25Smrg  fi
5182f29dbc25Smrg  ;;
5183f29dbc25Smrgesac
5184f29dbc25Smrg
5185f29dbc25Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5186f29dbc25Smrg    [Whether or not to add -lc for building shared libraries])
5187f29dbc25Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5188f29dbc25Smrg    [enable_shared_with_static_runtimes], [0],
5189f29dbc25Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5190f29dbc25Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5191f29dbc25Smrg    [Compiler flag to allow reflexive dlopens])
5192f29dbc25Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5193f29dbc25Smrg    [Compiler flag to generate shared objects directly from archives])
5194f29dbc25Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5195f29dbc25Smrg    [Whether the compiler copes with passing no objects directly])
5196f29dbc25Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5197f29dbc25Smrg    [Create an old-style archive from a shared archive])
5198f29dbc25Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5199f29dbc25Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5200f29dbc25Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5201f29dbc25Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5202f29dbc25Smrg_LT_TAGDECL([], [module_cmds], [2],
5203f29dbc25Smrg    [Commands used to build a loadable module if different from building
5204f29dbc25Smrg    a shared archive.])
5205f29dbc25Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5206f29dbc25Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5207f29dbc25Smrg    [Whether we are building with GNU ld or not])
5208f29dbc25Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5209f29dbc25Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5210f29dbc25Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5211f29dbc25Smrg    [Flag that enforces no undefined symbols])
5212f29dbc25Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5213f29dbc25Smrg    [Flag to hardcode $libdir into a binary during linking.
5214f29dbc25Smrg    This must work even if $libdir does not exist])
5215f29dbc25Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5216f29dbc25Smrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5217f29dbc25Smrg    during linking.  This must work even if $libdir does not exist]])
5218f29dbc25Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5219f29dbc25Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5220f29dbc25Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5221f29dbc25Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5222f29dbc25Smrg    DIR into the resulting binary])
5223f29dbc25Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5224f29dbc25Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5225f29dbc25Smrg    DIR into the resulting binary and the resulting library dependency is
5226f29dbc25Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5227f29dbc25Smrg    library is relocated])
5228f29dbc25Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5229f29dbc25Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5230f29dbc25Smrg    into the resulting binary])
5231f29dbc25Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5232f29dbc25Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5233f29dbc25Smrg    into the resulting binary])
5234f29dbc25Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5235f29dbc25Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5236f29dbc25Smrg    into the library and all subsequent libraries and executables linked
5237f29dbc25Smrg    against it])
5238f29dbc25Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5239f29dbc25Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5240f29dbc25Smrg    to runtime path list])
5241f29dbc25Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5242f29dbc25Smrg    [Whether libtool must link a program against all its dependency libraries])
5243f29dbc25Smrg_LT_TAGDECL([], [fix_srcfile_path], [1],
5244f29dbc25Smrg    [Fix the shell variable $srcfile for the compiler])
5245f29dbc25Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5246f29dbc25Smrg    [Set to "yes" if exported symbols are required])
5247f29dbc25Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5248f29dbc25Smrg    [The commands to list exported symbols])
5249f29dbc25Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5250f29dbc25Smrg    [Symbols that should not be listed in the preloaded symbols])
5251f29dbc25Smrg_LT_TAGDECL([], [include_expsyms], [1],
5252f29dbc25Smrg    [Symbols that must always be exported])
5253f29dbc25Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5254f29dbc25Smrg    [Commands necessary for linking programs (against libraries) with templates])
5255f29dbc25Smrg_LT_TAGDECL([], [file_list_spec], [1],
5256f29dbc25Smrg    [Specify filename containing input files])
5257f29dbc25Smrgdnl FIXME: Not yet implemented
5258f29dbc25Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5259f29dbc25Smrgdnl    [Compiler flag to generate thread safe objects])
5260f29dbc25Smrg])# _LT_LINKER_SHLIBS
5261f29dbc25Smrg
5262f29dbc25Smrg
5263f29dbc25Smrg# _LT_LANG_C_CONFIG([TAG])
5264f29dbc25Smrg# ------------------------
5265f29dbc25Smrg# Ensure that the configuration variables for a C compiler are suitably
5266f29dbc25Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5267f29dbc25Smrg# the compiler configuration to `libtool'.
5268f29dbc25Smrgm4_defun([_LT_LANG_C_CONFIG],
5269f29dbc25Smrg[m4_require([_LT_DECL_EGREP])dnl
5270f29dbc25Smrglt_save_CC="$CC"
5271f29dbc25SmrgAC_LANG_PUSH(C)
5272f29dbc25Smrg
5273f29dbc25Smrg# Source file extension for C test sources.
5274f29dbc25Smrgac_ext=c
5275f29dbc25Smrg
5276f29dbc25Smrg# Object file extension for compiled C test sources.
5277f29dbc25Smrgobjext=o
5278f29dbc25Smrg_LT_TAGVAR(objext, $1)=$objext
5279f29dbc25Smrg
5280f29dbc25Smrg# Code to be used in simple compile tests
5281f29dbc25Smrglt_simple_compile_test_code="int some_variable = 0;"
5282f29dbc25Smrg
5283f29dbc25Smrg# Code to be used in simple link tests
5284f29dbc25Smrglt_simple_link_test_code='int main(){return(0);}'
5285f29dbc25Smrg
5286f29dbc25Smrg_LT_TAG_COMPILER
5287f29dbc25Smrg# Save the default compiler, since it gets overwritten when the other
5288f29dbc25Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5289f29dbc25Smrgcompiler_DEFAULT=$CC
5290f29dbc25Smrg
5291f29dbc25Smrg# save warnings/boilerplate of simple test code
5292f29dbc25Smrg_LT_COMPILER_BOILERPLATE
5293f29dbc25Smrg_LT_LINKER_BOILERPLATE
5294f29dbc25Smrg
5295f29dbc25Smrgif test -n "$compiler"; then
5296f29dbc25Smrg  _LT_COMPILER_NO_RTTI($1)
5297f29dbc25Smrg  _LT_COMPILER_PIC($1)
5298f29dbc25Smrg  _LT_COMPILER_C_O($1)
5299f29dbc25Smrg  _LT_COMPILER_FILE_LOCKS($1)
5300f29dbc25Smrg  _LT_LINKER_SHLIBS($1)
5301f29dbc25Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5302f29dbc25Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5303f29dbc25Smrg  LT_SYS_DLOPEN_SELF
5304f29dbc25Smrg  _LT_CMD_STRIPLIB
5305f29dbc25Smrg
5306f29dbc25Smrg  # Report which library types will actually be built
5307f29dbc25Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5308f29dbc25Smrg  AC_MSG_RESULT([$can_build_shared])
5309f29dbc25Smrg
5310f29dbc25Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5311f29dbc25Smrg  test "$can_build_shared" = "no" && enable_shared=no
5312f29dbc25Smrg
5313f29dbc25Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5314f29dbc25Smrg  # are all built from PIC.
5315f29dbc25Smrg  case $host_os in
5316f29dbc25Smrg  aix3*)
5317f29dbc25Smrg    test "$enable_shared" = yes && enable_static=no
5318f29dbc25Smrg    if test -n "$RANLIB"; then
5319f29dbc25Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5320f29dbc25Smrg      postinstall_cmds='$RANLIB $lib'
5321f29dbc25Smrg    fi
5322f29dbc25Smrg    ;;
5323f29dbc25Smrg
5324f29dbc25Smrg  aix[[4-9]]*)
5325f29dbc25Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5326f29dbc25Smrg      test "$enable_shared" = yes && enable_static=no
5327f29dbc25Smrg    fi
5328f29dbc25Smrg    ;;
5329f29dbc25Smrg  esac
5330f29dbc25Smrg  AC_MSG_RESULT([$enable_shared])
5331f29dbc25Smrg
5332f29dbc25Smrg  AC_MSG_CHECKING([whether to build static libraries])
5333f29dbc25Smrg  # Make sure either enable_shared or enable_static is yes.
5334f29dbc25Smrg  test "$enable_shared" = yes || enable_static=yes
5335f29dbc25Smrg  AC_MSG_RESULT([$enable_static])
5336f29dbc25Smrg
5337f29dbc25Smrg  _LT_CONFIG($1)
5338f29dbc25Smrgfi
5339f29dbc25SmrgAC_LANG_POP
5340f29dbc25SmrgCC="$lt_save_CC"
5341f29dbc25Smrg])# _LT_LANG_C_CONFIG
5342f29dbc25Smrg
5343f29dbc25Smrg
5344f29dbc25Smrg# _LT_PROG_CXX
5345f29dbc25Smrg# ------------
5346f29dbc25Smrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5347f29dbc25Smrg# compiler, we have our own version here.
5348f29dbc25Smrgm4_defun([_LT_PROG_CXX],
5349f29dbc25Smrg[
5350f29dbc25Smrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5351f29dbc25SmrgAC_PROG_CXX
5352f29dbc25Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5353f29dbc25Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5354f29dbc25Smrg    (test "X$CXX" != "Xg++"))) ; then
5355f29dbc25Smrg  AC_PROG_CXXCPP
5356f29dbc25Smrgelse
5357f29dbc25Smrg  _lt_caught_CXX_error=yes
5358f29dbc25Smrgfi
5359f29dbc25Smrgpopdef([AC_MSG_ERROR])
5360f29dbc25Smrg])# _LT_PROG_CXX
5361f29dbc25Smrg
5362f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
5363f29dbc25Smrgdnl AC_DEFUN([_LT_PROG_CXX], [])
5364f29dbc25Smrg
5365f29dbc25Smrg
5366f29dbc25Smrg# _LT_LANG_CXX_CONFIG([TAG])
5367f29dbc25Smrg# --------------------------
5368f29dbc25Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5369f29dbc25Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5370f29dbc25Smrg# the compiler configuration to `libtool'.
5371f29dbc25Smrgm4_defun([_LT_LANG_CXX_CONFIG],
5372f29dbc25Smrg[AC_REQUIRE([_LT_PROG_CXX])dnl
5373f29dbc25Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5374f29dbc25Smrgm4_require([_LT_DECL_EGREP])dnl
5375f29dbc25Smrg
5376f29dbc25SmrgAC_LANG_PUSH(C++)
5377f29dbc25Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5378f29dbc25Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5379f29dbc25Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5380f29dbc25Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5381f29dbc25Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5382f29dbc25Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5383f29dbc25Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5384f29dbc25Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5385f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5386f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5387f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5388f29dbc25Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5389f29dbc25Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5390f29dbc25Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5391f29dbc25Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5392f29dbc25Smrg_LT_TAGVAR(module_cmds, $1)=
5393f29dbc25Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5394f29dbc25Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5395f29dbc25Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5396f29dbc25Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5397f29dbc25Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5398f29dbc25Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5399f29dbc25Smrg
5400f29dbc25Smrg# Source file extension for C++ test sources.
5401f29dbc25Smrgac_ext=cpp
5402f29dbc25Smrg
5403f29dbc25Smrg# Object file extension for compiled C++ test sources.
5404f29dbc25Smrgobjext=o
5405f29dbc25Smrg_LT_TAGVAR(objext, $1)=$objext
5406f29dbc25Smrg
5407f29dbc25Smrg# No sense in running all these tests if we already determined that
5408f29dbc25Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5409f29dbc25Smrg# are currently assumed to apply to all compilers on this platform,
5410f29dbc25Smrg# and will be corrupted by setting them based on a non-working compiler.
5411f29dbc25Smrgif test "$_lt_caught_CXX_error" != yes; then
5412f29dbc25Smrg  # Code to be used in simple compile tests
5413f29dbc25Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5414f29dbc25Smrg
5415f29dbc25Smrg  # Code to be used in simple link tests
5416f29dbc25Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5417f29dbc25Smrg
5418f29dbc25Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5419f29dbc25Smrg  _LT_TAG_COMPILER
5420f29dbc25Smrg
5421f29dbc25Smrg  # save warnings/boilerplate of simple test code
5422f29dbc25Smrg  _LT_COMPILER_BOILERPLATE
5423f29dbc25Smrg  _LT_LINKER_BOILERPLATE
5424f29dbc25Smrg
5425f29dbc25Smrg  # Allow CC to be a program name with arguments.
5426f29dbc25Smrg  lt_save_CC=$CC
5427f29dbc25Smrg  lt_save_LD=$LD
5428f29dbc25Smrg  lt_save_GCC=$GCC
5429f29dbc25Smrg  GCC=$GXX
5430f29dbc25Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5431f29dbc25Smrg  lt_save_path_LD=$lt_cv_path_LD
5432f29dbc25Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5433f29dbc25Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5434f29dbc25Smrg  else
5435f29dbc25Smrg    $as_unset lt_cv_prog_gnu_ld
5436f29dbc25Smrg  fi
5437f29dbc25Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5438f29dbc25Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5439f29dbc25Smrg  else
5440f29dbc25Smrg    $as_unset lt_cv_path_LD
5441f29dbc25Smrg  fi
5442f29dbc25Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5443f29dbc25Smrg  CC=${CXX-"c++"}
5444f29dbc25Smrg  compiler=$CC
5445f29dbc25Smrg  _LT_TAGVAR(compiler, $1)=$CC
5446f29dbc25Smrg  _LT_CC_BASENAME([$compiler])
5447f29dbc25Smrg
5448f29dbc25Smrg  if test -n "$compiler"; then
5449f29dbc25Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5450f29dbc25Smrg    # no_builtin_flag separately
5451f29dbc25Smrg    if test "$GXX" = yes; then
5452f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5453f29dbc25Smrg    else
5454f29dbc25Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5455f29dbc25Smrg    fi
5456f29dbc25Smrg
5457f29dbc25Smrg    if test "$GXX" = yes; then
5458f29dbc25Smrg      # Set up default GNU C++ configuration
5459f29dbc25Smrg
5460f29dbc25Smrg      LT_PATH_LD
5461f29dbc25Smrg
5462f29dbc25Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5463f29dbc25Smrg      # archiving commands below assume that GNU ld is being used.
5464f29dbc25Smrg      if test "$with_gnu_ld" = yes; then
5465f29dbc25Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5466f29dbc25Smrg        _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'
5467f29dbc25Smrg
5468f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5469f29dbc25Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5470f29dbc25Smrg
5471f29dbc25Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5472f29dbc25Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5473f29dbc25Smrg        #     investigate it a little bit more. (MM)
5474f29dbc25Smrg        wlarc='${wl}'
5475f29dbc25Smrg
5476f29dbc25Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5477f29dbc25Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5478f29dbc25Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5479f29dbc25Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5480f29dbc25Smrg        else
5481f29dbc25Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5482f29dbc25Smrg        fi
5483f29dbc25Smrg      else
5484f29dbc25Smrg        with_gnu_ld=no
5485f29dbc25Smrg        wlarc=
5486f29dbc25Smrg
5487f29dbc25Smrg        # A generic and very simple default shared library creation
5488f29dbc25Smrg        # command for GNU C++ for the case where it uses the native
5489f29dbc25Smrg        # linker, instead of GNU ld.  If possible, this setting should
5490f29dbc25Smrg        # overridden to take advantage of the native linker features on
5491f29dbc25Smrg        # the platform it is being used on.
5492f29dbc25Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5493f29dbc25Smrg      fi
5494f29dbc25Smrg
5495f29dbc25Smrg      # Commands to make compiler produce verbose output that lists
5496f29dbc25Smrg      # what "hidden" libraries, object files and flags are used when
5497f29dbc25Smrg      # linking a shared library.
5498f29dbc25Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5499f29dbc25Smrg
5500f29dbc25Smrg    else
5501f29dbc25Smrg      GXX=no
5502f29dbc25Smrg      with_gnu_ld=no
5503f29dbc25Smrg      wlarc=
5504f29dbc25Smrg    fi
5505f29dbc25Smrg
5506f29dbc25Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5507f29dbc25Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5508f29dbc25Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5509f29dbc25Smrg    case $host_os in
5510f29dbc25Smrg      aix3*)
5511f29dbc25Smrg        # FIXME: insert proper C++ library support
5512f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5513f29dbc25Smrg        ;;
5514f29dbc25Smrg      aix[[4-9]]*)
5515f29dbc25Smrg        if test "$host_cpu" = ia64; then
5516f29dbc25Smrg          # On IA64, the linker does run time linking by default, so we don't
5517f29dbc25Smrg          # have to do anything special.
5518f29dbc25Smrg          aix_use_runtimelinking=no
5519f29dbc25Smrg          exp_sym_flag='-Bexport'
5520f29dbc25Smrg          no_entry_flag=""
5521f29dbc25Smrg        else
5522f29dbc25Smrg          aix_use_runtimelinking=no
5523f29dbc25Smrg
5524f29dbc25Smrg          # Test if we are trying to use run time linking or normal
5525f29dbc25Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5526f29dbc25Smrg          # need to do runtime linking.
5527f29dbc25Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5528f29dbc25Smrg	    for ld_flag in $LDFLAGS; do
5529f29dbc25Smrg	      case $ld_flag in
5530f29dbc25Smrg	      *-brtl*)
5531f29dbc25Smrg	        aix_use_runtimelinking=yes
5532f29dbc25Smrg	        break
5533f29dbc25Smrg	        ;;
5534f29dbc25Smrg	      esac
5535f29dbc25Smrg	    done
5536f29dbc25Smrg	    ;;
5537f29dbc25Smrg          esac
5538f29dbc25Smrg
5539f29dbc25Smrg          exp_sym_flag='-bexport'
5540f29dbc25Smrg          no_entry_flag='-bnoentry'
5541f29dbc25Smrg        fi
5542f29dbc25Smrg
5543f29dbc25Smrg        # When large executables or shared objects are built, AIX ld can
5544f29dbc25Smrg        # have problems creating the table of contents.  If linking a library
5545f29dbc25Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
5546f29dbc25Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5547f29dbc25Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5548f29dbc25Smrg
5549f29dbc25Smrg        _LT_TAGVAR(archive_cmds, $1)=''
5550f29dbc25Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5551f29dbc25Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5552f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5553f29dbc25Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5554f29dbc25Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5555f29dbc25Smrg
5556f29dbc25Smrg        if test "$GXX" = yes; then
5557f29dbc25Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5558f29dbc25Smrg          # We only want to do this on AIX 4.2 and lower, the check
5559f29dbc25Smrg          # below for broken collect2 doesn't work under 4.3+
5560f29dbc25Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5561f29dbc25Smrg	  if test -f "$collect2name" &&
5562f29dbc25Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5563f29dbc25Smrg	  then
5564f29dbc25Smrg	    # We have reworked collect2
5565f29dbc25Smrg	    :
5566f29dbc25Smrg	  else
5567f29dbc25Smrg	    # We have old collect2
5568f29dbc25Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5569f29dbc25Smrg	    # It fails to find uninstalled libraries when the uninstalled
5570f29dbc25Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5571f29dbc25Smrg	    # to unsupported forces relinking
5572f29dbc25Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5573f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5574f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5575f29dbc25Smrg	  fi
5576f29dbc25Smrg          esac
5577f29dbc25Smrg          shared_flag='-shared'
5578f29dbc25Smrg	  if test "$aix_use_runtimelinking" = yes; then
5579f29dbc25Smrg	    shared_flag="$shared_flag "'${wl}-G'
5580f29dbc25Smrg	  fi
5581f29dbc25Smrg        else
5582f29dbc25Smrg          # not using gcc
5583f29dbc25Smrg          if test "$host_cpu" = ia64; then
5584f29dbc25Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5585f29dbc25Smrg	  # chokes on -Wl,-G. The following line is correct:
5586f29dbc25Smrg	  shared_flag='-G'
5587f29dbc25Smrg          else
5588f29dbc25Smrg	    if test "$aix_use_runtimelinking" = yes; then
5589f29dbc25Smrg	      shared_flag='${wl}-G'
5590f29dbc25Smrg	    else
5591f29dbc25Smrg	      shared_flag='${wl}-bM:SRE'
5592f29dbc25Smrg	    fi
5593f29dbc25Smrg          fi
5594f29dbc25Smrg        fi
5595f29dbc25Smrg
5596f29dbc25Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5597f29dbc25Smrg        # It seems that -bexpall does not export symbols beginning with
5598f29dbc25Smrg        # underscore (_), so it is better to generate a list of symbols to
5599f29dbc25Smrg	# export.
5600f29dbc25Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
5601f29dbc25Smrg        if test "$aix_use_runtimelinking" = yes; then
5602f29dbc25Smrg          # Warning - without using the other runtime loading flags (-brtl),
5603f29dbc25Smrg          # -berok will link without error, but may produce a broken library.
5604f29dbc25Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5605f29dbc25Smrg          # Determine the default libpath from the value encoded in an empty
5606f29dbc25Smrg          # executable.
5607f29dbc25Smrg          _LT_SYS_MODULE_PATH_AIX
5608f29dbc25Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5609f29dbc25Smrg
5610f29dbc25Smrg          _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"
5611f29dbc25Smrg        else
5612f29dbc25Smrg          if test "$host_cpu" = ia64; then
5613f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5614f29dbc25Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5615f29dbc25Smrg	    _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"
5616f29dbc25Smrg          else
5617f29dbc25Smrg	    # Determine the default libpath from the value encoded in an
5618f29dbc25Smrg	    # empty executable.
5619f29dbc25Smrg	    _LT_SYS_MODULE_PATH_AIX
5620f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5621f29dbc25Smrg	    # Warning - without using the other run time loading flags,
5622f29dbc25Smrg	    # -berok will link without error, but may produce a broken library.
5623f29dbc25Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5624f29dbc25Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5625f29dbc25Smrg	    # Exported symbols can be pulled into shared objects from archives
5626f29dbc25Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5627f29dbc25Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5628f29dbc25Smrg	    # This is similar to how AIX traditionally builds its shared
5629f29dbc25Smrg	    # libraries.
5630f29dbc25Smrg	    _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'
5631f29dbc25Smrg          fi
5632f29dbc25Smrg        fi
5633f29dbc25Smrg        ;;
5634f29dbc25Smrg
5635f29dbc25Smrg      beos*)
5636f29dbc25Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5637f29dbc25Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5638f29dbc25Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5639f29dbc25Smrg	  # support --undefined.  This deserves some investigation.  FIXME
5640f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5641f29dbc25Smrg	else
5642f29dbc25Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5643f29dbc25Smrg	fi
5644f29dbc25Smrg	;;
5645f29dbc25Smrg
5646f29dbc25Smrg      chorus*)
5647f29dbc25Smrg        case $cc_basename in
5648f29dbc25Smrg          *)
5649f29dbc25Smrg	  # FIXME: insert proper C++ library support
5650f29dbc25Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5651f29dbc25Smrg	  ;;
5652f29dbc25Smrg        esac
5653f29dbc25Smrg        ;;
5654f29dbc25Smrg
5655f29dbc25Smrg      cygwin* | mingw* | pw32* | cegcc*)
5656f29dbc25Smrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5657f29dbc25Smrg        # as there is no search path for DLLs.
5658f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5659f29dbc25Smrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5660f29dbc25Smrg        _LT_TAGVAR(always_export_symbols, $1)=no
5661f29dbc25Smrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5662f29dbc25Smrg
5663f29dbc25Smrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5664f29dbc25Smrg          _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'
5665f29dbc25Smrg          # If the export-symbols file already is a .def file (1st line
5666f29dbc25Smrg          # is EXPORTS), use it as is; otherwise, prepend...
5667f29dbc25Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5668f29dbc25Smrg	    cp $export_symbols $output_objdir/$soname.def;
5669f29dbc25Smrg          else
5670f29dbc25Smrg	    echo EXPORTS > $output_objdir/$soname.def;
5671f29dbc25Smrg	    cat $export_symbols >> $output_objdir/$soname.def;
5672f29dbc25Smrg          fi~
5673f29dbc25Smrg          $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'
5674f29dbc25Smrg        else
5675f29dbc25Smrg          _LT_TAGVAR(ld_shlibs, $1)=no
5676f29dbc25Smrg        fi
5677f29dbc25Smrg        ;;
5678f29dbc25Smrg      darwin* | rhapsody*)
5679f29dbc25Smrg        _LT_DARWIN_LINKER_FEATURES($1)
5680f29dbc25Smrg	;;
5681f29dbc25Smrg
5682f29dbc25Smrg      dgux*)
5683f29dbc25Smrg        case $cc_basename in
5684f29dbc25Smrg          ec++*)
5685f29dbc25Smrg	    # FIXME: insert proper C++ library support
5686f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5687f29dbc25Smrg	    ;;
5688f29dbc25Smrg          ghcx*)
5689f29dbc25Smrg	    # Green Hills C++ Compiler
5690f29dbc25Smrg	    # FIXME: insert proper C++ library support
5691f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5692f29dbc25Smrg	    ;;
5693f29dbc25Smrg          *)
5694f29dbc25Smrg	    # FIXME: insert proper C++ library support
5695f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5696f29dbc25Smrg	    ;;
5697f29dbc25Smrg        esac
5698f29dbc25Smrg        ;;
5699f29dbc25Smrg
5700f29dbc25Smrg      freebsd[[12]]*)
5701f29dbc25Smrg        # C++ shared libraries reported to be fairly broken before
5702f29dbc25Smrg	# switch to ELF
5703f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5704f29dbc25Smrg        ;;
5705f29dbc25Smrg
5706f29dbc25Smrg      freebsd-elf*)
5707f29dbc25Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5708f29dbc25Smrg        ;;
5709f29dbc25Smrg
5710f29dbc25Smrg      freebsd* | dragonfly*)
5711f29dbc25Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5712f29dbc25Smrg        # conventions
5713f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
5714f29dbc25Smrg        ;;
5715f29dbc25Smrg
5716f29dbc25Smrg      gnu*)
5717f29dbc25Smrg        ;;
5718f29dbc25Smrg
5719f29dbc25Smrg      hpux9*)
5720f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5721f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5722f29dbc25Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5723f29dbc25Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5724f29dbc25Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5725f29dbc25Smrg				             # but as the default
5726f29dbc25Smrg				             # location of the library.
5727f29dbc25Smrg
5728f29dbc25Smrg        case $cc_basename in
5729f29dbc25Smrg          CC*)
5730f29dbc25Smrg            # FIXME: insert proper C++ library support
5731f29dbc25Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
5732f29dbc25Smrg            ;;
5733f29dbc25Smrg          aCC*)
5734f29dbc25Smrg            _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'
5735f29dbc25Smrg            # Commands to make compiler produce verbose output that lists
5736f29dbc25Smrg            # what "hidden" libraries, object files and flags are used when
5737f29dbc25Smrg            # linking a shared library.
5738f29dbc25Smrg            #
5739f29dbc25Smrg            # There doesn't appear to be a way to prevent this compiler from
5740f29dbc25Smrg            # explicitly linking system object files so we need to strip them
5741f29dbc25Smrg            # from the output so that they don't get included in the library
5742f29dbc25Smrg            # dependencies.
5743f29dbc25Smrg            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'
5744f29dbc25Smrg            ;;
5745f29dbc25Smrg          *)
5746f29dbc25Smrg            if test "$GXX" = yes; then
5747f29dbc25Smrg              _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'
5748f29dbc25Smrg            else
5749f29dbc25Smrg              # FIXME: insert proper C++ library support
5750f29dbc25Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
5751f29dbc25Smrg            fi
5752f29dbc25Smrg            ;;
5753f29dbc25Smrg        esac
5754f29dbc25Smrg        ;;
5755f29dbc25Smrg
5756f29dbc25Smrg      hpux10*|hpux11*)
5757f29dbc25Smrg        if test $with_gnu_ld = no; then
5758f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5759f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5760f29dbc25Smrg
5761f29dbc25Smrg          case $host_cpu in
5762f29dbc25Smrg            hppa*64*|ia64*)
5763f29dbc25Smrg              ;;
5764f29dbc25Smrg            *)
5765f29dbc25Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5766f29dbc25Smrg              ;;
5767f29dbc25Smrg          esac
5768f29dbc25Smrg        fi
5769f29dbc25Smrg        case $host_cpu in
5770f29dbc25Smrg          hppa*64*|ia64*)
5771f29dbc25Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
5772f29dbc25Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5773f29dbc25Smrg            ;;
5774f29dbc25Smrg          *)
5775f29dbc25Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
5776f29dbc25Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5777f29dbc25Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5778f29dbc25Smrg					         # but as the default
5779f29dbc25Smrg					         # location of the library.
5780f29dbc25Smrg            ;;
5781f29dbc25Smrg        esac
5782f29dbc25Smrg
5783f29dbc25Smrg        case $cc_basename in
5784f29dbc25Smrg          CC*)
5785f29dbc25Smrg	    # FIXME: insert proper C++ library support
5786f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5787f29dbc25Smrg	    ;;
5788f29dbc25Smrg          aCC*)
5789f29dbc25Smrg	    case $host_cpu in
5790f29dbc25Smrg	      hppa*64*)
5791f29dbc25Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5792f29dbc25Smrg	        ;;
5793f29dbc25Smrg	      ia64*)
5794f29dbc25Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5795f29dbc25Smrg	        ;;
5796f29dbc25Smrg	      *)
5797f29dbc25Smrg	        _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'
5798f29dbc25Smrg	        ;;
5799f29dbc25Smrg	    esac
5800f29dbc25Smrg	    # Commands to make compiler produce verbose output that lists
5801f29dbc25Smrg	    # what "hidden" libraries, object files and flags are used when
5802f29dbc25Smrg	    # linking a shared library.
5803f29dbc25Smrg	    #
5804f29dbc25Smrg	    # There doesn't appear to be a way to prevent this compiler from
5805f29dbc25Smrg	    # explicitly linking system object files so we need to strip them
5806f29dbc25Smrg	    # from the output so that they don't get included in the library
5807f29dbc25Smrg	    # dependencies.
5808f29dbc25Smrg	    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'
5809f29dbc25Smrg	    ;;
5810f29dbc25Smrg          *)
5811f29dbc25Smrg	    if test "$GXX" = yes; then
5812f29dbc25Smrg	      if test $with_gnu_ld = no; then
5813f29dbc25Smrg	        case $host_cpu in
5814f29dbc25Smrg	          hppa*64*)
5815f29dbc25Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5816f29dbc25Smrg	            ;;
5817f29dbc25Smrg	          ia64*)
5818f29dbc25Smrg	            _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'
5819f29dbc25Smrg	            ;;
5820f29dbc25Smrg	          *)
5821f29dbc25Smrg	            _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'
5822f29dbc25Smrg	            ;;
5823f29dbc25Smrg	        esac
5824f29dbc25Smrg	      fi
5825f29dbc25Smrg	    else
5826f29dbc25Smrg	      # FIXME: insert proper C++ library support
5827f29dbc25Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
5828f29dbc25Smrg	    fi
5829f29dbc25Smrg	    ;;
5830f29dbc25Smrg        esac
5831f29dbc25Smrg        ;;
5832f29dbc25Smrg
5833f29dbc25Smrg      interix[[3-9]]*)
5834f29dbc25Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5835f29dbc25Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5836f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5837f29dbc25Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5838f29dbc25Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5839f29dbc25Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
5840f29dbc25Smrg	# default) and relocated if they conflict, which is a slow very memory
5841f29dbc25Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
5842f29dbc25Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5843f29dbc25Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5844f29dbc25Smrg	_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'
5845f29dbc25Smrg	_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'
5846f29dbc25Smrg	;;
5847f29dbc25Smrg      irix5* | irix6*)
5848f29dbc25Smrg        case $cc_basename in
5849f29dbc25Smrg          CC*)
5850f29dbc25Smrg	    # SGI C++
5851f29dbc25Smrg	    _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'
5852f29dbc25Smrg
5853f29dbc25Smrg	    # Archives containing C++ object files must be created using
5854f29dbc25Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5855f29dbc25Smrg	    # necessary to make sure instantiated templates are included
5856f29dbc25Smrg	    # in the archive.
5857f29dbc25Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5858f29dbc25Smrg	    ;;
5859f29dbc25Smrg          *)
5860f29dbc25Smrg	    if test "$GXX" = yes; then
5861f29dbc25Smrg	      if test "$with_gnu_ld" = no; then
5862f29dbc25Smrg	        _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'
5863f29dbc25Smrg	      else
5864f29dbc25Smrg	        _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'
5865f29dbc25Smrg	      fi
5866f29dbc25Smrg	    fi
5867f29dbc25Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
5868f29dbc25Smrg	    ;;
5869f29dbc25Smrg        esac
5870f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5871f29dbc25Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5872f29dbc25Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
5873f29dbc25Smrg        ;;
5874f29dbc25Smrg
5875f29dbc25Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
5876f29dbc25Smrg        case $cc_basename in
5877f29dbc25Smrg          KCC*)
5878f29dbc25Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5879f29dbc25Smrg
5880f29dbc25Smrg	    # KCC will only create a shared library if the output file
5881f29dbc25Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
5882f29dbc25Smrg	    # to its proper name (with version) after linking.
5883f29dbc25Smrg	    _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'
5884f29dbc25Smrg	    _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'
5885f29dbc25Smrg	    # Commands to make compiler produce verbose output that lists
5886f29dbc25Smrg	    # what "hidden" libraries, object files and flags are used when
5887f29dbc25Smrg	    # linking a shared library.
5888f29dbc25Smrg	    #
5889f29dbc25Smrg	    # There doesn't appear to be a way to prevent this compiler from
5890f29dbc25Smrg	    # explicitly linking system object files so we need to strip them
5891f29dbc25Smrg	    # from the output so that they don't get included in the library
5892f29dbc25Smrg	    # dependencies.
5893f29dbc25Smrg	    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'
5894f29dbc25Smrg
5895f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5896f29dbc25Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5897f29dbc25Smrg
5898f29dbc25Smrg	    # Archives containing C++ object files must be created using
5899f29dbc25Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5900f29dbc25Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5901f29dbc25Smrg	    ;;
5902f29dbc25Smrg	  icpc* | ecpc* )
5903f29dbc25Smrg	    # Intel C++
5904f29dbc25Smrg	    with_gnu_ld=yes
5905f29dbc25Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
5906f29dbc25Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
5907f29dbc25Smrg	    # earlier do not add the objects themselves.
5908f29dbc25Smrg	    case `$CC -V 2>&1` in
5909f29dbc25Smrg	      *"Version 7."*)
5910f29dbc25Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5911f29dbc25Smrg		_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'
5912f29dbc25Smrg		;;
5913f29dbc25Smrg	      *)  # Version 8.0 or newer
5914f29dbc25Smrg	        tmp_idyn=
5915f29dbc25Smrg	        case $host_cpu in
5916f29dbc25Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
5917f29dbc25Smrg		esac
5918f29dbc25Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5919f29dbc25Smrg		_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'
5920f29dbc25Smrg		;;
5921f29dbc25Smrg	    esac
5922f29dbc25Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5923f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5924f29dbc25Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5925f29dbc25Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5926f29dbc25Smrg	    ;;
5927f29dbc25Smrg          pgCC* | pgcpp*)
5928f29dbc25Smrg            # Portland Group C++ compiler
5929f29dbc25Smrg	    case `$CC -V` in
5930f29dbc25Smrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5931f29dbc25Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5932f29dbc25Smrg		rm -rf $tpldir~
5933f29dbc25Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5934f29dbc25Smrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5935f29dbc25Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5936f29dbc25Smrg		rm -rf $tpldir~
5937f29dbc25Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5938f29dbc25Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5939f29dbc25Smrg		$RANLIB $oldlib'
5940f29dbc25Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5941f29dbc25Smrg		rm -rf $tpldir~
5942f29dbc25Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5943f29dbc25Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5944f29dbc25Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5945f29dbc25Smrg		rm -rf $tpldir~
5946f29dbc25Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5947f29dbc25Smrg		$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'
5948f29dbc25Smrg	      ;;
5949f29dbc25Smrg	    *) # Version 6 will use weak symbols
5950f29dbc25Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5951f29dbc25Smrg	      _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'
5952f29dbc25Smrg	      ;;
5953f29dbc25Smrg	    esac
5954f29dbc25Smrg
5955f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5956f29dbc25Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5957f29dbc25Smrg	    _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'
5958f29dbc25Smrg            ;;
5959f29dbc25Smrg	  cxx*)
5960f29dbc25Smrg	    # Compaq C++
5961f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5962f29dbc25Smrg	    _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'
5963f29dbc25Smrg
5964f29dbc25Smrg	    runpath_var=LD_RUN_PATH
5965f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5966f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5967f29dbc25Smrg
5968f29dbc25Smrg	    # Commands to make compiler produce verbose output that lists
5969f29dbc25Smrg	    # what "hidden" libraries, object files and flags are used when
5970f29dbc25Smrg	    # linking a shared library.
5971f29dbc25Smrg	    #
5972f29dbc25Smrg	    # There doesn't appear to be a way to prevent this compiler from
5973f29dbc25Smrg	    # explicitly linking system object files so we need to strip them
5974f29dbc25Smrg	    # from the output so that they don't get included in the library
5975f29dbc25Smrg	    # dependencies.
5976f29dbc25Smrg	    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'
5977f29dbc25Smrg	    ;;
5978f29dbc25Smrg	  xl*)
5979f29dbc25Smrg	    # IBM XL 8.0 on PPC, with GNU ld
5980f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5981f29dbc25Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5982f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5983f29dbc25Smrg	    if test "x$supports_anon_versioning" = xyes; then
5984f29dbc25Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5985f29dbc25Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5986f29dbc25Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
5987f29dbc25Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5988f29dbc25Smrg	    fi
5989f29dbc25Smrg	    ;;
5990f29dbc25Smrg	  *)
5991f29dbc25Smrg	    case `$CC -V 2>&1 | sed 5q` in
5992f29dbc25Smrg	    *Sun\ C*)
5993f29dbc25Smrg	      # Sun C++ 5.9
5994f29dbc25Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5995f29dbc25Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5996f29dbc25Smrg	      _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'
5997f29dbc25Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5998f29dbc25Smrg	      _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'
5999f29dbc25Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6000f29dbc25Smrg
6001f29dbc25Smrg	      # Not sure whether something based on
6002f29dbc25Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6003f29dbc25Smrg	      # would be better.
6004f29dbc25Smrg	      output_verbose_link_cmd='echo'
6005f29dbc25Smrg
6006f29dbc25Smrg	      # Archives containing C++ object files must be created using
6007f29dbc25Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6008f29dbc25Smrg	      # necessary to make sure instantiated templates are included
6009f29dbc25Smrg	      # in the archive.
6010f29dbc25Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6011f29dbc25Smrg	      ;;
6012f29dbc25Smrg	    esac
6013f29dbc25Smrg	    ;;
6014f29dbc25Smrg	esac
6015f29dbc25Smrg	;;
6016f29dbc25Smrg
6017f29dbc25Smrg      lynxos*)
6018f29dbc25Smrg        # FIXME: insert proper C++ library support
6019f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6020f29dbc25Smrg	;;
6021f29dbc25Smrg
6022f29dbc25Smrg      m88k*)
6023f29dbc25Smrg        # FIXME: insert proper C++ library support
6024f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6025f29dbc25Smrg	;;
6026f29dbc25Smrg
6027f29dbc25Smrg      mvs*)
6028f29dbc25Smrg        case $cc_basename in
6029f29dbc25Smrg          cxx*)
6030f29dbc25Smrg	    # FIXME: insert proper C++ library support
6031f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6032f29dbc25Smrg	    ;;
6033f29dbc25Smrg	  *)
6034f29dbc25Smrg	    # FIXME: insert proper C++ library support
6035f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6036f29dbc25Smrg	    ;;
6037f29dbc25Smrg	esac
6038f29dbc25Smrg	;;
6039f29dbc25Smrg
6040f29dbc25Smrg      netbsd*)
6041f29dbc25Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6042f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6043f29dbc25Smrg	  wlarc=
6044f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6045f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6046f29dbc25Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6047f29dbc25Smrg	fi
6048f29dbc25Smrg	# Workaround some broken pre-1.5 toolchains
6049f29dbc25Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6050f29dbc25Smrg	;;
6051f29dbc25Smrg
6052f29dbc25Smrg      *nto* | *qnx*)
6053f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6054f29dbc25Smrg	;;
6055f29dbc25Smrg
6056f29dbc25Smrg      openbsd2*)
6057f29dbc25Smrg        # C++ shared libraries are fairly broken
6058f29dbc25Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6059f29dbc25Smrg	;;
6060f29dbc25Smrg
6061f29dbc25Smrg      openbsd*)
6062f29dbc25Smrg	if test -f /usr/libexec/ld.so; then
6063f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6064f29dbc25Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6065f29dbc25Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6066f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6067f29dbc25Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6068f29dbc25Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6069f29dbc25Smrg	    _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'
6070f29dbc25Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6071f29dbc25Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6072f29dbc25Smrg	  fi
6073f29dbc25Smrg	  output_verbose_link_cmd=echo
6074f29dbc25Smrg	else
6075f29dbc25Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6076f29dbc25Smrg	fi
6077f29dbc25Smrg	;;
6078f29dbc25Smrg
6079f29dbc25Smrg      osf3* | osf4* | osf5*)
6080f29dbc25Smrg        case $cc_basename in
6081f29dbc25Smrg          KCC*)
6082f29dbc25Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6083f29dbc25Smrg
6084f29dbc25Smrg	    # KCC will only create a shared library if the output file
6085f29dbc25Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6086f29dbc25Smrg	    # to its proper name (with version) after linking.
6087f29dbc25Smrg	    _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'
6088f29dbc25Smrg
6089f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6090f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6091f29dbc25Smrg
6092f29dbc25Smrg	    # Archives containing C++ object files must be created using
6093f29dbc25Smrg	    # the KAI C++ compiler.
6094f29dbc25Smrg	    case $host in
6095f29dbc25Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6096f29dbc25Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6097f29dbc25Smrg	    esac
6098f29dbc25Smrg	    ;;
6099f29dbc25Smrg          RCC*)
6100f29dbc25Smrg	    # Rational C++ 2.4.1
6101f29dbc25Smrg	    # FIXME: insert proper C++ library support
6102f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6103f29dbc25Smrg	    ;;
6104f29dbc25Smrg          cxx*)
6105f29dbc25Smrg	    case $host in
6106f29dbc25Smrg	      osf3*)
6107f29dbc25Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6108f29dbc25Smrg	        _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'
6109f29dbc25Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6110f29dbc25Smrg		;;
6111f29dbc25Smrg	      *)
6112f29dbc25Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6113f29dbc25Smrg	        _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'
6114f29dbc25Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6115f29dbc25Smrg	          echo "-hidden">> $lib.exp~
6116f29dbc25Smrg	          $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~
6117f29dbc25Smrg	          $RM $lib.exp'
6118f29dbc25Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6119f29dbc25Smrg		;;
6120f29dbc25Smrg	    esac
6121f29dbc25Smrg
6122f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6123f29dbc25Smrg
6124f29dbc25Smrg	    # Commands to make compiler produce verbose output that lists
6125f29dbc25Smrg	    # what "hidden" libraries, object files and flags are used when
6126f29dbc25Smrg	    # linking a shared library.
6127f29dbc25Smrg	    #
6128f29dbc25Smrg	    # There doesn't appear to be a way to prevent this compiler from
6129f29dbc25Smrg	    # explicitly linking system object files so we need to strip them
6130f29dbc25Smrg	    # from the output so that they don't get included in the library
6131f29dbc25Smrg	    # dependencies.
6132f29dbc25Smrg	    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'
6133f29dbc25Smrg	    ;;
6134f29dbc25Smrg	  *)
6135f29dbc25Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6136f29dbc25Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6137f29dbc25Smrg	      case $host in
6138f29dbc25Smrg	        osf3*)
6139f29dbc25Smrg	          _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'
6140f29dbc25Smrg		  ;;
6141f29dbc25Smrg	        *)
6142f29dbc25Smrg	          _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'
6143f29dbc25Smrg		  ;;
6144f29dbc25Smrg	      esac
6145f29dbc25Smrg
6146f29dbc25Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6147f29dbc25Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6148f29dbc25Smrg
6149f29dbc25Smrg	      # Commands to make compiler produce verbose output that lists
6150f29dbc25Smrg	      # what "hidden" libraries, object files and flags are used when
6151f29dbc25Smrg	      # linking a shared library.
6152f29dbc25Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6153f29dbc25Smrg
6154f29dbc25Smrg	    else
6155f29dbc25Smrg	      # FIXME: insert proper C++ library support
6156f29dbc25Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6157f29dbc25Smrg	    fi
6158f29dbc25Smrg	    ;;
6159f29dbc25Smrg        esac
6160f29dbc25Smrg        ;;
6161f29dbc25Smrg
6162f29dbc25Smrg      psos*)
6163f29dbc25Smrg        # FIXME: insert proper C++ library support
6164f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6165f29dbc25Smrg        ;;
6166f29dbc25Smrg
6167f29dbc25Smrg      sunos4*)
6168f29dbc25Smrg        case $cc_basename in
6169f29dbc25Smrg          CC*)
6170f29dbc25Smrg	    # Sun C++ 4.x
6171f29dbc25Smrg	    # FIXME: insert proper C++ library support
6172f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6173f29dbc25Smrg	    ;;
6174f29dbc25Smrg          lcc*)
6175f29dbc25Smrg	    # Lucid
6176f29dbc25Smrg	    # FIXME: insert proper C++ library support
6177f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6178f29dbc25Smrg	    ;;
6179f29dbc25Smrg          *)
6180f29dbc25Smrg	    # FIXME: insert proper C++ library support
6181f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6182f29dbc25Smrg	    ;;
6183f29dbc25Smrg        esac
6184f29dbc25Smrg        ;;
6185f29dbc25Smrg
6186f29dbc25Smrg      solaris*)
6187f29dbc25Smrg        case $cc_basename in
6188f29dbc25Smrg          CC*)
6189f29dbc25Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6190f29dbc25Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6191f29dbc25Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6192f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6193f29dbc25Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6194f29dbc25Smrg	      $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'
6195f29dbc25Smrg
6196f29dbc25Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6197f29dbc25Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6198f29dbc25Smrg	    case $host_os in
6199f29dbc25Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6200f29dbc25Smrg	      *)
6201f29dbc25Smrg		# The compiler driver will combine and reorder linker options,
6202f29dbc25Smrg		# but understands `-z linker_flag'.
6203f29dbc25Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6204f29dbc25Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6205f29dbc25Smrg	        ;;
6206f29dbc25Smrg	    esac
6207f29dbc25Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6208f29dbc25Smrg
6209f29dbc25Smrg	    output_verbose_link_cmd='echo'
6210f29dbc25Smrg
6211f29dbc25Smrg	    # Archives containing C++ object files must be created using
6212f29dbc25Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6213f29dbc25Smrg	    # necessary to make sure instantiated templates are included
6214f29dbc25Smrg	    # in the archive.
6215f29dbc25Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6216f29dbc25Smrg	    ;;
6217f29dbc25Smrg          gcx*)
6218f29dbc25Smrg	    # Green Hills C++ Compiler
6219f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6220f29dbc25Smrg
6221f29dbc25Smrg	    # The C++ compiler must be used to create the archive.
6222f29dbc25Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6223f29dbc25Smrg	    ;;
6224f29dbc25Smrg          *)
6225f29dbc25Smrg	    # GNU C++ compiler with Solaris linker
6226f29dbc25Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6227f29dbc25Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6228f29dbc25Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6229f29dbc25Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6230f29dbc25Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6231f29dbc25Smrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6232f29dbc25Smrg
6233f29dbc25Smrg	        # Commands to make compiler produce verbose output that lists
6234f29dbc25Smrg	        # what "hidden" libraries, object files and flags are used when
6235f29dbc25Smrg	        # linking a shared library.
6236f29dbc25Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6237f29dbc25Smrg	      else
6238f29dbc25Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6239f29dbc25Smrg	        # platform.
6240f29dbc25Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6241f29dbc25Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6242f29dbc25Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6243f29dbc25Smrg
6244f29dbc25Smrg	        # Commands to make compiler produce verbose output that lists
6245f29dbc25Smrg	        # what "hidden" libraries, object files and flags are used when
6246f29dbc25Smrg	        # linking a shared library.
6247f29dbc25Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6248f29dbc25Smrg	      fi
6249f29dbc25Smrg
6250f29dbc25Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6251f29dbc25Smrg	      case $host_os in
6252f29dbc25Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6253f29dbc25Smrg		*)
6254f29dbc25Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6255f29dbc25Smrg		  ;;
6256f29dbc25Smrg	      esac
6257f29dbc25Smrg	    fi
6258f29dbc25Smrg	    ;;
6259f29dbc25Smrg        esac
6260f29dbc25Smrg        ;;
6261f29dbc25Smrg
6262f29dbc25Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6263f29dbc25Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6264f29dbc25Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6265f29dbc25Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6266f29dbc25Smrg      runpath_var='LD_RUN_PATH'
6267f29dbc25Smrg
6268f29dbc25Smrg      case $cc_basename in
6269f29dbc25Smrg        CC*)
6270f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6271f29dbc25Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6272f29dbc25Smrg	  ;;
6273f29dbc25Smrg	*)
6274f29dbc25Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6275f29dbc25Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6276f29dbc25Smrg	  ;;
6277f29dbc25Smrg      esac
6278f29dbc25Smrg      ;;
6279f29dbc25Smrg
6280f29dbc25Smrg      sysv5* | sco3.2v5* | sco5v6*)
6281f29dbc25Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6282f29dbc25Smrg	# link with -lc, and that would cause any symbols used from libc to
6283f29dbc25Smrg	# always be unresolved, which means just about no library would
6284f29dbc25Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6285f29dbc25Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6286f29dbc25Smrg	# as -z defs.
6287f29dbc25Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6288f29dbc25Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6289f29dbc25Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6290f29dbc25Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6291f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6292f29dbc25Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6293f29dbc25Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6294f29dbc25Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6295f29dbc25Smrg	runpath_var='LD_RUN_PATH'
6296f29dbc25Smrg
6297f29dbc25Smrg	case $cc_basename in
6298f29dbc25Smrg          CC*)
6299f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6300f29dbc25Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6301f29dbc25Smrg	    ;;
6302f29dbc25Smrg	  *)
6303f29dbc25Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6304f29dbc25Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6305f29dbc25Smrg	    ;;
6306f29dbc25Smrg	esac
6307f29dbc25Smrg      ;;
6308f29dbc25Smrg
6309f29dbc25Smrg      tandem*)
6310f29dbc25Smrg        case $cc_basename in
6311f29dbc25Smrg          NCC*)
6312f29dbc25Smrg	    # NonStop-UX NCC 3.20
6313f29dbc25Smrg	    # FIXME: insert proper C++ library support
6314f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6315f29dbc25Smrg	    ;;
6316f29dbc25Smrg          *)
6317f29dbc25Smrg	    # FIXME: insert proper C++ library support
6318f29dbc25Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6319f29dbc25Smrg	    ;;
6320f29dbc25Smrg        esac
6321f29dbc25Smrg        ;;
6322f29dbc25Smrg
6323f29dbc25Smrg      vxworks*)
6324f29dbc25Smrg        # FIXME: insert proper C++ library support
6325f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6326f29dbc25Smrg        ;;
6327f29dbc25Smrg
6328f29dbc25Smrg      *)
6329f29dbc25Smrg        # FIXME: insert proper C++ library support
6330f29dbc25Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6331f29dbc25Smrg        ;;
6332f29dbc25Smrg    esac
6333f29dbc25Smrg
6334f29dbc25Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6335f29dbc25Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6336f29dbc25Smrg
6337f29dbc25Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6338f29dbc25Smrg    _LT_TAGVAR(LD, $1)="$LD"
6339f29dbc25Smrg
6340f29dbc25Smrg    ## CAVEAT EMPTOR:
6341f29dbc25Smrg    ## There is no encapsulation within the following macros, do not change
6342f29dbc25Smrg    ## the running order or otherwise move them around unless you know exactly
6343f29dbc25Smrg    ## what you are doing...
6344f29dbc25Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6345f29dbc25Smrg    _LT_COMPILER_PIC($1)
6346f29dbc25Smrg    _LT_COMPILER_C_O($1)
6347f29dbc25Smrg    _LT_COMPILER_FILE_LOCKS($1)
6348f29dbc25Smrg    _LT_LINKER_SHLIBS($1)
6349f29dbc25Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6350f29dbc25Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6351f29dbc25Smrg
6352f29dbc25Smrg    _LT_CONFIG($1)
6353f29dbc25Smrg  fi # test -n "$compiler"
6354f29dbc25Smrg
6355f29dbc25Smrg  CC=$lt_save_CC
6356f29dbc25Smrg  LDCXX=$LD
6357f29dbc25Smrg  LD=$lt_save_LD
6358f29dbc25Smrg  GCC=$lt_save_GCC
6359f29dbc25Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6360f29dbc25Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6361f29dbc25Smrg  lt_cv_path_LD=$lt_save_path_LD
6362f29dbc25Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6363f29dbc25Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6364f29dbc25Smrgfi # test "$_lt_caught_CXX_error" != yes
6365f29dbc25Smrg
6366f29dbc25SmrgAC_LANG_POP
6367f29dbc25Smrg])# _LT_LANG_CXX_CONFIG
6368f29dbc25Smrg
6369f29dbc25Smrg
6370f29dbc25Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6371f29dbc25Smrg# ---------------------------------
6372f29dbc25Smrg# Figure out "hidden" library dependencies from verbose
6373f29dbc25Smrg# compiler output when linking a shared library.
6374f29dbc25Smrg# Parse the compiler output and extract the necessary
6375f29dbc25Smrg# objects, libraries and library flags.
6376f29dbc25Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6377f29dbc25Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6378f29dbc25Smrg# Dependencies to place before and after the object being linked:
6379f29dbc25Smrg_LT_TAGVAR(predep_objects, $1)=
6380f29dbc25Smrg_LT_TAGVAR(postdep_objects, $1)=
6381f29dbc25Smrg_LT_TAGVAR(predeps, $1)=
6382f29dbc25Smrg_LT_TAGVAR(postdeps, $1)=
6383f29dbc25Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6384f29dbc25Smrg
6385f29dbc25Smrgdnl we can't use the lt_simple_compile_test_code here,
6386f29dbc25Smrgdnl because it contains code intended for an executable,
6387f29dbc25Smrgdnl not a library.  It's possible we should let each
6388f29dbc25Smrgdnl tag define a new lt_????_link_test_code variable,
6389f29dbc25Smrgdnl but it's only used here...
6390f29dbc25Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6391f29dbc25Smrgint a;
6392f29dbc25Smrgvoid foo (void) { a = 0; }
6393f29dbc25Smrg_LT_EOF
6394f29dbc25Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6395f29dbc25Smrgclass Foo
6396f29dbc25Smrg{
6397f29dbc25Smrgpublic:
6398f29dbc25Smrg  Foo (void) { a = 0; }
6399f29dbc25Smrgprivate:
6400f29dbc25Smrg  int a;
6401f29dbc25Smrg};
6402f29dbc25Smrg_LT_EOF
6403f29dbc25Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6404f29dbc25Smrg      subroutine foo
6405f29dbc25Smrg      implicit none
6406f29dbc25Smrg      integer*4 a
6407f29dbc25Smrg      a=0
6408f29dbc25Smrg      return
6409f29dbc25Smrg      end
6410f29dbc25Smrg_LT_EOF
6411f29dbc25Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6412f29dbc25Smrg      subroutine foo
6413f29dbc25Smrg      implicit none
6414f29dbc25Smrg      integer a
6415f29dbc25Smrg      a=0
6416f29dbc25Smrg      return
6417f29dbc25Smrg      end
6418f29dbc25Smrg_LT_EOF
6419f29dbc25Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6420f29dbc25Smrgpublic class foo {
6421f29dbc25Smrg  private int a;
6422f29dbc25Smrg  public void bar (void) {
6423f29dbc25Smrg    a = 0;
6424f29dbc25Smrg  }
6425f29dbc25Smrg};
6426f29dbc25Smrg_LT_EOF
6427f29dbc25Smrg])
6428f29dbc25Smrgdnl Parse the compiler output and extract the necessary
6429f29dbc25Smrgdnl objects, libraries and library flags.
6430f29dbc25Smrgif AC_TRY_EVAL(ac_compile); then
6431f29dbc25Smrg  # Parse the compiler output and extract the necessary
6432f29dbc25Smrg  # objects, libraries and library flags.
6433f29dbc25Smrg
6434f29dbc25Smrg  # Sentinel used to keep track of whether or not we are before
6435f29dbc25Smrg  # the conftest object file.
6436f29dbc25Smrg  pre_test_object_deps_done=no
6437f29dbc25Smrg
6438f29dbc25Smrg  for p in `eval "$output_verbose_link_cmd"`; do
6439f29dbc25Smrg    case $p in
6440f29dbc25Smrg
6441f29dbc25Smrg    -L* | -R* | -l*)
6442f29dbc25Smrg       # Some compilers place space between "-{L,R}" and the path.
6443f29dbc25Smrg       # Remove the space.
6444f29dbc25Smrg       if test $p = "-L" ||
6445f29dbc25Smrg          test $p = "-R"; then
6446f29dbc25Smrg	 prev=$p
6447f29dbc25Smrg	 continue
6448f29dbc25Smrg       else
6449f29dbc25Smrg	 prev=
6450f29dbc25Smrg       fi
6451f29dbc25Smrg
6452f29dbc25Smrg       if test "$pre_test_object_deps_done" = no; then
6453f29dbc25Smrg	 case $p in
6454f29dbc25Smrg	 -L* | -R*)
6455f29dbc25Smrg	   # Internal compiler library paths should come after those
6456f29dbc25Smrg	   # provided the user.  The postdeps already come after the
6457f29dbc25Smrg	   # user supplied libs so there is no need to process them.
6458f29dbc25Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6459f29dbc25Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6460f29dbc25Smrg	   else
6461f29dbc25Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6462f29dbc25Smrg	   fi
6463f29dbc25Smrg	   ;;
6464f29dbc25Smrg	 # The "-l" case would never come before the object being
6465f29dbc25Smrg	 # linked, so don't bother handling this case.
6466f29dbc25Smrg	 esac
6467f29dbc25Smrg       else
6468f29dbc25Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6469f29dbc25Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6470f29dbc25Smrg	 else
6471f29dbc25Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6472f29dbc25Smrg	 fi
6473f29dbc25Smrg       fi
6474f29dbc25Smrg       ;;
6475f29dbc25Smrg
6476f29dbc25Smrg    *.$objext)
6477f29dbc25Smrg       # This assumes that the test object file only shows up
6478f29dbc25Smrg       # once in the compiler output.
6479f29dbc25Smrg       if test "$p" = "conftest.$objext"; then
6480f29dbc25Smrg	 pre_test_object_deps_done=yes
6481f29dbc25Smrg	 continue
6482f29dbc25Smrg       fi
6483f29dbc25Smrg
6484f29dbc25Smrg       if test "$pre_test_object_deps_done" = no; then
6485f29dbc25Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6486f29dbc25Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6487f29dbc25Smrg	 else
6488f29dbc25Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6489f29dbc25Smrg	 fi
6490f29dbc25Smrg       else
6491f29dbc25Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6492f29dbc25Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
6493f29dbc25Smrg	 else
6494f29dbc25Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6495f29dbc25Smrg	 fi
6496f29dbc25Smrg       fi
6497f29dbc25Smrg       ;;
6498f29dbc25Smrg
6499f29dbc25Smrg    *) ;; # Ignore the rest.
6500f29dbc25Smrg
6501f29dbc25Smrg    esac
6502f29dbc25Smrg  done
6503f29dbc25Smrg
6504f29dbc25Smrg  # Clean up.
6505f29dbc25Smrg  rm -f a.out a.exe
6506f29dbc25Smrgelse
6507f29dbc25Smrg  echo "libtool.m4: error: problem compiling $1 test program"
6508f29dbc25Smrgfi
6509f29dbc25Smrg
6510f29dbc25Smrg$RM -f confest.$objext
6511f29dbc25Smrg
6512f29dbc25Smrg# PORTME: override above test on systems where it is broken
6513f29dbc25Smrgm4_if([$1], [CXX],
6514f29dbc25Smrg[case $host_os in
6515f29dbc25Smrginterix[[3-9]]*)
6516f29dbc25Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
6517f29dbc25Smrg  # hack all around it, let's just trust "g++" to DTRT.
6518f29dbc25Smrg  _LT_TAGVAR(predep_objects,$1)=
6519f29dbc25Smrg  _LT_TAGVAR(postdep_objects,$1)=
6520f29dbc25Smrg  _LT_TAGVAR(postdeps,$1)=
6521f29dbc25Smrg  ;;
6522f29dbc25Smrg
6523f29dbc25Smrglinux*)
6524f29dbc25Smrg  case `$CC -V 2>&1 | sed 5q` in
6525f29dbc25Smrg  *Sun\ C*)
6526f29dbc25Smrg    # Sun C++ 5.9
6527f29dbc25Smrg
6528f29dbc25Smrg    # The more standards-conforming stlport4 library is
6529f29dbc25Smrg    # incompatible with the Cstd library. Avoid specifying
6530f29dbc25Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6531f29dbc25Smrg    # -library=stlport4 depends on it.
6532f29dbc25Smrg    case " $CXX $CXXFLAGS " in
6533f29dbc25Smrg    *" -library=stlport4 "*)
6534f29dbc25Smrg      solaris_use_stlport4=yes
6535f29dbc25Smrg      ;;
6536f29dbc25Smrg    esac
6537f29dbc25Smrg
6538f29dbc25Smrg    if test "$solaris_use_stlport4" != yes; then
6539f29dbc25Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6540f29dbc25Smrg    fi
6541f29dbc25Smrg    ;;
6542f29dbc25Smrg  esac
6543f29dbc25Smrg  ;;
6544f29dbc25Smrg
6545f29dbc25Smrgsolaris*)
6546f29dbc25Smrg  case $cc_basename in
6547f29dbc25Smrg  CC*)
6548f29dbc25Smrg    # The more standards-conforming stlport4 library is
6549f29dbc25Smrg    # incompatible with the Cstd library. Avoid specifying
6550f29dbc25Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
6551f29dbc25Smrg    # -library=stlport4 depends on it.
6552f29dbc25Smrg    case " $CXX $CXXFLAGS " in
6553f29dbc25Smrg    *" -library=stlport4 "*)
6554f29dbc25Smrg      solaris_use_stlport4=yes
6555f29dbc25Smrg      ;;
6556f29dbc25Smrg    esac
6557f29dbc25Smrg
6558f29dbc25Smrg    # Adding this requires a known-good setup of shared libraries for
6559f29dbc25Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
6560f29dbc25Smrg    # archive will be linked into the output, leading to subtle bugs.
6561f29dbc25Smrg    if test "$solaris_use_stlport4" != yes; then
6562f29dbc25Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6563f29dbc25Smrg    fi
6564f29dbc25Smrg    ;;
6565f29dbc25Smrg  esac
6566f29dbc25Smrg  ;;
6567f29dbc25Smrgesac
6568f29dbc25Smrg])
6569f29dbc25Smrg
6570f29dbc25Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
6571f29dbc25Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6572f29dbc25Smrgesac
6573f29dbc25Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6574f29dbc25Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6575f29dbc25Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6576f29dbc25Smrgfi
6577f29dbc25Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6578f29dbc25Smrg    [The directories searched by this compiler when creating a shared library])
6579f29dbc25Smrg_LT_TAGDECL([], [predep_objects], [1],
6580f29dbc25Smrg    [Dependencies to place before and after the objects being linked to
6581f29dbc25Smrg    create a shared library])
6582f29dbc25Smrg_LT_TAGDECL([], [postdep_objects], [1])
6583f29dbc25Smrg_LT_TAGDECL([], [predeps], [1])
6584f29dbc25Smrg_LT_TAGDECL([], [postdeps], [1])
6585f29dbc25Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
6586f29dbc25Smrg    [The library search path used internally by the compiler when linking
6587f29dbc25Smrg    a shared library])
6588f29dbc25Smrg])# _LT_SYS_HIDDEN_LIBDEPS
6589f29dbc25Smrg
6590f29dbc25Smrg
6591f29dbc25Smrg# _LT_PROG_F77
6592f29dbc25Smrg# ------------
6593f29dbc25Smrg# Since AC_PROG_F77 is broken, in that it returns the empty string
6594f29dbc25Smrg# if there is no fortran compiler, we have our own version here.
6595f29dbc25Smrgm4_defun([_LT_PROG_F77],
6596f29dbc25Smrg[
6597f29dbc25Smrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6598f29dbc25SmrgAC_PROG_F77
6599f29dbc25Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
6600f29dbc25Smrg  _lt_disable_F77=yes
6601f29dbc25Smrgfi
6602f29dbc25Smrgpopdef([AC_MSG_ERROR])
6603f29dbc25Smrg])# _LT_PROG_F77
6604f29dbc25Smrg
6605f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
6606f29dbc25Smrgdnl AC_DEFUN([_LT_PROG_F77], [])
6607f29dbc25Smrg
6608f29dbc25Smrg
6609f29dbc25Smrg# _LT_LANG_F77_CONFIG([TAG])
6610f29dbc25Smrg# --------------------------
6611f29dbc25Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
6612f29dbc25Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6613f29dbc25Smrg# to write the compiler configuration to `libtool'.
6614f29dbc25Smrgm4_defun([_LT_LANG_F77_CONFIG],
6615f29dbc25Smrg[AC_REQUIRE([_LT_PROG_F77])dnl
6616f29dbc25SmrgAC_LANG_PUSH(Fortran 77)
6617f29dbc25Smrg
6618f29dbc25Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6619f29dbc25Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6620f29dbc25Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6621f29dbc25Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6622f29dbc25Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6623f29dbc25Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6624f29dbc25Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6625f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6626f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6627f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6628f29dbc25Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6629f29dbc25Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6630f29dbc25Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6631f29dbc25Smrg_LT_TAGVAR(module_cmds, $1)=
6632f29dbc25Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6633f29dbc25Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6634f29dbc25Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6635f29dbc25Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6636f29dbc25Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6637f29dbc25Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6638f29dbc25Smrg
6639f29dbc25Smrg# Source file extension for f77 test sources.
6640f29dbc25Smrgac_ext=f
6641f29dbc25Smrg
6642f29dbc25Smrg# Object file extension for compiled f77 test sources.
6643f29dbc25Smrgobjext=o
6644f29dbc25Smrg_LT_TAGVAR(objext, $1)=$objext
6645f29dbc25Smrg
6646f29dbc25Smrg# No sense in running all these tests if we already determined that
6647f29dbc25Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
6648f29dbc25Smrg# are currently assumed to apply to all compilers on this platform,
6649f29dbc25Smrg# and will be corrupted by setting them based on a non-working compiler.
6650f29dbc25Smrgif test "$_lt_disable_F77" != yes; then
6651f29dbc25Smrg  # Code to be used in simple compile tests
6652f29dbc25Smrg  lt_simple_compile_test_code="\
6653f29dbc25Smrg      subroutine t
6654f29dbc25Smrg      return
6655f29dbc25Smrg      end
6656f29dbc25Smrg"
6657f29dbc25Smrg
6658f29dbc25Smrg  # Code to be used in simple link tests
6659f29dbc25Smrg  lt_simple_link_test_code="\
6660f29dbc25Smrg      program t
6661f29dbc25Smrg      end
6662f29dbc25Smrg"
6663f29dbc25Smrg
6664f29dbc25Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6665f29dbc25Smrg  _LT_TAG_COMPILER
6666f29dbc25Smrg
6667f29dbc25Smrg  # save warnings/boilerplate of simple test code
6668f29dbc25Smrg  _LT_COMPILER_BOILERPLATE
6669f29dbc25Smrg  _LT_LINKER_BOILERPLATE
6670f29dbc25Smrg
6671f29dbc25Smrg  # Allow CC to be a program name with arguments.
6672f29dbc25Smrg  lt_save_CC="$CC"
6673f29dbc25Smrg  lt_save_GCC=$GCC
6674f29dbc25Smrg  CC=${F77-"f77"}
6675f29dbc25Smrg  compiler=$CC
6676f29dbc25Smrg  _LT_TAGVAR(compiler, $1)=$CC
6677f29dbc25Smrg  _LT_CC_BASENAME([$compiler])
6678f29dbc25Smrg  GCC=$G77
6679f29dbc25Smrg  if test -n "$compiler"; then
6680f29dbc25Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6681f29dbc25Smrg    AC_MSG_RESULT([$can_build_shared])
6682f29dbc25Smrg
6683f29dbc25Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6684f29dbc25Smrg    test "$can_build_shared" = "no" && enable_shared=no
6685f29dbc25Smrg
6686f29dbc25Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6687f29dbc25Smrg    # are all built from PIC.
6688f29dbc25Smrg    case $host_os in
6689f29dbc25Smrg      aix3*)
6690f29dbc25Smrg        test "$enable_shared" = yes && enable_static=no
6691f29dbc25Smrg        if test -n "$RANLIB"; then
6692f29dbc25Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6693f29dbc25Smrg          postinstall_cmds='$RANLIB $lib'
6694f29dbc25Smrg        fi
6695f29dbc25Smrg        ;;
6696f29dbc25Smrg      aix[[4-9]]*)
6697f29dbc25Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6698f29dbc25Smrg	  test "$enable_shared" = yes && enable_static=no
6699f29dbc25Smrg	fi
6700f29dbc25Smrg        ;;
6701f29dbc25Smrg    esac
6702f29dbc25Smrg    AC_MSG_RESULT([$enable_shared])
6703f29dbc25Smrg
6704f29dbc25Smrg    AC_MSG_CHECKING([whether to build static libraries])
6705f29dbc25Smrg    # Make sure either enable_shared or enable_static is yes.
6706f29dbc25Smrg    test "$enable_shared" = yes || enable_static=yes
6707f29dbc25Smrg    AC_MSG_RESULT([$enable_static])
6708f29dbc25Smrg
6709f29dbc25Smrg    _LT_TAGVAR(GCC, $1)="$G77"
6710f29dbc25Smrg    _LT_TAGVAR(LD, $1)="$LD"
6711f29dbc25Smrg
6712f29dbc25Smrg    ## CAVEAT EMPTOR:
6713f29dbc25Smrg    ## There is no encapsulation within the following macros, do not change
6714f29dbc25Smrg    ## the running order or otherwise move them around unless you know exactly
6715f29dbc25Smrg    ## what you are doing...
6716f29dbc25Smrg    _LT_COMPILER_PIC($1)
6717f29dbc25Smrg    _LT_COMPILER_C_O($1)
6718f29dbc25Smrg    _LT_COMPILER_FILE_LOCKS($1)
6719f29dbc25Smrg    _LT_LINKER_SHLIBS($1)
6720f29dbc25Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6721f29dbc25Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6722f29dbc25Smrg
6723f29dbc25Smrg    _LT_CONFIG($1)
6724f29dbc25Smrg  fi # test -n "$compiler"
6725f29dbc25Smrg
6726f29dbc25Smrg  GCC=$lt_save_GCC
6727f29dbc25Smrg  CC="$lt_save_CC"
6728f29dbc25Smrgfi # test "$_lt_disable_F77" != yes
6729f29dbc25Smrg
6730f29dbc25SmrgAC_LANG_POP
6731f29dbc25Smrg])# _LT_LANG_F77_CONFIG
6732f29dbc25Smrg
6733f29dbc25Smrg
6734f29dbc25Smrg# _LT_PROG_FC
6735f29dbc25Smrg# -----------
6736f29dbc25Smrg# Since AC_PROG_FC is broken, in that it returns the empty string
6737f29dbc25Smrg# if there is no fortran compiler, we have our own version here.
6738f29dbc25Smrgm4_defun([_LT_PROG_FC],
6739f29dbc25Smrg[
6740f29dbc25Smrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6741f29dbc25SmrgAC_PROG_FC
6742f29dbc25Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
6743f29dbc25Smrg  _lt_disable_FC=yes
6744f29dbc25Smrgfi
6745f29dbc25Smrgpopdef([AC_MSG_ERROR])
6746f29dbc25Smrg])# _LT_PROG_FC
6747f29dbc25Smrg
6748f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
6749f29dbc25Smrgdnl AC_DEFUN([_LT_PROG_FC], [])
6750f29dbc25Smrg
6751f29dbc25Smrg
6752f29dbc25Smrg# _LT_LANG_FC_CONFIG([TAG])
6753f29dbc25Smrg# -------------------------
6754f29dbc25Smrg# Ensure that the configuration variables for a Fortran compiler are
6755f29dbc25Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6756f29dbc25Smrg# to write the compiler configuration to `libtool'.
6757f29dbc25Smrgm4_defun([_LT_LANG_FC_CONFIG],
6758f29dbc25Smrg[AC_REQUIRE([_LT_PROG_FC])dnl
6759f29dbc25SmrgAC_LANG_PUSH(Fortran)
6760f29dbc25Smrg
6761f29dbc25Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6762f29dbc25Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
6763f29dbc25Smrg_LT_TAGVAR(always_export_symbols, $1)=no
6764f29dbc25Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6765f29dbc25Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6766f29dbc25Smrg_LT_TAGVAR(hardcode_direct, $1)=no
6767f29dbc25Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6768f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6769f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6770f29dbc25Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6771f29dbc25Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6772f29dbc25Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
6773f29dbc25Smrg_LT_TAGVAR(inherit_rpath, $1)=no
6774f29dbc25Smrg_LT_TAGVAR(module_cmds, $1)=
6775f29dbc25Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
6776f29dbc25Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6777f29dbc25Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6778f29dbc25Smrg_LT_TAGVAR(no_undefined_flag, $1)=
6779f29dbc25Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6780f29dbc25Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6781f29dbc25Smrg
6782f29dbc25Smrg# Source file extension for fc test sources.
6783f29dbc25Smrgac_ext=${ac_fc_srcext-f}
6784f29dbc25Smrg
6785f29dbc25Smrg# Object file extension for compiled fc test sources.
6786f29dbc25Smrgobjext=o
6787f29dbc25Smrg_LT_TAGVAR(objext, $1)=$objext
6788f29dbc25Smrg
6789f29dbc25Smrg# No sense in running all these tests if we already determined that
6790f29dbc25Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
6791f29dbc25Smrg# are currently assumed to apply to all compilers on this platform,
6792f29dbc25Smrg# and will be corrupted by setting them based on a non-working compiler.
6793f29dbc25Smrgif test "$_lt_disable_FC" != yes; then
6794f29dbc25Smrg  # Code to be used in simple compile tests
6795f29dbc25Smrg  lt_simple_compile_test_code="\
6796f29dbc25Smrg      subroutine t
6797f29dbc25Smrg      return
6798f29dbc25Smrg      end
6799f29dbc25Smrg"
6800f29dbc25Smrg
6801f29dbc25Smrg  # Code to be used in simple link tests
6802f29dbc25Smrg  lt_simple_link_test_code="\
6803f29dbc25Smrg      program t
6804f29dbc25Smrg      end
6805f29dbc25Smrg"
6806f29dbc25Smrg
6807f29dbc25Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6808f29dbc25Smrg  _LT_TAG_COMPILER
6809f29dbc25Smrg
6810f29dbc25Smrg  # save warnings/boilerplate of simple test code
6811f29dbc25Smrg  _LT_COMPILER_BOILERPLATE
6812f29dbc25Smrg  _LT_LINKER_BOILERPLATE
6813f29dbc25Smrg
6814f29dbc25Smrg  # Allow CC to be a program name with arguments.
6815f29dbc25Smrg  lt_save_CC="$CC"
6816f29dbc25Smrg  lt_save_GCC=$GCC
6817f29dbc25Smrg  CC=${FC-"f95"}
6818f29dbc25Smrg  compiler=$CC
6819f29dbc25Smrg  GCC=$ac_cv_fc_compiler_gnu
6820f29dbc25Smrg
6821f29dbc25Smrg  _LT_TAGVAR(compiler, $1)=$CC
6822f29dbc25Smrg  _LT_CC_BASENAME([$compiler])
6823f29dbc25Smrg
6824f29dbc25Smrg  if test -n "$compiler"; then
6825f29dbc25Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6826f29dbc25Smrg    AC_MSG_RESULT([$can_build_shared])
6827f29dbc25Smrg
6828f29dbc25Smrg    AC_MSG_CHECKING([whether to build shared libraries])
6829f29dbc25Smrg    test "$can_build_shared" = "no" && enable_shared=no
6830f29dbc25Smrg
6831f29dbc25Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
6832f29dbc25Smrg    # are all built from PIC.
6833f29dbc25Smrg    case $host_os in
6834f29dbc25Smrg      aix3*)
6835f29dbc25Smrg        test "$enable_shared" = yes && enable_static=no
6836f29dbc25Smrg        if test -n "$RANLIB"; then
6837f29dbc25Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6838f29dbc25Smrg          postinstall_cmds='$RANLIB $lib'
6839f29dbc25Smrg        fi
6840f29dbc25Smrg        ;;
6841f29dbc25Smrg      aix[[4-9]]*)
6842f29dbc25Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6843f29dbc25Smrg	  test "$enable_shared" = yes && enable_static=no
6844f29dbc25Smrg	fi
6845f29dbc25Smrg        ;;
6846f29dbc25Smrg    esac
6847f29dbc25Smrg    AC_MSG_RESULT([$enable_shared])
6848f29dbc25Smrg
6849f29dbc25Smrg    AC_MSG_CHECKING([whether to build static libraries])
6850f29dbc25Smrg    # Make sure either enable_shared or enable_static is yes.
6851f29dbc25Smrg    test "$enable_shared" = yes || enable_static=yes
6852f29dbc25Smrg    AC_MSG_RESULT([$enable_static])
6853f29dbc25Smrg
6854f29dbc25Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6855f29dbc25Smrg    _LT_TAGVAR(LD, $1)="$LD"
6856f29dbc25Smrg
6857f29dbc25Smrg    ## CAVEAT EMPTOR:
6858f29dbc25Smrg    ## There is no encapsulation within the following macros, do not change
6859f29dbc25Smrg    ## the running order or otherwise move them around unless you know exactly
6860f29dbc25Smrg    ## what you are doing...
6861f29dbc25Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6862f29dbc25Smrg    _LT_COMPILER_PIC($1)
6863f29dbc25Smrg    _LT_COMPILER_C_O($1)
6864f29dbc25Smrg    _LT_COMPILER_FILE_LOCKS($1)
6865f29dbc25Smrg    _LT_LINKER_SHLIBS($1)
6866f29dbc25Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6867f29dbc25Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6868f29dbc25Smrg
6869f29dbc25Smrg    _LT_CONFIG($1)
6870f29dbc25Smrg  fi # test -n "$compiler"
6871f29dbc25Smrg
6872f29dbc25Smrg  GCC=$lt_save_GCC
6873f29dbc25Smrg  CC="$lt_save_CC"
6874f29dbc25Smrgfi # test "$_lt_disable_FC" != yes
6875f29dbc25Smrg
6876f29dbc25SmrgAC_LANG_POP
6877f29dbc25Smrg])# _LT_LANG_FC_CONFIG
6878f29dbc25Smrg
6879f29dbc25Smrg
6880f29dbc25Smrg# _LT_LANG_GCJ_CONFIG([TAG])
6881f29dbc25Smrg# --------------------------
6882f29dbc25Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
6883f29dbc25Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6884f29dbc25Smrg# to write the compiler configuration to `libtool'.
6885f29dbc25Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
6886f29dbc25Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
6887f29dbc25SmrgAC_LANG_SAVE
6888f29dbc25Smrg
6889f29dbc25Smrg# Source file extension for Java test sources.
6890f29dbc25Smrgac_ext=java
6891f29dbc25Smrg
6892f29dbc25Smrg# Object file extension for compiled Java test sources.
6893f29dbc25Smrgobjext=o
6894f29dbc25Smrg_LT_TAGVAR(objext, $1)=$objext
6895f29dbc25Smrg
6896f29dbc25Smrg# Code to be used in simple compile tests
6897f29dbc25Smrglt_simple_compile_test_code="class foo {}"
6898f29dbc25Smrg
6899f29dbc25Smrg# Code to be used in simple link tests
6900f29dbc25Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
6901f29dbc25Smrg
6902f29dbc25Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6903f29dbc25Smrg_LT_TAG_COMPILER
6904f29dbc25Smrg
6905f29dbc25Smrg# save warnings/boilerplate of simple test code
6906f29dbc25Smrg_LT_COMPILER_BOILERPLATE
6907f29dbc25Smrg_LT_LINKER_BOILERPLATE
6908f29dbc25Smrg
6909f29dbc25Smrg# Allow CC to be a program name with arguments.
6910f29dbc25Smrglt_save_CC="$CC"
6911f29dbc25Smrglt_save_GCC=$GCC
6912f29dbc25SmrgGCC=yes
6913f29dbc25SmrgCC=${GCJ-"gcj"}
6914f29dbc25Smrgcompiler=$CC
6915f29dbc25Smrg_LT_TAGVAR(compiler, $1)=$CC
6916f29dbc25Smrg_LT_TAGVAR(LD, $1)="$LD"
6917f29dbc25Smrg_LT_CC_BASENAME([$compiler])
6918f29dbc25Smrg
6919f29dbc25Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6920f29dbc25Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6921f29dbc25Smrg
6922f29dbc25Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6923f29dbc25Smrg
6924f29dbc25Smrgif test -n "$compiler"; then
6925f29dbc25Smrg  _LT_COMPILER_NO_RTTI($1)
6926f29dbc25Smrg  _LT_COMPILER_PIC($1)
6927f29dbc25Smrg  _LT_COMPILER_C_O($1)
6928f29dbc25Smrg  _LT_COMPILER_FILE_LOCKS($1)
6929f29dbc25Smrg  _LT_LINKER_SHLIBS($1)
6930f29dbc25Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6931f29dbc25Smrg
6932f29dbc25Smrg  _LT_CONFIG($1)
6933f29dbc25Smrgfi
6934f29dbc25Smrg
6935f29dbc25SmrgAC_LANG_RESTORE
6936f29dbc25Smrg
6937f29dbc25SmrgGCC=$lt_save_GCC
6938f29dbc25SmrgCC="$lt_save_CC"
6939f29dbc25Smrg])# _LT_LANG_GCJ_CONFIG
6940f29dbc25Smrg
6941f29dbc25Smrg
6942f29dbc25Smrg# _LT_LANG_RC_CONFIG([TAG])
6943f29dbc25Smrg# -------------------------
6944f29dbc25Smrg# Ensure that the configuration variables for the Windows resource compiler
6945f29dbc25Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6946f29dbc25Smrg# to write the compiler configuration to `libtool'.
6947f29dbc25Smrgm4_defun([_LT_LANG_RC_CONFIG],
6948f29dbc25Smrg[AC_REQUIRE([LT_PROG_RC])dnl
6949f29dbc25SmrgAC_LANG_SAVE
6950f29dbc25Smrg
6951f29dbc25Smrg# Source file extension for RC test sources.
6952f29dbc25Smrgac_ext=rc
6953f29dbc25Smrg
6954f29dbc25Smrg# Object file extension for compiled RC test sources.
6955f29dbc25Smrgobjext=o
6956f29dbc25Smrg_LT_TAGVAR(objext, $1)=$objext
6957f29dbc25Smrg
6958f29dbc25Smrg# Code to be used in simple compile tests
6959f29dbc25Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6960f29dbc25Smrg
6961f29dbc25Smrg# Code to be used in simple link tests
6962f29dbc25Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
6963f29dbc25Smrg
6964f29dbc25Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6965f29dbc25Smrg_LT_TAG_COMPILER
6966f29dbc25Smrg
6967f29dbc25Smrg# save warnings/boilerplate of simple test code
6968f29dbc25Smrg_LT_COMPILER_BOILERPLATE
6969f29dbc25Smrg_LT_LINKER_BOILERPLATE
6970f29dbc25Smrg
6971f29dbc25Smrg# Allow CC to be a program name with arguments.
6972f29dbc25Smrglt_save_CC="$CC"
6973f29dbc25Smrglt_save_GCC=$GCC
6974f29dbc25SmrgGCC=
6975f29dbc25SmrgCC=${RC-"windres"}
6976f29dbc25Smrgcompiler=$CC
6977f29dbc25Smrg_LT_TAGVAR(compiler, $1)=$CC
6978f29dbc25Smrg_LT_CC_BASENAME([$compiler])
6979f29dbc25Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6980f29dbc25Smrg
6981f29dbc25Smrgif test -n "$compiler"; then
6982f29dbc25Smrg  :
6983f29dbc25Smrg  _LT_CONFIG($1)
6984f29dbc25Smrgfi
6985f29dbc25Smrg
6986f29dbc25SmrgGCC=$lt_save_GCC
6987f29dbc25SmrgAC_LANG_RESTORE
6988f29dbc25SmrgCC="$lt_save_CC"
6989f29dbc25Smrg])# _LT_LANG_RC_CONFIG
6990f29dbc25Smrg
6991f29dbc25Smrg
6992f29dbc25Smrg# LT_PROG_GCJ
6993f29dbc25Smrg# -----------
6994f29dbc25SmrgAC_DEFUN([LT_PROG_GCJ],
6995f29dbc25Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6996f29dbc25Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6997f29dbc25Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
6998f29dbc25Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6999f29dbc25Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
7000f29dbc25Smrg])
7001f29dbc25Smrg
7002f29dbc25Smrg# Old name:
7003f29dbc25SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7004f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7005f29dbc25Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7006f29dbc25Smrg
7007f29dbc25Smrg
7008f29dbc25Smrg# LT_PROG_RC
7009f29dbc25Smrg# ----------
7010f29dbc25SmrgAC_DEFUN([LT_PROG_RC],
7011f29dbc25Smrg[AC_CHECK_TOOL(RC, windres,)
7012f29dbc25Smrg])
7013f29dbc25Smrg
7014f29dbc25Smrg# Old name:
7015f29dbc25SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7016f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7017f29dbc25Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7018f29dbc25Smrg
7019f29dbc25Smrg
7020f29dbc25Smrg# _LT_DECL_EGREP
7021f29dbc25Smrg# --------------
7022f29dbc25Smrg# If we don't have a new enough Autoconf to choose the best grep
7023f29dbc25Smrg# available, choose the one first in the user's PATH.
7024f29dbc25Smrgm4_defun([_LT_DECL_EGREP],
7025f29dbc25Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7026f29dbc25SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7027f29dbc25Smrgtest -z "$GREP" && GREP=grep
7028f29dbc25Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7029f29dbc25Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7030f29dbc25Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7031f29dbc25Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7032f29dbc25SmrgAC_SUBST([GREP])
7033f29dbc25Smrg])
7034f29dbc25Smrg
7035f29dbc25Smrg
7036f29dbc25Smrg# _LT_DECL_OBJDUMP
7037f29dbc25Smrg# --------------
7038f29dbc25Smrg# If we don't have a new enough Autoconf to choose the best objdump
7039f29dbc25Smrg# available, choose the one first in the user's PATH.
7040f29dbc25Smrgm4_defun([_LT_DECL_OBJDUMP],
7041f29dbc25Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7042f29dbc25Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7043f29dbc25Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7044f29dbc25SmrgAC_SUBST([OBJDUMP])
7045f29dbc25Smrg])
7046f29dbc25Smrg
7047f29dbc25Smrg
7048f29dbc25Smrg# _LT_DECL_SED
7049f29dbc25Smrg# ------------
7050f29dbc25Smrg# Check for a fully-functional sed program, that truncates
7051f29dbc25Smrg# as few characters as possible.  Prefer GNU sed if found.
7052f29dbc25Smrgm4_defun([_LT_DECL_SED],
7053f29dbc25Smrg[AC_PROG_SED
7054f29dbc25Smrgtest -z "$SED" && SED=sed
7055f29dbc25SmrgXsed="$SED -e 1s/^X//"
7056f29dbc25Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7057f29dbc25Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7058f29dbc25Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7059f29dbc25Smrg])# _LT_DECL_SED
7060f29dbc25Smrg
7061f29dbc25Smrgm4_ifndef([AC_PROG_SED], [
7062f29dbc25Smrg# NOTE: This macro has been submitted for inclusion into   #
7063f29dbc25Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7064f29dbc25Smrg#  a released version of Autoconf we should remove this    #
7065f29dbc25Smrg#  macro and use it instead.                               #
7066f29dbc25Smrg
7067f29dbc25Smrgm4_defun([AC_PROG_SED],
7068f29dbc25Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7069f29dbc25SmrgAC_CACHE_VAL(lt_cv_path_SED,
7070f29dbc25Smrg[# Loop through the user's path and test for sed and gsed.
7071f29dbc25Smrg# Then use that list of sed's as ones to test for truncation.
7072f29dbc25Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7073f29dbc25Smrgfor as_dir in $PATH
7074f29dbc25Smrgdo
7075f29dbc25Smrg  IFS=$as_save_IFS
7076f29dbc25Smrg  test -z "$as_dir" && as_dir=.
7077f29dbc25Smrg  for lt_ac_prog in sed gsed; do
7078f29dbc25Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7079f29dbc25Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7080f29dbc25Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7081f29dbc25Smrg      fi
7082f29dbc25Smrg    done
7083f29dbc25Smrg  done
7084f29dbc25Smrgdone
7085f29dbc25SmrgIFS=$as_save_IFS
7086f29dbc25Smrglt_ac_max=0
7087f29dbc25Smrglt_ac_count=0
7088f29dbc25Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7089f29dbc25Smrg# along with /bin/sed that truncates output.
7090f29dbc25Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7091f29dbc25Smrg  test ! -f $lt_ac_sed && continue
7092f29dbc25Smrg  cat /dev/null > conftest.in
7093f29dbc25Smrg  lt_ac_count=0
7094f29dbc25Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7095f29dbc25Smrg  # Check for GNU sed and select it if it is found.
7096f29dbc25Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7097f29dbc25Smrg    lt_cv_path_SED=$lt_ac_sed
7098f29dbc25Smrg    break
7099f29dbc25Smrg  fi
7100f29dbc25Smrg  while true; do
7101f29dbc25Smrg    cat conftest.in conftest.in >conftest.tmp
7102f29dbc25Smrg    mv conftest.tmp conftest.in
7103f29dbc25Smrg    cp conftest.in conftest.nl
7104f29dbc25Smrg    echo >>conftest.nl
7105f29dbc25Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7106f29dbc25Smrg    cmp -s conftest.out conftest.nl || break
7107f29dbc25Smrg    # 10000 chars as input seems more than enough
7108f29dbc25Smrg    test $lt_ac_count -gt 10 && break
7109f29dbc25Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7110f29dbc25Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7111f29dbc25Smrg      lt_ac_max=$lt_ac_count
7112f29dbc25Smrg      lt_cv_path_SED=$lt_ac_sed
7113f29dbc25Smrg    fi
7114f29dbc25Smrg  done
7115f29dbc25Smrgdone
7116f29dbc25Smrg])
7117f29dbc25SmrgSED=$lt_cv_path_SED
7118f29dbc25SmrgAC_SUBST([SED])
7119f29dbc25SmrgAC_MSG_RESULT([$SED])
7120f29dbc25Smrg])#AC_PROG_SED
7121f29dbc25Smrg])#m4_ifndef
7122f29dbc25Smrg
7123f29dbc25Smrg# Old name:
7124f29dbc25SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7125f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7126f29dbc25Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7127f29dbc25Smrg
7128f29dbc25Smrg
7129f29dbc25Smrg# _LT_CHECK_SHELL_FEATURES
7130f29dbc25Smrg# ------------------------
7131f29dbc25Smrg# Find out whether the shell is Bourne or XSI compatible,
7132f29dbc25Smrg# or has some other useful features.
7133f29dbc25Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7134f29dbc25Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7135f29dbc25Smrg# Try some XSI features
7136f29dbc25Smrgxsi_shell=no
7137f29dbc25Smrg( _lt_dummy="a/b/c"
7138f29dbc25Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7139f29dbc25Smrg      = c,a/b,, \
7140f29dbc25Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7141f29dbc25Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7142f29dbc25Smrg  && xsi_shell=yes
7143f29dbc25SmrgAC_MSG_RESULT([$xsi_shell])
7144f29dbc25Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7145f29dbc25Smrg
7146f29dbc25SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7147f29dbc25Smrglt_shell_append=no
7148f29dbc25Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7149f29dbc25Smrg    >/dev/null 2>&1 \
7150f29dbc25Smrg  && lt_shell_append=yes
7151f29dbc25SmrgAC_MSG_RESULT([$lt_shell_append])
7152f29dbc25Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7153f29dbc25Smrg
7154f29dbc25Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7155f29dbc25Smrg  lt_unset=unset
7156f29dbc25Smrgelse
7157f29dbc25Smrg  lt_unset=false
7158f29dbc25Smrgfi
7159f29dbc25Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7160f29dbc25Smrg
7161f29dbc25Smrg# test EBCDIC or ASCII
7162f29dbc25Smrgcase `echo X|tr X '\101'` in
7163f29dbc25Smrg A) # ASCII based system
7164f29dbc25Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7165f29dbc25Smrg  lt_SP2NL='tr \040 \012'
7166f29dbc25Smrg  lt_NL2SP='tr \015\012 \040\040'
7167f29dbc25Smrg  ;;
7168f29dbc25Smrg *) # EBCDIC based system
7169f29dbc25Smrg  lt_SP2NL='tr \100 \n'
7170f29dbc25Smrg  lt_NL2SP='tr \r\n \100\100'
7171f29dbc25Smrg  ;;
7172f29dbc25Smrgesac
7173f29dbc25Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7174f29dbc25Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7175f29dbc25Smrg])# _LT_CHECK_SHELL_FEATURES
7176f29dbc25Smrg
7177f29dbc25Smrg
7178f29dbc25Smrg# _LT_PROG_XSI_SHELLFNS
7179f29dbc25Smrg# ---------------------
7180f29dbc25Smrg# Bourne and XSI compatible variants of some useful shell functions.
7181f29dbc25Smrgm4_defun([_LT_PROG_XSI_SHELLFNS],
7182f29dbc25Smrg[case $xsi_shell in
7183f29dbc25Smrg  yes)
7184f29dbc25Smrg    cat << \_LT_EOF >> "$cfgfile"
7185f29dbc25Smrg
7186f29dbc25Smrg# func_dirname file append nondir_replacement
7187f29dbc25Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7188f29dbc25Smrg# otherwise set result to NONDIR_REPLACEMENT.
7189f29dbc25Smrgfunc_dirname ()
7190f29dbc25Smrg{
7191f29dbc25Smrg  case ${1} in
7192f29dbc25Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7193f29dbc25Smrg    *  ) func_dirname_result="${3}" ;;
7194f29dbc25Smrg  esac
7195f29dbc25Smrg}
7196f29dbc25Smrg
7197f29dbc25Smrg# func_basename file
7198f29dbc25Smrgfunc_basename ()
7199f29dbc25Smrg{
7200f29dbc25Smrg  func_basename_result="${1##*/}"
7201f29dbc25Smrg}
7202f29dbc25Smrg
7203f29dbc25Smrg# func_dirname_and_basename file append nondir_replacement
7204f29dbc25Smrg# perform func_basename and func_dirname in a single function
7205f29dbc25Smrg# call:
7206f29dbc25Smrg#   dirname:  Compute the dirname of FILE.  If nonempty,
7207f29dbc25Smrg#             add APPEND to the result, otherwise set result
7208f29dbc25Smrg#             to NONDIR_REPLACEMENT.
7209f29dbc25Smrg#             value returned in "$func_dirname_result"
7210f29dbc25Smrg#   basename: Compute filename of FILE.
7211f29dbc25Smrg#             value retuned in "$func_basename_result"
7212f29dbc25Smrg# Implementation must be kept synchronized with func_dirname
7213f29dbc25Smrg# and func_basename. For efficiency, we do not delegate to
7214f29dbc25Smrg# those functions but instead duplicate the functionality here.
7215f29dbc25Smrgfunc_dirname_and_basename ()
7216f29dbc25Smrg{
7217f29dbc25Smrg  case ${1} in
7218f29dbc25Smrg    */*) func_dirname_result="${1%/*}${2}" ;;
7219f29dbc25Smrg    *  ) func_dirname_result="${3}" ;;
7220f29dbc25Smrg  esac
7221f29dbc25Smrg  func_basename_result="${1##*/}"
7222f29dbc25Smrg}
7223f29dbc25Smrg
7224f29dbc25Smrg# func_stripname prefix suffix name
7225f29dbc25Smrg# strip PREFIX and SUFFIX off of NAME.
7226f29dbc25Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7227f29dbc25Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7228f29dbc25Smrg# dot (in which case that matches only a dot).
7229f29dbc25Smrgfunc_stripname ()
7230f29dbc25Smrg{
7231f29dbc25Smrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7232f29dbc25Smrg  # positional parameters, so assign one to ordinary parameter first.
7233f29dbc25Smrg  func_stripname_result=${3}
7234f29dbc25Smrg  func_stripname_result=${func_stripname_result#"${1}"}
7235f29dbc25Smrg  func_stripname_result=${func_stripname_result%"${2}"}
7236f29dbc25Smrg}
7237f29dbc25Smrg
7238f29dbc25Smrg# func_opt_split
7239f29dbc25Smrgfunc_opt_split ()
7240f29dbc25Smrg{
7241f29dbc25Smrg  func_opt_split_opt=${1%%=*}
7242f29dbc25Smrg  func_opt_split_arg=${1#*=}
7243f29dbc25Smrg}
7244f29dbc25Smrg
7245f29dbc25Smrg# func_lo2o object
7246f29dbc25Smrgfunc_lo2o ()
7247f29dbc25Smrg{
7248f29dbc25Smrg  case ${1} in
7249f29dbc25Smrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7250f29dbc25Smrg    *)    func_lo2o_result=${1} ;;
7251f29dbc25Smrg  esac
7252f29dbc25Smrg}
7253f29dbc25Smrg
7254f29dbc25Smrg# func_xform libobj-or-source
7255f29dbc25Smrgfunc_xform ()
7256f29dbc25Smrg{
7257f29dbc25Smrg  func_xform_result=${1%.*}.lo
7258f29dbc25Smrg}
7259f29dbc25Smrg
7260f29dbc25Smrg# func_arith arithmetic-term...
7261f29dbc25Smrgfunc_arith ()
7262f29dbc25Smrg{
7263f29dbc25Smrg  func_arith_result=$(( $[*] ))
7264f29dbc25Smrg}
7265f29dbc25Smrg
7266f29dbc25Smrg# func_len string
7267f29dbc25Smrg# STRING may not start with a hyphen.
7268f29dbc25Smrgfunc_len ()
7269f29dbc25Smrg{
7270f29dbc25Smrg  func_len_result=${#1}
7271f29dbc25Smrg}
7272f29dbc25Smrg
7273f29dbc25Smrg_LT_EOF
7274f29dbc25Smrg    ;;
7275f29dbc25Smrg  *) # Bourne compatible functions.
7276f29dbc25Smrg    cat << \_LT_EOF >> "$cfgfile"
7277f29dbc25Smrg
7278f29dbc25Smrg# func_dirname file append nondir_replacement
7279f29dbc25Smrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7280f29dbc25Smrg# otherwise set result to NONDIR_REPLACEMENT.
7281f29dbc25Smrgfunc_dirname ()
7282f29dbc25Smrg{
7283f29dbc25Smrg  # Extract subdirectory from the argument.
7284f29dbc25Smrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7285f29dbc25Smrg  if test "X$func_dirname_result" = "X${1}"; then
7286f29dbc25Smrg    func_dirname_result="${3}"
7287f29dbc25Smrg  else
7288f29dbc25Smrg    func_dirname_result="$func_dirname_result${2}"
7289f29dbc25Smrg  fi
7290f29dbc25Smrg}
7291f29dbc25Smrg
7292f29dbc25Smrg# func_basename file
7293f29dbc25Smrgfunc_basename ()
7294f29dbc25Smrg{
7295f29dbc25Smrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7296f29dbc25Smrg}
7297f29dbc25Smrg
7298f29dbc25Smrgdnl func_dirname_and_basename
7299f29dbc25Smrgdnl A portable version of this function is already defined in general.m4sh
7300f29dbc25Smrgdnl so there is no need for it here.
7301f29dbc25Smrg
7302f29dbc25Smrg# func_stripname prefix suffix name
7303f29dbc25Smrg# strip PREFIX and SUFFIX off of NAME.
7304f29dbc25Smrg# PREFIX and SUFFIX must not contain globbing or regex special
7305f29dbc25Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7306f29dbc25Smrg# dot (in which case that matches only a dot).
7307f29dbc25Smrg# func_strip_suffix prefix name
7308f29dbc25Smrgfunc_stripname ()
7309f29dbc25Smrg{
7310f29dbc25Smrg  case ${2} in
7311f29dbc25Smrg    .*) func_stripname_result=`$ECHO "X${3}" \
7312f29dbc25Smrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7313f29dbc25Smrg    *)  func_stripname_result=`$ECHO "X${3}" \
7314f29dbc25Smrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7315f29dbc25Smrg  esac
7316f29dbc25Smrg}
7317f29dbc25Smrg
7318f29dbc25Smrg# sed scripts:
7319f29dbc25Smrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7320f29dbc25Smrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7321f29dbc25Smrg
7322f29dbc25Smrg# func_opt_split
7323f29dbc25Smrgfunc_opt_split ()
7324f29dbc25Smrg{
7325f29dbc25Smrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7326f29dbc25Smrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7327f29dbc25Smrg}
7328f29dbc25Smrg
7329f29dbc25Smrg# func_lo2o object
7330f29dbc25Smrgfunc_lo2o ()
7331f29dbc25Smrg{
7332f29dbc25Smrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7333f29dbc25Smrg}
7334f29dbc25Smrg
7335f29dbc25Smrg# func_xform libobj-or-source
7336f29dbc25Smrgfunc_xform ()
7337f29dbc25Smrg{
7338f29dbc25Smrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7339f29dbc25Smrg}
7340f29dbc25Smrg
7341f29dbc25Smrg# func_arith arithmetic-term...
7342f29dbc25Smrgfunc_arith ()
7343f29dbc25Smrg{
7344f29dbc25Smrg  func_arith_result=`expr "$[@]"`
7345f29dbc25Smrg}
7346f29dbc25Smrg
7347f29dbc25Smrg# func_len string
7348f29dbc25Smrg# STRING may not start with a hyphen.
7349f29dbc25Smrgfunc_len ()
7350f29dbc25Smrg{
7351f29dbc25Smrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7352f29dbc25Smrg}
7353f29dbc25Smrg
7354f29dbc25Smrg_LT_EOF
7355f29dbc25Smrgesac
7356f29dbc25Smrg
7357f29dbc25Smrgcase $lt_shell_append in
7358f29dbc25Smrg  yes)
7359f29dbc25Smrg    cat << \_LT_EOF >> "$cfgfile"
7360f29dbc25Smrg
7361f29dbc25Smrg# func_append var value
7362f29dbc25Smrg# Append VALUE to the end of shell variable VAR.
7363f29dbc25Smrgfunc_append ()
7364f29dbc25Smrg{
7365f29dbc25Smrg  eval "$[1]+=\$[2]"
7366f29dbc25Smrg}
7367f29dbc25Smrg_LT_EOF
7368f29dbc25Smrg    ;;
7369f29dbc25Smrg  *)
7370f29dbc25Smrg    cat << \_LT_EOF >> "$cfgfile"
7371f29dbc25Smrg
7372f29dbc25Smrg# func_append var value
7373f29dbc25Smrg# Append VALUE to the end of shell variable VAR.
7374f29dbc25Smrgfunc_append ()
7375f29dbc25Smrg{
7376f29dbc25Smrg  eval "$[1]=\$$[1]\$[2]"
7377f29dbc25Smrg}
7378f29dbc25Smrg
7379f29dbc25Smrg_LT_EOF
7380f29dbc25Smrg    ;;
7381f29dbc25Smrg  esac
7382f29dbc25Smrg])
7383f29dbc25Smrg
7384f29dbc25Smrg# Helper functions for option handling.                    -*- Autoconf -*-
7385f29dbc25Smrg#
7386f29dbc25Smrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7387f29dbc25Smrg#   Written by Gary V. Vaughan, 2004
7388f29dbc25Smrg#
7389f29dbc25Smrg# This file is free software; the Free Software Foundation gives
7390f29dbc25Smrg# unlimited permission to copy and/or distribute it, with or without
7391f29dbc25Smrg# modifications, as long as this notice is preserved.
7392f29dbc25Smrg
7393f29dbc25Smrg# serial 6 ltoptions.m4
7394f29dbc25Smrg
7395f29dbc25Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7396f29dbc25SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7397f29dbc25Smrg
7398f29dbc25Smrg
7399f29dbc25Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7400f29dbc25Smrg# ------------------------------------------
7401f29dbc25Smrgm4_define([_LT_MANGLE_OPTION],
7402f29dbc25Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7403f29dbc25Smrg
7404f29dbc25Smrg
7405f29dbc25Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7406f29dbc25Smrg# ---------------------------------------
7407f29dbc25Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7408f29dbc25Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
7409f29dbc25Smrg# saved as a flag.
7410f29dbc25Smrgm4_define([_LT_SET_OPTION],
7411f29dbc25Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7412f29dbc25Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7413f29dbc25Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
7414f29dbc25Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
7415f29dbc25Smrg])
7416f29dbc25Smrg
7417f29dbc25Smrg
7418f29dbc25Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7419f29dbc25Smrg# ------------------------------------------------------------
7420f29dbc25Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7421f29dbc25Smrgm4_define([_LT_IF_OPTION],
7422f29dbc25Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7423f29dbc25Smrg
7424f29dbc25Smrg
7425f29dbc25Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7426f29dbc25Smrg# -------------------------------------------------------
7427f29dbc25Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7428f29dbc25Smrg# are set.
7429f29dbc25Smrgm4_define([_LT_UNLESS_OPTIONS],
7430f29dbc25Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7431f29dbc25Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7432f29dbc25Smrg		      [m4_define([$0_found])])])[]dnl
7433f29dbc25Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7434f29dbc25Smrg])[]dnl
7435f29dbc25Smrg])
7436f29dbc25Smrg
7437f29dbc25Smrg
7438f29dbc25Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7439f29dbc25Smrg# ----------------------------------------
7440f29dbc25Smrg# OPTION-LIST is a space-separated list of Libtool options associated
7441f29dbc25Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
7442f29dbc25Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7443f29dbc25Smrg# the unknown option and exit.
7444f29dbc25Smrgm4_defun([_LT_SET_OPTIONS],
7445f29dbc25Smrg[# Set options
7446f29dbc25Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7447f29dbc25Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
7448f29dbc25Smrg
7449f29dbc25Smrgm4_if([$1],[LT_INIT],[
7450f29dbc25Smrg  dnl
7451f29dbc25Smrg  dnl Simply set some default values (i.e off) if boolean options were not
7452f29dbc25Smrg  dnl specified:
7453f29dbc25Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7454f29dbc25Smrg  ])
7455f29dbc25Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7456f29dbc25Smrg  ])
7457f29dbc25Smrg  dnl
7458f29dbc25Smrg  dnl If no reference was made to various pairs of opposing options, then
7459f29dbc25Smrg  dnl we run the default mode handler for the pair.  For example, if neither
7460f29dbc25Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
7461f29dbc25Smrg  dnl archives by default:
7462f29dbc25Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7463f29dbc25Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7464f29dbc25Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7465f29dbc25Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7466f29dbc25Smrg  		   [_LT_ENABLE_FAST_INSTALL])
7467f29dbc25Smrg  ])
7468f29dbc25Smrg])# _LT_SET_OPTIONS
7469f29dbc25Smrg
7470f29dbc25Smrg
7471f29dbc25Smrg
7472f29dbc25Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7473f29dbc25Smrg# -----------------------------------------
7474f29dbc25Smrgm4_define([_LT_MANGLE_DEFUN],
7475f29dbc25Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7476f29dbc25Smrg
7477f29dbc25Smrg
7478f29dbc25Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7479f29dbc25Smrg# -----------------------------------------------
7480f29dbc25Smrgm4_define([LT_OPTION_DEFINE],
7481f29dbc25Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7482f29dbc25Smrg])# LT_OPTION_DEFINE
7483f29dbc25Smrg
7484f29dbc25Smrg
7485f29dbc25Smrg# dlopen
7486f29dbc25Smrg# ------
7487f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7488f29dbc25Smrg])
7489f29dbc25Smrg
7490f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
7491f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
7492f29dbc25SmrgAC_DIAGNOSE([obsolete],
7493f29dbc25Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7494f29dbc25Smrgput the `dlopen' option into LT_INIT's first parameter.])
7495f29dbc25Smrg])
7496f29dbc25Smrg
7497f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7498f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7499f29dbc25Smrg
7500f29dbc25Smrg
7501f29dbc25Smrg# win32-dll
7502f29dbc25Smrg# ---------
7503f29dbc25Smrg# Declare package support for building win32 dll's.
7504f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
7505f29dbc25Smrg[enable_win32_dll=yes
7506f29dbc25Smrg
7507f29dbc25Smrgcase $host in
7508f29dbc25Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
7509f29dbc25Smrg  AC_CHECK_TOOL(AS, as, false)
7510f29dbc25Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7511f29dbc25Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
7512f29dbc25Smrg  ;;
7513f29dbc25Smrgesac
7514f29dbc25Smrg
7515f29dbc25Smrgtest -z "$AS" && AS=as
7516f29dbc25Smrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
7517f29dbc25Smrg
7518f29dbc25Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7519f29dbc25Smrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7520f29dbc25Smrg
7521f29dbc25Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7522f29dbc25Smrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
7523f29dbc25Smrg])# win32-dll
7524f29dbc25Smrg
7525f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7526f29dbc25Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7527f29dbc25Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
7528f29dbc25SmrgAC_DIAGNOSE([obsolete],
7529f29dbc25Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7530f29dbc25Smrgput the `win32-dll' option into LT_INIT's first parameter.])
7531f29dbc25Smrg])
7532f29dbc25Smrg
7533f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7534f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7535f29dbc25Smrg
7536f29dbc25Smrg
7537f29dbc25Smrg# _LT_ENABLE_SHARED([DEFAULT])
7538f29dbc25Smrg# ----------------------------
7539f29dbc25Smrg# implement the --enable-shared flag, and supports the `shared' and
7540f29dbc25Smrg# `disable-shared' LT_INIT options.
7541f29dbc25Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7542f29dbc25Smrgm4_define([_LT_ENABLE_SHARED],
7543f29dbc25Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
7544f29dbc25SmrgAC_ARG_ENABLE([shared],
7545f29dbc25Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7546f29dbc25Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
7547f29dbc25Smrg    [p=${PACKAGE-default}
7548f29dbc25Smrg    case $enableval in
7549f29dbc25Smrg    yes) enable_shared=yes ;;
7550f29dbc25Smrg    no) enable_shared=no ;;
7551f29dbc25Smrg    *)
7552f29dbc25Smrg      enable_shared=no
7553f29dbc25Smrg      # Look at the argument we got.  We use all the common list separators.
7554f29dbc25Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7555f29dbc25Smrg      for pkg in $enableval; do
7556f29dbc25Smrg	IFS="$lt_save_ifs"
7557f29dbc25Smrg	if test "X$pkg" = "X$p"; then
7558f29dbc25Smrg	  enable_shared=yes
7559f29dbc25Smrg	fi
7560f29dbc25Smrg      done
7561f29dbc25Smrg      IFS="$lt_save_ifs"
7562f29dbc25Smrg      ;;
7563f29dbc25Smrg    esac],
7564f29dbc25Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7565f29dbc25Smrg
7566f29dbc25Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
7567f29dbc25Smrg	[Whether or not to build shared libraries])
7568f29dbc25Smrg])# _LT_ENABLE_SHARED
7569f29dbc25Smrg
7570f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
7571f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
7572f29dbc25Smrg
7573f29dbc25Smrg# Old names:
7574f29dbc25SmrgAC_DEFUN([AC_ENABLE_SHARED],
7575f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
7576f29dbc25Smrg])
7577f29dbc25Smrg
7578f29dbc25SmrgAC_DEFUN([AC_DISABLE_SHARED],
7579f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
7580f29dbc25Smrg])
7581f29dbc25Smrg
7582f29dbc25SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
7583f29dbc25SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7584f29dbc25Smrg
7585f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7586f29dbc25Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
7587f29dbc25Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
7588f29dbc25Smrg
7589f29dbc25Smrg
7590f29dbc25Smrg
7591f29dbc25Smrg# _LT_ENABLE_STATIC([DEFAULT])
7592f29dbc25Smrg# ----------------------------
7593f29dbc25Smrg# implement the --enable-static flag, and support the `static' and
7594f29dbc25Smrg# `disable-static' LT_INIT options.
7595f29dbc25Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7596f29dbc25Smrgm4_define([_LT_ENABLE_STATIC],
7597f29dbc25Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
7598f29dbc25SmrgAC_ARG_ENABLE([static],
7599f29dbc25Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7600f29dbc25Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
7601f29dbc25Smrg    [p=${PACKAGE-default}
7602f29dbc25Smrg    case $enableval in
7603f29dbc25Smrg    yes) enable_static=yes ;;
7604f29dbc25Smrg    no) enable_static=no ;;
7605f29dbc25Smrg    *)
7606f29dbc25Smrg     enable_static=no
7607f29dbc25Smrg      # Look at the argument we got.  We use all the common list separators.
7608f29dbc25Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7609f29dbc25Smrg      for pkg in $enableval; do
7610f29dbc25Smrg	IFS="$lt_save_ifs"
7611f29dbc25Smrg	if test "X$pkg" = "X$p"; then
7612f29dbc25Smrg	  enable_static=yes
7613f29dbc25Smrg	fi
7614f29dbc25Smrg      done
7615f29dbc25Smrg      IFS="$lt_save_ifs"
7616f29dbc25Smrg      ;;
7617f29dbc25Smrg    esac],
7618f29dbc25Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
7619f29dbc25Smrg
7620f29dbc25Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
7621f29dbc25Smrg	[Whether or not to build static libraries])
7622f29dbc25Smrg])# _LT_ENABLE_STATIC
7623f29dbc25Smrg
7624f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
7625f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
7626f29dbc25Smrg
7627f29dbc25Smrg# Old names:
7628f29dbc25SmrgAC_DEFUN([AC_ENABLE_STATIC],
7629f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7630f29dbc25Smrg])
7631f29dbc25Smrg
7632f29dbc25SmrgAC_DEFUN([AC_DISABLE_STATIC],
7633f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
7634f29dbc25Smrg])
7635f29dbc25Smrg
7636f29dbc25SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
7637f29dbc25SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7638f29dbc25Smrg
7639f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7640f29dbc25Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
7641f29dbc25Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
7642f29dbc25Smrg
7643f29dbc25Smrg
7644f29dbc25Smrg
7645f29dbc25Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
7646f29dbc25Smrg# ----------------------------------
7647f29dbc25Smrg# implement the --enable-fast-install flag, and support the `fast-install'
7648f29dbc25Smrg# and `disable-fast-install' LT_INIT options.
7649f29dbc25Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7650f29dbc25Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
7651f29dbc25Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
7652f29dbc25SmrgAC_ARG_ENABLE([fast-install],
7653f29dbc25Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7654f29dbc25Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7655f29dbc25Smrg    [p=${PACKAGE-default}
7656f29dbc25Smrg    case $enableval in
7657f29dbc25Smrg    yes) enable_fast_install=yes ;;
7658f29dbc25Smrg    no) enable_fast_install=no ;;
7659f29dbc25Smrg    *)
7660f29dbc25Smrg      enable_fast_install=no
7661f29dbc25Smrg      # Look at the argument we got.  We use all the common list separators.
7662f29dbc25Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7663f29dbc25Smrg      for pkg in $enableval; do
7664f29dbc25Smrg	IFS="$lt_save_ifs"
7665f29dbc25Smrg	if test "X$pkg" = "X$p"; then
7666f29dbc25Smrg	  enable_fast_install=yes
7667f29dbc25Smrg	fi
7668f29dbc25Smrg      done
7669f29dbc25Smrg      IFS="$lt_save_ifs"
7670f29dbc25Smrg      ;;
7671f29dbc25Smrg    esac],
7672f29dbc25Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
7673f29dbc25Smrg
7674f29dbc25Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
7675f29dbc25Smrg	 [Whether or not to optimize for fast installation])dnl
7676f29dbc25Smrg])# _LT_ENABLE_FAST_INSTALL
7677f29dbc25Smrg
7678f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
7679f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
7680f29dbc25Smrg
7681f29dbc25Smrg# Old names:
7682f29dbc25SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
7683f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
7684f29dbc25SmrgAC_DIAGNOSE([obsolete],
7685f29dbc25Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7686f29dbc25Smrgthe `fast-install' option into LT_INIT's first parameter.])
7687f29dbc25Smrg])
7688f29dbc25Smrg
7689f29dbc25SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
7690f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
7691f29dbc25SmrgAC_DIAGNOSE([obsolete],
7692f29dbc25Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7693f29dbc25Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
7694f29dbc25Smrg])
7695f29dbc25Smrg
7696f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7697f29dbc25Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
7698f29dbc25Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7699f29dbc25Smrg
7700f29dbc25Smrg
7701f29dbc25Smrg# _LT_WITH_PIC([MODE])
7702f29dbc25Smrg# --------------------
7703f29dbc25Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
7704f29dbc25Smrg# LT_INIT options.
7705f29dbc25Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7706f29dbc25Smrgm4_define([_LT_WITH_PIC],
7707f29dbc25Smrg[AC_ARG_WITH([pic],
7708f29dbc25Smrg    [AS_HELP_STRING([--with-pic],
7709f29dbc25Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
7710f29dbc25Smrg    [pic_mode="$withval"],
7711f29dbc25Smrg    [pic_mode=default])
7712f29dbc25Smrg
7713f29dbc25Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7714f29dbc25Smrg
7715f29dbc25Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
7716f29dbc25Smrg])# _LT_WITH_PIC
7717f29dbc25Smrg
7718f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
7719f29dbc25SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7720f29dbc25Smrg
7721f29dbc25Smrg# Old name:
7722f29dbc25SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
7723f29dbc25Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
7724f29dbc25SmrgAC_DIAGNOSE([obsolete],
7725f29dbc25Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7726f29dbc25Smrgput the `pic-only' option into LT_INIT's first parameter.])
7727f29dbc25Smrg])
7728f29dbc25Smrg
7729f29dbc25Smrgdnl aclocal-1.4 backwards compatibility:
7730f29dbc25Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7731f29dbc25Smrg
7732f29dbc25Smrg
7733f29dbc25Smrgm4_define([_LTDL_MODE], [])
7734f29dbc25SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
7735f29dbc25Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
7736f29dbc25SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
7737f29dbc25Smrg		 [m4_define([_LTDL_MODE], [recursive])])
7738f29dbc25SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
7739f29dbc25Smrg		 [m4_define([_LTDL_MODE], [subproject])])
7740f29dbc25Smrg
7741f29dbc25Smrgm4_define([_LTDL_TYPE], [])
7742f29dbc25SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
7743f29dbc25Smrg		 [m4_define([_LTDL_TYPE], [installable])])
7744f29dbc25SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
7745f29dbc25Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
7746f29dbc25Smrg
7747f29dbc25Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
7748f29dbc25Smrg#
7749f29dbc25Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7750f29dbc25Smrg# Written by Gary V. Vaughan, 2004
7751f29dbc25Smrg#
7752f29dbc25Smrg# This file is free software; the Free Software Foundation gives
7753f29dbc25Smrg# unlimited permission to copy and/or distribute it, with or without
7754f29dbc25Smrg# modifications, as long as this notice is preserved.
7755f29dbc25Smrg
7756f29dbc25Smrg# serial 6 ltsugar.m4
7757f29dbc25Smrg
7758f29dbc25Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7759f29dbc25SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
7760f29dbc25Smrg
7761f29dbc25Smrg
7762f29dbc25Smrg# lt_join(SEP, ARG1, [ARG2...])
7763f29dbc25Smrg# -----------------------------
7764f29dbc25Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
7765f29dbc25Smrg# associated separator.
7766f29dbc25Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
7767f29dbc25Smrg# versions in m4sugar had bugs.
7768f29dbc25Smrgm4_define([lt_join],
7769f29dbc25Smrg[m4_if([$#], [1], [],
7770f29dbc25Smrg       [$#], [2], [[$2]],
7771f29dbc25Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
7772f29dbc25Smrgm4_define([_lt_join],
7773f29dbc25Smrg[m4_if([$#$2], [2], [],
7774f29dbc25Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
7775f29dbc25Smrg
7776f29dbc25Smrg
7777f29dbc25Smrg# lt_car(LIST)
7778f29dbc25Smrg# lt_cdr(LIST)
7779f29dbc25Smrg# ------------
7780f29dbc25Smrg# Manipulate m4 lists.
7781f29dbc25Smrg# These macros are necessary as long as will still need to support
7782f29dbc25Smrg# Autoconf-2.59 which quotes differently.
7783f29dbc25Smrgm4_define([lt_car], [[$1]])
7784f29dbc25Smrgm4_define([lt_cdr],
7785f29dbc25Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
7786f29dbc25Smrg       [$#], 1, [],
7787f29dbc25Smrg       [m4_dquote(m4_shift($@))])])
7788f29dbc25Smrgm4_define([lt_unquote], $1)
7789f29dbc25Smrg
7790f29dbc25Smrg
7791f29dbc25Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
7792f29dbc25Smrg# ------------------------------------------
7793f29dbc25Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
7794f29dbc25Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
7795f29dbc25Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
7796f29dbc25Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
7797f29dbc25Smrg# than defined and empty).
7798f29dbc25Smrg#
7799f29dbc25Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
7800f29dbc25Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
7801f29dbc25Smrgm4_define([lt_append],
7802f29dbc25Smrg[m4_define([$1],
7803f29dbc25Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
7804f29dbc25Smrg
7805f29dbc25Smrg
7806f29dbc25Smrg
7807f29dbc25Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
7808f29dbc25Smrg# ----------------------------------------------------------
7809f29dbc25Smrg# Produce a SEP delimited list of all paired combinations of elements of
7810f29dbc25Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
7811f29dbc25Smrg# has the form PREFIXmINFIXSUFFIXn.
7812f29dbc25Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
7813f29dbc25Smrgm4_define([lt_combine],
7814f29dbc25Smrg[m4_if(m4_eval([$# > 3]), [1],
7815f29dbc25Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
7816f29dbc25Smrg[[m4_foreach([_Lt_prefix], [$2],
7817f29dbc25Smrg	     [m4_foreach([_Lt_suffix],
7818f29dbc25Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
7819f29dbc25Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
7820f29dbc25Smrg
7821f29dbc25Smrg
7822f29dbc25Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
7823f29dbc25Smrg# -----------------------------------------------------------------------
7824f29dbc25Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
7825f29dbc25Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
7826f29dbc25Smrgm4_define([lt_if_append_uniq],
7827f29dbc25Smrg[m4_ifdef([$1],
7828f29dbc25Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
7829f29dbc25Smrg		 [lt_append([$1], [$2], [$3])$4],
7830f29dbc25Smrg		 [$5])],
7831f29dbc25Smrg	  [lt_append([$1], [$2], [$3])$4])])
7832f29dbc25Smrg
7833f29dbc25Smrg
7834f29dbc25Smrg# lt_dict_add(DICT, KEY, VALUE)
7835f29dbc25Smrg# -----------------------------
7836f29dbc25Smrgm4_define([lt_dict_add],
7837f29dbc25Smrg[m4_define([$1($2)], [$3])])
7838f29dbc25Smrg
7839f29dbc25Smrg
7840f29dbc25Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
7841f29dbc25Smrg# --------------------------------------------
7842f29dbc25Smrgm4_define([lt_dict_add_subkey],
7843f29dbc25Smrg[m4_define([$1($2:$3)], [$4])])
7844f29dbc25Smrg
7845f29dbc25Smrg
7846f29dbc25Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
7847f29dbc25Smrg# ----------------------------------
7848f29dbc25Smrgm4_define([lt_dict_fetch],
7849f29dbc25Smrg[m4_ifval([$3],
7850f29dbc25Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
7851f29dbc25Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7852f29dbc25Smrg
7853f29dbc25Smrg
7854f29dbc25Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
7855f29dbc25Smrg# -----------------------------------------------------------------
7856f29dbc25Smrgm4_define([lt_if_dict_fetch],
7857f29dbc25Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
7858f29dbc25Smrg	[$5],
7859f29dbc25Smrg    [$6])])
7860f29dbc25Smrg
7861f29dbc25Smrg
7862f29dbc25Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
7863f29dbc25Smrg# --------------------------------------------------------------
7864f29dbc25Smrgm4_define([lt_dict_filter],
7865f29dbc25Smrg[m4_if([$5], [], [],
7866f29dbc25Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
7867f29dbc25Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
7868f29dbc25Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
7869f29dbc25Smrg])
7870f29dbc25Smrg
7871f29dbc25Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
7872f29dbc25Smrg#
7873f29dbc25Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
7874f29dbc25Smrg#   Written by Scott James Remnant, 2004
7875f29dbc25Smrg#
7876f29dbc25Smrg# This file is free software; the Free Software Foundation gives
7877f29dbc25Smrg# unlimited permission to copy and/or distribute it, with or without
7878f29dbc25Smrg# modifications, as long as this notice is preserved.
7879f29dbc25Smrg
7880f29dbc25Smrg# Generated from ltversion.in.
7881f29dbc25Smrg
7882f29dbc25Smrg# serial 3017 ltversion.m4
7883f29dbc25Smrg# This file is part of GNU Libtool
7884f29dbc25Smrg
7885f29dbc25Smrgm4_define([LT_PACKAGE_VERSION], [2.2.6b])
7886f29dbc25Smrgm4_define([LT_PACKAGE_REVISION], [1.3017])
7887f29dbc25Smrg
7888f29dbc25SmrgAC_DEFUN([LTVERSION_VERSION],
7889f29dbc25Smrg[macro_version='2.2.6b'
7890f29dbc25Smrgmacro_revision='1.3017'
7891f29dbc25Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
7892f29dbc25Smrg_LT_DECL(, macro_revision, 0)
7893f29dbc25Smrg])
7894f29dbc25Smrg
7895f29dbc25Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
7896f29dbc25Smrg#
7897f29dbc25Smrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
7898f29dbc25Smrg#   Written by Scott James Remnant, 2004.
7899f29dbc25Smrg#
7900f29dbc25Smrg# This file is free software; the Free Software Foundation gives
7901f29dbc25Smrg# unlimited permission to copy and/or distribute it, with or without
7902f29dbc25Smrg# modifications, as long as this notice is preserved.
7903f29dbc25Smrg
7904f29dbc25Smrg# serial 4 lt~obsolete.m4
7905f29dbc25Smrg
7906f29dbc25Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
7907f29dbc25Smrg#
7908f29dbc25Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
7909f29dbc25Smrg# which have later been changed to m4_define as they aren't part of the
7910f29dbc25Smrg# exported API, or moved to Autoconf or Automake where they belong.
7911f29dbc25Smrg#
7912f29dbc25Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
7913f29dbc25Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
7914f29dbc25Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
7915f29dbc25Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
7916f29dbc25Smrg# and doesn't know about Autoconf macros at all.)
7917f29dbc25Smrg#
7918f29dbc25Smrg# So we provide this file, which has a silly filename so it's always
7919f29dbc25Smrg# included after everything else.  This provides aclocal with the
7920f29dbc25Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
7921f29dbc25Smrg# because those macros already exist, or will be overwritten later.
7922f29dbc25Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
7923f29dbc25Smrg#
7924f29dbc25Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
7925f29dbc25Smrg# Yes, that means every name once taken will need to remain here until
7926f29dbc25Smrg# we give up compatibility with versions before 1.7, at which point
7927f29dbc25Smrg# we need to keep only those names which we still refer to.
7928f29dbc25Smrg
7929f29dbc25Smrg# This is to help aclocal find these macros, as it can't see m4_define.
7930f29dbc25SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
7931f29dbc25Smrg
7932f29dbc25Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
7933f29dbc25Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
7934f29dbc25Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
7935f29dbc25Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
7936f29dbc25Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
7937f29dbc25Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
7938f29dbc25Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
7939f29dbc25Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
7940f29dbc25Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
7941f29dbc25Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
7942f29dbc25Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
7943f29dbc25Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
7944f29dbc25Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
7945f29dbc25Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
7946f29dbc25Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
7947f29dbc25Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
7948f29dbc25Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
7949f29dbc25Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
7950f29dbc25Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
7951f29dbc25Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
7952f29dbc25Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
7953f29dbc25Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
7954f29dbc25Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
7955f29dbc25Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
7956f29dbc25Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
7957f29dbc25Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
7958f29dbc25Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
7959f29dbc25Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
7960f29dbc25Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
7961f29dbc25Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
7962f29dbc25Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
7963f29dbc25Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
7964f29dbc25Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
7965f29dbc25Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
7966f29dbc25Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
7967f29dbc25Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
7968f29dbc25Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
7969f29dbc25Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
7970f29dbc25Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
7971f29dbc25Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
7972f29dbc25Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
7973f29dbc25Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
7974f29dbc25Smrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
7975f29dbc25Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
7976f29dbc25Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
7977f29dbc25Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
7978f29dbc25Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
7979f29dbc25Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
7980f29dbc25Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
7981f29dbc25Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
7982f29dbc25Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
7983f29dbc25Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
7984f29dbc25Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
7985f29dbc25Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
7986f29dbc25Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7987f29dbc25Smrg
7988f29dbc25Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
7989f29dbc25Smrg# 
7990f29dbc25Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
7991f29dbc25Smrg#
7992f29dbc25Smrg# This program is free software; you can redistribute it and/or modify
7993f29dbc25Smrg# it under the terms of the GNU General Public License as published by
7994f29dbc25Smrg# the Free Software Foundation; either version 2 of the License, or
7995f29dbc25Smrg# (at your option) any later version.
7996f29dbc25Smrg#
7997f29dbc25Smrg# This program is distributed in the hope that it will be useful, but
7998f29dbc25Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
7999f29dbc25Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8000f29dbc25Smrg# General Public License for more details.
8001f29dbc25Smrg#
8002f29dbc25Smrg# You should have received a copy of the GNU General Public License
8003f29dbc25Smrg# along with this program; if not, write to the Free Software
8004f29dbc25Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8005f29dbc25Smrg#
8006f29dbc25Smrg# As a special exception to the GNU General Public License, if you
8007f29dbc25Smrg# distribute this file as part of a program that contains a
8008f29dbc25Smrg# configuration script generated by Autoconf, you may include it under
8009f29dbc25Smrg# the same distribution terms that you use for the rest of that program.
8010f29dbc25Smrg
8011f29dbc25Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8012f29dbc25Smrg# ----------------------------------
8013f29dbc25SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8014f29dbc25Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8015f29dbc25Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
8016f29dbc25SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
8017f29dbc25Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8018f29dbc25Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8019f29dbc25Smrgfi
8020f29dbc25Smrgif test -n "$PKG_CONFIG"; then
8021f29dbc25Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
8022f29dbc25Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8023f29dbc25Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8024f29dbc25Smrg		AC_MSG_RESULT([yes])
8025f29dbc25Smrg	else
8026f29dbc25Smrg		AC_MSG_RESULT([no])
8027f29dbc25Smrg		PKG_CONFIG=""
8028f29dbc25Smrg	fi
8029f29dbc25Smrg		
8030f29dbc25Smrgfi[]dnl
8031f29dbc25Smrg])# PKG_PROG_PKG_CONFIG
8032f29dbc25Smrg
8033f29dbc25Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8034f29dbc25Smrg#
8035f29dbc25Smrg# Check to see whether a particular set of modules exists.  Similar
8036f29dbc25Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8037f29dbc25Smrg#
8038f29dbc25Smrg#
8039f29dbc25Smrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
8040f29dbc25Smrg# this or PKG_CHECK_MODULES is called, or make sure to call
8041f29dbc25Smrg# PKG_CHECK_EXISTS manually
8042f29dbc25Smrg# --------------------------------------------------------------
8043f29dbc25SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8044f29dbc25Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8045f29dbc25Smrgif test -n "$PKG_CONFIG" && \
8046f29dbc25Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8047f29dbc25Smrg  m4_ifval([$2], [$2], [:])
8048f29dbc25Smrgm4_ifvaln([$3], [else
8049f29dbc25Smrg  $3])dnl
8050f29dbc25Smrgfi])
8051f29dbc25Smrg
8052f29dbc25Smrg
8053f29dbc25Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8054f29dbc25Smrg# ---------------------------------------------
8055f29dbc25Smrgm4_define([_PKG_CONFIG],
8056f29dbc25Smrg[if test -n "$PKG_CONFIG"; then
8057f29dbc25Smrg    if test -n "$$1"; then
8058f29dbc25Smrg        pkg_cv_[]$1="$$1"
8059f29dbc25Smrg    else
8060f29dbc25Smrg        PKG_CHECK_EXISTS([$3],
8061f29dbc25Smrg                         [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8062f29dbc25Smrg			 [pkg_failed=yes])
8063f29dbc25Smrg    fi
8064f29dbc25Smrgelse
8065f29dbc25Smrg	pkg_failed=untried
8066f29dbc25Smrgfi[]dnl
8067f29dbc25Smrg])# _PKG_CONFIG
8068f29dbc25Smrg
8069f29dbc25Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8070f29dbc25Smrg# -----------------------------
8071f29dbc25SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8072f29dbc25Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8073f29dbc25Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8074f29dbc25Smrg        _pkg_short_errors_supported=yes
8075f29dbc25Smrgelse
8076f29dbc25Smrg        _pkg_short_errors_supported=no
8077f29dbc25Smrgfi[]dnl
8078f29dbc25Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8079f29dbc25Smrg
8080f29dbc25Smrg
8081f29dbc25Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8082f29dbc25Smrg# [ACTION-IF-NOT-FOUND])
8083f29dbc25Smrg#
8084f29dbc25Smrg#
8085f29dbc25Smrg# Note that if there is a possibility the first call to
8086f29dbc25Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8087f29dbc25Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8088f29dbc25Smrg#
8089f29dbc25Smrg#
8090f29dbc25Smrg# --------------------------------------------------------------
8091f29dbc25SmrgAC_DEFUN([PKG_CHECK_MODULES],
8092f29dbc25Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8093f29dbc25SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8094f29dbc25SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8095f29dbc25Smrg
8096f29dbc25Smrgpkg_failed=no
8097f29dbc25SmrgAC_MSG_CHECKING([for $1])
8098f29dbc25Smrg
8099f29dbc25Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8100f29dbc25Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8101f29dbc25Smrg
8102f29dbc25Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8103f29dbc25Smrgand $1[]_LIBS to avoid the need to call pkg-config.
8104f29dbc25SmrgSee the pkg-config man page for more details.])
8105f29dbc25Smrg
8106f29dbc25Smrgif test $pkg_failed = yes; then
8107f29dbc25Smrg        _PKG_SHORT_ERRORS_SUPPORTED
8108f29dbc25Smrg        if test $_pkg_short_errors_supported = yes; then
8109f29dbc25Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
8110f29dbc25Smrg        else 
8111f29dbc25Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
8112f29dbc25Smrg        fi
8113f29dbc25Smrg	# Put the nasty error message in config.log where it belongs
8114f29dbc25Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8115f29dbc25Smrg
8116f29dbc25Smrg	ifelse([$4], , [AC_MSG_ERROR(dnl
8117f29dbc25Smrg[Package requirements ($2) were not met:
8118f29dbc25Smrg
8119f29dbc25Smrg$$1_PKG_ERRORS
8120f29dbc25Smrg
8121f29dbc25SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8122f29dbc25Smrginstalled software in a non-standard prefix.
8123f29dbc25Smrg
8124f29dbc25Smrg_PKG_TEXT
8125f29dbc25Smrg])],
8126f29dbc25Smrg		[AC_MSG_RESULT([no])
8127f29dbc25Smrg                $4])
8128f29dbc25Smrgelif test $pkg_failed = untried; then
8129f29dbc25Smrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
8130f29dbc25Smrg[The pkg-config script could not be found or is too old.  Make sure it
8131f29dbc25Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8132f29dbc25Smrgpath to pkg-config.
8133f29dbc25Smrg
8134f29dbc25Smrg_PKG_TEXT
8135f29dbc25Smrg
8136f29dbc25SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
8137f29dbc25Smrg		[$4])
8138f29dbc25Smrgelse
8139f29dbc25Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8140f29dbc25Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8141f29dbc25Smrg        AC_MSG_RESULT([yes])
8142f29dbc25Smrg	ifelse([$3], , :, [$3])
8143f29dbc25Smrgfi[]dnl
8144f29dbc25Smrg])# PKG_CHECK_MODULES
8145f29dbc25Smrg
8146f29dbc25Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8147f29dbc25Smrgdnl
8148f29dbc25Smrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
8149f29dbc25Smrgdnl 
8150f29dbc25Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
8151f29dbc25Smrgdnl copy of this software and associated documentation files (the "Software"),
8152f29dbc25Smrgdnl to deal in the Software without restriction, including without limitation
8153f29dbc25Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8154f29dbc25Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
8155f29dbc25Smrgdnl Software is furnished to do so, subject to the following conditions:
8156f29dbc25Smrgdnl
8157f29dbc25Smrgdnl The above copyright notice and this permission notice (including the next
8158f29dbc25Smrgdnl paragraph) shall be included in all copies or substantial portions of the
8159f29dbc25Smrgdnl Software.
8160f29dbc25Smrgdnl
8161f29dbc25Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8162f29dbc25Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8163f29dbc25Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
8164f29dbc25Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8165f29dbc25Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8166f29dbc25Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8167f29dbc25Smrgdnl DEALINGS IN THE SOFTWARE.
8168f29dbc25Smrg
8169f29dbc25Smrg# XORG_MACROS_VERSION(required-version)
8170f29dbc25Smrg# -------------------------------------
8171f29dbc25Smrg# Minimum version: 1.1.0
8172f29dbc25Smrg#
8173f29dbc25Smrg# If you're using a macro added in Version 1.1 or newer, include this in
8174f29dbc25Smrg# your configure.ac with the minimum required version, such as:
8175f29dbc25Smrg# XORG_MACROS_VERSION(1.1)
8176f29dbc25Smrg#
8177f29dbc25Smrg# To ensure that this macro is defined, also add:
8178f29dbc25Smrg# m4_ifndef([XORG_MACROS_VERSION],
8179f29dbc25Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8180f29dbc25Smrg#
8181f29dbc25Smrg#
8182f29dbc25Smrg# See the "minimum version" comment for each macro you use to see what 
8183f29dbc25Smrg# version you require.
8184f29dbc25Smrgm4_defun([XORG_MACROS_VERSION],[
8185f29dbc25Smrgm4_define([vers_have], [1.5.0])
8186f29dbc25Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8187f29dbc25Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8188f29dbc25Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
8189f29dbc25Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8190f29dbc25Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
8191f29dbc25Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8192f29dbc25Smrgm4_undefine([vers_have])
8193f29dbc25Smrgm4_undefine([maj_have])
8194f29dbc25Smrgm4_undefine([maj_needed])
8195f29dbc25Smrg]) # XORG_MACROS_VERSION
8196f29dbc25Smrg
8197f29dbc25Smrg# XORG_PROG_RAWCPP()
8198f29dbc25Smrg# ------------------
8199f29dbc25Smrg# Minimum version: 1.0.0
8200f29dbc25Smrg#
8201f29dbc25Smrg# Find cpp program and necessary flags for use in pre-processing text files
8202f29dbc25Smrg# such as man pages and config files
8203f29dbc25SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
8204f29dbc25SmrgAC_REQUIRE([AC_PROG_CPP])
8205f29dbc25SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
8206f29dbc25Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8207f29dbc25Smrg
8208f29dbc25Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
8209f29dbc25Smrg# which is not the best choice for supporting other OS'es, but covers most
8210f29dbc25Smrg# of the ones we need for now.
8211f29dbc25SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
8212f29dbc25SmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
8213f29dbc25Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8214f29dbc25Smrg	AC_MSG_RESULT([no])
8215f29dbc25Smrgelse
8216f29dbc25Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8217f29dbc25Smrg		RAWCPPFLAGS=-undef
8218f29dbc25Smrg		AC_MSG_RESULT([yes])
8219f29dbc25Smrg	# under Cygwin unix is still defined even with -undef
8220f29dbc25Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8221f29dbc25Smrg		RAWCPPFLAGS="-undef -ansi"
8222f29dbc25Smrg		AC_MSG_RESULT([yes, with -ansi])
8223f29dbc25Smrg	else
8224f29dbc25Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
8225f29dbc25Smrg	fi
8226f29dbc25Smrgfi
8227f29dbc25Smrgrm -f conftest.$ac_ext
8228f29dbc25Smrg
8229f29dbc25SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
8230f29dbc25SmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
8231f29dbc25Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8232f29dbc25Smrg	AC_MSG_RESULT([no])
8233f29dbc25Smrgelse
8234f29dbc25Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8235f29dbc25Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8236f29dbc25Smrg		AC_MSG_RESULT([yes])
8237f29dbc25Smrg	else
8238f29dbc25Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
8239f29dbc25Smrg	fi
8240f29dbc25Smrgfi
8241f29dbc25Smrgrm -f conftest.$ac_ext
8242f29dbc25SmrgAC_SUBST(RAWCPPFLAGS)
8243f29dbc25Smrg]) # XORG_PROG_RAWCPP
8244f29dbc25Smrg
8245f29dbc25Smrg# XORG_MANPAGE_SECTIONS()
8246f29dbc25Smrg# -----------------------
8247f29dbc25Smrg# Minimum version: 1.0.0
8248f29dbc25Smrg#
8249f29dbc25Smrg# Determine which sections man pages go in for the different man page types
8250f29dbc25Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8251f29dbc25Smrg# Not sure if there's any better way than just hardcoding by OS name.
8252f29dbc25Smrg# Override default settings by setting environment variables
8253f29dbc25Smrg
8254f29dbc25SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
8255f29dbc25SmrgAC_REQUIRE([AC_CANONICAL_HOST])
8256f29dbc25Smrg
8257f29dbc25Smrgif test x$APP_MAN_SUFFIX = x    ; then
8258f29dbc25Smrg    APP_MAN_SUFFIX=1
8259f29dbc25Smrgfi
8260f29dbc25Smrgif test x$APP_MAN_DIR = x    ; then
8261f29dbc25Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8262f29dbc25Smrgfi
8263f29dbc25Smrg
8264f29dbc25Smrgif test x$LIB_MAN_SUFFIX = x    ; then
8265f29dbc25Smrg    LIB_MAN_SUFFIX=3
8266f29dbc25Smrgfi
8267f29dbc25Smrgif test x$LIB_MAN_DIR = x    ; then
8268f29dbc25Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8269f29dbc25Smrgfi
8270f29dbc25Smrg
8271f29dbc25Smrgif test x$FILE_MAN_SUFFIX = x    ; then
8272f29dbc25Smrg    case $host_os in
8273f29dbc25Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
8274f29dbc25Smrg	*)		FILE_MAN_SUFFIX=5  ;;
8275f29dbc25Smrg    esac
8276f29dbc25Smrgfi
8277f29dbc25Smrgif test x$FILE_MAN_DIR = x    ; then
8278f29dbc25Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8279f29dbc25Smrgfi
8280f29dbc25Smrg
8281f29dbc25Smrgif test x$MISC_MAN_SUFFIX = x    ; then
8282f29dbc25Smrg    case $host_os in
8283f29dbc25Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
8284f29dbc25Smrg	*)		MISC_MAN_SUFFIX=7  ;;
8285f29dbc25Smrg    esac
8286f29dbc25Smrgfi
8287f29dbc25Smrgif test x$MISC_MAN_DIR = x    ; then
8288f29dbc25Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8289f29dbc25Smrgfi
8290f29dbc25Smrg
8291f29dbc25Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
8292f29dbc25Smrg    case $host_os in
8293f29dbc25Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
8294f29dbc25Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
8295f29dbc25Smrg    esac
8296f29dbc25Smrgfi
8297f29dbc25Smrgif test x$DRIVER_MAN_DIR = x    ; then
8298f29dbc25Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
8299f29dbc25Smrgfi
8300f29dbc25Smrg
8301f29dbc25Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
8302f29dbc25Smrg    case $host_os in
8303f29dbc25Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
8304f29dbc25Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
8305f29dbc25Smrg    esac
8306f29dbc25Smrgfi
8307f29dbc25Smrgif test x$ADMIN_MAN_DIR = x    ; then
8308f29dbc25Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8309f29dbc25Smrgfi
8310f29dbc25Smrg
8311f29dbc25Smrg
8312f29dbc25SmrgAC_SUBST([APP_MAN_SUFFIX])
8313f29dbc25SmrgAC_SUBST([LIB_MAN_SUFFIX])
8314f29dbc25SmrgAC_SUBST([FILE_MAN_SUFFIX])
8315f29dbc25SmrgAC_SUBST([MISC_MAN_SUFFIX])
8316f29dbc25SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
8317f29dbc25SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
8318f29dbc25SmrgAC_SUBST([APP_MAN_DIR])
8319f29dbc25SmrgAC_SUBST([LIB_MAN_DIR])
8320f29dbc25SmrgAC_SUBST([FILE_MAN_DIR])
8321f29dbc25SmrgAC_SUBST([MISC_MAN_DIR])
8322f29dbc25SmrgAC_SUBST([DRIVER_MAN_DIR])
8323f29dbc25SmrgAC_SUBST([ADMIN_MAN_DIR])
8324f29dbc25Smrg]) # XORG_MANPAGE_SECTIONS
8325f29dbc25Smrg
8326f29dbc25Smrg# XORG_CHECK_LINUXDOC
8327f29dbc25Smrg# -------------------
8328f29dbc25Smrg# Minimum version: 1.0.0
8329f29dbc25Smrg#
8330f29dbc25Smrg# Defines the variable MAKE_TEXT if the necessary tools and
8331f29dbc25Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
8332f29dbc25Smrg# Whether or not the necessary tools and files are found can be checked
8333f29dbc25Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
8334f29dbc25SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
8335f29dbc25Smrgif test x$XORG_SGML_PATH = x ; then
8336f29dbc25Smrg    XORG_SGML_PATH=$prefix/share/sgml
8337f29dbc25Smrgfi
8338f29dbc25SmrgHAVE_DEFS_ENT=
8339f29dbc25Smrg
8340f29dbc25Smrgif test x"$cross_compiling" = x"yes" ; then
8341f29dbc25Smrg  HAVE_DEFS_ENT=no
8342f29dbc25Smrgelse
8343f29dbc25Smrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
8344f29dbc25Smrgfi
8345f29dbc25Smrg
8346f29dbc25SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
8347f29dbc25SmrgAC_PATH_PROG(PS2PDF, ps2pdf)
8348f29dbc25Smrg
8349f29dbc25SmrgAC_MSG_CHECKING([Whether to build documentation])
8350f29dbc25Smrg
8351f29dbc25Smrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
8352f29dbc25Smrg   BUILDDOC=yes
8353f29dbc25Smrgelse
8354f29dbc25Smrg   BUILDDOC=no
8355f29dbc25Smrgfi
8356f29dbc25Smrg
8357f29dbc25SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
8358f29dbc25Smrg
8359f29dbc25SmrgAC_MSG_RESULT([$BUILDDOC])
8360f29dbc25Smrg
8361f29dbc25SmrgAC_MSG_CHECKING([Whether to build pdf documentation])
8362f29dbc25Smrg
8363f29dbc25Smrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
8364f29dbc25Smrg   BUILDPDFDOC=yes
8365f29dbc25Smrgelse
8366f29dbc25Smrg   BUILDPDFDOC=no
8367f29dbc25Smrgfi
8368f29dbc25Smrg
8369f29dbc25SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8370f29dbc25Smrg
8371f29dbc25SmrgAC_MSG_RESULT([$BUILDPDFDOC])
8372f29dbc25Smrg
8373f29dbc25SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
8374f29dbc25SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
8375f29dbc25SmrgMAKE_PDF="$PS2PDF"
8376f29dbc25SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
8377f29dbc25Smrg
8378f29dbc25SmrgAC_SUBST(MAKE_TEXT)
8379f29dbc25SmrgAC_SUBST(MAKE_PS)
8380f29dbc25SmrgAC_SUBST(MAKE_PDF)
8381f29dbc25SmrgAC_SUBST(MAKE_HTML)
8382f29dbc25Smrg]) # XORG_CHECK_LINUXDOC
8383f29dbc25Smrg
8384f29dbc25Smrg# XORG_CHECK_DOCBOOK
8385f29dbc25Smrg# -------------------
8386f29dbc25Smrg# Minimum version: 1.0.0
8387f29dbc25Smrg#
8388f29dbc25Smrg# Checks for the ability to build output formats from SGML DocBook source.
8389f29dbc25Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
8390f29dbc25Smrg# indicates whether the necessary tools and files are found and, if set,
8391f29dbc25Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
8392f29dbc25SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
8393f29dbc25Smrgif test x$XORG_SGML_PATH = x ; then
8394f29dbc25Smrg    XORG_SGML_PATH=$prefix/share/sgml
8395f29dbc25Smrgfi
8396f29dbc25SmrgHAVE_DEFS_ENT=
8397f29dbc25SmrgBUILDTXTDOC=no
8398f29dbc25SmrgBUILDPDFDOC=no
8399f29dbc25SmrgBUILDPSDOC=no
8400f29dbc25SmrgBUILDHTMLDOC=no
8401f29dbc25Smrg
8402f29dbc25SmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
8403f29dbc25Smrg
8404f29dbc25SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
8405f29dbc25SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
8406f29dbc25SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
8407f29dbc25SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
8408f29dbc25Smrg
8409f29dbc25SmrgAC_MSG_CHECKING([Whether to build text documentation])
8410f29dbc25Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
8411f29dbc25Smrg   test x$BUILD_TXTDOC != xno; then
8412f29dbc25Smrg	BUILDTXTDOC=yes
8413f29dbc25Smrgfi
8414f29dbc25SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
8415f29dbc25SmrgAC_MSG_RESULT([$BUILDTXTDOC])
8416f29dbc25Smrg
8417f29dbc25SmrgAC_MSG_CHECKING([Whether to build PDF documentation])
8418f29dbc25Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
8419f29dbc25Smrg   test x$BUILD_PDFDOC != xno; then
8420f29dbc25Smrg	BUILDPDFDOC=yes
8421f29dbc25Smrgfi
8422f29dbc25SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
8423f29dbc25SmrgAC_MSG_RESULT([$BUILDPDFDOC])
8424f29dbc25Smrg
8425f29dbc25SmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
8426f29dbc25Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
8427f29dbc25Smrg   test x$BUILD_PSDOC != xno; then
8428f29dbc25Smrg	BUILDPSDOC=yes
8429f29dbc25Smrgfi
8430f29dbc25SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
8431f29dbc25SmrgAC_MSG_RESULT([$BUILDPSDOC])
8432f29dbc25Smrg
8433f29dbc25SmrgAC_MSG_CHECKING([Whether to build HTML documentation])
8434f29dbc25Smrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
8435f29dbc25Smrg   test x$BUILD_HTMLDOC != xno; then
8436f29dbc25Smrg	BUILDHTMLDOC=yes
8437f29dbc25Smrgfi
8438f29dbc25SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
8439f29dbc25SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
8440f29dbc25Smrg
8441f29dbc25SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
8442f29dbc25SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
8443f29dbc25SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
8444f29dbc25SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
8445f29dbc25Smrg
8446f29dbc25SmrgAC_SUBST(MAKE_TEXT)
8447f29dbc25SmrgAC_SUBST(MAKE_PS)
8448f29dbc25SmrgAC_SUBST(MAKE_PDF)
8449f29dbc25SmrgAC_SUBST(MAKE_HTML)
8450f29dbc25Smrg]) # XORG_CHECK_DOCBOOK
8451f29dbc25Smrg
8452f29dbc25Smrg# XORG_WITH_XMLTO
8453f29dbc25Smrg# ----------------
8454f29dbc25Smrg# Minimum version: 1.5.0
8455f29dbc25Smrg#
8456f29dbc25Smrg# Documentation tools are not always available on all platforms and sometimes
8457f29dbc25Smrg# not at the appropriate level. This macro enables a module to test for the
8458f29dbc25Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8459f29dbc25Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
8460f29dbc25Smrg# as whether or not to use the xmlto package.
8461f29dbc25Smrg#
8462f29dbc25Smrg# Interface to module:
8463f29dbc25Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
8464f29dbc25Smrg# XMLTO:	returns the path of the xmlto program found
8465f29dbc25Smrg#		returns the path set by the user in the environment
8466f29dbc25Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
8467f29dbc25Smrg#		'no' user instructs the module not to use xmlto
8468f29dbc25Smrg#
8469f29dbc25Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
8470f29dbc25Smrg#
8471f29dbc25SmrgAC_DEFUN([XORG_WITH_XMLTO],[
8472f29dbc25SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
8473f29dbc25SmrgAC_ARG_WITH(xmlto,
8474f29dbc25Smrg	AS_HELP_STRING([--with-xmlto],
8475f29dbc25Smrg	   [Use xmlto to regenerate documentation (default: yes, if installed)]),
8476f29dbc25Smrg	   [use_xmlto=$withval], [use_xmlto=auto])
8477f29dbc25Smrg
8478f29dbc25Smrgif test "x$use_xmlto" = x"auto"; then
8479f29dbc25Smrg   AC_PATH_PROG([XMLTO], [xmlto])
8480f29dbc25Smrg   if test "x$XMLTO" = "x"; then
8481f29dbc25Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
8482f29dbc25Smrg	have_xmlto=no
8483f29dbc25Smrg   else
8484f29dbc25Smrg        have_xmlto=yes
8485f29dbc25Smrg   fi
8486f29dbc25Smrgelif test "x$use_xmlto" = x"yes" ; then
8487f29dbc25Smrg   AC_PATH_PROG([XMLTO], [xmlto])
8488f29dbc25Smrg   if test "x$XMLTO" = "x"; then
8489f29dbc25Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
8490f29dbc25Smrg   fi
8491f29dbc25Smrg   have_xmlto=yes
8492f29dbc25Smrgelif test "x$use_xmlto" = x"no" ; then
8493f29dbc25Smrg   if test "x$XMLTO" != "x"; then
8494f29dbc25Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
8495f29dbc25Smrg   fi
8496f29dbc25Smrg   have_xmlto=no
8497f29dbc25Smrgelse
8498f29dbc25Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
8499f29dbc25Smrgfi
8500f29dbc25SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
8501f29dbc25Smrg]) # XORG_CHECK_XMLTO
8502f29dbc25Smrg
8503f29dbc25Smrg# XORG_WITH_ASCIIDOC
8504f29dbc25Smrg# ----------------
8505f29dbc25Smrg# Minimum version: 1.5.0
8506f29dbc25Smrg#
8507f29dbc25Smrg# Documentation tools are not always available on all platforms and sometimes
8508f29dbc25Smrg# not at the appropriate level. This macro enables a module to test for the
8509f29dbc25Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8510f29dbc25Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
8511f29dbc25Smrg# as whether or not to use the asciidoc package.
8512f29dbc25Smrg#
8513f29dbc25Smrg# Interface to module:
8514f29dbc25Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
8515f29dbc25Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
8516f29dbc25Smrg#		 returns the path set by the user in the environment
8517f29dbc25Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
8518f29dbc25Smrg#		  'no' user instructs the module not to use asciidoc
8519f29dbc25Smrg#
8520f29dbc25Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
8521f29dbc25Smrg#
8522f29dbc25SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
8523f29dbc25SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
8524f29dbc25SmrgAC_ARG_WITH(asciidoc,
8525f29dbc25Smrg	AS_HELP_STRING([--with-asciidoc],
8526f29dbc25Smrg	   [Use asciidoc to regenerate documentation (default: yes, if installed)]),
8527f29dbc25Smrg	   [use_asciidoc=$withval], [use_asciidoc=auto])
8528f29dbc25Smrg
8529f29dbc25Smrgif test "x$use_asciidoc" = x"auto"; then
8530f29dbc25Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8531f29dbc25Smrg   if test "x$ASCIIDOC" = "x"; then
8532f29dbc25Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
8533f29dbc25Smrg	have_asciidoc=no
8534f29dbc25Smrg   else
8535f29dbc25Smrg        have_asciidoc=yes
8536f29dbc25Smrg   fi
8537f29dbc25Smrgelif test "x$use_asciidoc" = x"yes" ; then
8538f29dbc25Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
8539f29dbc25Smrg   if test "x$ASCIIDOC" = "x"; then
8540f29dbc25Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
8541f29dbc25Smrg   fi
8542f29dbc25Smrg   have_asciidoc=yes
8543f29dbc25Smrgelif test "x$use_asciidoc" = x"no" ; then
8544f29dbc25Smrg   if test "x$ASCIIDOC" != "x"; then
8545f29dbc25Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
8546f29dbc25Smrg   fi
8547f29dbc25Smrg   have_asciidoc=no
8548f29dbc25Smrgelse
8549f29dbc25Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
8550f29dbc25Smrgfi
8551f29dbc25SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
8552f29dbc25Smrg]) # XORG_CHECK_ASCIIDOC
8553f29dbc25Smrg
8554f29dbc25Smrg# XORG_WITH_DOXYGEN
8555f29dbc25Smrg# ----------------
8556f29dbc25Smrg# Minimum version: 1.5.0
8557f29dbc25Smrg#
8558f29dbc25Smrg# Documentation tools are not always available on all platforms and sometimes
8559f29dbc25Smrg# not at the appropriate level. This macro enables a module to test for the
8560f29dbc25Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
8561f29dbc25Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
8562f29dbc25Smrg# as whether or not to use the doxygen package.
8563f29dbc25Smrg#
8564f29dbc25Smrg# Interface to module:
8565f29dbc25Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
8566f29dbc25Smrg# DOXYGEN:	 returns the path of the doxygen program found
8567f29dbc25Smrg#		 returns the path set by the user in the environment
8568f29dbc25Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
8569f29dbc25Smrg#		  'no' user instructs the module not to use doxygen
8570f29dbc25Smrg#
8571f29dbc25Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
8572f29dbc25Smrg#
8573f29dbc25SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
8574f29dbc25SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
8575f29dbc25SmrgAC_ARG_WITH(doxygen,
8576f29dbc25Smrg	AS_HELP_STRING([--with-doxygen],
8577f29dbc25Smrg	   [Use doxygen to regenerate documentation (default: yes, if installed)]),
8578f29dbc25Smrg	   [use_doxygen=$withval], [use_doxygen=auto])
8579f29dbc25Smrg
8580f29dbc25Smrgif test "x$use_doxygen" = x"auto"; then
8581f29dbc25Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8582f29dbc25Smrg   if test "x$DOXYGEN" = "x"; then
8583f29dbc25Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
8584f29dbc25Smrg	have_doxygen=no
8585f29dbc25Smrg   else
8586f29dbc25Smrg        have_doxygen=yes
8587f29dbc25Smrg   fi
8588f29dbc25Smrgelif test "x$use_doxygen" = x"yes" ; then
8589f29dbc25Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
8590f29dbc25Smrg   if test "x$DOXYGEN" = "x"; then
8591f29dbc25Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
8592f29dbc25Smrg   fi
8593f29dbc25Smrg   have_doxygen=yes
8594f29dbc25Smrgelif test "x$use_doxygen" = x"no" ; then
8595f29dbc25Smrg   if test "x$DOXYGEN" != "x"; then
8596f29dbc25Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
8597f29dbc25Smrg   fi
8598f29dbc25Smrg   have_doxygen=no
8599f29dbc25Smrgelse
8600f29dbc25Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
8601f29dbc25Smrgfi
8602f29dbc25SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
8603f29dbc25Smrg]) # XORG_CHECK_DOXYGEN
8604f29dbc25Smrg
8605f29dbc25Smrg# XORG_CHECK_MALLOC_ZERO
8606f29dbc25Smrg# ----------------------
8607f29dbc25Smrg# Minimum version: 1.0.0
8608f29dbc25Smrg#
8609f29dbc25Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
8610f29dbc25Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
8611f29dbc25Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
8612f29dbc25SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
8613f29dbc25SmrgAC_ARG_ENABLE(malloc0returnsnull,
8614f29dbc25Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
8615f29dbc25Smrg		       [malloc(0) returns NULL (default: auto)]),
8616f29dbc25Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
8617f29dbc25Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
8618f29dbc25Smrg
8619f29dbc25SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
8620f29dbc25Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
8621f29dbc25Smrg	AC_RUN_IFELSE([
8622f29dbc25Smrgchar *malloc();
8623f29dbc25Smrgchar *realloc();
8624f29dbc25Smrgchar *calloc();
8625f29dbc25Smrgmain() {
8626f29dbc25Smrg    char *m0, *r0, *c0, *p;
8627f29dbc25Smrg    m0 = malloc(0);
8628f29dbc25Smrg    p = malloc(10);
8629f29dbc25Smrg    r0 = realloc(p,0);
8630f29dbc25Smrg    c0 = calloc(0);
8631f29dbc25Smrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
8632f29dbc25Smrg}],
8633f29dbc25Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
8634f29dbc25Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
8635f29dbc25Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
8636f29dbc25Smrgfi
8637f29dbc25SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
8638f29dbc25Smrg
8639f29dbc25Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
8640f29dbc25Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
8641f29dbc25Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
8642f29dbc25Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
8643f29dbc25Smrgelse
8644f29dbc25Smrg	MALLOC_ZERO_CFLAGS=""
8645f29dbc25Smrg	XMALLOC_ZERO_CFLAGS=""
8646f29dbc25Smrg	XTMALLOC_ZERO_CFLAGS=""
8647f29dbc25Smrgfi
8648f29dbc25Smrg
8649f29dbc25SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
8650f29dbc25SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
8651f29dbc25SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
8652f29dbc25Smrg]) # XORG_CHECK_MALLOC_ZERO
8653f29dbc25Smrg
8654f29dbc25Smrg# XORG_WITH_LINT()
8655f29dbc25Smrg# ----------------
8656f29dbc25Smrg# Minimum version: 1.1.0
8657f29dbc25Smrg#
8658f29dbc25Smrg# Sets up flags for source checkers such as lint and sparse if --with-lint
8659f29dbc25Smrg# is specified.   (Use --with-lint=sparse for sparse.)
8660f29dbc25Smrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
8661f29dbc25Smrg# Sets $LINT_FLAGS to flags to pass to source checker
8662f29dbc25Smrg# Sets LINT automake conditional if enabled (default: disabled)
8663f29dbc25Smrg#
8664f29dbc25SmrgAC_DEFUN([XORG_WITH_LINT],[
8665f29dbc25Smrg
8666f29dbc25Smrg# Allow checking code with lint, sparse, etc.
8667f29dbc25SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
8668f29dbc25Smrg		[Use a lint-style source code checker (default: disabled)])],
8669f29dbc25Smrg		[use_lint=$withval], [use_lint=no])
8670f29dbc25Smrgif test "x$use_lint" = "xyes" ; then
8671f29dbc25Smrg	LINT="lint"
8672f29dbc25Smrgelse
8673f29dbc25Smrg	LINT="$use_lint"
8674f29dbc25Smrgfi
8675f29dbc25Smrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
8676f29dbc25Smrg    case $LINT in
8677f29dbc25Smrg	lint|*/lint)
8678f29dbc25Smrg	    case $host_os in
8679f29dbc25Smrg		solaris*)
8680f29dbc25Smrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
8681f29dbc25Smrg			;;
8682f29dbc25Smrg	    esac
8683f29dbc25Smrg	    ;;
8684f29dbc25Smrg    esac
8685f29dbc25Smrgfi
8686f29dbc25Smrg
8687f29dbc25SmrgAC_SUBST(LINT)
8688f29dbc25SmrgAC_SUBST(LINT_FLAGS)
8689f29dbc25SmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
8690f29dbc25Smrg
8691f29dbc25Smrg]) # XORG_WITH_LINT
8692f29dbc25Smrg
8693f29dbc25Smrg# XORG_LINT_LIBRARY(LIBNAME)
8694f29dbc25Smrg# --------------------------
8695f29dbc25Smrg# Minimum version: 1.1.0
8696f29dbc25Smrg#
8697f29dbc25Smrg# Sets up flags for building lint libraries for checking programs that call
8698f29dbc25Smrg# functions in the library.
8699f29dbc25Smrg# Disabled by default, enable with --enable-lint-library
8700f29dbc25Smrg# Sets: 
8701f29dbc25Smrg#	@LINTLIB@		- name of lint library file to make
8702f29dbc25Smrg#	MAKE_LINT_LIB		- automake conditional
8703f29dbc25Smrg#
8704f29dbc25Smrg
8705f29dbc25SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
8706f29dbc25SmrgAC_REQUIRE([XORG_WITH_LINT])
8707f29dbc25Smrg# Build lint "library" for more indepth checks of programs calling this library
8708f29dbc25SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
8709f29dbc25Smrg	[Create lint library (default: disabled)])],
8710f29dbc25Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
8711f29dbc25Smrgif test "x$make_lint_lib" != "xno" ; then
8712f29dbc25Smrg	if test "x$LINT" = "xno" ; then
8713f29dbc25Smrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
8714f29dbc25Smrg	fi
8715f29dbc25Smrg	if test "x$make_lint_lib" = "xyes" ; then
8716f29dbc25Smrg		LINTLIB=llib-l$1.ln
8717f29dbc25Smrg	else
8718f29dbc25Smrg		LINTLIB=$make_lint_lib
8719f29dbc25Smrg	fi
8720f29dbc25Smrgfi
8721f29dbc25SmrgAC_SUBST(LINTLIB)
8722f29dbc25SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
8723f29dbc25Smrg
8724f29dbc25Smrg]) # XORG_LINT_LIBRARY
8725f29dbc25Smrg
8726f29dbc25Smrg# XORG_CWARNFLAGS
8727f29dbc25Smrg# ---------------
8728f29dbc25Smrg# Minimum version: 1.2.0
8729f29dbc25Smrg#
8730f29dbc25Smrg# Defines CWARNFLAGS to enable C compiler warnings.
8731f29dbc25Smrg#
8732f29dbc25SmrgAC_DEFUN([XORG_CWARNFLAGS], [
8733f29dbc25SmrgAC_REQUIRE([AC_PROG_CC])
8734f29dbc25Smrgif  test "x$GCC" = xyes ; then
8735f29dbc25Smrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
8736f29dbc25Smrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
8737f29dbc25Smrg-Wbad-function-cast"
8738f29dbc25Smrg    case `$CC -dumpversion` in
8739f29dbc25Smrg    3.4.* | 4.*)
8740f29dbc25Smrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
8741f29dbc25Smrg	;;
8742f29dbc25Smrg    esac
8743f29dbc25Smrgelse
8744f29dbc25Smrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
8745f29dbc25Smrg    if test "x$SUNCC" = "xyes"; then
8746f29dbc25Smrg	CWARNFLAGS="-v"
8747f29dbc25Smrg    fi
8748f29dbc25Smrgfi
8749f29dbc25SmrgAC_SUBST(CWARNFLAGS)
8750f29dbc25Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8751f29dbc25Smrg]) # XORG_CWARNFLAGS
8752f29dbc25Smrg
8753f29dbc25Smrg# XORG_STRICT_OPTION
8754f29dbc25Smrg# -----------------------
8755f29dbc25Smrg# Minimum version: 1.3.0
8756f29dbc25Smrg#
8757f29dbc25Smrg# Add configure option to enable strict compilation
8758f29dbc25SmrgAC_DEFUN([XORG_STRICT_OPTION], [
8759f29dbc25SmrgAC_REQUIRE([AC_PROG_CC])
8760f29dbc25SmrgAC_REQUIRE([AC_PROG_CC_C99])
8761f29dbc25SmrgAC_REQUIRE([XORG_CWARNFLAGS])
8762f29dbc25Smrg
8763f29dbc25SmrgAC_ARG_ENABLE(strict-compilation,
8764f29dbc25Smrg			  AS_HELP_STRING([--enable-strict-compilation],
8765f29dbc25Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
8766f29dbc25Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
8767f29dbc25Smrgif test "x$STRICT_COMPILE" = "xyes"; then
8768f29dbc25Smrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
8769f29dbc25Smrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
8770f29dbc25Smrg	if test "x$GCC" = xyes ; then
8771f29dbc25Smrg		STRICT_CFLAGS="-pedantic -Werror"
8772f29dbc25Smrg	elif test "x$SUNCC" = "xyes"; then
8773f29dbc25Smrg		STRICT_CFLAGS="-errwarn"
8774f29dbc25Smrg    elif test "x$INTELCC" = "xyes"; then
8775f29dbc25Smrg		STRICT_CFLAGS="-Werror"
8776f29dbc25Smrg	fi
8777f29dbc25Smrgfi
8778f29dbc25SmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
8779f29dbc25SmrgAC_SUBST([CWARNFLAGS])
8780f29dbc25Smrg]) # XORG_STRICT_OPTION
8781f29dbc25Smrg
8782f29dbc25Smrg# XORG_DEFAULT_OPTIONS
8783f29dbc25Smrg# --------------------
8784f29dbc25Smrg# Minimum version: 1.3.0
8785f29dbc25Smrg#
8786f29dbc25Smrg# Defines default options for X.Org modules.
8787f29dbc25Smrg#
8788f29dbc25SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
8789f29dbc25SmrgXORG_CWARNFLAGS
8790f29dbc25SmrgXORG_STRICT_OPTION
8791f29dbc25SmrgXORG_RELEASE_VERSION
8792f29dbc25SmrgXORG_CHANGELOG
8793f29dbc25SmrgXORG_INSTALL
8794f29dbc25SmrgXORG_MANPAGE_SECTIONS
8795f29dbc25Smrg]) # XORG_DEFAULT_OPTIONS
8796f29dbc25Smrg
8797f29dbc25Smrg# XORG_INSTALL()
8798f29dbc25Smrg# ----------------
8799f29dbc25Smrg# Minimum version: 1.4.0
8800f29dbc25Smrg#
8801f29dbc25Smrg# Defines the variable INSTALL_CMD as the command to copy
8802f29dbc25Smrg# INSTALL from $prefix/share/util-macros.
8803f29dbc25Smrg#
8804f29dbc25SmrgAC_DEFUN([XORG_INSTALL], [
8805f29dbc25SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
8806f29dbc25Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
8807f29dbc25SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
8808f29dbc25Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
8809f29dbc25Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
8810f29dbc25Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
8811f29dbc25SmrgAC_SUBST([INSTALL_CMD])
8812f29dbc25Smrg]) # XORG_INSTALL
8813f29dbc25Smrgdnl Copyright 2005 Red Hat, Inc
8814f29dbc25Smrgdnl
8815f29dbc25Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
8816f29dbc25Smrgdnl documentation for any purpose is hereby granted without fee, provided that
8817f29dbc25Smrgdnl the above copyright notice appear in all copies and that both that
8818f29dbc25Smrgdnl copyright notice and this permission notice appear in supporting
8819f29dbc25Smrgdnl documentation.
8820f29dbc25Smrgdnl
8821f29dbc25Smrgdnl The above copyright notice and this permission notice shall be included
8822f29dbc25Smrgdnl in all copies or substantial portions of the Software.
8823f29dbc25Smrgdnl
8824f29dbc25Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8825f29dbc25Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8826f29dbc25Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8827f29dbc25Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8828f29dbc25Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8829f29dbc25Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8830f29dbc25Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
8831f29dbc25Smrgdnl
8832f29dbc25Smrgdnl Except as contained in this notice, the name of the copyright holders shall
8833f29dbc25Smrgdnl not be used in advertising or otherwise to promote the sale, use or
8834f29dbc25Smrgdnl other dealings in this Software without prior written authorization
8835f29dbc25Smrgdnl from the copyright holders.
8836f29dbc25Smrgdnl
8837f29dbc25Smrg
8838f29dbc25Smrg# XORG_RELEASE_VERSION
8839f29dbc25Smrg# --------------------
8840f29dbc25Smrg# Adds --with/without-release-string and changes the PACKAGE and
8841f29dbc25Smrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
8842f29dbc25Smrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
8843f29dbc25Smrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
8844f29dbc25Smrg 
8845f29dbc25SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
8846f29dbc25Smrg	AC_ARG_WITH(release-version,
8847f29dbc25Smrg			AS_HELP_STRING([--with-release-version=STRING],
8848f29dbc25Smrg				[Use release version string in package name]),
8849f29dbc25Smrg			[RELEASE_VERSION="$withval"],
8850f29dbc25Smrg			[RELEASE_VERSION=""])
8851f29dbc25Smrg	if test "x$RELEASE_VERSION" != "x"; then
8852f29dbc25Smrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
8853f29dbc25Smrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
8854f29dbc25Smrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
8855f29dbc25Smrg	fi
8856f29dbc25Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
8857f29dbc25Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
8858f29dbc25Smrg		[Major version of this package])
8859f29dbc25Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
8860f29dbc25Smrg	if test "x$PVM" = "x"; then
8861f29dbc25Smrg		PVM="0"
8862f29dbc25Smrg	fi
8863f29dbc25Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
8864f29dbc25Smrg		[$PVM],
8865f29dbc25Smrg		[Minor version of this package])
8866f29dbc25Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
8867f29dbc25Smrg	if test "x$PVP" = "x"; then
8868f29dbc25Smrg		PVP="0"
8869f29dbc25Smrg	fi
8870f29dbc25Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
8871f29dbc25Smrg		[$PVP],
8872f29dbc25Smrg		[Patch version of this package])
8873f29dbc25Smrg])
8874f29dbc25Smrg
8875f29dbc25Smrg# XORG_CHANGELOG()
8876f29dbc25Smrg# ----------------
8877f29dbc25Smrg# Minimum version: 1.2.0
8878f29dbc25Smrg#
8879f29dbc25Smrg# Defines the variable CHANGELOG_CMD as the command to generate
8880f29dbc25Smrg# ChangeLog from git.
8881f29dbc25Smrg#
8882f29dbc25Smrg#
8883f29dbc25SmrgAC_DEFUN([XORG_CHANGELOG], [
8884f29dbc25SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
8885f29dbc25Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
8886f29dbc25Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
8887f29dbc25Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
8888f29dbc25SmrgAC_SUBST([CHANGELOG_CMD])
8889f29dbc25Smrg]) # XORG_CHANGELOG
8890f29dbc25Smrg
8891f29dbc25Smrgdnl Copyright 2005 Red Hat, Inc
8892f29dbc25Smrgdnl 
8893f29dbc25Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
8894f29dbc25Smrgdnl documentation for any purpose is hereby granted without fee, provided that
8895f29dbc25Smrgdnl the above copyright notice appear in all copies and that both that
8896f29dbc25Smrgdnl copyright notice and this permission notice appear in supporting
8897f29dbc25Smrgdnl documentation.
8898f29dbc25Smrgdnl 
8899f29dbc25Smrgdnl The above copyright notice and this permission notice shall be included
8900f29dbc25Smrgdnl in all copies or substantial portions of the Software.
8901f29dbc25Smrgdnl 
8902f29dbc25Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
8903f29dbc25Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
8904f29dbc25Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
8905f29dbc25Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
8906f29dbc25Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
8907f29dbc25Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
8908f29dbc25Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
8909f29dbc25Smrgdnl 
8910f29dbc25Smrgdnl Except as contained in this notice, the name of the copyright holders shall
8911f29dbc25Smrgdnl not be used in advertising or otherwise to promote the sale, use or
8912f29dbc25Smrgdnl other dealings in this Software without prior written authorization
8913f29dbc25Smrgdnl from the copyright holders.
8914f29dbc25Smrgdnl 
8915f29dbc25Smrg
8916f29dbc25Smrg# XORG_DRIVER_CHECK_EXT()
8917f29dbc25Smrg# --------------------------
8918f29dbc25Smrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
8919f29dbc25Smrg# is defined, then add $1 to $REQUIRED_MODULES.
8920f29dbc25Smrg
8921f29dbc25SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
8922f29dbc25Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8923f29dbc25Smrg	SAVE_CFLAGS="$CFLAGS"
8924f29dbc25Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
8925f29dbc25Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
8926f29dbc25Smrg#include "xorg-server.h"
8927f29dbc25Smrg#if !defined $1
8928f29dbc25Smrg#error $1 not defined
8929f29dbc25Smrg#endif
8930f29dbc25Smrg		]])],
8931f29dbc25Smrg		[_EXT_CHECK=yes],
8932f29dbc25Smrg		[_EXT_CHECK=no])
8933f29dbc25Smrg	CFLAGS="$SAVE_CFLAGS"
8934f29dbc25Smrg	AC_MSG_CHECKING([if $1 is defined])
8935f29dbc25Smrg	AC_MSG_RESULT([$_EXT_CHECK])
8936f29dbc25Smrg	if test "$_EXT_CHECK" != no; then
8937f29dbc25Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
8938f29dbc25Smrg	fi
8939f29dbc25Smrg])
8940f29dbc25Smrg
8941f29dbc25Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
8942f29dbc25Smrg#
8943f29dbc25Smrg# This file is free software; the Free Software Foundation
8944f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
8945f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
8946f29dbc25Smrg
8947f29dbc25Smrg# AM_AUTOMAKE_VERSION(VERSION)
8948f29dbc25Smrg# ----------------------------
8949f29dbc25Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
8950f29dbc25Smrg# generated from the m4 files accompanying Automake X.Y.
8951f29dbc25Smrg# (This private macro should not be called outside this file.)
8952f29dbc25SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8953f29dbc25Smrg[am__api_version='1.11'
8954f29dbc25Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8955f29dbc25Smrgdnl require some minimum version.  Point them to the right macro.
8956f29dbc25Smrgm4_if([$1], [1.11.1], [],
8957f29dbc25Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8958f29dbc25Smrg])
8959f29dbc25Smrg
8960f29dbc25Smrg# _AM_AUTOCONF_VERSION(VERSION)
8961f29dbc25Smrg# -----------------------------
8962f29dbc25Smrg# aclocal traces this macro to find the Autoconf version.
8963f29dbc25Smrg# This is a private macro too.  Using m4_define simplifies
8964f29dbc25Smrg# the logic in aclocal, which can simply ignore this definition.
8965f29dbc25Smrgm4_define([_AM_AUTOCONF_VERSION], [])
8966f29dbc25Smrg
8967f29dbc25Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
8968f29dbc25Smrg# -------------------------------
8969f29dbc25Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8970f29dbc25Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8971f29dbc25SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8972f29dbc25Smrg[AM_AUTOMAKE_VERSION([1.11.1])dnl
8973f29dbc25Smrgm4_ifndef([AC_AUTOCONF_VERSION],
8974f29dbc25Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8975f29dbc25Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8976f29dbc25Smrg
8977f29dbc25Smrg# Figure out how to run the assembler.                      -*- Autoconf -*-
8978f29dbc25Smrg
8979f29dbc25Smrg# Copyright (C) 2001, 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
8980f29dbc25Smrg#
8981f29dbc25Smrg# This file is free software; the Free Software Foundation
8982f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
8983f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
8984f29dbc25Smrg
8985f29dbc25Smrg# serial 5
8986f29dbc25Smrg
8987f29dbc25Smrg# AM_PROG_AS
8988f29dbc25Smrg# ----------
8989f29dbc25SmrgAC_DEFUN([AM_PROG_AS],
8990f29dbc25Smrg[# By default we simply use the C compiler to build assembly code.
8991f29dbc25SmrgAC_REQUIRE([AC_PROG_CC])
8992f29dbc25Smrgtest "${CCAS+set}" = set || CCAS=$CC
8993f29dbc25Smrgtest "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
8994f29dbc25SmrgAC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
8995f29dbc25SmrgAC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
8996f29dbc25Smrg_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
8997f29dbc25Smrg])
8998f29dbc25Smrg
8999f29dbc25Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
9000f29dbc25Smrg
9001f29dbc25Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
9002f29dbc25Smrg#
9003f29dbc25Smrg# This file is free software; the Free Software Foundation
9004f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9005f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9006f29dbc25Smrg
9007f29dbc25Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
9008f29dbc25Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
9009f29dbc25Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
9010f29dbc25Smrg#
9011f29dbc25Smrg# Of course, Automake must honor this variable whenever it calls a
9012f29dbc25Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
9013f29dbc25Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
9014f29dbc25Smrg# depending on how configure is run.  This is pretty annoying, since
9015f29dbc25Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
9016f29dbc25Smrg# source directory, any form will work fine, but in subdirectories a
9017f29dbc25Smrg# relative path needs to be adjusted first.
9018f29dbc25Smrg#
9019f29dbc25Smrg# $ac_aux_dir/missing
9020f29dbc25Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
9021f29dbc25Smrg# $top_srcdir/$ac_aux_dir/missing
9022f29dbc25Smrg#    fails if $ac_aux_dir is absolute,
9023f29dbc25Smrg#    fails when called from a subdirectory in a VPATH build with
9024f29dbc25Smrg#          a relative $ac_aux_dir
9025f29dbc25Smrg#
9026f29dbc25Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
9027f29dbc25Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
9028f29dbc25Smrg# harmless because $srcdir is `.', but things will broke when you
9029f29dbc25Smrg# start a VPATH build or use an absolute $srcdir.
9030f29dbc25Smrg#
9031f29dbc25Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
9032f29dbc25Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
9033f29dbc25Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
9034f29dbc25Smrg# and then we would define $MISSING as
9035f29dbc25Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
9036f29dbc25Smrg# This will work as long as MISSING is not called from configure, because
9037f29dbc25Smrg# unfortunately $(top_srcdir) has no meaning in configure.
9038f29dbc25Smrg# However there are other variables, like CC, which are often used in
9039f29dbc25Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
9040f29dbc25Smrg#
9041f29dbc25Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
9042f29dbc25Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
9043f29dbc25Smrg# configured tree to be moved without reconfiguration.
9044f29dbc25Smrg
9045f29dbc25SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
9046f29dbc25Smrg[dnl Rely on autoconf to set up CDPATH properly.
9047f29dbc25SmrgAC_PREREQ([2.50])dnl
9048f29dbc25Smrg# expand $ac_aux_dir to an absolute path
9049f29dbc25Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
9050f29dbc25Smrg])
9051f29dbc25Smrg
9052f29dbc25Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
9053f29dbc25Smrg
9054f29dbc25Smrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
9055f29dbc25Smrg# Free Software Foundation, Inc.
9056f29dbc25Smrg#
9057f29dbc25Smrg# This file is free software; the Free Software Foundation
9058f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9059f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9060f29dbc25Smrg
9061f29dbc25Smrg# serial 9
9062f29dbc25Smrg
9063f29dbc25Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
9064f29dbc25Smrg# -------------------------------------
9065f29dbc25Smrg# Define a conditional.
9066f29dbc25SmrgAC_DEFUN([AM_CONDITIONAL],
9067f29dbc25Smrg[AC_PREREQ(2.52)dnl
9068f29dbc25Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
9069f29dbc25Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
9070f29dbc25SmrgAC_SUBST([$1_TRUE])dnl
9071f29dbc25SmrgAC_SUBST([$1_FALSE])dnl
9072f29dbc25Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
9073f29dbc25Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
9074f29dbc25Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
9075f29dbc25Smrgif $2; then
9076f29dbc25Smrg  $1_TRUE=
9077f29dbc25Smrg  $1_FALSE='#'
9078f29dbc25Smrgelse
9079f29dbc25Smrg  $1_TRUE='#'
9080f29dbc25Smrg  $1_FALSE=
9081f29dbc25Smrgfi
9082f29dbc25SmrgAC_CONFIG_COMMANDS_PRE(
9083f29dbc25Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
9084f29dbc25Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
9085f29dbc25SmrgUsually this means the macro was only invoked conditionally.]])
9086f29dbc25Smrgfi])])
9087f29dbc25Smrg
9088f29dbc25Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
9089f29dbc25Smrg# Free Software Foundation, Inc.
9090f29dbc25Smrg#
9091f29dbc25Smrg# This file is free software; the Free Software Foundation
9092f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9093f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9094f29dbc25Smrg
9095f29dbc25Smrg# serial 10
9096f29dbc25Smrg
9097f29dbc25Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
9098f29dbc25Smrg# written in clear, in which case automake, when reading aclocal.m4,
9099f29dbc25Smrg# will think it sees a *use*, and therefore will trigger all it's
9100f29dbc25Smrg# C support machinery.  Also note that it means that autoscan, seeing
9101f29dbc25Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
9102f29dbc25Smrg
9103f29dbc25Smrg
9104f29dbc25Smrg# _AM_DEPENDENCIES(NAME)
9105f29dbc25Smrg# ----------------------
9106f29dbc25Smrg# See how the compiler implements dependency checking.
9107f29dbc25Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
9108f29dbc25Smrg# We try a few techniques and use that to set a single cache variable.
9109f29dbc25Smrg#
9110f29dbc25Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
9111f29dbc25Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
9112f29dbc25Smrg# dependency, and given that the user is not expected to run this macro,
9113f29dbc25Smrg# just rely on AC_PROG_CC.
9114f29dbc25SmrgAC_DEFUN([_AM_DEPENDENCIES],
9115f29dbc25Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
9116f29dbc25SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
9117f29dbc25SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
9118f29dbc25SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
9119f29dbc25Smrg
9120f29dbc25Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
9121f29dbc25Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
9122f29dbc25Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
9123f29dbc25Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
9124f29dbc25Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
9125f29dbc25Smrg                   [depcc="$$1"   am_compiler_list=])
9126f29dbc25Smrg
9127f29dbc25SmrgAC_CACHE_CHECK([dependency style of $depcc],
9128f29dbc25Smrg               [am_cv_$1_dependencies_compiler_type],
9129f29dbc25Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
9130f29dbc25Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
9131f29dbc25Smrg  # making bogus files that we don't know about and never remove.  For
9132f29dbc25Smrg  # instance it was reported that on HP-UX the gcc test will end up
9133f29dbc25Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
9134f29dbc25Smrg  # in D'.
9135f29dbc25Smrg  mkdir conftest.dir
9136f29dbc25Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
9137f29dbc25Smrg  # using a relative directory.
9138f29dbc25Smrg  cp "$am_depcomp" conftest.dir
9139f29dbc25Smrg  cd conftest.dir
9140f29dbc25Smrg  # We will build objects and dependencies in a subdirectory because
9141f29dbc25Smrg  # it helps to detect inapplicable dependency modes.  For instance
9142f29dbc25Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
9143f29dbc25Smrg  # side effect of compilation, but ICC will put the dependencies in
9144f29dbc25Smrg  # the current directory while Tru64 will put them in the object
9145f29dbc25Smrg  # directory.
9146f29dbc25Smrg  mkdir sub
9147f29dbc25Smrg
9148f29dbc25Smrg  am_cv_$1_dependencies_compiler_type=none
9149f29dbc25Smrg  if test "$am_compiler_list" = ""; then
9150f29dbc25Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
9151f29dbc25Smrg  fi
9152f29dbc25Smrg  am__universal=false
9153f29dbc25Smrg  m4_case([$1], [CC],
9154f29dbc25Smrg    [case " $depcc " in #(
9155f29dbc25Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9156f29dbc25Smrg     esac],
9157f29dbc25Smrg    [CXX],
9158f29dbc25Smrg    [case " $depcc " in #(
9159f29dbc25Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
9160f29dbc25Smrg     esac])
9161f29dbc25Smrg
9162f29dbc25Smrg  for depmode in $am_compiler_list; do
9163f29dbc25Smrg    # Setup a source with many dependencies, because some compilers
9164f29dbc25Smrg    # like to wrap large dependency lists on column 80 (with \), and
9165f29dbc25Smrg    # we should not choose a depcomp mode which is confused by this.
9166f29dbc25Smrg    #
9167f29dbc25Smrg    # We need to recreate these files for each test, as the compiler may
9168f29dbc25Smrg    # overwrite some of them when testing with obscure command lines.
9169f29dbc25Smrg    # This happens at least with the AIX C compiler.
9170f29dbc25Smrg    : > sub/conftest.c
9171f29dbc25Smrg    for i in 1 2 3 4 5 6; do
9172f29dbc25Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
9173f29dbc25Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
9174f29dbc25Smrg      # Solaris 8's {/usr,}/bin/sh.
9175f29dbc25Smrg      touch sub/conftst$i.h
9176f29dbc25Smrg    done
9177f29dbc25Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
9178f29dbc25Smrg
9179f29dbc25Smrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
9180f29dbc25Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9181f29dbc25Smrg    # handle `-M -o', and we need to detect this.  Also, some Intel
9182f29dbc25Smrg    # versions had trouble with output in subdirs
9183f29dbc25Smrg    am__obj=sub/conftest.${OBJEXT-o}
9184f29dbc25Smrg    am__minus_obj="-o $am__obj"
9185f29dbc25Smrg    case $depmode in
9186f29dbc25Smrg    gcc)
9187f29dbc25Smrg      # This depmode causes a compiler race in universal mode.
9188f29dbc25Smrg      test "$am__universal" = false || continue
9189f29dbc25Smrg      ;;
9190f29dbc25Smrg    nosideeffect)
9191f29dbc25Smrg      # after this tag, mechanisms are not by side-effect, so they'll
9192f29dbc25Smrg      # only be used when explicitly requested
9193f29dbc25Smrg      if test "x$enable_dependency_tracking" = xyes; then
9194f29dbc25Smrg	continue
9195f29dbc25Smrg      else
9196f29dbc25Smrg	break
9197f29dbc25Smrg      fi
9198f29dbc25Smrg      ;;
9199f29dbc25Smrg    msvisualcpp | msvcmsys)
9200f29dbc25Smrg      # This compiler won't grok `-c -o', but also, the minuso test has
9201f29dbc25Smrg      # not run yet.  These depmodes are late enough in the game, and
9202f29dbc25Smrg      # so weak that their functioning should not be impacted.
9203f29dbc25Smrg      am__obj=conftest.${OBJEXT-o}
9204f29dbc25Smrg      am__minus_obj=
9205f29dbc25Smrg      ;;
9206f29dbc25Smrg    none) break ;;
9207f29dbc25Smrg    esac
9208f29dbc25Smrg    if depmode=$depmode \
9209f29dbc25Smrg       source=sub/conftest.c object=$am__obj \
9210f29dbc25Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9211f29dbc25Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
9212f29dbc25Smrg         >/dev/null 2>conftest.err &&
9213f29dbc25Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9214f29dbc25Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9215f29dbc25Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
9216f29dbc25Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9217f29dbc25Smrg      # icc doesn't choke on unknown options, it will just issue warnings
9218f29dbc25Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
9219f29dbc25Smrg      # that says an option was ignored or not supported.
9220f29dbc25Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
9221f29dbc25Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
9222f29dbc25Smrg      # The diagnosis changed in icc 8.0:
9223f29dbc25Smrg      #   icc: Command line remark: option '-MP' not supported
9224f29dbc25Smrg      if (grep 'ignoring option' conftest.err ||
9225f29dbc25Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
9226f29dbc25Smrg        am_cv_$1_dependencies_compiler_type=$depmode
9227f29dbc25Smrg        break
9228f29dbc25Smrg      fi
9229f29dbc25Smrg    fi
9230f29dbc25Smrg  done
9231f29dbc25Smrg
9232f29dbc25Smrg  cd ..
9233f29dbc25Smrg  rm -rf conftest.dir
9234f29dbc25Smrgelse
9235f29dbc25Smrg  am_cv_$1_dependencies_compiler_type=none
9236f29dbc25Smrgfi
9237f29dbc25Smrg])
9238f29dbc25SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
9239f29dbc25SmrgAM_CONDITIONAL([am__fastdep$1], [
9240f29dbc25Smrg  test "x$enable_dependency_tracking" != xno \
9241f29dbc25Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
9242f29dbc25Smrg])
9243f29dbc25Smrg
9244f29dbc25Smrg
9245f29dbc25Smrg# AM_SET_DEPDIR
9246f29dbc25Smrg# -------------
9247f29dbc25Smrg# Choose a directory name for dependency files.
9248f29dbc25Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
9249f29dbc25SmrgAC_DEFUN([AM_SET_DEPDIR],
9250f29dbc25Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
9251f29dbc25SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
9252f29dbc25Smrg])
9253f29dbc25Smrg
9254f29dbc25Smrg
9255f29dbc25Smrg# AM_DEP_TRACK
9256f29dbc25Smrg# ------------
9257f29dbc25SmrgAC_DEFUN([AM_DEP_TRACK],
9258f29dbc25Smrg[AC_ARG_ENABLE(dependency-tracking,
9259f29dbc25Smrg[  --disable-dependency-tracking  speeds up one-time build
9260f29dbc25Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
9261f29dbc25Smrgif test "x$enable_dependency_tracking" != xno; then
9262f29dbc25Smrg  am_depcomp="$ac_aux_dir/depcomp"
9263f29dbc25Smrg  AMDEPBACKSLASH='\'
9264f29dbc25Smrgfi
9265f29dbc25SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
9266f29dbc25SmrgAC_SUBST([AMDEPBACKSLASH])dnl
9267f29dbc25Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9268f29dbc25Smrg])
9269f29dbc25Smrg
9270f29dbc25Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9271f29dbc25Smrg
9272f29dbc25Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
9273f29dbc25Smrg# Free Software Foundation, Inc.
9274f29dbc25Smrg#
9275f29dbc25Smrg# This file is free software; the Free Software Foundation
9276f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9277f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9278f29dbc25Smrg
9279f29dbc25Smrg#serial 5
9280f29dbc25Smrg
9281f29dbc25Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
9282f29dbc25Smrg# ------------------------------
9283f29dbc25SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
9284f29dbc25Smrg[{
9285f29dbc25Smrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
9286f29dbc25Smrg  # are listed without --file.  Let's play safe and only enable the eval
9287f29dbc25Smrg  # if we detect the quoting.
9288f29dbc25Smrg  case $CONFIG_FILES in
9289f29dbc25Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
9290f29dbc25Smrg  *)   set x $CONFIG_FILES ;;
9291f29dbc25Smrg  esac
9292f29dbc25Smrg  shift
9293f29dbc25Smrg  for mf
9294f29dbc25Smrg  do
9295f29dbc25Smrg    # Strip MF so we end up with the name of the file.
9296f29dbc25Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
9297f29dbc25Smrg    # Check whether this is an Automake generated Makefile or not.
9298f29dbc25Smrg    # We used to match only the files named `Makefile.in', but
9299f29dbc25Smrg    # some people rename them; so instead we look at the file content.
9300f29dbc25Smrg    # Grep'ing the first line is not enough: some people post-process
9301f29dbc25Smrg    # each Makefile.in and add a new line on top of each file to say so.
9302f29dbc25Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
9303f29dbc25Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
9304f29dbc25Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
9305f29dbc25Smrg      dirpart=`AS_DIRNAME("$mf")`
9306f29dbc25Smrg    else
9307f29dbc25Smrg      continue
9308f29dbc25Smrg    fi
9309f29dbc25Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
9310f29dbc25Smrg    # from the Makefile without running `make'.
9311f29dbc25Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
9312f29dbc25Smrg    test -z "$DEPDIR" && continue
9313f29dbc25Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
9314f29dbc25Smrg    test -z "am__include" && continue
9315f29dbc25Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
9316f29dbc25Smrg    # When using ansi2knr, U may be empty or an underscore; expand it
9317f29dbc25Smrg    U=`sed -n 's/^U = //p' < "$mf"`
9318f29dbc25Smrg    # Find all dependency output files, they are included files with
9319f29dbc25Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
9320f29dbc25Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
9321f29dbc25Smrg    # expansion.
9322f29dbc25Smrg    for file in `sed -n "
9323f29dbc25Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9324f29dbc25Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
9325f29dbc25Smrg      # Make sure the directory exists.
9326f29dbc25Smrg      test -f "$dirpart/$file" && continue
9327f29dbc25Smrg      fdir=`AS_DIRNAME(["$file"])`
9328f29dbc25Smrg      AS_MKDIR_P([$dirpart/$fdir])
9329f29dbc25Smrg      # echo "creating $dirpart/$file"
9330f29dbc25Smrg      echo '# dummy' > "$dirpart/$file"
9331f29dbc25Smrg    done
9332f29dbc25Smrg  done
9333f29dbc25Smrg}
9334f29dbc25Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
9335f29dbc25Smrg
9336f29dbc25Smrg
9337f29dbc25Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
9338f29dbc25Smrg# -----------------------------
9339f29dbc25Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
9340f29dbc25Smrg#
9341f29dbc25Smrg# This code is only required when automatic dependency tracking
9342f29dbc25Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
9343f29dbc25Smrg# need in order to bootstrap the dependency handling code.
9344f29dbc25SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
9345f29dbc25Smrg[AC_CONFIG_COMMANDS([depfiles],
9346f29dbc25Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
9347f29dbc25Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
9348f29dbc25Smrg])
9349f29dbc25Smrg
9350f29dbc25Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
9351f29dbc25Smrg# Free Software Foundation, Inc.
9352f29dbc25Smrg#
9353f29dbc25Smrg# This file is free software; the Free Software Foundation
9354f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9355f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9356f29dbc25Smrg
9357f29dbc25Smrg# serial 8
9358f29dbc25Smrg
9359f29dbc25Smrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
9360f29dbc25SmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
9361f29dbc25Smrg
9362f29dbc25Smrg# Do all the work for Automake.                             -*- Autoconf -*-
9363f29dbc25Smrg
9364f29dbc25Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
9365f29dbc25Smrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
9366f29dbc25Smrg#
9367f29dbc25Smrg# This file is free software; the Free Software Foundation
9368f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9369f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9370f29dbc25Smrg
9371f29dbc25Smrg# serial 16
9372f29dbc25Smrg
9373f29dbc25Smrg# This macro actually does too much.  Some checks are only needed if
9374f29dbc25Smrg# your package does certain things.  But this isn't really a big deal.
9375f29dbc25Smrg
9376f29dbc25Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
9377f29dbc25Smrg# AM_INIT_AUTOMAKE([OPTIONS])
9378f29dbc25Smrg# -----------------------------------------------
9379f29dbc25Smrg# The call with PACKAGE and VERSION arguments is the old style
9380f29dbc25Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
9381f29dbc25Smrg# and VERSION should now be passed to AC_INIT and removed from
9382f29dbc25Smrg# the call to AM_INIT_AUTOMAKE.
9383f29dbc25Smrg# We support both call styles for the transition.  After
9384f29dbc25Smrg# the next Automake release, Autoconf can make the AC_INIT
9385f29dbc25Smrg# arguments mandatory, and then we can depend on a new Autoconf
9386f29dbc25Smrg# release and drop the old call support.
9387f29dbc25SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
9388f29dbc25Smrg[AC_PREREQ([2.62])dnl
9389f29dbc25Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
9390f29dbc25Smrgdnl the ones we care about.
9391f29dbc25Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
9392f29dbc25SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
9393f29dbc25SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
9394f29dbc25Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
9395f29dbc25Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
9396f29dbc25Smrg  # is not polluted with repeated "-I."
9397f29dbc25Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
9398f29dbc25Smrg  # test to see if srcdir already configured
9399f29dbc25Smrg  if test -f $srcdir/config.status; then
9400f29dbc25Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
9401f29dbc25Smrg  fi
9402f29dbc25Smrgfi
9403f29dbc25Smrg
9404f29dbc25Smrg# test whether we have cygpath
9405f29dbc25Smrgif test -z "$CYGPATH_W"; then
9406f29dbc25Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
9407f29dbc25Smrg    CYGPATH_W='cygpath -w'
9408f29dbc25Smrg  else
9409f29dbc25Smrg    CYGPATH_W=echo
9410f29dbc25Smrg  fi
9411f29dbc25Smrgfi
9412f29dbc25SmrgAC_SUBST([CYGPATH_W])
9413f29dbc25Smrg
9414f29dbc25Smrg# Define the identity of the package.
9415f29dbc25Smrgdnl Distinguish between old-style and new-style calls.
9416f29dbc25Smrgm4_ifval([$2],
9417f29dbc25Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
9418f29dbc25Smrg AC_SUBST([PACKAGE], [$1])dnl
9419f29dbc25Smrg AC_SUBST([VERSION], [$2])],
9420f29dbc25Smrg[_AM_SET_OPTIONS([$1])dnl
9421f29dbc25Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9422f29dbc25Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
9423f29dbc25Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
9424f29dbc25Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
9425f29dbc25Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
9426f29dbc25Smrg
9427f29dbc25Smrg_AM_IF_OPTION([no-define],,
9428f29dbc25Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
9429f29dbc25Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
9430f29dbc25Smrg
9431f29dbc25Smrg# Some tools Automake needs.
9432f29dbc25SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
9433f29dbc25SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
9434f29dbc25SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
9435f29dbc25SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
9436f29dbc25SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
9437f29dbc25SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
9438f29dbc25SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
9439f29dbc25SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9440f29dbc25SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9441f29dbc25SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
9442f29dbc25Smrg# We need awk for the "check" target.  The system "awk" is bad on
9443f29dbc25Smrg# some platforms.
9444f29dbc25SmrgAC_REQUIRE([AC_PROG_AWK])dnl
9445f29dbc25SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
9446f29dbc25SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
9447f29dbc25Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
9448f29dbc25Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
9449f29dbc25Smrg			     [_AM_PROG_TAR([v7])])])
9450f29dbc25Smrg_AM_IF_OPTION([no-dependencies],,
9451f29dbc25Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
9452f29dbc25Smrg		  [_AM_DEPENDENCIES(CC)],
9453f29dbc25Smrg		  [define([AC_PROG_CC],
9454f29dbc25Smrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
9455f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
9456f29dbc25Smrg		  [_AM_DEPENDENCIES(CXX)],
9457f29dbc25Smrg		  [define([AC_PROG_CXX],
9458f29dbc25Smrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
9459f29dbc25SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9460f29dbc25Smrg		  [_AM_DEPENDENCIES(OBJC)],
9461f29dbc25Smrg		  [define([AC_PROG_OBJC],
9462f29dbc25Smrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
9463f29dbc25Smrg])
9464f29dbc25Smrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
9465f29dbc25Smrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
9466f29dbc25Smrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
9467f29dbc25Smrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
9468f29dbc25SmrgAC_CONFIG_COMMANDS_PRE(dnl
9469f29dbc25Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
9470f29dbc25Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
9471f29dbc25Smrg])
9472f29dbc25Smrg
9473f29dbc25Smrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
9474f29dbc25Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
9475f29dbc25Smrgdnl mangled by Autoconf and run in a shell conditional statement.
9476f29dbc25Smrgm4_define([_AC_COMPILER_EXEEXT],
9477f29dbc25Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
9478f29dbc25Smrg
9479f29dbc25Smrg
9480f29dbc25Smrg# When config.status generates a header, we must update the stamp-h file.
9481f29dbc25Smrg# This file resides in the same directory as the config header
9482f29dbc25Smrg# that is generated.  The stamp files are numbered to have different names.
9483f29dbc25Smrg
9484f29dbc25Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
9485f29dbc25Smrg# loop where config.status creates the headers, so we can generate
9486f29dbc25Smrg# our stamp files there.
9487f29dbc25SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
9488f29dbc25Smrg[# Compute $1's index in $config_headers.
9489f29dbc25Smrg_am_arg=$1
9490f29dbc25Smrg_am_stamp_count=1
9491f29dbc25Smrgfor _am_header in $config_headers :; do
9492f29dbc25Smrg  case $_am_header in
9493f29dbc25Smrg    $_am_arg | $_am_arg:* )
9494f29dbc25Smrg      break ;;
9495f29dbc25Smrg    * )
9496f29dbc25Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
9497f29dbc25Smrg  esac
9498f29dbc25Smrgdone
9499f29dbc25Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
9500f29dbc25Smrg
9501f29dbc25Smrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
9502f29dbc25Smrg#
9503f29dbc25Smrg# This file is free software; the Free Software Foundation
9504f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9505f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9506f29dbc25Smrg
9507f29dbc25Smrg# AM_PROG_INSTALL_SH
9508f29dbc25Smrg# ------------------
9509f29dbc25Smrg# Define $install_sh.
9510f29dbc25SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
9511f29dbc25Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9512f29dbc25Smrgif test x"${install_sh}" != xset; then
9513f29dbc25Smrg  case $am_aux_dir in
9514f29dbc25Smrg  *\ * | *\	*)
9515f29dbc25Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
9516f29dbc25Smrg  *)
9517f29dbc25Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
9518f29dbc25Smrg  esac
9519f29dbc25Smrgfi
9520f29dbc25SmrgAC_SUBST(install_sh)])
9521f29dbc25Smrg
9522f29dbc25Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
9523f29dbc25Smrg#
9524f29dbc25Smrg# This file is free software; the Free Software Foundation
9525f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9526f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9527f29dbc25Smrg
9528f29dbc25Smrg# serial 2
9529f29dbc25Smrg
9530f29dbc25Smrg# Check whether the underlying file-system supports filenames
9531f29dbc25Smrg# with a leading dot.  For instance MS-DOS doesn't.
9532f29dbc25SmrgAC_DEFUN([AM_SET_LEADING_DOT],
9533f29dbc25Smrg[rm -rf .tst 2>/dev/null
9534f29dbc25Smrgmkdir .tst 2>/dev/null
9535f29dbc25Smrgif test -d .tst; then
9536f29dbc25Smrg  am__leading_dot=.
9537f29dbc25Smrgelse
9538f29dbc25Smrg  am__leading_dot=_
9539f29dbc25Smrgfi
9540f29dbc25Smrgrmdir .tst 2>/dev/null
9541f29dbc25SmrgAC_SUBST([am__leading_dot])])
9542f29dbc25Smrg
9543f29dbc25Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
9544f29dbc25Smrg# From Jim Meyering
9545f29dbc25Smrg
9546f29dbc25Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
9547f29dbc25Smrg# Free Software Foundation, Inc.
9548f29dbc25Smrg#
9549f29dbc25Smrg# This file is free software; the Free Software Foundation
9550f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9551f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9552f29dbc25Smrg
9553f29dbc25Smrg# serial 5
9554f29dbc25Smrg
9555f29dbc25Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
9556f29dbc25Smrg# ----------------------------------
9557f29dbc25Smrg# Control maintainer-specific portions of Makefiles.
9558f29dbc25Smrg# Default is to disable them, unless `enable' is passed literally.
9559f29dbc25Smrg# For symmetry, `disable' may be passed as well.  Anyway, the user
9560f29dbc25Smrg# can override the default with the --enable/--disable switch.
9561f29dbc25SmrgAC_DEFUN([AM_MAINTAINER_MODE],
9562f29dbc25Smrg[m4_case(m4_default([$1], [disable]),
9563f29dbc25Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
9564f29dbc25Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
9565f29dbc25Smrg       [m4_define([am_maintainer_other], [enable])
9566f29dbc25Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
9567f29dbc25SmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
9568f29dbc25Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
9569f29dbc25Smrg  AC_ARG_ENABLE([maintainer-mode],
9570f29dbc25Smrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
9571f29dbc25Smrg			  (and sometimes confusing) to the casual installer],
9572f29dbc25Smrg      [USE_MAINTAINER_MODE=$enableval],
9573f29dbc25Smrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
9574f29dbc25Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
9575f29dbc25Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
9576f29dbc25Smrg  MAINT=$MAINTAINER_MODE_TRUE
9577f29dbc25Smrg  AC_SUBST([MAINT])dnl
9578f29dbc25Smrg]
9579f29dbc25Smrg)
9580f29dbc25Smrg
9581f29dbc25SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
9582f29dbc25Smrg
9583f29dbc25Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
9584f29dbc25Smrg
9585f29dbc25Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
9586f29dbc25Smrg#
9587f29dbc25Smrg# This file is free software; the Free Software Foundation
9588f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9589f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9590f29dbc25Smrg
9591f29dbc25Smrg# serial 4
9592f29dbc25Smrg
9593f29dbc25Smrg# AM_MAKE_INCLUDE()
9594f29dbc25Smrg# -----------------
9595f29dbc25Smrg# Check to see how make treats includes.
9596f29dbc25SmrgAC_DEFUN([AM_MAKE_INCLUDE],
9597f29dbc25Smrg[am_make=${MAKE-make}
9598f29dbc25Smrgcat > confinc << 'END'
9599f29dbc25Smrgam__doit:
9600f29dbc25Smrg	@echo this is the am__doit target
9601f29dbc25Smrg.PHONY: am__doit
9602f29dbc25SmrgEND
9603f29dbc25Smrg# If we don't find an include directive, just comment out the code.
9604f29dbc25SmrgAC_MSG_CHECKING([for style of include used by $am_make])
9605f29dbc25Smrgam__include="#"
9606f29dbc25Smrgam__quote=
9607f29dbc25Smrg_am_result=none
9608f29dbc25Smrg# First try GNU make style include.
9609f29dbc25Smrgecho "include confinc" > confmf
9610f29dbc25Smrg# Ignore all kinds of additional output from `make'.
9611f29dbc25Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
9612f29dbc25Smrg*the\ am__doit\ target*)
9613f29dbc25Smrg  am__include=include
9614f29dbc25Smrg  am__quote=
9615f29dbc25Smrg  _am_result=GNU
9616f29dbc25Smrg  ;;
9617f29dbc25Smrgesac
9618f29dbc25Smrg# Now try BSD make style include.
9619f29dbc25Smrgif test "$am__include" = "#"; then
9620f29dbc25Smrg   echo '.include "confinc"' > confmf
9621f29dbc25Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
9622f29dbc25Smrg   *the\ am__doit\ target*)
9623f29dbc25Smrg     am__include=.include
9624f29dbc25Smrg     am__quote="\""
9625f29dbc25Smrg     _am_result=BSD
9626f29dbc25Smrg     ;;
9627f29dbc25Smrg   esac
9628f29dbc25Smrgfi
9629f29dbc25SmrgAC_SUBST([am__include])
9630f29dbc25SmrgAC_SUBST([am__quote])
9631f29dbc25SmrgAC_MSG_RESULT([$_am_result])
9632f29dbc25Smrgrm -f confinc confmf
9633f29dbc25Smrg])
9634f29dbc25Smrg
9635f29dbc25Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
9636f29dbc25Smrg
9637f29dbc25Smrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
9638f29dbc25Smrg# Free Software Foundation, Inc.
9639f29dbc25Smrg#
9640f29dbc25Smrg# This file is free software; the Free Software Foundation
9641f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9642f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9643f29dbc25Smrg
9644f29dbc25Smrg# serial 6
9645f29dbc25Smrg
9646f29dbc25Smrg# AM_MISSING_PROG(NAME, PROGRAM)
9647f29dbc25Smrg# ------------------------------
9648f29dbc25SmrgAC_DEFUN([AM_MISSING_PROG],
9649f29dbc25Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
9650f29dbc25Smrg$1=${$1-"${am_missing_run}$2"}
9651f29dbc25SmrgAC_SUBST($1)])
9652f29dbc25Smrg
9653f29dbc25Smrg
9654f29dbc25Smrg# AM_MISSING_HAS_RUN
9655f29dbc25Smrg# ------------------
9656f29dbc25Smrg# Define MISSING if not defined so far and test if it supports --run.
9657f29dbc25Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
9658f29dbc25SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
9659f29dbc25Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
9660f29dbc25SmrgAC_REQUIRE_AUX_FILE([missing])dnl
9661f29dbc25Smrgif test x"${MISSING+set}" != xset; then
9662f29dbc25Smrg  case $am_aux_dir in
9663f29dbc25Smrg  *\ * | *\	*)
9664f29dbc25Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
9665f29dbc25Smrg  *)
9666f29dbc25Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
9667f29dbc25Smrg  esac
9668f29dbc25Smrgfi
9669f29dbc25Smrg# Use eval to expand $SHELL
9670f29dbc25Smrgif eval "$MISSING --run true"; then
9671f29dbc25Smrg  am_missing_run="$MISSING --run "
9672f29dbc25Smrgelse
9673f29dbc25Smrg  am_missing_run=
9674f29dbc25Smrg  AC_MSG_WARN([`missing' script is too old or missing])
9675f29dbc25Smrgfi
9676f29dbc25Smrg])
9677f29dbc25Smrg
9678f29dbc25Smrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
9679f29dbc25Smrg#
9680f29dbc25Smrg# This file is free software; the Free Software Foundation
9681f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9682f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9683f29dbc25Smrg
9684f29dbc25Smrg# AM_PROG_MKDIR_P
9685f29dbc25Smrg# ---------------
9686f29dbc25Smrg# Check for `mkdir -p'.
9687f29dbc25SmrgAC_DEFUN([AM_PROG_MKDIR_P],
9688f29dbc25Smrg[AC_PREREQ([2.60])dnl
9689f29dbc25SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
9690f29dbc25Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
9691f29dbc25Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
9692f29dbc25Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
9693f29dbc25Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
9694f29dbc25Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
9695f29dbc25Smrgdnl adjustment using top_builddir (which is defined more often than
9696f29dbc25Smrgdnl MKDIR_P).
9697f29dbc25SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
9698f29dbc25Smrgcase $mkdir_p in
9699f29dbc25Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
9700f29dbc25Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
9701f29dbc25Smrgesac
9702f29dbc25Smrg])
9703f29dbc25Smrg
9704f29dbc25Smrg# Helper functions for option handling.                     -*- Autoconf -*-
9705f29dbc25Smrg
9706f29dbc25Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
9707f29dbc25Smrg#
9708f29dbc25Smrg# This file is free software; the Free Software Foundation
9709f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9710f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9711f29dbc25Smrg
9712f29dbc25Smrg# serial 4
9713f29dbc25Smrg
9714f29dbc25Smrg# _AM_MANGLE_OPTION(NAME)
9715f29dbc25Smrg# -----------------------
9716f29dbc25SmrgAC_DEFUN([_AM_MANGLE_OPTION],
9717f29dbc25Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
9718f29dbc25Smrg
9719f29dbc25Smrg# _AM_SET_OPTION(NAME)
9720f29dbc25Smrg# ------------------------------
9721f29dbc25Smrg# Set option NAME.  Presently that only means defining a flag for this option.
9722f29dbc25SmrgAC_DEFUN([_AM_SET_OPTION],
9723f29dbc25Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
9724f29dbc25Smrg
9725f29dbc25Smrg# _AM_SET_OPTIONS(OPTIONS)
9726f29dbc25Smrg# ----------------------------------
9727f29dbc25Smrg# OPTIONS is a space-separated list of Automake options.
9728f29dbc25SmrgAC_DEFUN([_AM_SET_OPTIONS],
9729f29dbc25Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
9730f29dbc25Smrg
9731f29dbc25Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
9732f29dbc25Smrg# -------------------------------------------
9733f29dbc25Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
9734f29dbc25SmrgAC_DEFUN([_AM_IF_OPTION],
9735f29dbc25Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
9736f29dbc25Smrg
9737f29dbc25Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
9738f29dbc25Smrg
9739f29dbc25Smrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
9740f29dbc25Smrg# Free Software Foundation, Inc.
9741f29dbc25Smrg#
9742f29dbc25Smrg# This file is free software; the Free Software Foundation
9743f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9744f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9745f29dbc25Smrg
9746f29dbc25Smrg# serial 5
9747f29dbc25Smrg
9748f29dbc25Smrg# AM_SANITY_CHECK
9749f29dbc25Smrg# ---------------
9750f29dbc25SmrgAC_DEFUN([AM_SANITY_CHECK],
9751f29dbc25Smrg[AC_MSG_CHECKING([whether build environment is sane])
9752f29dbc25Smrg# Just in case
9753f29dbc25Smrgsleep 1
9754f29dbc25Smrgecho timestamp > conftest.file
9755f29dbc25Smrg# Reject unsafe characters in $srcdir or the absolute working directory
9756f29dbc25Smrg# name.  Accept space and tab only in the latter.
9757f29dbc25Smrgam_lf='
9758f29dbc25Smrg'
9759f29dbc25Smrgcase `pwd` in
9760f29dbc25Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
9761f29dbc25Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
9762f29dbc25Smrgesac
9763f29dbc25Smrgcase $srcdir in
9764f29dbc25Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9765f29dbc25Smrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
9766f29dbc25Smrgesac
9767f29dbc25Smrg
9768f29dbc25Smrg# Do `set' in a subshell so we don't clobber the current shell's
9769f29dbc25Smrg# arguments.  Must try -L first in case configure is actually a
9770f29dbc25Smrg# symlink; some systems play weird games with the mod time of symlinks
9771f29dbc25Smrg# (eg FreeBSD returns the mod time of the symlink's containing
9772f29dbc25Smrg# directory).
9773f29dbc25Smrgif (
9774f29dbc25Smrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9775f29dbc25Smrg   if test "$[*]" = "X"; then
9776f29dbc25Smrg      # -L didn't work.
9777f29dbc25Smrg      set X `ls -t "$srcdir/configure" conftest.file`
9778f29dbc25Smrg   fi
9779f29dbc25Smrg   rm -f conftest.file
9780f29dbc25Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
9781f29dbc25Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
9782f29dbc25Smrg
9783f29dbc25Smrg      # If neither matched, then we have a broken ls.  This can happen
9784f29dbc25Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
9785f29dbc25Smrg      # broken ls alias from the environment.  This has actually
9786f29dbc25Smrg      # happened.  Such a system could not be considered "sane".
9787f29dbc25Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9788f29dbc25Smrgalias in your environment])
9789f29dbc25Smrg   fi
9790f29dbc25Smrg
9791f29dbc25Smrg   test "$[2]" = conftest.file
9792f29dbc25Smrg   )
9793f29dbc25Smrgthen
9794f29dbc25Smrg   # Ok.
9795f29dbc25Smrg   :
9796f29dbc25Smrgelse
9797f29dbc25Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
9798f29dbc25SmrgCheck your system clock])
9799f29dbc25Smrgfi
9800f29dbc25SmrgAC_MSG_RESULT(yes)])
9801f29dbc25Smrg
9802f29dbc25Smrg# Copyright (C) 2009  Free Software Foundation, Inc.
9803f29dbc25Smrg#
9804f29dbc25Smrg# This file is free software; the Free Software Foundation
9805f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9806f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9807f29dbc25Smrg
9808f29dbc25Smrg# serial 1
9809f29dbc25Smrg
9810f29dbc25Smrg# AM_SILENT_RULES([DEFAULT])
9811f29dbc25Smrg# --------------------------
9812f29dbc25Smrg# Enable less verbose build rules; with the default set to DEFAULT
9813f29dbc25Smrg# (`yes' being less verbose, `no' or empty being verbose).
9814f29dbc25SmrgAC_DEFUN([AM_SILENT_RULES],
9815f29dbc25Smrg[AC_ARG_ENABLE([silent-rules],
9816f29dbc25Smrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
9817f29dbc25Smrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
9818f29dbc25Smrgcase $enable_silent_rules in
9819f29dbc25Smrgyes) AM_DEFAULT_VERBOSITY=0;;
9820f29dbc25Smrgno)  AM_DEFAULT_VERBOSITY=1;;
9821f29dbc25Smrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
9822f29dbc25Smrgesac
9823f29dbc25SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
9824f29dbc25SmrgAM_BACKSLASH='\'
9825f29dbc25SmrgAC_SUBST([AM_BACKSLASH])dnl
9826f29dbc25Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
9827f29dbc25Smrg])
9828f29dbc25Smrg
9829f29dbc25Smrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
9830f29dbc25Smrg#
9831f29dbc25Smrg# This file is free software; the Free Software Foundation
9832f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9833f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9834f29dbc25Smrg
9835f29dbc25Smrg# AM_PROG_INSTALL_STRIP
9836f29dbc25Smrg# ---------------------
9837f29dbc25Smrg# One issue with vendor `install' (even GNU) is that you can't
9838f29dbc25Smrg# specify the program used to strip binaries.  This is especially
9839f29dbc25Smrg# annoying in cross-compiling environments, where the build's strip
9840f29dbc25Smrg# is unlikely to handle the host's binaries.
9841f29dbc25Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9842f29dbc25Smrg# always use install-sh in `make install-strip', and initialize
9843f29dbc25Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
9844f29dbc25SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9845f29dbc25Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9846f29dbc25Smrg# Installed binaries are usually stripped using `strip' when the user
9847f29dbc25Smrg# run `make install-strip'.  However `strip' might not be the right
9848f29dbc25Smrg# tool to use in cross-compilation environments, therefore Automake
9849f29dbc25Smrg# will honor the `STRIP' environment variable to overrule this program.
9850f29dbc25Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9851f29dbc25Smrgif test "$cross_compiling" != no; then
9852f29dbc25Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
9853f29dbc25Smrgfi
9854f29dbc25SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9855f29dbc25SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9856f29dbc25Smrg
9857f29dbc25Smrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9858f29dbc25Smrg#
9859f29dbc25Smrg# This file is free software; the Free Software Foundation
9860f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9861f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9862f29dbc25Smrg
9863f29dbc25Smrg# serial 2
9864f29dbc25Smrg
9865f29dbc25Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
9866f29dbc25Smrg# ---------------------------
9867f29dbc25Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9868f29dbc25Smrg# This macro is traced by Automake.
9869f29dbc25SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9870f29dbc25Smrg
9871f29dbc25Smrg# AM_SUBST_NOTMAKE(VARIABLE)
9872f29dbc25Smrg# ---------------------------
9873f29dbc25Smrg# Public sister of _AM_SUBST_NOTMAKE.
9874f29dbc25SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9875f29dbc25Smrg
9876f29dbc25Smrg# Check how to create a tarball.                            -*- Autoconf -*-
9877f29dbc25Smrg
9878f29dbc25Smrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9879f29dbc25Smrg#
9880f29dbc25Smrg# This file is free software; the Free Software Foundation
9881f29dbc25Smrg# gives unlimited permission to copy and/or distribute it,
9882f29dbc25Smrg# with or without modifications, as long as this notice is preserved.
9883f29dbc25Smrg
9884f29dbc25Smrg# serial 2
9885f29dbc25Smrg
9886f29dbc25Smrg# _AM_PROG_TAR(FORMAT)
9887f29dbc25Smrg# --------------------
9888f29dbc25Smrg# Check how to create a tarball in format FORMAT.
9889f29dbc25Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
9890f29dbc25Smrg#
9891f29dbc25Smrg# Substitute a variable $(am__tar) that is a command
9892f29dbc25Smrg# writing to stdout a FORMAT-tarball containing the directory
9893f29dbc25Smrg# $tardir.
9894f29dbc25Smrg#     tardir=directory && $(am__tar) > result.tar
9895f29dbc25Smrg#
9896f29dbc25Smrg# Substitute a variable $(am__untar) that extract such
9897f29dbc25Smrg# a tarball read from stdin.
9898f29dbc25Smrg#     $(am__untar) < result.tar
9899f29dbc25SmrgAC_DEFUN([_AM_PROG_TAR],
9900f29dbc25Smrg[# Always define AMTAR for backward compatibility.
9901f29dbc25SmrgAM_MISSING_PROG([AMTAR], [tar])
9902f29dbc25Smrgm4_if([$1], [v7],
9903f29dbc25Smrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9904f29dbc25Smrg     [m4_case([$1], [ustar],, [pax],,
9905f29dbc25Smrg              [m4_fatal([Unknown tar format])])
9906f29dbc25SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9907f29dbc25Smrg# Loop over all known methods to create a tar archive until one works.
9908f29dbc25Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9909f29dbc25Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9910f29dbc25Smrg# Do not fold the above two line into one, because Tru64 sh and
9911f29dbc25Smrg# Solaris sh will not grok spaces in the rhs of `-'.
9912f29dbc25Smrgfor _am_tool in $_am_tools
9913f29dbc25Smrgdo
9914f29dbc25Smrg  case $_am_tool in
9915f29dbc25Smrg  gnutar)
9916f29dbc25Smrg    for _am_tar in tar gnutar gtar;
9917f29dbc25Smrg    do
9918f29dbc25Smrg      AM_RUN_LOG([$_am_tar --version]) && break
9919f29dbc25Smrg    done
9920f29dbc25Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9921f29dbc25Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9922f29dbc25Smrg    am__untar="$_am_tar -xf -"
9923f29dbc25Smrg    ;;
9924f29dbc25Smrg  plaintar)
9925f29dbc25Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9926f29dbc25Smrg    # ustar tarball either.
9927f29dbc25Smrg    (tar --version) >/dev/null 2>&1 && continue
9928f29dbc25Smrg    am__tar='tar chf - "$$tardir"'
9929f29dbc25Smrg    am__tar_='tar chf - "$tardir"'
9930f29dbc25Smrg    am__untar='tar xf -'
9931f29dbc25Smrg    ;;
9932f29dbc25Smrg  pax)
9933f29dbc25Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
9934f29dbc25Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
9935f29dbc25Smrg    am__untar='pax -r'
9936f29dbc25Smrg    ;;
9937f29dbc25Smrg  cpio)
9938f29dbc25Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9939f29dbc25Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9940f29dbc25Smrg    am__untar='cpio -i -H $1 -d'
9941f29dbc25Smrg    ;;
9942f29dbc25Smrg  none)
9943f29dbc25Smrg    am__tar=false
9944f29dbc25Smrg    am__tar_=false
9945f29dbc25Smrg    am__untar=false
9946f29dbc25Smrg    ;;
9947f29dbc25Smrg  esac
9948f29dbc25Smrg
9949f29dbc25Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
9950f29dbc25Smrg  # and am__untar set.
9951f29dbc25Smrg  test -n "${am_cv_prog_tar_$1}" && break
9952f29dbc25Smrg
9953f29dbc25Smrg  # tar/untar a dummy directory, and stop if the command works
9954f29dbc25Smrg  rm -rf conftest.dir
9955f29dbc25Smrg  mkdir conftest.dir
9956f29dbc25Smrg  echo GrepMe > conftest.dir/file
9957f29dbc25Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9958f29dbc25Smrg  rm -rf conftest.dir
9959f29dbc25Smrg  if test -s conftest.tar; then
9960f29dbc25Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
9961f29dbc25Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9962f29dbc25Smrg  fi
9963f29dbc25Smrgdone
9964f29dbc25Smrgrm -rf conftest.dir
9965f29dbc25Smrg
9966f29dbc25SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9967f29dbc25SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9968f29dbc25SmrgAC_SUBST([am__tar])
9969f29dbc25SmrgAC_SUBST([am__untar])
9970f29dbc25Smrg]) # _AM_PROG_TAR
9971f29dbc25Smrg
9972