aclocal.m4 revision fc27e79c
1fc27e79cSmrg# generated automatically by aclocal 1.11 -*- Autoconf -*-
2659607e0Smrg
3659607e0Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4fc27e79cSmrg# 2005, 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
5659607e0Smrg# This file is free software; the Free Software Foundation
6659607e0Smrg# gives unlimited permission to copy and/or distribute it,
7659607e0Smrg# with or without modifications, as long as this notice is preserved.
8659607e0Smrg
9659607e0Smrg# This program is distributed in the hope that it will be useful,
10659607e0Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11659607e0Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12659607e0Smrg# PARTICULAR PURPOSE.
13659607e0Smrg
14fc27e79cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
15fc27e79cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16fc27e79cSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],,
17fc27e79cSmrg[m4_warning([this file was generated for autoconf 2.63.
18fc27e79cSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
19fc27e79cSmrgIf you have problems, you may need to regenerate the build system entirely.
20fc27e79cSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
21659607e0Smrg
22fc27e79cSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
236aab59a7Smrg#
24fc27e79cSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
25fc27e79cSmrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
26fc27e79cSmrg#   Written by Gordon Matzigkeit, 1996
276aab59a7Smrg#
28fc27e79cSmrg# This file is free software; the Free Software Foundation gives
29fc27e79cSmrg# unlimited permission to copy and/or distribute it, with or without
30fc27e79cSmrg# modifications, as long as this notice is preserved.
31fc27e79cSmrg
32fc27e79cSmrgm4_define([_LT_COPYING], [dnl
33fc27e79cSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
34fc27e79cSmrg#                 2006, 2007, 2008 Free Software Foundation, Inc.
35fc27e79cSmrg#   Written by Gordon Matzigkeit, 1996
366aab59a7Smrg#
37fc27e79cSmrg#   This file is part of GNU Libtool.
386aab59a7Smrg#
39fc27e79cSmrg# GNU Libtool is free software; you can redistribute it and/or
40fc27e79cSmrg# modify it under the terms of the GNU General Public License as
41fc27e79cSmrg# published by the Free Software Foundation; either version 2 of
42fc27e79cSmrg# the License, or (at your option) any later version.
436aab59a7Smrg#
44fc27e79cSmrg# As a special exception to the GNU General Public License,
45fc27e79cSmrg# if you distribute this file as part of a program or library that
46fc27e79cSmrg# is built using GNU Libtool, you may include this file under the
47fc27e79cSmrg# same distribution terms that you use for the rest of that program.
486aab59a7Smrg#
49fc27e79cSmrg# GNU Libtool is distributed in the hope that it will be useful,
50fc27e79cSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
51fc27e79cSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
52fc27e79cSmrg# GNU General Public License for more details.
536aab59a7Smrg#
54fc27e79cSmrg# You should have received a copy of the GNU General Public License
55fc27e79cSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
56fc27e79cSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
57fc27e79cSmrg# obtained by writing to the Free Software Foundation, Inc.,
58fc27e79cSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
596aab59a7Smrg])
60659607e0Smrg
61fc27e79cSmrg# serial 56 LT_INIT
62659607e0Smrg
63659607e0Smrg
64fc27e79cSmrg# LT_PREREQ(VERSION)
65fc27e79cSmrg# ------------------
66fc27e79cSmrg# Complain and exit if this libtool version is less that VERSION.
67fc27e79cSmrgm4_defun([LT_PREREQ],
68fc27e79cSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
69fc27e79cSmrg       [m4_default([$3],
70fc27e79cSmrg		   [m4_fatal([Libtool version $1 or higher is required],
71fc27e79cSmrg		             63)])],
72fc27e79cSmrg       [$2])])
73659607e0Smrg
74659607e0Smrg
75fc27e79cSmrg# _LT_CHECK_BUILDDIR
76fc27e79cSmrg# ------------------
77fc27e79cSmrg# Complain if the absolute build directory name contains unusual characters
78fc27e79cSmrgm4_defun([_LT_CHECK_BUILDDIR],
79fc27e79cSmrg[case `pwd` in
80fc27e79cSmrg  *\ * | *\	*)
81fc27e79cSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
82fc27e79cSmrgesac
83fc27e79cSmrg])
84659607e0Smrg
85659607e0Smrg
86fc27e79cSmrg# LT_INIT([OPTIONS])
87fc27e79cSmrg# ------------------
88fc27e79cSmrgAC_DEFUN([LT_INIT],
89fc27e79cSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
90fc27e79cSmrgAC_BEFORE([$0], [LT_LANG])dnl
91fc27e79cSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
92fc27e79cSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
93fc27e79cSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
94fc27e79cSmrg
95fc27e79cSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
96fc27e79cSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
97fc27e79cSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
98fc27e79cSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
99fc27e79cSmrgdnl unless we require an AC_DEFUNed macro:
100fc27e79cSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
101fc27e79cSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
102fc27e79cSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
103fc27e79cSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
104fc27e79cSmrgm4_require([_LT_PROG_LTMAIN])dnl
105fc27e79cSmrg
106fc27e79cSmrgdnl Parse OPTIONS
107fc27e79cSmrg_LT_SET_OPTIONS([$0], [$1])
108659607e0Smrg
109fc27e79cSmrg# This can be used to rebuild libtool when needed
110fc27e79cSmrgLIBTOOL_DEPS="$ltmain"
111659607e0Smrg
112fc27e79cSmrg# Always use our own libtool.
113fc27e79cSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
114fc27e79cSmrgAC_SUBST(LIBTOOL)dnl
115659607e0Smrg
116fc27e79cSmrg_LT_SETUP
117659607e0Smrg
118fc27e79cSmrg# Only expand once:
119fc27e79cSmrgm4_define([LT_INIT])
120fc27e79cSmrg])# LT_INIT
121659607e0Smrg
122fc27e79cSmrg# Old names:
123fc27e79cSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
124fc27e79cSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
125fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
126fc27e79cSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
127fc27e79cSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
128659607e0Smrg
129659607e0Smrg
130fc27e79cSmrg# _LT_CC_BASENAME(CC)
131fc27e79cSmrg# -------------------
132fc27e79cSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
133fc27e79cSmrgm4_defun([_LT_CC_BASENAME],
134fc27e79cSmrg[for cc_temp in $1""; do
135fc27e79cSmrg  case $cc_temp in
136fc27e79cSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137fc27e79cSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138fc27e79cSmrg    \-*) ;;
139fc27e79cSmrg    *) break;;
140fc27e79cSmrg  esac
141fc27e79cSmrgdone
142fc27e79cSmrgcc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
1436aab59a7Smrg])
144fc27e79cSmrg
145fc27e79cSmrg
146fc27e79cSmrg# _LT_FILEUTILS_DEFAULTS
147fc27e79cSmrg# ----------------------
148fc27e79cSmrg# It is okay to use these file commands and assume they have been set
149fc27e79cSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
150fc27e79cSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
151fc27e79cSmrg[: ${CP="cp -f"}
152fc27e79cSmrg: ${MV="mv -f"}
153fc27e79cSmrg: ${RM="rm -f"}
154fc27e79cSmrg])# _LT_FILEUTILS_DEFAULTS
155fc27e79cSmrg
156fc27e79cSmrg
157fc27e79cSmrg# _LT_SETUP
158fc27e79cSmrg# ---------
159fc27e79cSmrgm4_defun([_LT_SETUP],
160fc27e79cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
161fc27e79cSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
162fc27e79cSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
163fc27e79cSmrg_LT_DECL([], [host], [0])dnl
164fc27e79cSmrg_LT_DECL([], [host_os], [0])dnl
165fc27e79cSmrgdnl
166fc27e79cSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
167fc27e79cSmrg_LT_DECL([], [build], [0])dnl
168fc27e79cSmrg_LT_DECL([], [build_os], [0])dnl
169fc27e79cSmrgdnl
170fc27e79cSmrgAC_REQUIRE([AC_PROG_CC])dnl
171fc27e79cSmrgAC_REQUIRE([LT_PATH_LD])dnl
172fc27e79cSmrgAC_REQUIRE([LT_PATH_NM])dnl
173fc27e79cSmrgdnl
174fc27e79cSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
175fc27e79cSmrgtest -z "$LN_S" && LN_S="ln -s"
176fc27e79cSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
177fc27e79cSmrgdnl
178fc27e79cSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
179fc27e79cSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
180fc27e79cSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
181fc27e79cSmrgdnl
182fc27e79cSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
183fc27e79cSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
184fc27e79cSmrgm4_require([_LT_CMD_RELOAD])dnl
185fc27e79cSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
186fc27e79cSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
187fc27e79cSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
188fc27e79cSmrg
189fc27e79cSmrg_LT_CONFIG_LIBTOOL_INIT([
190fc27e79cSmrg# See if we are running on zsh, and set the options which allow our
191fc27e79cSmrg# commands through without removal of \ escapes INIT.
192fc27e79cSmrgif test -n "\${ZSH_VERSION+set}" ; then
193fc27e79cSmrg   setopt NO_GLOB_SUBST
194fc27e79cSmrgfi
1956aab59a7Smrg])
196fc27e79cSmrgif test -n "${ZSH_VERSION+set}" ; then
197fc27e79cSmrg   setopt NO_GLOB_SUBST
198fc27e79cSmrgfi
199659607e0Smrg
200fc27e79cSmrg_LT_CHECK_OBJDIR
201659607e0Smrg
202fc27e79cSmrgm4_require([_LT_TAG_COMPILER])dnl
203fc27e79cSmrg_LT_PROG_ECHO_BACKSLASH
204659607e0Smrg
205fc27e79cSmrgcase $host_os in
206fc27e79cSmrgaix3*)
207fc27e79cSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
208fc27e79cSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
209fc27e79cSmrg  # vanish in a puff of smoke.
210fc27e79cSmrg  if test "X${COLLECT_NAMES+set}" != Xset; then
211fc27e79cSmrg    COLLECT_NAMES=
212fc27e79cSmrg    export COLLECT_NAMES
213fc27e79cSmrg  fi
214fc27e79cSmrg  ;;
215fc27e79cSmrgesac
216659607e0Smrg
217fc27e79cSmrg# Sed substitution that helps us do robust quoting.  It backslashifies
218fc27e79cSmrg# metacharacters that are still active within double-quoted strings.
219fc27e79cSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
220659607e0Smrg
221fc27e79cSmrg# Same as above, but do not quote variable references.
222fc27e79cSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
223659607e0Smrg
224fc27e79cSmrg# Sed substitution to delay expansion of an escaped shell variable in a
225fc27e79cSmrg# double_quote_subst'ed string.
226fc27e79cSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
227659607e0Smrg
228fc27e79cSmrg# Sed substitution to delay expansion of an escaped single quote.
229fc27e79cSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
230659607e0Smrg
231fc27e79cSmrg# Sed substitution to avoid accidental globbing in evaled expressions
232fc27e79cSmrgno_glob_subst='s/\*/\\\*/g'
233659607e0Smrg
234fc27e79cSmrg# Global variables:
235fc27e79cSmrgofile=libtool
236fc27e79cSmrgcan_build_shared=yes
237659607e0Smrg
238fc27e79cSmrg# All known linkers require a `.a' archive for static linking (except MSVC,
239fc27e79cSmrg# which needs '.lib').
240fc27e79cSmrglibext=a
241659607e0Smrg
242fc27e79cSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
243659607e0Smrg
244fc27e79cSmrgold_CC="$CC"
245fc27e79cSmrgold_CFLAGS="$CFLAGS"
246659607e0Smrg
247fc27e79cSmrg# Set sane defaults for various variables
248fc27e79cSmrgtest -z "$CC" && CC=cc
249fc27e79cSmrgtest -z "$LTCC" && LTCC=$CC
250fc27e79cSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
251fc27e79cSmrgtest -z "$LD" && LD=ld
252fc27e79cSmrgtest -z "$ac_objext" && ac_objext=o
253659607e0Smrg
254fc27e79cSmrg_LT_CC_BASENAME([$compiler])
255659607e0Smrg
256fc27e79cSmrg# Only perform the check for file, if the check method requires it
257fc27e79cSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
258fc27e79cSmrgcase $deplibs_check_method in
259fc27e79cSmrgfile_magic*)
260fc27e79cSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
261fc27e79cSmrg    _LT_PATH_MAGIC
262fc27e79cSmrg  fi
263fc27e79cSmrg  ;;
264fc27e79cSmrgesac
265659607e0Smrg
266fc27e79cSmrg# Use C for the default configuration in the libtool script
267fc27e79cSmrgLT_SUPPORTED_TAG([CC])
268fc27e79cSmrg_LT_LANG_C_CONFIG
269fc27e79cSmrg_LT_LANG_DEFAULT_CONFIG
270fc27e79cSmrg_LT_CONFIG_COMMANDS
271fc27e79cSmrg])# _LT_SETUP
272659607e0Smrg
273659607e0Smrg
274fc27e79cSmrg# _LT_PROG_LTMAIN
275fc27e79cSmrg# ---------------
276fc27e79cSmrg# Note that this code is called both from `configure', and `config.status'
277fc27e79cSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
278fc27e79cSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
279fc27e79cSmrg# so we pass a copy along to make sure it has a sensible value anyway.
280fc27e79cSmrgm4_defun([_LT_PROG_LTMAIN],
281fc27e79cSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
282fc27e79cSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
283fc27e79cSmrgltmain="$ac_aux_dir/ltmain.sh"
284fc27e79cSmrg])# _LT_PROG_LTMAIN
285659607e0Smrg
286659607e0Smrg
287659607e0Smrg
288fc27e79cSmrg# So that we can recreate a full libtool script including additional
289fc27e79cSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
290fc27e79cSmrg# in macros and then make a single call at the end using the `libtool'
291fc27e79cSmrg# label.
292659607e0Smrg
293fc27e79cSmrg
294fc27e79cSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
295fc27e79cSmrg# ----------------------------------------
296fc27e79cSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
297fc27e79cSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
298fc27e79cSmrg[m4_ifval([$1],
299fc27e79cSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
300fc27e79cSmrg                     [$1
301fc27e79cSmrg])])])
302fc27e79cSmrg
303fc27e79cSmrg# Initialize.
304fc27e79cSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
305fc27e79cSmrg
306fc27e79cSmrg
307fc27e79cSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
308fc27e79cSmrg# ------------------------------
309fc27e79cSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
310fc27e79cSmrgm4_define([_LT_CONFIG_LIBTOOL],
311fc27e79cSmrg[m4_ifval([$1],
312fc27e79cSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
313fc27e79cSmrg                     [$1
314fc27e79cSmrg])])])
315fc27e79cSmrg
316fc27e79cSmrg# Initialize.
317fc27e79cSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
318fc27e79cSmrg
319fc27e79cSmrg
320fc27e79cSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
321fc27e79cSmrg# -----------------------------------------------------
322fc27e79cSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
323fc27e79cSmrg[_LT_CONFIG_LIBTOOL([$1])
324fc27e79cSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
3256aab59a7Smrg])
326fc27e79cSmrg
327fc27e79cSmrg
328fc27e79cSmrg# _LT_FORMAT_COMMENT([COMMENT])
329fc27e79cSmrg# -----------------------------
330fc27e79cSmrg# Add leading comment marks to the start of each line, and a trailing
331fc27e79cSmrg# full-stop to the whole comment if one is not present already.
332fc27e79cSmrgm4_define([_LT_FORMAT_COMMENT],
333fc27e79cSmrg[m4_ifval([$1], [
334fc27e79cSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
335fc27e79cSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
336fc27e79cSmrg)])
337fc27e79cSmrg
338fc27e79cSmrg
339fc27e79cSmrg
340fc27e79cSmrg
341fc27e79cSmrg
342fc27e79cSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
343fc27e79cSmrg# -------------------------------------------------------------------
344fc27e79cSmrg# CONFIGNAME is the name given to the value in the libtool script.
345fc27e79cSmrg# VARNAME is the (base) name used in the configure script.
346fc27e79cSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
347fc27e79cSmrg# VARNAME.  Any other value will be used directly.
348fc27e79cSmrgm4_define([_LT_DECL],
349fc27e79cSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
350fc27e79cSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
351fc27e79cSmrg	[m4_ifval([$1], [$1], [$2])])
352fc27e79cSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
353fc27e79cSmrg    m4_ifval([$4],
354fc27e79cSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
355fc27e79cSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
356fc27e79cSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3576aab59a7Smrg])
358659607e0Smrg
359659607e0Smrg
360fc27e79cSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
361fc27e79cSmrg# --------------------------------------------------------
362fc27e79cSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
363659607e0Smrg
364659607e0Smrg
365fc27e79cSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
366fc27e79cSmrg# ------------------------------------------------
367fc27e79cSmrgm4_define([lt_decl_tag_varnames],
368fc27e79cSmrg[_lt_decl_filter([tagged?], [yes], $@)])
369659607e0Smrg
370659607e0Smrg
371fc27e79cSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
372fc27e79cSmrg# ---------------------------------------------------------
373fc27e79cSmrgm4_define([_lt_decl_filter],
374fc27e79cSmrg[m4_case([$#],
375fc27e79cSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
376fc27e79cSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
377fc27e79cSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
378fc27e79cSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
379fc27e79cSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
380fc27e79cSmrg])
381659607e0Smrg
382659607e0Smrg
383fc27e79cSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
384fc27e79cSmrg# --------------------------------------------------
385fc27e79cSmrgm4_define([lt_decl_quote_varnames],
386fc27e79cSmrg[_lt_decl_filter([value], [1], $@)])
387659607e0Smrg
388659607e0Smrg
389fc27e79cSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
390fc27e79cSmrg# ---------------------------------------------------
391fc27e79cSmrgm4_define([lt_decl_dquote_varnames],
392fc27e79cSmrg[_lt_decl_filter([value], [2], $@)])
393659607e0Smrg
394659607e0Smrg
395fc27e79cSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
396fc27e79cSmrg# ---------------------------------------------------
397fc27e79cSmrgm4_define([lt_decl_varnames_tagged],
398fc27e79cSmrg[m4_assert([$# <= 2])dnl
399fc27e79cSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
400fc27e79cSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
401fc27e79cSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
402fc27e79cSmrgm4_define([_lt_decl_varnames_tagged],
403fc27e79cSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
404659607e0Smrg
405659607e0Smrg
406fc27e79cSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
407fc27e79cSmrg# ------------------------------------------------
408fc27e79cSmrgm4_define([lt_decl_all_varnames],
409fc27e79cSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
410fc27e79cSmrg     m4_if([$2], [],
411fc27e79cSmrg	   m4_quote(lt_decl_varnames),
412fc27e79cSmrg	m4_quote(m4_shift($@))))[]dnl
413fc27e79cSmrg])
414fc27e79cSmrgm4_define([_lt_decl_all_varnames],
415fc27e79cSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
416fc27e79cSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
417fc27e79cSmrg])
418659607e0Smrg
419659607e0Smrg
420fc27e79cSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
421fc27e79cSmrg# ------------------------------------
422fc27e79cSmrg# Quote a variable value, and forward it to `config.status' so that its
423fc27e79cSmrg# declaration there will have the same value as in `configure'.  VARNAME
424fc27e79cSmrg# must have a single quote delimited value for this to work.
425fc27e79cSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
426fc27e79cSmrg[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
427659607e0Smrg
428fc27e79cSmrg
429fc27e79cSmrg# _LT_CONFIG_STATUS_DECLARATIONS
430fc27e79cSmrg# ------------------------------
431fc27e79cSmrg# We delimit libtool config variables with single quotes, so when
432fc27e79cSmrg# we write them to config.status, we have to be sure to quote all
433fc27e79cSmrg# embedded single quotes properly.  In configure, this macro expands
434fc27e79cSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
435fc27e79cSmrg#
436fc27e79cSmrg#    <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
437fc27e79cSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
438fc27e79cSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
439fc27e79cSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
440fc27e79cSmrg
441fc27e79cSmrg
442fc27e79cSmrg# _LT_LIBTOOL_TAGS
443fc27e79cSmrg# ----------------
444fc27e79cSmrg# Output comment and list of tags supported by the script
445fc27e79cSmrgm4_defun([_LT_LIBTOOL_TAGS],
446fc27e79cSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
447fc27e79cSmrgavailable_tags="_LT_TAGS"dnl
4486aab59a7Smrg])
449659607e0Smrg
450659607e0Smrg
451fc27e79cSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
452fc27e79cSmrg# -----------------------------------
453fc27e79cSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
454fc27e79cSmrg# expand to a commented shell variable setting:
4556aab59a7Smrg#
456fc27e79cSmrg#    # Some comment about what VAR is for.
457fc27e79cSmrg#    visible_name=$lt_internal_name
458fc27e79cSmrgm4_define([_LT_LIBTOOL_DECLARE],
459fc27e79cSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
460fc27e79cSmrg					   [description])))[]dnl
461fc27e79cSmrgm4_pushdef([_libtool_name],
462fc27e79cSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
463fc27e79cSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
464fc27e79cSmrg    [0], [_libtool_name=[$]$1],
465fc27e79cSmrg    [1], [_libtool_name=$lt_[]$1],
466fc27e79cSmrg    [2], [_libtool_name=$lt_[]$1],
467fc27e79cSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
468fc27e79cSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
469fc27e79cSmrg])
470659607e0Smrg
471659607e0Smrg
472fc27e79cSmrg# _LT_LIBTOOL_CONFIG_VARS
473fc27e79cSmrg# -----------------------
474fc27e79cSmrg# Produce commented declarations of non-tagged libtool config variables
475fc27e79cSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
476fc27e79cSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
477fc27e79cSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
478fc27e79cSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
479fc27e79cSmrg[m4_foreach([_lt_var],
480fc27e79cSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
481fc27e79cSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
482fc27e79cSmrg
483fc27e79cSmrg
484fc27e79cSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
485fc27e79cSmrg# -------------------------
486fc27e79cSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
487fc27e79cSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
488fc27e79cSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
489fc27e79cSmrg
490fc27e79cSmrg
491fc27e79cSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
4926aab59a7Smrg# ------------------------------
493fc27e79cSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
4946aab59a7Smrg
4956aab59a7Smrg
496fc27e79cSmrg# _LT_CONFIG_COMMANDS
497fc27e79cSmrg# -------------------
498fc27e79cSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
499fc27e79cSmrg# variables for single and double quote escaping we saved from calls
500fc27e79cSmrg# to _LT_DECL, we can put quote escaped variables declarations
501fc27e79cSmrg# into `config.status', and then the shell code to quote escape them in
502fc27e79cSmrg# for loops in `config.status'.  Finally, any additional code accumulated
503fc27e79cSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
504fc27e79cSmrgm4_defun([_LT_CONFIG_COMMANDS],
505fc27e79cSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
506fc27e79cSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
507fc27e79cSmrg	dnl instead of duplicating it all over again into config.status,
508fc27e79cSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
509fc27e79cSmrg	dnl needs to know what name is stored there:
510fc27e79cSmrg        [AC_CONFIG_COMMANDS([libtool],
511fc27e79cSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
512fc27e79cSmrg    dnl If the libtool generation code is destined for config.status,
513fc27e79cSmrg    dnl expand the accumulated commands and init code now:
514fc27e79cSmrg    [AC_CONFIG_COMMANDS([libtool],
515fc27e79cSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
516fc27e79cSmrg])#_LT_CONFIG_COMMANDS
517fc27e79cSmrg
518fc27e79cSmrg
519fc27e79cSmrg# Initialize.
520fc27e79cSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
521fc27e79cSmrg[
522659607e0Smrg
523fc27e79cSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
524fc27e79cSmrg# if CDPATH is set.
525fc27e79cSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
526659607e0Smrg
527fc27e79cSmrgsed_quote_subst='$sed_quote_subst'
528fc27e79cSmrgdouble_quote_subst='$double_quote_subst'
529fc27e79cSmrgdelay_variable_subst='$delay_variable_subst'
530fc27e79cSmrg_LT_CONFIG_STATUS_DECLARATIONS
531fc27e79cSmrgLTCC='$LTCC'
532fc27e79cSmrgLTCFLAGS='$LTCFLAGS'
533fc27e79cSmrgcompiler='$compiler_DEFAULT'
534fc27e79cSmrg
535fc27e79cSmrg# Quote evaled strings.
536fc27e79cSmrgfor var in lt_decl_all_varnames([[ \
537fc27e79cSmrg]], lt_decl_quote_varnames); do
538fc27e79cSmrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
539fc27e79cSmrg    *[[\\\\\\\`\\"\\\$]]*)
540fc27e79cSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
541fc27e79cSmrg      ;;
542fc27e79cSmrg    *)
543fc27e79cSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
544fc27e79cSmrg      ;;
545fc27e79cSmrg    esac
546fc27e79cSmrgdone
547fc27e79cSmrg
548fc27e79cSmrg# Double-quote double-evaled strings.
549fc27e79cSmrgfor var in lt_decl_all_varnames([[ \
550fc27e79cSmrg]], lt_decl_dquote_varnames); do
551fc27e79cSmrg    case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
552fc27e79cSmrg    *[[\\\\\\\`\\"\\\$]]*)
553fc27e79cSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
554fc27e79cSmrg      ;;
555fc27e79cSmrg    *)
556fc27e79cSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
557fc27e79cSmrg      ;;
558fc27e79cSmrg    esac
559fc27e79cSmrgdone
560fc27e79cSmrg
561fc27e79cSmrg# Fix-up fallback echo if it was mangled by the above quoting rules.
562fc27e79cSmrgcase \$lt_ECHO in
563fc27e79cSmrg*'\\\[$]0 --fallback-echo"')dnl "
564fc27e79cSmrg  lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
565fc27e79cSmrg  ;;
5666aab59a7Smrgesac
567fc27e79cSmrg
568fc27e79cSmrg_LT_OUTPUT_LIBTOOL_INIT
569659607e0Smrg])
570659607e0Smrg
571659607e0Smrg
572fc27e79cSmrg# LT_OUTPUT
573fc27e79cSmrg# ---------
574fc27e79cSmrg# This macro allows early generation of the libtool script (before
575fc27e79cSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
576fc27e79cSmrg# tests.
577fc27e79cSmrgAC_DEFUN([LT_OUTPUT],
578fc27e79cSmrg[: ${CONFIG_LT=./config.lt}
579fc27e79cSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
580fc27e79cSmrgcat >"$CONFIG_LT" <<_LTEOF
581fc27e79cSmrg#! $SHELL
582fc27e79cSmrg# Generated by $as_me.
583fc27e79cSmrg# Run this file to recreate a libtool stub with the current configuration.
584fc27e79cSmrg
585fc27e79cSmrglt_cl_silent=false
586fc27e79cSmrgSHELL=\${CONFIG_SHELL-$SHELL}
587fc27e79cSmrg_LTEOF
588fc27e79cSmrg
589fc27e79cSmrgcat >>"$CONFIG_LT" <<\_LTEOF
590fc27e79cSmrgAS_SHELL_SANITIZE
591fc27e79cSmrg_AS_PREPARE
592fc27e79cSmrg
593fc27e79cSmrgexec AS_MESSAGE_FD>&1
594fc27e79cSmrgexec AS_MESSAGE_LOG_FD>>config.log
595fc27e79cSmrg{
596fc27e79cSmrg  echo
597fc27e79cSmrg  AS_BOX([Running $as_me.])
598fc27e79cSmrg} >&AS_MESSAGE_LOG_FD
599659607e0Smrg
600fc27e79cSmrglt_cl_help="\
601fc27e79cSmrg\`$as_me' creates a local libtool stub from the current configuration,
602fc27e79cSmrgfor use in further configure time tests before the real libtool is
603fc27e79cSmrggenerated.
604659607e0Smrg
605fc27e79cSmrgUsage: $[0] [[OPTIONS]]
606659607e0Smrg
607fc27e79cSmrg  -h, --help      print this help, then exit
608fc27e79cSmrg  -V, --version   print version number, then exit
609fc27e79cSmrg  -q, --quiet     do not print progress messages
610fc27e79cSmrg  -d, --debug     don't remove temporary files
611659607e0Smrg
612fc27e79cSmrgReport bugs to <bug-libtool@gnu.org>."
613659607e0Smrg
614fc27e79cSmrglt_cl_version="\
615fc27e79cSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
616fc27e79cSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
617fc27e79cSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
618659607e0Smrg
619fc27e79cSmrgCopyright (C) 2008 Free Software Foundation, Inc.
620fc27e79cSmrgThis config.lt script is free software; the Free Software Foundation
621fc27e79cSmrggives unlimited permision to copy, distribute and modify it."
622659607e0Smrg
623fc27e79cSmrgwhile test $[#] != 0
624fc27e79cSmrgdo
625fc27e79cSmrg  case $[1] in
626fc27e79cSmrg    --version | --v* | -V )
627fc27e79cSmrg      echo "$lt_cl_version"; exit 0 ;;
628fc27e79cSmrg    --help | --h* | -h )
629fc27e79cSmrg      echo "$lt_cl_help"; exit 0 ;;
630fc27e79cSmrg    --debug | --d* | -d )
631fc27e79cSmrg      debug=: ;;
632fc27e79cSmrg    --quiet | --q* | --silent | --s* | -q )
633fc27e79cSmrg      lt_cl_silent=: ;;
634fc27e79cSmrg
635fc27e79cSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
636fc27e79cSmrgTry \`$[0] --help' for more information.]) ;;
637fc27e79cSmrg
638fc27e79cSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
639fc27e79cSmrgTry \`$[0] --help' for more information.]) ;;
640fc27e79cSmrg  esac
641fc27e79cSmrg  shift
642fc27e79cSmrgdone
643659607e0Smrg
644fc27e79cSmrgif $lt_cl_silent; then
645fc27e79cSmrg  exec AS_MESSAGE_FD>/dev/null
646fc27e79cSmrgfi
647fc27e79cSmrg_LTEOF
648fc27e79cSmrg
649fc27e79cSmrgcat >>"$CONFIG_LT" <<_LTEOF
650fc27e79cSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
651fc27e79cSmrg_LTEOF
652fc27e79cSmrg
653fc27e79cSmrgcat >>"$CONFIG_LT" <<\_LTEOF
654fc27e79cSmrgAC_MSG_NOTICE([creating $ofile])
655fc27e79cSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
656fc27e79cSmrgAS_EXIT(0)
657fc27e79cSmrg_LTEOF
658fc27e79cSmrgchmod +x "$CONFIG_LT"
659fc27e79cSmrg
660fc27e79cSmrg# configure is writing to config.log, but config.lt does its own redirection,
661fc27e79cSmrg# appending to config.log, which fails on DOS, as config.log is still kept
662fc27e79cSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
663fc27e79cSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
664fc27e79cSmrgif test "$no_create" != yes; then
665fc27e79cSmrg  lt_cl_success=:
666fc27e79cSmrg  test "$silent" = yes &&
667fc27e79cSmrg    lt_config_lt_args="$lt_config_lt_args --quiet"
668fc27e79cSmrg  exec AS_MESSAGE_LOG_FD>/dev/null
669fc27e79cSmrg  $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
670fc27e79cSmrg  exec AS_MESSAGE_LOG_FD>>config.log
671fc27e79cSmrg  $lt_cl_success || AS_EXIT(1)
672fc27e79cSmrgfi
673fc27e79cSmrg])# LT_OUTPUT
674659607e0Smrg
675fc27e79cSmrg
676fc27e79cSmrg# _LT_CONFIG(TAG)
6776aab59a7Smrg# ---------------
678fc27e79cSmrg# If TAG is the built-in tag, create an initial libtool script with a
679fc27e79cSmrg# default configuration from the untagged config vars.  Otherwise add code
680fc27e79cSmrg# to config.status for appending the configuration named by TAG from the
681fc27e79cSmrg# matching tagged config vars.
682fc27e79cSmrgm4_defun([_LT_CONFIG],
683fc27e79cSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
684fc27e79cSmrg_LT_CONFIG_SAVE_COMMANDS([
685fc27e79cSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
686fc27e79cSmrg  m4_if(_LT_TAG, [C], [
687fc27e79cSmrg    # See if we are running on zsh, and set the options which allow our
688fc27e79cSmrg    # commands through without removal of \ escapes.
689fc27e79cSmrg    if test -n "${ZSH_VERSION+set}" ; then
690fc27e79cSmrg      setopt NO_GLOB_SUBST
691fc27e79cSmrg    fi
692659607e0Smrg
693fc27e79cSmrg    cfgfile="${ofile}T"
694fc27e79cSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
695fc27e79cSmrg    $RM "$cfgfile"
696659607e0Smrg
697fc27e79cSmrg    cat <<_LT_EOF >> "$cfgfile"
698fc27e79cSmrg#! $SHELL
699659607e0Smrg
700fc27e79cSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
701fc27e79cSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
702fc27e79cSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
703fc27e79cSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
7046aab59a7Smrg#
705fc27e79cSmrg_LT_COPYING
706fc27e79cSmrg_LT_LIBTOOL_TAGS
707659607e0Smrg
708fc27e79cSmrg# ### BEGIN LIBTOOL CONFIG
709fc27e79cSmrg_LT_LIBTOOL_CONFIG_VARS
710fc27e79cSmrg_LT_LIBTOOL_TAG_VARS
711fc27e79cSmrg# ### END LIBTOOL CONFIG
712fc27e79cSmrg
713fc27e79cSmrg_LT_EOF
714fc27e79cSmrg
715fc27e79cSmrg  case $host_os in
716fc27e79cSmrg  aix3*)
717fc27e79cSmrg    cat <<\_LT_EOF >> "$cfgfile"
718fc27e79cSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
719fc27e79cSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
720fc27e79cSmrg# vanish in a puff of smoke.
721fc27e79cSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
722fc27e79cSmrg  COLLECT_NAMES=
723fc27e79cSmrg  export COLLECT_NAMES
724659607e0Smrgfi
725fc27e79cSmrg_LT_EOF
726fc27e79cSmrg    ;;
727fc27e79cSmrg  esac
728659607e0Smrg
729fc27e79cSmrg  _LT_PROG_LTMAIN
730659607e0Smrg
731fc27e79cSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
732fc27e79cSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
733fc27e79cSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
734fc27e79cSmrg  # is reportedly fixed, but why not run on old versions too?
735fc27e79cSmrg  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
736fc27e79cSmrg    || (rm -f "$cfgfile"; exit 1)
737659607e0Smrg
738fc27e79cSmrg  _LT_PROG_XSI_SHELLFNS
739659607e0Smrg
740fc27e79cSmrg  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
741fc27e79cSmrg    || (rm -f "$cfgfile"; exit 1)
742659607e0Smrg
743fc27e79cSmrg  mv -f "$cfgfile" "$ofile" ||
744fc27e79cSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
745fc27e79cSmrg  chmod +x "$ofile"
746fc27e79cSmrg],
747fc27e79cSmrg[cat <<_LT_EOF >> "$ofile"
748659607e0Smrg
749fc27e79cSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
750fc27e79cSmrgdnl in a comment (ie after a #).
751fc27e79cSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
752fc27e79cSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
753fc27e79cSmrg# ### END LIBTOOL TAG CONFIG: $1
754fc27e79cSmrg_LT_EOF
755fc27e79cSmrg])dnl /m4_if
756fc27e79cSmrg],
757fc27e79cSmrg[m4_if([$1], [], [
758fc27e79cSmrg    PACKAGE='$PACKAGE'
759fc27e79cSmrg    VERSION='$VERSION'
760fc27e79cSmrg    TIMESTAMP='$TIMESTAMP'
761fc27e79cSmrg    RM='$RM'
762fc27e79cSmrg    ofile='$ofile'], [])
763fc27e79cSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
764fc27e79cSmrg])# _LT_CONFIG
765659607e0Smrg
7666aab59a7Smrg
767fc27e79cSmrg# LT_SUPPORTED_TAG(TAG)
768fc27e79cSmrg# ---------------------
769fc27e79cSmrg# Trace this macro to discover what tags are supported by the libtool
770fc27e79cSmrg# --tag option, using:
771fc27e79cSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
772fc27e79cSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
773659607e0Smrg
774659607e0Smrg
775fc27e79cSmrg# C support is built-in for now
776fc27e79cSmrgm4_define([_LT_LANG_C_enabled], [])
777fc27e79cSmrgm4_define([_LT_TAGS], [])
778659607e0Smrg
779659607e0Smrg
780fc27e79cSmrg# LT_LANG(LANG)
781fc27e79cSmrg# -------------
782fc27e79cSmrg# Enable libtool support for the given language if not already enabled.
783fc27e79cSmrgAC_DEFUN([LT_LANG],
784fc27e79cSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
785fc27e79cSmrgm4_case([$1],
786fc27e79cSmrg  [C],			[_LT_LANG(C)],
787fc27e79cSmrg  [C++],		[_LT_LANG(CXX)],
788fc27e79cSmrg  [Java],		[_LT_LANG(GCJ)],
789fc27e79cSmrg  [Fortran 77],		[_LT_LANG(F77)],
790fc27e79cSmrg  [Fortran],		[_LT_LANG(FC)],
791fc27e79cSmrg  [Windows Resource],	[_LT_LANG(RC)],
792fc27e79cSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
793fc27e79cSmrg    [_LT_LANG($1)],
794fc27e79cSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
795fc27e79cSmrg])# LT_LANG
796fc27e79cSmrg
797fc27e79cSmrg
798fc27e79cSmrg# _LT_LANG(LANGNAME)
7996aab59a7Smrg# ------------------
800fc27e79cSmrgm4_defun([_LT_LANG],
801fc27e79cSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
802fc27e79cSmrg  [LT_SUPPORTED_TAG([$1])dnl
803fc27e79cSmrg  m4_append([_LT_TAGS], [$1 ])dnl
804fc27e79cSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
805fc27e79cSmrg  _LT_LANG_$1_CONFIG($1)])dnl
806fc27e79cSmrg])# _LT_LANG
807659607e0Smrg
808659607e0Smrg
809fc27e79cSmrg# _LT_LANG_DEFAULT_CONFIG
8106aab59a7Smrg# -----------------------
811fc27e79cSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
812fc27e79cSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
813fc27e79cSmrg  [LT_LANG(CXX)],
814fc27e79cSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
815fc27e79cSmrg
816fc27e79cSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
817fc27e79cSmrg  [LT_LANG(F77)],
818fc27e79cSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
819fc27e79cSmrg
820fc27e79cSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
821fc27e79cSmrg  [LT_LANG(FC)],
822fc27e79cSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
823fc27e79cSmrg
824fc27e79cSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
825fc27e79cSmrgdnl pulling things in needlessly.
826fc27e79cSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
827fc27e79cSmrg  [LT_LANG(GCJ)],
828fc27e79cSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
829fc27e79cSmrg    [LT_LANG(GCJ)],
830fc27e79cSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
831fc27e79cSmrg      [LT_LANG(GCJ)],
832fc27e79cSmrg      [m4_ifdef([AC_PROG_GCJ],
833fc27e79cSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
834fc27e79cSmrg       m4_ifdef([A][M_PROG_GCJ],
835fc27e79cSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
836fc27e79cSmrg       m4_ifdef([LT_PROG_GCJ],
837fc27e79cSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
838fc27e79cSmrg
839fc27e79cSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
840fc27e79cSmrg  [LT_LANG(RC)],
841fc27e79cSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
842fc27e79cSmrg])# _LT_LANG_DEFAULT_CONFIG
843fc27e79cSmrg
844fc27e79cSmrg# Obsolete macros:
845fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
846fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
847fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
848fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
849fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
850fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
851fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
852fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
853fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
854fc27e79cSmrg
855fc27e79cSmrg
856fc27e79cSmrg# _LT_TAG_COMPILER
857fc27e79cSmrg# ----------------
858fc27e79cSmrgm4_defun([_LT_TAG_COMPILER],
859fc27e79cSmrg[AC_REQUIRE([AC_PROG_CC])dnl
8606aab59a7Smrg
861fc27e79cSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
862fc27e79cSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
863fc27e79cSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
864fc27e79cSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
865659607e0Smrg
866fc27e79cSmrg# If no C compiler was specified, use CC.
867fc27e79cSmrgLTCC=${LTCC-"$CC"}
868659607e0Smrg
869fc27e79cSmrg# If no C compiler flags were specified, use CFLAGS.
870fc27e79cSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
871659607e0Smrg
872fc27e79cSmrg# Allow CC to be a program name with arguments.
873fc27e79cSmrgcompiler=$CC
874fc27e79cSmrg])# _LT_TAG_COMPILER
875659607e0Smrg
876659607e0Smrg
877fc27e79cSmrg# _LT_COMPILER_BOILERPLATE
878fc27e79cSmrg# ------------------------
879fc27e79cSmrg# Check for compiler boilerplate output or warnings with
880fc27e79cSmrg# the simple compiler test code.
881fc27e79cSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
882fc27e79cSmrg[m4_require([_LT_DECL_SED])dnl
883fc27e79cSmrgac_outfile=conftest.$ac_objext
884fc27e79cSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
885fc27e79cSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
886fc27e79cSmrg_lt_compiler_boilerplate=`cat conftest.err`
887fc27e79cSmrg$RM conftest*
888fc27e79cSmrg])# _LT_COMPILER_BOILERPLATE
889659607e0Smrg
890659607e0Smrg
891fc27e79cSmrg# _LT_LINKER_BOILERPLATE
892fc27e79cSmrg# ----------------------
893fc27e79cSmrg# Check for linker boilerplate output or warnings with
894fc27e79cSmrg# the simple link test code.
895fc27e79cSmrgm4_defun([_LT_LINKER_BOILERPLATE],
896fc27e79cSmrg[m4_require([_LT_DECL_SED])dnl
897fc27e79cSmrgac_outfile=conftest.$ac_objext
898fc27e79cSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
899fc27e79cSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
900fc27e79cSmrg_lt_linker_boilerplate=`cat conftest.err`
901fc27e79cSmrg$RM -r conftest*
902fc27e79cSmrg])# _LT_LINKER_BOILERPLATE
9036aab59a7Smrg
904fc27e79cSmrg# _LT_REQUIRED_DARWIN_CHECKS
905fc27e79cSmrg# -------------------------
906fc27e79cSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
907fc27e79cSmrg  case $host_os in
908fc27e79cSmrg    rhapsody* | darwin*)
909fc27e79cSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
910fc27e79cSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
911fc27e79cSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
912fc27e79cSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
913fc27e79cSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
914fc27e79cSmrg    _LT_DECL([], [DSYMUTIL], [1],
915fc27e79cSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
916fc27e79cSmrg    _LT_DECL([], [NMEDIT], [1],
917fc27e79cSmrg      [Tool to change global to local symbols on Mac OS X])
918fc27e79cSmrg    _LT_DECL([], [LIPO], [1],
919fc27e79cSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
920fc27e79cSmrg    _LT_DECL([], [OTOOL], [1],
921fc27e79cSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
922fc27e79cSmrg    _LT_DECL([], [OTOOL64], [1],
923fc27e79cSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
924fc27e79cSmrg
925fc27e79cSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
926fc27e79cSmrg      [lt_cv_apple_cc_single_mod=no
927fc27e79cSmrg      if test -z "${LT_MULTI_MODULE}"; then
928fc27e79cSmrg	# By default we will add the -single_module flag. You can override
929fc27e79cSmrg	# by either setting the environment variable LT_MULTI_MODULE
930fc27e79cSmrg	# non-empty at configure time, or by adding -multi_module to the
931fc27e79cSmrg	# link flags.
932fc27e79cSmrg	rm -rf libconftest.dylib*
933fc27e79cSmrg	echo "int foo(void){return 1;}" > conftest.c
934fc27e79cSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
935fc27e79cSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
936fc27e79cSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
937fc27e79cSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
938fc27e79cSmrg        _lt_result=$?
939fc27e79cSmrg	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
940fc27e79cSmrg	  lt_cv_apple_cc_single_mod=yes
941fc27e79cSmrg	else
942fc27e79cSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
943fc27e79cSmrg	fi
944fc27e79cSmrg	rm -rf libconftest.dylib*
945fc27e79cSmrg	rm -f conftest.*
946fc27e79cSmrg      fi])
947fc27e79cSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
948fc27e79cSmrg      [lt_cv_ld_exported_symbols_list],
949fc27e79cSmrg      [lt_cv_ld_exported_symbols_list=no
950fc27e79cSmrg      save_LDFLAGS=$LDFLAGS
951fc27e79cSmrg      echo "_main" > conftest.sym
952fc27e79cSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
953fc27e79cSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
954fc27e79cSmrg	[lt_cv_ld_exported_symbols_list=yes],
955fc27e79cSmrg	[lt_cv_ld_exported_symbols_list=no])
956fc27e79cSmrg	LDFLAGS="$save_LDFLAGS"
957fc27e79cSmrg    ])
958fc27e79cSmrg    case $host_os in
959fc27e79cSmrg    rhapsody* | darwin1.[[012]])
960fc27e79cSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
961fc27e79cSmrg    darwin1.*)
962fc27e79cSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
963fc27e79cSmrg    darwin*) # darwin 5.x on
964fc27e79cSmrg      # if running on 10.5 or later, the deployment target defaults
965fc27e79cSmrg      # to the OS version, if on x86, and 10.4, the deployment
966fc27e79cSmrg      # target defaults to 10.4. Don't you love it?
967fc27e79cSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
968fc27e79cSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
969fc27e79cSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
970fc27e79cSmrg	10.[[012]]*)
971fc27e79cSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
972fc27e79cSmrg	10.*)
973fc27e79cSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
974fc27e79cSmrg      esac
975fc27e79cSmrg    ;;
976fc27e79cSmrg  esac
977fc27e79cSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
978fc27e79cSmrg      _lt_dar_single_mod='$single_module'
979fc27e79cSmrg    fi
980fc27e79cSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
981fc27e79cSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
982fc27e79cSmrg    else
983fc27e79cSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
984fc27e79cSmrg    fi
985fc27e79cSmrg    if test "$DSYMUTIL" != ":"; then
986fc27e79cSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
987fc27e79cSmrg    else
988fc27e79cSmrg      _lt_dsymutil=
989fc27e79cSmrg    fi
990fc27e79cSmrg    ;;
991fc27e79cSmrg  esac
992fc27e79cSmrg])
9936aab59a7Smrg
994659607e0Smrg
995fc27e79cSmrg# _LT_DARWIN_LINKER_FEATURES
996fc27e79cSmrg# --------------------------
997fc27e79cSmrg# Checks for linker and compiler features on darwin
998fc27e79cSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
999fc27e79cSmrg[
1000fc27e79cSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1001fc27e79cSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1002fc27e79cSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1003fc27e79cSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1004fc27e79cSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1005fc27e79cSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1006fc27e79cSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1007fc27e79cSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1008fc27e79cSmrg  case $cc_basename in
1009fc27e79cSmrg     ifort*) _lt_dar_can_shared=yes ;;
1010fc27e79cSmrg     *) _lt_dar_can_shared=$GCC ;;
1011fc27e79cSmrg  esac
1012fc27e79cSmrg  if test "$_lt_dar_can_shared" = "yes"; then
1013fc27e79cSmrg    output_verbose_link_cmd=echo
1014fc27e79cSmrg    _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}"
1015fc27e79cSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1016fc27e79cSmrg    _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}"
1017fc27e79cSmrg    _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}"
1018fc27e79cSmrg    m4_if([$1], [CXX],
1019fc27e79cSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1020fc27e79cSmrg      _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}"
1021fc27e79cSmrg      _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}"
1022fc27e79cSmrg    fi
1023fc27e79cSmrg],[])
1024fc27e79cSmrg  else
1025fc27e79cSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1026fc27e79cSmrg  fi
1027fc27e79cSmrg])
1028659607e0Smrg
1029fc27e79cSmrg# _LT_SYS_MODULE_PATH_AIX
1030fc27e79cSmrg# -----------------------
1031fc27e79cSmrg# Links a minimal program and checks the executable
1032fc27e79cSmrg# for the system default hardcoded library path. In most cases,
1033fc27e79cSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
1034fc27e79cSmrg# the location of the communication and MPI libs are included too.
1035fc27e79cSmrg# If we don't find anything, use the default library path according
1036fc27e79cSmrg# to the aix ld manual.
1037fc27e79cSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1038fc27e79cSmrg[m4_require([_LT_DECL_SED])dnl
1039fc27e79cSmrgAC_LINK_IFELSE(AC_LANG_PROGRAM,[
1040fc27e79cSmrglt_aix_libpath_sed='
1041fc27e79cSmrg    /Import File Strings/,/^$/ {
1042fc27e79cSmrg	/^0/ {
1043fc27e79cSmrg	    s/^0  *\(.*\)$/\1/
1044fc27e79cSmrg	    p
1045fc27e79cSmrg	}
1046fc27e79cSmrg    }'
1047fc27e79cSmrgaix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1048fc27e79cSmrg# Check for a 64-bit object if we didn't find anything.
1049fc27e79cSmrgif test -z "$aix_libpath"; then
1050fc27e79cSmrg  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1051fc27e79cSmrgfi],[])
1052fc27e79cSmrgif test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
1053fc27e79cSmrg])# _LT_SYS_MODULE_PATH_AIX
1054659607e0Smrg
1055659607e0Smrg
1056fc27e79cSmrg# _LT_SHELL_INIT(ARG)
1057fc27e79cSmrg# -------------------
1058fc27e79cSmrgm4_define([_LT_SHELL_INIT],
1059fc27e79cSmrg[ifdef([AC_DIVERSION_NOTICE],
1060fc27e79cSmrg	     [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
1061fc27e79cSmrg	 [AC_DIVERT_PUSH(NOTICE)])
1062fc27e79cSmrg$1
1063fc27e79cSmrgAC_DIVERT_POP
1064fc27e79cSmrg])# _LT_SHELL_INIT
1065659607e0Smrg
1066659607e0Smrg
1067fc27e79cSmrg# _LT_PROG_ECHO_BACKSLASH
1068fc27e79cSmrg# -----------------------
1069fc27e79cSmrg# Add some code to the start of the generated configure script which
1070fc27e79cSmrg# will find an echo command which doesn't interpret backslashes.
1071fc27e79cSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1072fc27e79cSmrg[_LT_SHELL_INIT([
1073fc27e79cSmrg# Check that we are running under the correct shell.
1074fc27e79cSmrgSHELL=${CONFIG_SHELL-/bin/sh}
10756aab59a7Smrg
1076fc27e79cSmrgcase X$lt_ECHO in
1077fc27e79cSmrgX*--fallback-echo)
1078fc27e79cSmrg  # Remove one level of quotation (which was required for Make).
1079fc27e79cSmrg  ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
1080fc27e79cSmrg  ;;
1081fc27e79cSmrgesac
1082fc27e79cSmrg
1083fc27e79cSmrgECHO=${lt_ECHO-echo}
1084fc27e79cSmrgif test "X[$]1" = X--no-reexec; then
1085fc27e79cSmrg  # Discard the --no-reexec flag, and continue.
1086fc27e79cSmrg  shift
1087fc27e79cSmrgelif test "X[$]1" = X--fallback-echo; then
1088fc27e79cSmrg  # Avoid inline document here, it may be left over
1089fc27e79cSmrg  :
1090fc27e79cSmrgelif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
1091fc27e79cSmrg  # Yippee, $ECHO works!
1092fc27e79cSmrg  :
1093659607e0Smrgelse
1094fc27e79cSmrg  # Restart under the correct shell.
1095fc27e79cSmrg  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
1096659607e0Smrgfi
1097659607e0Smrg
1098fc27e79cSmrgif test "X[$]1" = X--fallback-echo; then
1099fc27e79cSmrg  # used as fallback echo
1100fc27e79cSmrg  shift
1101fc27e79cSmrg  cat <<_LT_EOF
1102fc27e79cSmrg[$]*
1103fc27e79cSmrg_LT_EOF
1104fc27e79cSmrg  exit 0
1105fc27e79cSmrgfi
1106659607e0Smrg
1107fc27e79cSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
1108fc27e79cSmrg# if CDPATH is set.
1109fc27e79cSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
1110659607e0Smrg
1111fc27e79cSmrgif test -z "$lt_ECHO"; then
1112fc27e79cSmrg  if test "X${echo_test_string+set}" != Xset; then
1113fc27e79cSmrg    # find a string as large as possible, as long as the shell can cope with it
1114fc27e79cSmrg    for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
1115fc27e79cSmrg      # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
1116fc27e79cSmrg      if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
1117fc27e79cSmrg	 { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
1118fc27e79cSmrg      then
1119fc27e79cSmrg        break
1120fc27e79cSmrg      fi
1121fc27e79cSmrg    done
1122fc27e79cSmrg  fi
1123659607e0Smrg
1124fc27e79cSmrg  if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1125fc27e79cSmrg     echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1126fc27e79cSmrg     test "X$echo_testing_string" = "X$echo_test_string"; then
1127fc27e79cSmrg    :
1128fc27e79cSmrg  else
1129fc27e79cSmrg    # The Solaris, AIX, and Digital Unix default echo programs unquote
1130fc27e79cSmrg    # backslashes.  This makes it impossible to quote backslashes using
1131fc27e79cSmrg    #   echo "$something" | sed 's/\\/\\\\/g'
1132fc27e79cSmrg    #
1133fc27e79cSmrg    # So, first we look for a working echo in the user's PATH.
1134659607e0Smrg
1135fc27e79cSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
1136fc27e79cSmrg    for dir in $PATH /usr/ucb; do
1137fc27e79cSmrg      IFS="$lt_save_ifs"
1138fc27e79cSmrg      if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
1139fc27e79cSmrg         test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
1140fc27e79cSmrg         echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
1141fc27e79cSmrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1142fc27e79cSmrg        ECHO="$dir/echo"
1143fc27e79cSmrg        break
1144fc27e79cSmrg      fi
1145fc27e79cSmrg    done
1146fc27e79cSmrg    IFS="$lt_save_ifs"
1147659607e0Smrg
1148fc27e79cSmrg    if test "X$ECHO" = Xecho; then
1149fc27e79cSmrg      # We didn't find a better echo, so look for alternatives.
1150fc27e79cSmrg      if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
1151fc27e79cSmrg         echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
1152fc27e79cSmrg         test "X$echo_testing_string" = "X$echo_test_string"; then
1153fc27e79cSmrg        # This shell has a builtin print -r that does the trick.
1154fc27e79cSmrg        ECHO='print -r'
1155fc27e79cSmrg      elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
1156fc27e79cSmrg	   test "X$CONFIG_SHELL" != X/bin/ksh; then
1157fc27e79cSmrg        # If we have ksh, try running configure again with it.
1158fc27e79cSmrg        ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
1159fc27e79cSmrg        export ORIGINAL_CONFIG_SHELL
1160fc27e79cSmrg        CONFIG_SHELL=/bin/ksh
1161fc27e79cSmrg        export CONFIG_SHELL
1162fc27e79cSmrg        exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
1163fc27e79cSmrg      else
1164fc27e79cSmrg        # Try using printf.
1165fc27e79cSmrg        ECHO='printf %s\n'
1166fc27e79cSmrg        if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
1167fc27e79cSmrg	   echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
1168fc27e79cSmrg	   test "X$echo_testing_string" = "X$echo_test_string"; then
1169fc27e79cSmrg	  # Cool, printf works
1170fc27e79cSmrg	  :
1171fc27e79cSmrg        elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1172fc27e79cSmrg	     test "X$echo_testing_string" = 'X\t' &&
1173fc27e79cSmrg	     echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1174fc27e79cSmrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1175fc27e79cSmrg	  CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
1176fc27e79cSmrg	  export CONFIG_SHELL
1177fc27e79cSmrg	  SHELL="$CONFIG_SHELL"
1178fc27e79cSmrg	  export SHELL
1179fc27e79cSmrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1180fc27e79cSmrg        elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
1181fc27e79cSmrg	     test "X$echo_testing_string" = 'X\t' &&
1182fc27e79cSmrg	     echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
1183fc27e79cSmrg	     test "X$echo_testing_string" = "X$echo_test_string"; then
1184fc27e79cSmrg	  ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
1185fc27e79cSmrg        else
1186fc27e79cSmrg	  # maybe with a smaller string...
1187fc27e79cSmrg	  prev=:
1188659607e0Smrg
1189fc27e79cSmrg	  for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
1190fc27e79cSmrg	    if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
1191fc27e79cSmrg	    then
1192fc27e79cSmrg	      break
1193fc27e79cSmrg	    fi
1194fc27e79cSmrg	    prev="$cmd"
1195fc27e79cSmrg	  done
1196659607e0Smrg
1197fc27e79cSmrg	  if test "$prev" != 'sed 50q "[$]0"'; then
1198fc27e79cSmrg	    echo_test_string=`eval $prev`
1199fc27e79cSmrg	    export echo_test_string
1200fc27e79cSmrg	    exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
1201fc27e79cSmrg	  else
1202fc27e79cSmrg	    # Oops.  We lost completely, so just stick with echo.
1203fc27e79cSmrg	    ECHO=echo
1204fc27e79cSmrg	  fi
1205fc27e79cSmrg        fi
1206fc27e79cSmrg      fi
1207fc27e79cSmrg    fi
1208fc27e79cSmrg  fi
12096aab59a7Smrgfi
1210659607e0Smrg
1211fc27e79cSmrg# Copy echo and quote the copy suitably for passing to libtool from
1212fc27e79cSmrg# the Makefile, instead of quoting the original, which is used later.
1213fc27e79cSmrglt_ECHO=$ECHO
1214fc27e79cSmrgif test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
1215fc27e79cSmrg   lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
12166aab59a7Smrgfi
1217659607e0Smrg
1218fc27e79cSmrgAC_SUBST(lt_ECHO)
1219fc27e79cSmrg])
1220fc27e79cSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1221fc27e79cSmrg_LT_DECL([], [ECHO], [1],
1222fc27e79cSmrg    [An echo program that does not interpret backslashes])
1223fc27e79cSmrg])# _LT_PROG_ECHO_BACKSLASH
1224659607e0Smrg
1225659607e0Smrg
1226fc27e79cSmrg# _LT_ENABLE_LOCK
1227fc27e79cSmrg# ---------------
1228fc27e79cSmrgm4_defun([_LT_ENABLE_LOCK],
1229fc27e79cSmrg[AC_ARG_ENABLE([libtool-lock],
1230fc27e79cSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1231fc27e79cSmrg    [avoid locking (might break parallel builds)])])
1232fc27e79cSmrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1233659607e0Smrg
1234fc27e79cSmrg# Some flags need to be propagated to the compiler or linker for good
1235fc27e79cSmrg# libtool support.
1236fc27e79cSmrgcase $host in
1237fc27e79cSmrgia64-*-hpux*)
1238fc27e79cSmrg  # Find out which ABI we are using.
1239fc27e79cSmrg  echo 'int i;' > conftest.$ac_ext
1240fc27e79cSmrg  if AC_TRY_EVAL(ac_compile); then
1241fc27e79cSmrg    case `/usr/bin/file conftest.$ac_objext` in
1242fc27e79cSmrg      *ELF-32*)
1243fc27e79cSmrg	HPUX_IA64_MODE="32"
1244fc27e79cSmrg	;;
1245fc27e79cSmrg      *ELF-64*)
1246fc27e79cSmrg	HPUX_IA64_MODE="64"
1247fc27e79cSmrg	;;
1248fc27e79cSmrg    esac
1249fc27e79cSmrg  fi
1250fc27e79cSmrg  rm -rf conftest*
1251fc27e79cSmrg  ;;
1252fc27e79cSmrg*-*-irix6*)
1253fc27e79cSmrg  # Find out which ABI we are using.
1254fc27e79cSmrg  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
1255fc27e79cSmrg  if AC_TRY_EVAL(ac_compile); then
1256fc27e79cSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1257fc27e79cSmrg      case `/usr/bin/file conftest.$ac_objext` in
1258fc27e79cSmrg	*32-bit*)
1259fc27e79cSmrg	  LD="${LD-ld} -melf32bsmip"
1260fc27e79cSmrg	  ;;
1261fc27e79cSmrg	*N32*)
1262fc27e79cSmrg	  LD="${LD-ld} -melf32bmipn32"
1263fc27e79cSmrg	  ;;
1264fc27e79cSmrg	*64-bit*)
1265fc27e79cSmrg	  LD="${LD-ld} -melf64bmip"
1266fc27e79cSmrg	;;
1267fc27e79cSmrg      esac
1268fc27e79cSmrg    else
1269fc27e79cSmrg      case `/usr/bin/file conftest.$ac_objext` in
1270fc27e79cSmrg	*32-bit*)
1271fc27e79cSmrg	  LD="${LD-ld} -32"
1272fc27e79cSmrg	  ;;
1273fc27e79cSmrg	*N32*)
1274fc27e79cSmrg	  LD="${LD-ld} -n32"
1275fc27e79cSmrg	  ;;
1276fc27e79cSmrg	*64-bit*)
1277fc27e79cSmrg	  LD="${LD-ld} -64"
1278fc27e79cSmrg	  ;;
1279fc27e79cSmrg      esac
1280fc27e79cSmrg    fi
1281fc27e79cSmrg  fi
1282fc27e79cSmrg  rm -rf conftest*
1283fc27e79cSmrg  ;;
1284659607e0Smrg
1285fc27e79cSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1286fc27e79cSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1287fc27e79cSmrg  # Find out which ABI we are using.
1288fc27e79cSmrg  echo 'int i;' > conftest.$ac_ext
1289fc27e79cSmrg  if AC_TRY_EVAL(ac_compile); then
1290fc27e79cSmrg    case `/usr/bin/file conftest.o` in
1291fc27e79cSmrg      *32-bit*)
1292fc27e79cSmrg	case $host in
1293fc27e79cSmrg	  x86_64-*kfreebsd*-gnu)
1294fc27e79cSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1295fc27e79cSmrg	    ;;
1296fc27e79cSmrg	  x86_64-*linux*)
1297fc27e79cSmrg	    LD="${LD-ld} -m elf_i386"
1298fc27e79cSmrg	    ;;
1299fc27e79cSmrg	  ppc64-*linux*|powerpc64-*linux*)
1300fc27e79cSmrg	    LD="${LD-ld} -m elf32ppclinux"
1301fc27e79cSmrg	    ;;
1302fc27e79cSmrg	  s390x-*linux*)
1303fc27e79cSmrg	    LD="${LD-ld} -m elf_s390"
1304fc27e79cSmrg	    ;;
1305fc27e79cSmrg	  sparc64-*linux*)
1306fc27e79cSmrg	    LD="${LD-ld} -m elf32_sparc"
1307fc27e79cSmrg	    ;;
1308fc27e79cSmrg	esac
1309fc27e79cSmrg	;;
1310fc27e79cSmrg      *64-bit*)
1311fc27e79cSmrg	case $host in
1312fc27e79cSmrg	  x86_64-*kfreebsd*-gnu)
1313fc27e79cSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1314fc27e79cSmrg	    ;;
1315fc27e79cSmrg	  x86_64-*linux*)
1316fc27e79cSmrg	    LD="${LD-ld} -m elf_x86_64"
1317fc27e79cSmrg	    ;;
1318fc27e79cSmrg	  ppc*-*linux*|powerpc*-*linux*)
1319fc27e79cSmrg	    LD="${LD-ld} -m elf64ppc"
1320fc27e79cSmrg	    ;;
1321fc27e79cSmrg	  s390*-*linux*|s390*-*tpf*)
1322fc27e79cSmrg	    LD="${LD-ld} -m elf64_s390"
1323fc27e79cSmrg	    ;;
1324fc27e79cSmrg	  sparc*-*linux*)
1325fc27e79cSmrg	    LD="${LD-ld} -m elf64_sparc"
1326fc27e79cSmrg	    ;;
1327fc27e79cSmrg	esac
1328fc27e79cSmrg	;;
1329fc27e79cSmrg    esac
1330fc27e79cSmrg  fi
1331fc27e79cSmrg  rm -rf conftest*
1332fc27e79cSmrg  ;;
1333659607e0Smrg
1334fc27e79cSmrg*-*-sco3.2v5*)
1335fc27e79cSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1336fc27e79cSmrg  SAVE_CFLAGS="$CFLAGS"
1337fc27e79cSmrg  CFLAGS="$CFLAGS -belf"
1338fc27e79cSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1339fc27e79cSmrg    [AC_LANG_PUSH(C)
1340fc27e79cSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1341fc27e79cSmrg     AC_LANG_POP])
1342fc27e79cSmrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1343fc27e79cSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1344fc27e79cSmrg    CFLAGS="$SAVE_CFLAGS"
1345fc27e79cSmrg  fi
1346fc27e79cSmrg  ;;
1347fc27e79cSmrgsparc*-*solaris*)
1348fc27e79cSmrg  # Find out which ABI we are using.
1349fc27e79cSmrg  echo 'int i;' > conftest.$ac_ext
1350fc27e79cSmrg  if AC_TRY_EVAL(ac_compile); then
1351fc27e79cSmrg    case `/usr/bin/file conftest.o` in
1352fc27e79cSmrg    *64-bit*)
1353fc27e79cSmrg      case $lt_cv_prog_gnu_ld in
1354fc27e79cSmrg      yes*) LD="${LD-ld} -m elf64_sparc" ;;
1355fc27e79cSmrg      *)
1356fc27e79cSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1357fc27e79cSmrg	  LD="${LD-ld} -64"
1358fc27e79cSmrg	fi
1359fc27e79cSmrg	;;
1360fc27e79cSmrg      esac
1361fc27e79cSmrg      ;;
1362fc27e79cSmrg    esac
1363fc27e79cSmrg  fi
1364fc27e79cSmrg  rm -rf conftest*
1365fc27e79cSmrg  ;;
1366fc27e79cSmrgesac
1367fc27e79cSmrg
1368fc27e79cSmrgneed_locks="$enable_libtool_lock"
1369fc27e79cSmrg])# _LT_ENABLE_LOCK
1370fc27e79cSmrg
1371fc27e79cSmrg
1372fc27e79cSmrg# _LT_CMD_OLD_ARCHIVE
1373fc27e79cSmrg# -------------------
1374fc27e79cSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1375fc27e79cSmrg[AC_CHECK_TOOL(AR, ar, false)
1376fc27e79cSmrgtest -z "$AR" && AR=ar
1377fc27e79cSmrgtest -z "$AR_FLAGS" && AR_FLAGS=cru
1378fc27e79cSmrg_LT_DECL([], [AR], [1], [The archiver])
1379fc27e79cSmrg_LT_DECL([], [AR_FLAGS], [1])
1380fc27e79cSmrg
1381fc27e79cSmrgAC_CHECK_TOOL(STRIP, strip, :)
1382fc27e79cSmrgtest -z "$STRIP" && STRIP=:
1383fc27e79cSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1384fc27e79cSmrg
1385fc27e79cSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1386fc27e79cSmrgtest -z "$RANLIB" && RANLIB=:
1387fc27e79cSmrg_LT_DECL([], [RANLIB], [1],
1388fc27e79cSmrg    [Commands used to install an old-style archive])
1389fc27e79cSmrg
1390fc27e79cSmrg# Determine commands to create old-style static archives.
1391fc27e79cSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1392fc27e79cSmrgold_postinstall_cmds='chmod 644 $oldlib'
1393fc27e79cSmrgold_postuninstall_cmds=
1394fc27e79cSmrg
1395fc27e79cSmrgif test -n "$RANLIB"; then
1396fc27e79cSmrg  case $host_os in
1397fc27e79cSmrg  openbsd*)
1398fc27e79cSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
1399fc27e79cSmrg    ;;
1400fc27e79cSmrg  *)
1401fc27e79cSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
1402fc27e79cSmrg    ;;
1403fc27e79cSmrg  esac
1404fc27e79cSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
14056aab59a7Smrgfi
1406fc27e79cSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1407fc27e79cSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1408fc27e79cSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1409fc27e79cSmrg    [Commands used to build an old-style archive])
1410fc27e79cSmrg])# _LT_CMD_OLD_ARCHIVE
1411659607e0Smrg
1412659607e0Smrg
1413fc27e79cSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1414fc27e79cSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1415fc27e79cSmrg# ----------------------------------------------------------------
1416fc27e79cSmrg# Check whether the given compiler option works
1417fc27e79cSmrgAC_DEFUN([_LT_COMPILER_OPTION],
1418fc27e79cSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1419fc27e79cSmrgm4_require([_LT_DECL_SED])dnl
1420fc27e79cSmrgAC_CACHE_CHECK([$1], [$2],
1421fc27e79cSmrg  [$2=no
1422fc27e79cSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1423fc27e79cSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1424fc27e79cSmrg   lt_compiler_flag="$3"
1425fc27e79cSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1426fc27e79cSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1427fc27e79cSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1428fc27e79cSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1429fc27e79cSmrg   # The option is referenced via a variable to avoid confusing sed.
1430fc27e79cSmrg   lt_compile=`echo "$ac_compile" | $SED \
1431fc27e79cSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1432fc27e79cSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1433fc27e79cSmrg   -e 's:$: $lt_compiler_flag:'`
1434fc27e79cSmrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1435fc27e79cSmrg   (eval "$lt_compile" 2>conftest.err)
1436fc27e79cSmrg   ac_status=$?
1437fc27e79cSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1438fc27e79cSmrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1439fc27e79cSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1440fc27e79cSmrg     # The compiler can only warn and ignore the option if not recognized
1441fc27e79cSmrg     # So say no if there are warnings other than the usual output.
1442fc27e79cSmrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
1443fc27e79cSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1444fc27e79cSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1445fc27e79cSmrg       $2=yes
1446fc27e79cSmrg     fi
1447fc27e79cSmrg   fi
1448fc27e79cSmrg   $RM conftest*
1449fc27e79cSmrg])
1450659607e0Smrg
1451fc27e79cSmrgif test x"[$]$2" = xyes; then
1452fc27e79cSmrg    m4_if([$5], , :, [$5])
14536aab59a7Smrgelse
1454fc27e79cSmrg    m4_if([$6], , :, [$6])
14556aab59a7Smrgfi
1456fc27e79cSmrg])# _LT_COMPILER_OPTION
1457659607e0Smrg
1458fc27e79cSmrg# Old name:
1459fc27e79cSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1460fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
1461fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1462659607e0Smrg
1463659607e0Smrg
1464fc27e79cSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1465fc27e79cSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1466fc27e79cSmrg# ----------------------------------------------------
1467fc27e79cSmrg# Check whether the given linker option works
1468fc27e79cSmrgAC_DEFUN([_LT_LINKER_OPTION],
1469fc27e79cSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1470fc27e79cSmrgm4_require([_LT_DECL_SED])dnl
1471fc27e79cSmrgAC_CACHE_CHECK([$1], [$2],
1472fc27e79cSmrg  [$2=no
1473fc27e79cSmrg   save_LDFLAGS="$LDFLAGS"
1474fc27e79cSmrg   LDFLAGS="$LDFLAGS $3"
1475fc27e79cSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1476fc27e79cSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1477fc27e79cSmrg     # The linker can only warn and ignore the option if not recognized
1478fc27e79cSmrg     # So say no if there are warnings
1479fc27e79cSmrg     if test -s conftest.err; then
1480fc27e79cSmrg       # Append any errors to the config.log.
1481fc27e79cSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1482fc27e79cSmrg       $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
1483fc27e79cSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1484fc27e79cSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
1485fc27e79cSmrg         $2=yes
1486fc27e79cSmrg       fi
1487fc27e79cSmrg     else
1488fc27e79cSmrg       $2=yes
1489fc27e79cSmrg     fi
1490fc27e79cSmrg   fi
1491fc27e79cSmrg   $RM -r conftest*
1492fc27e79cSmrg   LDFLAGS="$save_LDFLAGS"
1493fc27e79cSmrg])
1494659607e0Smrg
1495fc27e79cSmrgif test x"[$]$2" = xyes; then
1496fc27e79cSmrg    m4_if([$4], , :, [$4])
1497fc27e79cSmrgelse
1498fc27e79cSmrg    m4_if([$5], , :, [$5])
14996aab59a7Smrgfi
1500fc27e79cSmrg])# _LT_LINKER_OPTION
1501659607e0Smrg
1502fc27e79cSmrg# Old name:
1503fc27e79cSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1504fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
1505fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1506659607e0Smrg
1507659607e0Smrg
1508fc27e79cSmrg# LT_CMD_MAX_LEN
1509fc27e79cSmrg#---------------
1510fc27e79cSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1511fc27e79cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1512fc27e79cSmrg# find the maximum length of command line arguments
1513fc27e79cSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1514fc27e79cSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1515fc27e79cSmrg  i=0
1516fc27e79cSmrg  teststring="ABCD"
1517659607e0Smrg
1518fc27e79cSmrg  case $build_os in
1519fc27e79cSmrg  msdosdjgpp*)
1520fc27e79cSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1521fc27e79cSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1522fc27e79cSmrg    # during glob expansion).  Even if it were fixed, the result of this
1523fc27e79cSmrg    # check would be larger than it should be.
1524fc27e79cSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1525fc27e79cSmrg    ;;
1526659607e0Smrg
1527fc27e79cSmrg  gnu*)
1528fc27e79cSmrg    # Under GNU Hurd, this test is not required because there is
1529fc27e79cSmrg    # no limit to the length of command line arguments.
1530fc27e79cSmrg    # Libtool will interpret -1 as no limit whatsoever
1531fc27e79cSmrg    lt_cv_sys_max_cmd_len=-1;
1532fc27e79cSmrg    ;;
1533659607e0Smrg
1534fc27e79cSmrg  cygwin* | mingw* | cegcc*)
1535fc27e79cSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1536fc27e79cSmrg    # about 5 minutes as the teststring grows exponentially.
1537fc27e79cSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1538fc27e79cSmrg    # you end up with a "frozen" computer, even though with patience
1539fc27e79cSmrg    # the test eventually succeeds (with a max line length of 256k).
1540fc27e79cSmrg    # Instead, let's just punt: use the minimum linelength reported by
1541fc27e79cSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1542fc27e79cSmrg    lt_cv_sys_max_cmd_len=8192;
1543fc27e79cSmrg    ;;
1544659607e0Smrg
1545fc27e79cSmrg  amigaos*)
1546fc27e79cSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
1547fc27e79cSmrg    # So we just punt and use a minimum line length of 8192.
1548fc27e79cSmrg    lt_cv_sys_max_cmd_len=8192;
1549fc27e79cSmrg    ;;
1550659607e0Smrg
1551fc27e79cSmrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1552fc27e79cSmrg    # This has been around since 386BSD, at least.  Likely further.
1553fc27e79cSmrg    if test -x /sbin/sysctl; then
1554fc27e79cSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1555fc27e79cSmrg    elif test -x /usr/sbin/sysctl; then
1556fc27e79cSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1557fc27e79cSmrg    else
1558fc27e79cSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1559fc27e79cSmrg    fi
1560fc27e79cSmrg    # And add a safety zone
1561fc27e79cSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1562fc27e79cSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1563fc27e79cSmrg    ;;
1564659607e0Smrg
1565fc27e79cSmrg  interix*)
1566fc27e79cSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1567fc27e79cSmrg    lt_cv_sys_max_cmd_len=196608
1568fc27e79cSmrg    ;;
1569659607e0Smrg
1570fc27e79cSmrg  osf*)
1571fc27e79cSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1572fc27e79cSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1573fc27e79cSmrg    # nice to cause kernel panics so lets avoid the loop below.
1574fc27e79cSmrg    # First set a reasonable default.
1575fc27e79cSmrg    lt_cv_sys_max_cmd_len=16384
1576fc27e79cSmrg    #
1577fc27e79cSmrg    if test -x /sbin/sysconfig; then
1578fc27e79cSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1579fc27e79cSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1580fc27e79cSmrg      esac
1581fc27e79cSmrg    fi
1582fc27e79cSmrg    ;;
1583fc27e79cSmrg  sco3.2v5*)
1584fc27e79cSmrg    lt_cv_sys_max_cmd_len=102400
1585fc27e79cSmrg    ;;
1586fc27e79cSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
1587fc27e79cSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1588fc27e79cSmrg    if test -n "$kargmax"; then
1589fc27e79cSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1590fc27e79cSmrg    else
1591fc27e79cSmrg      lt_cv_sys_max_cmd_len=32768
1592fc27e79cSmrg    fi
1593fc27e79cSmrg    ;;
1594fc27e79cSmrg  *)
1595fc27e79cSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1596fc27e79cSmrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1597fc27e79cSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1598fc27e79cSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1599fc27e79cSmrg    else
1600fc27e79cSmrg      # Make teststring a little bigger before we do anything with it.
1601fc27e79cSmrg      # a 1K string should be a reasonable start.
1602fc27e79cSmrg      for i in 1 2 3 4 5 6 7 8 ; do
1603fc27e79cSmrg        teststring=$teststring$teststring
1604fc27e79cSmrg      done
1605fc27e79cSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1606fc27e79cSmrg      # If test is not a shell built-in, we'll probably end up computing a
1607fc27e79cSmrg      # maximum length that is only half of the actual maximum length, but
1608fc27e79cSmrg      # we can't tell.
1609fc27e79cSmrg      while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
1610fc27e79cSmrg	         = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
1611fc27e79cSmrg	      test $i != 17 # 1/2 MB should be enough
1612fc27e79cSmrg      do
1613fc27e79cSmrg        i=`expr $i + 1`
1614fc27e79cSmrg        teststring=$teststring$teststring
1615fc27e79cSmrg      done
1616fc27e79cSmrg      # Only check the string length outside the loop.
1617fc27e79cSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1618fc27e79cSmrg      teststring=
1619fc27e79cSmrg      # Add a significant safety factor because C++ compilers can tack on
1620fc27e79cSmrg      # massive amounts of additional arguments before passing them to the
1621fc27e79cSmrg      # linker.  It appears as though 1/2 is a usable value.
1622fc27e79cSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1623fc27e79cSmrg    fi
1624fc27e79cSmrg    ;;
1625fc27e79cSmrg  esac
1626fc27e79cSmrg])
1627fc27e79cSmrgif test -n $lt_cv_sys_max_cmd_len ; then
1628fc27e79cSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1629fc27e79cSmrgelse
1630fc27e79cSmrg  AC_MSG_RESULT(none)
1631fc27e79cSmrgfi
1632fc27e79cSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1633fc27e79cSmrg_LT_DECL([], [max_cmd_len], [0],
1634fc27e79cSmrg    [What is the maximum length of a command?])
1635fc27e79cSmrg])# LT_CMD_MAX_LEN
1636659607e0Smrg
1637fc27e79cSmrg# Old name:
1638fc27e79cSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1639fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
1640fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1641659607e0Smrg
1642659607e0Smrg
1643fc27e79cSmrg# _LT_HEADER_DLFCN
1644659607e0Smrg# ----------------
1645fc27e79cSmrgm4_defun([_LT_HEADER_DLFCN],
1646fc27e79cSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1647fc27e79cSmrg])# _LT_HEADER_DLFCN
1648659607e0Smrg
1649659607e0Smrg
1650fc27e79cSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1651fc27e79cSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1652fc27e79cSmrg# ----------------------------------------------------------------
1653fc27e79cSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1654fc27e79cSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1655fc27e79cSmrgif test "$cross_compiling" = yes; then :
1656fc27e79cSmrg  [$4]
1657fc27e79cSmrgelse
1658fc27e79cSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1659fc27e79cSmrg  lt_status=$lt_dlunknown
1660fc27e79cSmrg  cat > conftest.$ac_ext <<_LT_EOF
1661fc27e79cSmrg[#line __oline__ "configure"
1662fc27e79cSmrg#include "confdefs.h"
1663659607e0Smrg
1664fc27e79cSmrg#if HAVE_DLFCN_H
1665fc27e79cSmrg#include <dlfcn.h>
1666fc27e79cSmrg#endif
1667659607e0Smrg
1668fc27e79cSmrg#include <stdio.h>
1669659607e0Smrg
1670fc27e79cSmrg#ifdef RTLD_GLOBAL
1671fc27e79cSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1672fc27e79cSmrg#else
1673fc27e79cSmrg#  ifdef DL_GLOBAL
1674fc27e79cSmrg#    define LT_DLGLOBAL		DL_GLOBAL
1675fc27e79cSmrg#  else
1676fc27e79cSmrg#    define LT_DLGLOBAL		0
1677fc27e79cSmrg#  endif
1678fc27e79cSmrg#endif
1679659607e0Smrg
1680fc27e79cSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1681fc27e79cSmrg   find out it does not work in some platform. */
1682fc27e79cSmrg#ifndef LT_DLLAZY_OR_NOW
1683fc27e79cSmrg#  ifdef RTLD_LAZY
1684fc27e79cSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1685fc27e79cSmrg#  else
1686fc27e79cSmrg#    ifdef DL_LAZY
1687fc27e79cSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1688fc27e79cSmrg#    else
1689fc27e79cSmrg#      ifdef RTLD_NOW
1690fc27e79cSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1691fc27e79cSmrg#      else
1692fc27e79cSmrg#        ifdef DL_NOW
1693fc27e79cSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1694fc27e79cSmrg#        else
1695fc27e79cSmrg#          define LT_DLLAZY_OR_NOW	0
1696fc27e79cSmrg#        endif
1697fc27e79cSmrg#      endif
1698fc27e79cSmrg#    endif
1699fc27e79cSmrg#  endif
1700fc27e79cSmrg#endif
1701659607e0Smrg
1702fc27e79cSmrgvoid fnord() { int i=42;}
1703fc27e79cSmrgint main ()
1704fc27e79cSmrg{
1705fc27e79cSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1706fc27e79cSmrg  int status = $lt_dlunknown;
1707659607e0Smrg
1708fc27e79cSmrg  if (self)
1709fc27e79cSmrg    {
1710fc27e79cSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1711fc27e79cSmrg      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
1712fc27e79cSmrg      /* dlclose (self); */
1713fc27e79cSmrg    }
1714fc27e79cSmrg  else
1715fc27e79cSmrg    puts (dlerror ());
1716659607e0Smrg
1717fc27e79cSmrg  return status;
1718fc27e79cSmrg}]
1719fc27e79cSmrg_LT_EOF
1720fc27e79cSmrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1721fc27e79cSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1722fc27e79cSmrg    lt_status=$?
1723fc27e79cSmrg    case x$lt_status in
1724fc27e79cSmrg      x$lt_dlno_uscore) $1 ;;
1725fc27e79cSmrg      x$lt_dlneed_uscore) $2 ;;
1726fc27e79cSmrg      x$lt_dlunknown|x*) $3 ;;
1727fc27e79cSmrg    esac
1728fc27e79cSmrg  else :
1729fc27e79cSmrg    # compilation failed
1730fc27e79cSmrg    $3
17316aab59a7Smrg  fi
1732fc27e79cSmrgfi
1733fc27e79cSmrgrm -fr conftest*
1734fc27e79cSmrg])# _LT_TRY_DLOPEN_SELF
1735659607e0Smrg
1736659607e0Smrg
1737fc27e79cSmrg# LT_SYS_DLOPEN_SELF
1738fc27e79cSmrg# ------------------
1739fc27e79cSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1740fc27e79cSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1741fc27e79cSmrgif test "x$enable_dlopen" != xyes; then
1742fc27e79cSmrg  enable_dlopen=unknown
1743fc27e79cSmrg  enable_dlopen_self=unknown
1744fc27e79cSmrg  enable_dlopen_self_static=unknown
1745fc27e79cSmrgelse
1746fc27e79cSmrg  lt_cv_dlopen=no
1747fc27e79cSmrg  lt_cv_dlopen_libs=
1748659607e0Smrg
1749fc27e79cSmrg  case $host_os in
1750fc27e79cSmrg  beos*)
1751fc27e79cSmrg    lt_cv_dlopen="load_add_on"
1752fc27e79cSmrg    lt_cv_dlopen_libs=
1753fc27e79cSmrg    lt_cv_dlopen_self=yes
1754fc27e79cSmrg    ;;
1755659607e0Smrg
1756fc27e79cSmrg  mingw* | pw32* | cegcc*)
1757fc27e79cSmrg    lt_cv_dlopen="LoadLibrary"
1758fc27e79cSmrg    lt_cv_dlopen_libs=
1759fc27e79cSmrg    ;;
1760659607e0Smrg
1761fc27e79cSmrg  cygwin*)
1762fc27e79cSmrg    lt_cv_dlopen="dlopen"
1763fc27e79cSmrg    lt_cv_dlopen_libs=
1764fc27e79cSmrg    ;;
1765659607e0Smrg
1766fc27e79cSmrg  darwin*)
1767fc27e79cSmrg  # if libdl is installed we need to link against it
1768fc27e79cSmrg    AC_CHECK_LIB([dl], [dlopen],
1769fc27e79cSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1770fc27e79cSmrg    lt_cv_dlopen="dyld"
1771fc27e79cSmrg    lt_cv_dlopen_libs=
1772fc27e79cSmrg    lt_cv_dlopen_self=yes
1773fc27e79cSmrg    ])
17746aab59a7Smrg    ;;
1775fc27e79cSmrg
17766aab59a7Smrg  *)
1777fc27e79cSmrg    AC_CHECK_FUNC([shl_load],
1778fc27e79cSmrg	  [lt_cv_dlopen="shl_load"],
1779fc27e79cSmrg      [AC_CHECK_LIB([dld], [shl_load],
1780fc27e79cSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1781fc27e79cSmrg	[AC_CHECK_FUNC([dlopen],
1782fc27e79cSmrg	      [lt_cv_dlopen="dlopen"],
1783fc27e79cSmrg	  [AC_CHECK_LIB([dl], [dlopen],
1784fc27e79cSmrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1785fc27e79cSmrg	    [AC_CHECK_LIB([svld], [dlopen],
1786fc27e79cSmrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1787fc27e79cSmrg	      [AC_CHECK_LIB([dld], [dld_link],
1788fc27e79cSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1789fc27e79cSmrg	      ])
1790fc27e79cSmrg	    ])
1791fc27e79cSmrg	  ])
1792fc27e79cSmrg	])
1793fc27e79cSmrg      ])
17946aab59a7Smrg    ;;
17956aab59a7Smrg  esac
1796659607e0Smrg
1797fc27e79cSmrg  if test "x$lt_cv_dlopen" != xno; then
1798fc27e79cSmrg    enable_dlopen=yes
1799fc27e79cSmrg  else
1800fc27e79cSmrg    enable_dlopen=no
18016aab59a7Smrg  fi
1802659607e0Smrg
1803fc27e79cSmrg  case $lt_cv_dlopen in
1804fc27e79cSmrg  dlopen)
1805fc27e79cSmrg    save_CPPFLAGS="$CPPFLAGS"
1806fc27e79cSmrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1807fc27e79cSmrg
1808fc27e79cSmrg    save_LDFLAGS="$LDFLAGS"
1809fc27e79cSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1810659607e0Smrg
1811fc27e79cSmrg    save_LIBS="$LIBS"
1812fc27e79cSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1813659607e0Smrg
1814fc27e79cSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1815fc27e79cSmrg	  lt_cv_dlopen_self, [dnl
1816fc27e79cSmrg	  _LT_TRY_DLOPEN_SELF(
1817fc27e79cSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1818fc27e79cSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1819fc27e79cSmrg    ])
1820659607e0Smrg
1821fc27e79cSmrg    if test "x$lt_cv_dlopen_self" = xyes; then
1822fc27e79cSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1823fc27e79cSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1824fc27e79cSmrg	  lt_cv_dlopen_self_static, [dnl
1825fc27e79cSmrg	  _LT_TRY_DLOPEN_SELF(
1826fc27e79cSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1827fc27e79cSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1828fc27e79cSmrg      ])
1829fc27e79cSmrg    fi
1830659607e0Smrg
1831fc27e79cSmrg    CPPFLAGS="$save_CPPFLAGS"
1832fc27e79cSmrg    LDFLAGS="$save_LDFLAGS"
1833fc27e79cSmrg    LIBS="$save_LIBS"
1834fc27e79cSmrg    ;;
1835fc27e79cSmrg  esac
1836659607e0Smrg
1837fc27e79cSmrg  case $lt_cv_dlopen_self in
1838fc27e79cSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1839fc27e79cSmrg  *) enable_dlopen_self=unknown ;;
1840fc27e79cSmrg  esac
1841659607e0Smrg
1842fc27e79cSmrg  case $lt_cv_dlopen_self_static in
1843fc27e79cSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1844fc27e79cSmrg  *) enable_dlopen_self_static=unknown ;;
1845fc27e79cSmrg  esac
1846fc27e79cSmrgfi
1847fc27e79cSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1848fc27e79cSmrg	 [Whether dlopen is supported])
1849fc27e79cSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1850fc27e79cSmrg	 [Whether dlopen of programs is supported])
1851fc27e79cSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1852fc27e79cSmrg	 [Whether dlopen of statically linked programs is supported])
1853fc27e79cSmrg])# LT_SYS_DLOPEN_SELF
1854659607e0Smrg
1855fc27e79cSmrg# Old name:
1856fc27e79cSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1857fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
1858fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1859659607e0Smrg
1860659607e0Smrg
1861fc27e79cSmrg# _LT_COMPILER_C_O([TAGNAME])
1862fc27e79cSmrg# ---------------------------
1863fc27e79cSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
1864fc27e79cSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1865fc27e79cSmrgm4_defun([_LT_COMPILER_C_O],
1866fc27e79cSmrg[m4_require([_LT_DECL_SED])dnl
1867fc27e79cSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1868fc27e79cSmrgm4_require([_LT_TAG_COMPILER])dnl
1869fc27e79cSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1870fc27e79cSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1871fc27e79cSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1872fc27e79cSmrg   $RM -r conftest 2>/dev/null
1873fc27e79cSmrg   mkdir conftest
1874fc27e79cSmrg   cd conftest
1875fc27e79cSmrg   mkdir out
1876fc27e79cSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1877659607e0Smrg
1878fc27e79cSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1879fc27e79cSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1880fc27e79cSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1881fc27e79cSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1882fc27e79cSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1883fc27e79cSmrg   lt_compile=`echo "$ac_compile" | $SED \
1884fc27e79cSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1885fc27e79cSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1886fc27e79cSmrg   -e 's:$: $lt_compiler_flag:'`
1887fc27e79cSmrg   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1888fc27e79cSmrg   (eval "$lt_compile" 2>out/conftest.err)
1889fc27e79cSmrg   ac_status=$?
1890fc27e79cSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
1891fc27e79cSmrg   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1892fc27e79cSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
1893fc27e79cSmrg   then
1894fc27e79cSmrg     # The compiler can only warn and ignore the option if not recognized
1895fc27e79cSmrg     # So say no if there are warnings
1896fc27e79cSmrg     $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
1897fc27e79cSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
1898fc27e79cSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
1899fc27e79cSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
1900fc27e79cSmrg     fi
1901fc27e79cSmrg   fi
1902fc27e79cSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
1903fc27e79cSmrg   $RM conftest*
1904fc27e79cSmrg   # SGI C++ compiler will create directory out/ii_files/ for
1905fc27e79cSmrg   # template instantiation
1906fc27e79cSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
1907fc27e79cSmrg   $RM out/* && rmdir out
1908fc27e79cSmrg   cd ..
1909fc27e79cSmrg   $RM -r conftest
1910fc27e79cSmrg   $RM conftest*
19116aab59a7Smrg])
1912fc27e79cSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
1913fc27e79cSmrg	[Does compiler simultaneously support -c and -o options?])
1914fc27e79cSmrg])# _LT_COMPILER_C_O
1915659607e0Smrg
1916659607e0Smrg
1917fc27e79cSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
1918fc27e79cSmrg# ----------------------------------
1919fc27e79cSmrg# Check to see if we can do hard links to lock some files if needed
1920fc27e79cSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
1921fc27e79cSmrg[m4_require([_LT_ENABLE_LOCK])dnl
1922fc27e79cSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1923fc27e79cSmrg_LT_COMPILER_C_O([$1])
1924659607e0Smrg
1925fc27e79cSmrghard_links="nottested"
1926fc27e79cSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
1927fc27e79cSmrg  # do not overwrite the value of need_locks provided by the user
1928fc27e79cSmrg  AC_MSG_CHECKING([if we can lock with hard links])
1929fc27e79cSmrg  hard_links=yes
1930fc27e79cSmrg  $RM conftest*
1931fc27e79cSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1932fc27e79cSmrg  touch conftest.a
1933fc27e79cSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
1934fc27e79cSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
1935fc27e79cSmrg  AC_MSG_RESULT([$hard_links])
1936fc27e79cSmrg  if test "$hard_links" = no; then
1937fc27e79cSmrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
1938fc27e79cSmrg    need_locks=warn
1939fc27e79cSmrg  fi
1940fc27e79cSmrgelse
1941fc27e79cSmrg  need_locks=no
1942fc27e79cSmrgfi
1943fc27e79cSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
1944fc27e79cSmrg])# _LT_COMPILER_FILE_LOCKS
1945659607e0Smrg
1946659607e0Smrg
1947fc27e79cSmrg# _LT_CHECK_OBJDIR
1948fc27e79cSmrg# ----------------
1949fc27e79cSmrgm4_defun([_LT_CHECK_OBJDIR],
1950fc27e79cSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
1951fc27e79cSmrg[rm -f .libs 2>/dev/null
1952fc27e79cSmrgmkdir .libs 2>/dev/null
1953fc27e79cSmrgif test -d .libs; then
1954fc27e79cSmrg  lt_cv_objdir=.libs
1955fc27e79cSmrgelse
1956fc27e79cSmrg  # MS-DOS does not allow filenames that begin with a dot.
1957fc27e79cSmrg  lt_cv_objdir=_libs
1958fc27e79cSmrgfi
1959fc27e79cSmrgrmdir .libs 2>/dev/null])
1960fc27e79cSmrgobjdir=$lt_cv_objdir
1961fc27e79cSmrg_LT_DECL([], [objdir], [0],
1962fc27e79cSmrg         [The name of the directory that contains temporary libtool files])dnl
1963fc27e79cSmrgm4_pattern_allow([LT_OBJDIR])dnl
1964fc27e79cSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
1965fc27e79cSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
1966fc27e79cSmrg])# _LT_CHECK_OBJDIR
1967659607e0Smrg
1968659607e0Smrg
1969fc27e79cSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
1970fc27e79cSmrg# --------------------------------------
1971fc27e79cSmrg# Check hardcoding attributes.
1972fc27e79cSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
1973fc27e79cSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
1974fc27e79cSmrg_LT_TAGVAR(hardcode_action, $1)=
1975fc27e79cSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
1976fc27e79cSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
1977fc27e79cSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
1978659607e0Smrg
1979fc27e79cSmrg  # We can hardcode non-existent directories.
1980fc27e79cSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
1981fc27e79cSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
1982fc27e79cSmrg     # have to relink, otherwise we might link with an installed library
1983fc27e79cSmrg     # when we should be linking with a yet-to-be-installed one
1984fc27e79cSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
1985fc27e79cSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
1986fc27e79cSmrg    # Linking always hardcodes the temporary library directory.
1987fc27e79cSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
1988fc27e79cSmrg  else
1989fc27e79cSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
1990fc27e79cSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
1991fc27e79cSmrg  fi
19926aab59a7Smrgelse
1993fc27e79cSmrg  # We cannot hardcode anything, or else we can only hardcode existing
1994fc27e79cSmrg  # directories.
1995fc27e79cSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
19966aab59a7Smrgfi
1997fc27e79cSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
1998659607e0Smrg
1999fc27e79cSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2000fc27e79cSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2001fc27e79cSmrg  # Fast installation is not supported
2002fc27e79cSmrg  enable_fast_install=no
2003fc27e79cSmrgelif test "$shlibpath_overrides_runpath" = yes ||
2004fc27e79cSmrg     test "$enable_shared" = no; then
2005fc27e79cSmrg  # Fast installation is not necessary
2006fc27e79cSmrg  enable_fast_install=needless
20076aab59a7Smrgfi
2008fc27e79cSmrg_LT_TAGDECL([], [hardcode_action], [0],
2009fc27e79cSmrg    [How to hardcode a shared library path into an executable])
2010fc27e79cSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2011659607e0Smrg
2012659607e0Smrg
2013fc27e79cSmrg# _LT_CMD_STRIPLIB
2014fc27e79cSmrg# ----------------
2015fc27e79cSmrgm4_defun([_LT_CMD_STRIPLIB],
2016fc27e79cSmrg[m4_require([_LT_DECL_EGREP])
2017fc27e79cSmrgstriplib=
2018fc27e79cSmrgold_striplib=
2019fc27e79cSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2020fc27e79cSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2021fc27e79cSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2022fc27e79cSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2023fc27e79cSmrg  AC_MSG_RESULT([yes])
2024fc27e79cSmrgelse
2025fc27e79cSmrg# FIXME - insert some real tests, host_os isn't really good enough
2026fc27e79cSmrg  case $host_os in
2027fc27e79cSmrg  darwin*)
2028fc27e79cSmrg    if test -n "$STRIP" ; then
2029fc27e79cSmrg      striplib="$STRIP -x"
2030fc27e79cSmrg      old_striplib="$STRIP -S"
2031fc27e79cSmrg      AC_MSG_RESULT([yes])
2032fc27e79cSmrg    else
2033fc27e79cSmrg      AC_MSG_RESULT([no])
20346aab59a7Smrg    fi
2035fc27e79cSmrg    ;;
2036fc27e79cSmrg  *)
2037fc27e79cSmrg    AC_MSG_RESULT([no])
2038fc27e79cSmrg    ;;
2039fc27e79cSmrg  esac
20406aab59a7Smrgfi
2041fc27e79cSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2042fc27e79cSmrg_LT_DECL([], [striplib], [1])
2043fc27e79cSmrg])# _LT_CMD_STRIPLIB
2044659607e0Smrg
2045659607e0Smrg
2046fc27e79cSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2047fc27e79cSmrg# -----------------------------
2048fc27e79cSmrg# PORTME Fill in your ld.so characteristics
2049fc27e79cSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2050fc27e79cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2051fc27e79cSmrgm4_require([_LT_DECL_EGREP])dnl
2052fc27e79cSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2053fc27e79cSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2054fc27e79cSmrgm4_require([_LT_DECL_SED])dnl
2055fc27e79cSmrgAC_MSG_CHECKING([dynamic linker characteristics])
2056fc27e79cSmrgm4_if([$1],
2057fc27e79cSmrg	[], [
2058fc27e79cSmrgif test "$GCC" = yes; then
2059fc27e79cSmrg  case $host_os in
2060fc27e79cSmrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2061fc27e79cSmrg    *) lt_awk_arg="/^libraries:/" ;;
2062fc27e79cSmrg  esac
2063fc27e79cSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2064fc27e79cSmrg  if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
2065fc27e79cSmrg    # if the path contains ";" then we assume it to be the separator
2066fc27e79cSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
2067fc27e79cSmrg    # assumed that no part of a normal pathname contains ";" but that should
2068fc27e79cSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
2069fc27e79cSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
2070fc27e79cSmrg  else
2071fc27e79cSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2072fc27e79cSmrg  fi
2073fc27e79cSmrg  # Ok, now we have the path, separated by spaces, we can step through it
2074fc27e79cSmrg  # and add multilib dir if necessary.
2075fc27e79cSmrg  lt_tmp_lt_search_path_spec=
2076fc27e79cSmrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2077fc27e79cSmrg  for lt_sys_path in $lt_search_path_spec; do
2078fc27e79cSmrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2079fc27e79cSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2080fc27e79cSmrg    else
2081fc27e79cSmrg      test -d "$lt_sys_path" && \
2082fc27e79cSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
20836aab59a7Smrg    fi
20846aab59a7Smrg  done
2085fc27e79cSmrg  lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
2086fc27e79cSmrgBEGIN {RS=" "; FS="/|\n";} {
2087fc27e79cSmrg  lt_foo="";
2088fc27e79cSmrg  lt_count=0;
2089fc27e79cSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2090fc27e79cSmrg    if ($lt_i != "" && $lt_i != ".") {
2091fc27e79cSmrg      if ($lt_i == "..") {
2092fc27e79cSmrg        lt_count++;
2093fc27e79cSmrg      } else {
2094fc27e79cSmrg        if (lt_count == 0) {
2095fc27e79cSmrg          lt_foo="/" $lt_i lt_foo;
2096fc27e79cSmrg        } else {
2097fc27e79cSmrg          lt_count--;
2098fc27e79cSmrg        }
2099fc27e79cSmrg      }
2100fc27e79cSmrg    }
2101fc27e79cSmrg  }
2102fc27e79cSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2103fc27e79cSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2104fc27e79cSmrg}'`
2105fc27e79cSmrg  sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
2106fc27e79cSmrgelse
2107fc27e79cSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2108fc27e79cSmrgfi])
2109fc27e79cSmrglibrary_names_spec=
2110fc27e79cSmrglibname_spec='lib$name'
2111fc27e79cSmrgsoname_spec=
2112fc27e79cSmrgshrext_cmds=".so"
2113fc27e79cSmrgpostinstall_cmds=
2114fc27e79cSmrgpostuninstall_cmds=
2115fc27e79cSmrgfinish_cmds=
2116fc27e79cSmrgfinish_eval=
2117fc27e79cSmrgshlibpath_var=
2118fc27e79cSmrgshlibpath_overrides_runpath=unknown
2119fc27e79cSmrgversion_type=none
2120fc27e79cSmrgdynamic_linker="$host_os ld.so"
2121fc27e79cSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2122fc27e79cSmrgneed_lib_prefix=unknown
2123fc27e79cSmrghardcode_into_libs=no
2124659607e0Smrg
2125fc27e79cSmrg# when you set need_version to no, make sure it does not cause -set_version
2126fc27e79cSmrg# flags to be left without arguments
2127fc27e79cSmrgneed_version=unknown
2128659607e0Smrg
2129fc27e79cSmrgcase $host_os in
2130fc27e79cSmrgaix3*)
2131fc27e79cSmrg  version_type=linux
2132fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2133fc27e79cSmrg  shlibpath_var=LIBPATH
2134659607e0Smrg
2135fc27e79cSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
2136fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2137fc27e79cSmrg  ;;
2138fc27e79cSmrg
2139fc27e79cSmrgaix[[4-9]]*)
2140fc27e79cSmrg  version_type=linux
2141fc27e79cSmrg  need_lib_prefix=no
2142fc27e79cSmrg  need_version=no
2143fc27e79cSmrg  hardcode_into_libs=yes
2144fc27e79cSmrg  if test "$host_cpu" = ia64; then
2145fc27e79cSmrg    # AIX 5 supports IA64
2146fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2147fc27e79cSmrg    shlibpath_var=LD_LIBRARY_PATH
2148fc27e79cSmrg  else
2149fc27e79cSmrg    # With GCC up to 2.95.x, collect2 would create an import file
2150fc27e79cSmrg    # for dependence libraries.  The import file would start with
2151fc27e79cSmrg    # the line `#! .'.  This would cause the generated library to
2152fc27e79cSmrg    # depend on `.', always an invalid library.  This was fixed in
2153fc27e79cSmrg    # development snapshots of GCC prior to 3.0.
2154fc27e79cSmrg    case $host_os in
2155fc27e79cSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2156fc27e79cSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2157fc27e79cSmrg	   echo ' yes '
2158fc27e79cSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2159fc27e79cSmrg	:
2160fc27e79cSmrg      else
2161fc27e79cSmrg	can_build_shared=no
21626aab59a7Smrg      fi
2163fc27e79cSmrg      ;;
2164fc27e79cSmrg    esac
2165fc27e79cSmrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2166fc27e79cSmrg    # soname into executable. Probably we can add versioning support to
2167fc27e79cSmrg    # collect2, so additional links can be useful in future.
2168fc27e79cSmrg    if test "$aix_use_runtimelinking" = yes; then
2169fc27e79cSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2170fc27e79cSmrg      # instead of lib<name>.a to let people know that these are not
2171fc27e79cSmrg      # typical AIX shared libraries.
2172fc27e79cSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2173fc27e79cSmrg    else
2174fc27e79cSmrg      # We preserve .a as extension for shared libraries through AIX4.2
2175fc27e79cSmrg      # and later when we are not doing run time linking.
2176fc27e79cSmrg      library_names_spec='${libname}${release}.a $libname.a'
2177fc27e79cSmrg      soname_spec='${libname}${release}${shared_ext}$major'
21786aab59a7Smrg    fi
2179fc27e79cSmrg    shlibpath_var=LIBPATH
21806aab59a7Smrg  fi
2181fc27e79cSmrg  ;;
2182659607e0Smrg
2183fc27e79cSmrgamigaos*)
2184fc27e79cSmrg  case $host_cpu in
2185fc27e79cSmrg  powerpc)
2186fc27e79cSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2187fc27e79cSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2188fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2189fc27e79cSmrg    ;;
2190fc27e79cSmrg  m68k)
2191fc27e79cSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2192fc27e79cSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2193fc27e79cSmrg    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'
2194fc27e79cSmrg    ;;
2195fc27e79cSmrg  esac
2196fc27e79cSmrg  ;;
2197659607e0Smrg
2198fc27e79cSmrgbeos*)
2199fc27e79cSmrg  library_names_spec='${libname}${shared_ext}'
2200fc27e79cSmrg  dynamic_linker="$host_os ld.so"
2201fc27e79cSmrg  shlibpath_var=LIBRARY_PATH
2202fc27e79cSmrg  ;;
2203659607e0Smrg
2204fc27e79cSmrgbsdi[[45]]*)
2205fc27e79cSmrg  version_type=linux
2206fc27e79cSmrg  need_version=no
2207fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2208fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2209fc27e79cSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2210fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2211fc27e79cSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2212fc27e79cSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2213fc27e79cSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
2214fc27e79cSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2215fc27e79cSmrg  # libtool to hard-code these into programs
2216fc27e79cSmrg  ;;
2217659607e0Smrg
2218fc27e79cSmrgcygwin* | mingw* | pw32* | cegcc*)
2219fc27e79cSmrg  version_type=windows
2220fc27e79cSmrg  shrext_cmds=".dll"
2221fc27e79cSmrg  need_version=no
2222fc27e79cSmrg  need_lib_prefix=no
2223659607e0Smrg
2224fc27e79cSmrg  case $GCC,$host_os in
2225fc27e79cSmrg  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
2226fc27e79cSmrg    library_names_spec='$libname.dll.a'
2227fc27e79cSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2228fc27e79cSmrg    postinstall_cmds='base_file=`basename \${file}`~
2229fc27e79cSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2230fc27e79cSmrg      dldir=$destdir/`dirname \$dlpath`~
2231fc27e79cSmrg      test -d \$dldir || mkdir -p \$dldir~
2232fc27e79cSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
2233fc27e79cSmrg      chmod a+x \$dldir/$dlname~
2234fc27e79cSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2235fc27e79cSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2236fc27e79cSmrg      fi'
2237fc27e79cSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2238fc27e79cSmrg      dlpath=$dir/\$dldll~
2239fc27e79cSmrg       $RM \$dlpath'
2240fc27e79cSmrg    shlibpath_overrides_runpath=yes
2241fc27e79cSmrg
2242fc27e79cSmrg    case $host_os in
2243fc27e79cSmrg    cygwin*)
2244fc27e79cSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2245fc27e79cSmrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2246fc27e79cSmrg      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
22476aab59a7Smrg      ;;
2248fc27e79cSmrg    mingw* | cegcc*)
2249fc27e79cSmrg      # MinGW DLLs use traditional 'lib' prefix
2250fc27e79cSmrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2251fc27e79cSmrg      sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
2252fc27e79cSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2253fc27e79cSmrg        # It is most probably a Windows format PATH printed by
2254fc27e79cSmrg        # mingw gcc, but we are running on Cygwin. Gcc prints its search
2255fc27e79cSmrg        # path with ; separators, and with drive letters. We can handle the
2256fc27e79cSmrg        # drive letters (cygwin fileutils understands them), so leave them,
2257fc27e79cSmrg        # especially as we might pass files found there to a mingw objdump,
2258fc27e79cSmrg        # which wouldn't understand a cygwinified path. Ahh.
2259fc27e79cSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2260fc27e79cSmrg      else
2261fc27e79cSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
2262fc27e79cSmrg      fi
22636aab59a7Smrg      ;;
2264fc27e79cSmrg    pw32*)
2265fc27e79cSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2266fc27e79cSmrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
22676aab59a7Smrg      ;;
22686aab59a7Smrg    esac
2269fc27e79cSmrg    ;;
2270fc27e79cSmrg
2271fc27e79cSmrg  *)
2272fc27e79cSmrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2273fc27e79cSmrg    ;;
2274fc27e79cSmrg  esac
2275fc27e79cSmrg  dynamic_linker='Win32 ld.exe'
2276fc27e79cSmrg  # FIXME: first we should search . and the directory the executable is in
2277fc27e79cSmrg  shlibpath_var=PATH
2278659607e0Smrg  ;;
2279659607e0Smrg
2280fc27e79cSmrgdarwin* | rhapsody*)
2281fc27e79cSmrg  dynamic_linker="$host_os dyld"
2282fc27e79cSmrg  version_type=darwin
2283fc27e79cSmrg  need_lib_prefix=no
2284fc27e79cSmrg  need_version=no
2285fc27e79cSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2286fc27e79cSmrg  soname_spec='${libname}${release}${major}$shared_ext'
2287fc27e79cSmrg  shlibpath_overrides_runpath=yes
2288fc27e79cSmrg  shlibpath_var=DYLD_LIBRARY_PATH
2289fc27e79cSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2290fc27e79cSmrgm4_if([$1], [],[
2291fc27e79cSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2292fc27e79cSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2293fc27e79cSmrg  ;;
2294fc27e79cSmrg
2295fc27e79cSmrgdgux*)
2296fc27e79cSmrg  version_type=linux
2297fc27e79cSmrg  need_lib_prefix=no
2298fc27e79cSmrg  need_version=no
2299fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2300fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2301fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2302fc27e79cSmrg  ;;
2303fc27e79cSmrg
2304fc27e79cSmrgfreebsd1*)
2305fc27e79cSmrg  dynamic_linker=no
2306fc27e79cSmrg  ;;
2307fc27e79cSmrg
2308fc27e79cSmrgfreebsd* | dragonfly*)
2309fc27e79cSmrg  # DragonFly does not have aout.  When/if they implement a new
2310fc27e79cSmrg  # versioning mechanism, adjust this.
2311fc27e79cSmrg  if test -x /usr/bin/objformat; then
2312fc27e79cSmrg    objformat=`/usr/bin/objformat`
2313fc27e79cSmrg  else
2314fc27e79cSmrg    case $host_os in
2315fc27e79cSmrg    freebsd[[123]]*) objformat=aout ;;
2316fc27e79cSmrg    *) objformat=elf ;;
23176aab59a7Smrg    esac
23186aab59a7Smrg  fi
2319fc27e79cSmrg  version_type=freebsd-$objformat
2320fc27e79cSmrg  case $version_type in
2321fc27e79cSmrg    freebsd-elf*)
2322fc27e79cSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2323fc27e79cSmrg      need_version=no
2324fc27e79cSmrg      need_lib_prefix=no
2325fc27e79cSmrg      ;;
2326fc27e79cSmrg    freebsd-*)
2327fc27e79cSmrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2328fc27e79cSmrg      need_version=yes
2329fc27e79cSmrg      ;;
2330fc27e79cSmrg  esac
2331fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2332fc27e79cSmrg  case $host_os in
2333fc27e79cSmrg  freebsd2*)
2334fc27e79cSmrg    shlibpath_overrides_runpath=yes
2335fc27e79cSmrg    ;;
2336fc27e79cSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2337fc27e79cSmrg    shlibpath_overrides_runpath=yes
2338fc27e79cSmrg    hardcode_into_libs=yes
2339fc27e79cSmrg    ;;
2340fc27e79cSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2341fc27e79cSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2342fc27e79cSmrg    shlibpath_overrides_runpath=no
2343fc27e79cSmrg    hardcode_into_libs=yes
2344fc27e79cSmrg    ;;
2345fc27e79cSmrg  *) # from 4.6 on, and DragonFly
2346fc27e79cSmrg    shlibpath_overrides_runpath=yes
2347fc27e79cSmrg    hardcode_into_libs=yes
2348fc27e79cSmrg    ;;
2349fc27e79cSmrg  esac
2350659607e0Smrg  ;;
2351659607e0Smrg
2352fc27e79cSmrggnu*)
2353fc27e79cSmrg  version_type=linux
2354fc27e79cSmrg  need_lib_prefix=no
2355fc27e79cSmrg  need_version=no
2356fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2357fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2358fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2359fc27e79cSmrg  hardcode_into_libs=yes
2360659607e0Smrg  ;;
2361fc27e79cSmrg
2362fc27e79cSmrghpux9* | hpux10* | hpux11*)
2363fc27e79cSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2364fc27e79cSmrg  # link against other versions.
2365fc27e79cSmrg  version_type=sunos
2366fc27e79cSmrg  need_lib_prefix=no
2367fc27e79cSmrg  need_version=no
2368fc27e79cSmrg  case $host_cpu in
2369fc27e79cSmrg  ia64*)
2370fc27e79cSmrg    shrext_cmds='.so'
2371fc27e79cSmrg    hardcode_into_libs=yes
2372fc27e79cSmrg    dynamic_linker="$host_os dld.so"
2373fc27e79cSmrg    shlibpath_var=LD_LIBRARY_PATH
2374fc27e79cSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2375fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2376fc27e79cSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2377fc27e79cSmrg    if test "X$HPUX_IA64_MODE" = X32; then
2378fc27e79cSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2379fc27e79cSmrg    else
2380fc27e79cSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2381fc27e79cSmrg    fi
2382fc27e79cSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2383fc27e79cSmrg    ;;
2384fc27e79cSmrg  hppa*64*)
2385fc27e79cSmrg    shrext_cmds='.sl'
2386fc27e79cSmrg    hardcode_into_libs=yes
2387fc27e79cSmrg    dynamic_linker="$host_os dld.sl"
2388fc27e79cSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2389fc27e79cSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2390fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2391fc27e79cSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2392fc27e79cSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2393fc27e79cSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2394fc27e79cSmrg    ;;
2395fc27e79cSmrg  *)
2396fc27e79cSmrg    shrext_cmds='.sl'
2397fc27e79cSmrg    dynamic_linker="$host_os dld.sl"
2398fc27e79cSmrg    shlibpath_var=SHLIB_PATH
2399fc27e79cSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2400fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2401fc27e79cSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2402fc27e79cSmrg    ;;
2403fc27e79cSmrg  esac
2404fc27e79cSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555.
2405fc27e79cSmrg  postinstall_cmds='chmod 555 $lib'
2406fc27e79cSmrg  ;;
2407fc27e79cSmrg
2408fc27e79cSmrginterix[[3-9]]*)
2409fc27e79cSmrg  version_type=linux
2410fc27e79cSmrg  need_lib_prefix=no
2411fc27e79cSmrg  need_version=no
2412fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2413fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2414fc27e79cSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2415fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2416fc27e79cSmrg  shlibpath_overrides_runpath=no
2417fc27e79cSmrg  hardcode_into_libs=yes
2418fc27e79cSmrg  ;;
2419fc27e79cSmrg
2420fc27e79cSmrgirix5* | irix6* | nonstopux*)
2421fc27e79cSmrg  case $host_os in
2422fc27e79cSmrg    nonstopux*) version_type=nonstopux ;;
2423fc27e79cSmrg    *)
2424fc27e79cSmrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2425fc27e79cSmrg		version_type=linux
2426fc27e79cSmrg	else
2427fc27e79cSmrg		version_type=irix
2428fc27e79cSmrg	fi ;;
2429fc27e79cSmrg  esac
2430fc27e79cSmrg  need_lib_prefix=no
2431fc27e79cSmrg  need_version=no
2432fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2433fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2434fc27e79cSmrg  case $host_os in
2435fc27e79cSmrg  irix5* | nonstopux*)
2436fc27e79cSmrg    libsuff= shlibsuff=
2437fc27e79cSmrg    ;;
2438fc27e79cSmrg  *)
2439fc27e79cSmrg    case $LD in # libtool.m4 will add one of these switches to LD
2440fc27e79cSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2441fc27e79cSmrg      libsuff= shlibsuff= libmagic=32-bit;;
2442fc27e79cSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2443fc27e79cSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2444fc27e79cSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2445fc27e79cSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2446fc27e79cSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
24476aab59a7Smrg    esac
2448fc27e79cSmrg    ;;
2449fc27e79cSmrg  esac
2450fc27e79cSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2451fc27e79cSmrg  shlibpath_overrides_runpath=no
2452fc27e79cSmrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2453fc27e79cSmrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2454fc27e79cSmrg  hardcode_into_libs=yes
2455659607e0Smrg  ;;
2456659607e0Smrg
2457fc27e79cSmrg# No shared lib support for Linux oldld, aout, or coff.
2458fc27e79cSmrglinux*oldld* | linux*aout* | linux*coff*)
2459fc27e79cSmrg  dynamic_linker=no
2460659607e0Smrg  ;;
2461659607e0Smrg
2462fc27e79cSmrg# This must be Linux ELF.
2463fc27e79cSmrglinux* | k*bsd*-gnu)
2464fc27e79cSmrg  version_type=linux
2465fc27e79cSmrg  need_lib_prefix=no
2466fc27e79cSmrg  need_version=no
2467fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2468fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2469fc27e79cSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2470fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2471fc27e79cSmrg  shlibpath_overrides_runpath=no
2472fc27e79cSmrg  # Some binutils ld are patched to set DT_RUNPATH
2473fc27e79cSmrg  save_LDFLAGS=$LDFLAGS
2474fc27e79cSmrg  save_libdir=$libdir
2475fc27e79cSmrg  eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2476fc27e79cSmrg       LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2477fc27e79cSmrg  AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2478fc27e79cSmrg    [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2479fc27e79cSmrg       [shlibpath_overrides_runpath=yes])])
2480fc27e79cSmrg  LDFLAGS=$save_LDFLAGS
2481fc27e79cSmrg  libdir=$save_libdir
2482659607e0Smrg
2483fc27e79cSmrg  # This implies no fast_install, which is unacceptable.
2484fc27e79cSmrg  # Some rework will be needed to allow for fast_install
2485fc27e79cSmrg  # before this can be enabled.
2486fc27e79cSmrg  hardcode_into_libs=yes
24876aab59a7Smrg
2488fc27e79cSmrg  # Add ABI-specific directories to the system library path.
2489fc27e79cSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
24906aab59a7Smrg
2491fc27e79cSmrg  # Append ld.so.conf contents to the search path
2492fc27e79cSmrg  if test -f /etc/ld.so.conf; then
2493fc27e79cSmrg    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' ' '`
2494fc27e79cSmrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2495fc27e79cSmrg  fi
24966aab59a7Smrg
2497fc27e79cSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2498fc27e79cSmrg  # powerpc, because MkLinux only supported shared libraries with the
2499fc27e79cSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2500fc27e79cSmrg  # most powerpc-linux boxes support dynamic linking these days and
2501fc27e79cSmrg  # people can always --disable-shared, the test was removed, and we
2502fc27e79cSmrg  # assume the GNU/Linux dynamic linker is in use.
2503fc27e79cSmrg  dynamic_linker='GNU/Linux ld.so'
2504fc27e79cSmrg  ;;
2505659607e0Smrg
2506fc27e79cSmrgnetbsd*)
2507fc27e79cSmrg  version_type=sunos
2508fc27e79cSmrg  need_lib_prefix=no
2509fc27e79cSmrg  need_version=no
2510fc27e79cSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2511fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2512fc27e79cSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2513fc27e79cSmrg    dynamic_linker='NetBSD (a.out) ld.so'
2514fc27e79cSmrg  else
2515fc27e79cSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2516fc27e79cSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2517fc27e79cSmrg    dynamic_linker='NetBSD ld.elf_so'
2518fc27e79cSmrg  fi
2519fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2520fc27e79cSmrg  shlibpath_overrides_runpath=yes
2521fc27e79cSmrg  hardcode_into_libs=yes
2522fc27e79cSmrg  ;;
2523659607e0Smrg
2524fc27e79cSmrgnewsos6)
2525fc27e79cSmrg  version_type=linux
2526fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2527fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2528fc27e79cSmrg  shlibpath_overrides_runpath=yes
2529fc27e79cSmrg  ;;
2530659607e0Smrg
2531fc27e79cSmrg*nto* | *qnx*)
2532fc27e79cSmrg  version_type=qnx
2533fc27e79cSmrg  need_lib_prefix=no
2534fc27e79cSmrg  need_version=no
2535fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2536fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2537fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2538fc27e79cSmrg  shlibpath_overrides_runpath=no
2539fc27e79cSmrg  hardcode_into_libs=yes
2540fc27e79cSmrg  dynamic_linker='ldqnx.so'
2541fc27e79cSmrg  ;;
2542659607e0Smrg
2543fc27e79cSmrgopenbsd*)
2544fc27e79cSmrg  version_type=sunos
2545fc27e79cSmrg  sys_lib_dlsearch_path_spec="/usr/lib"
2546fc27e79cSmrg  need_lib_prefix=no
2547fc27e79cSmrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2548fc27e79cSmrg  case $host_os in
2549fc27e79cSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2550fc27e79cSmrg    *)				need_version=no  ;;
2551fc27e79cSmrg  esac
2552fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2553fc27e79cSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2554fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2555fc27e79cSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2556fc27e79cSmrg    case $host_os in
2557fc27e79cSmrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2558fc27e79cSmrg	shlibpath_overrides_runpath=no
2559fc27e79cSmrg	;;
2560fc27e79cSmrg      *)
2561fc27e79cSmrg	shlibpath_overrides_runpath=yes
2562fc27e79cSmrg	;;
2563fc27e79cSmrg      esac
2564fc27e79cSmrg  else
2565fc27e79cSmrg    shlibpath_overrides_runpath=yes
2566fc27e79cSmrg  fi
2567fc27e79cSmrg  ;;
2568659607e0Smrg
2569fc27e79cSmrgos2*)
2570fc27e79cSmrg  libname_spec='$name'
2571fc27e79cSmrg  shrext_cmds=".dll"
2572fc27e79cSmrg  need_lib_prefix=no
2573fc27e79cSmrg  library_names_spec='$libname${shared_ext} $libname.a'
2574fc27e79cSmrg  dynamic_linker='OS/2 ld.exe'
2575fc27e79cSmrg  shlibpath_var=LIBPATH
2576fc27e79cSmrg  ;;
2577659607e0Smrg
2578fc27e79cSmrgosf3* | osf4* | osf5*)
2579fc27e79cSmrg  version_type=osf
2580fc27e79cSmrg  need_lib_prefix=no
2581fc27e79cSmrg  need_version=no
2582fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2583fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2584fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2585fc27e79cSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2586fc27e79cSmrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2587fc27e79cSmrg  ;;
2588659607e0Smrg
2589fc27e79cSmrgrdos*)
2590fc27e79cSmrg  dynamic_linker=no
2591fc27e79cSmrg  ;;
2592659607e0Smrg
2593fc27e79cSmrgsolaris*)
2594fc27e79cSmrg  version_type=linux
2595fc27e79cSmrg  need_lib_prefix=no
2596fc27e79cSmrg  need_version=no
2597fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2598fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2599fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2600fc27e79cSmrg  shlibpath_overrides_runpath=yes
2601fc27e79cSmrg  hardcode_into_libs=yes
2602fc27e79cSmrg  # ldd complains unless libraries are executable
2603fc27e79cSmrg  postinstall_cmds='chmod +x $lib'
2604fc27e79cSmrg  ;;
2605659607e0Smrg
2606fc27e79cSmrgsunos4*)
2607fc27e79cSmrg  version_type=sunos
2608fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2609fc27e79cSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2610fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2611fc27e79cSmrg  shlibpath_overrides_runpath=yes
2612fc27e79cSmrg  if test "$with_gnu_ld" = yes; then
2613fc27e79cSmrg    need_lib_prefix=no
2614fc27e79cSmrg  fi
2615fc27e79cSmrg  need_version=yes
2616fc27e79cSmrg  ;;
2617659607e0Smrg
2618fc27e79cSmrgsysv4 | sysv4.3*)
2619fc27e79cSmrg  version_type=linux
2620fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2621fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2622fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2623fc27e79cSmrg  case $host_vendor in
2624fc27e79cSmrg    sni)
2625fc27e79cSmrg      shlibpath_overrides_runpath=no
2626fc27e79cSmrg      need_lib_prefix=no
2627fc27e79cSmrg      runpath_var=LD_RUN_PATH
2628fc27e79cSmrg      ;;
2629fc27e79cSmrg    siemens)
2630fc27e79cSmrg      need_lib_prefix=no
2631fc27e79cSmrg      ;;
2632fc27e79cSmrg    motorola)
2633fc27e79cSmrg      need_lib_prefix=no
2634fc27e79cSmrg      need_version=no
2635fc27e79cSmrg      shlibpath_overrides_runpath=no
2636fc27e79cSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2637fc27e79cSmrg      ;;
2638fc27e79cSmrg  esac
2639fc27e79cSmrg  ;;
2640659607e0Smrg
2641fc27e79cSmrgsysv4*MP*)
2642fc27e79cSmrg  if test -d /usr/nec ;then
2643fc27e79cSmrg    version_type=linux
2644fc27e79cSmrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2645fc27e79cSmrg    soname_spec='$libname${shared_ext}.$major'
2646fc27e79cSmrg    shlibpath_var=LD_LIBRARY_PATH
2647fc27e79cSmrg  fi
2648fc27e79cSmrg  ;;
2649659607e0Smrg
2650fc27e79cSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2651fc27e79cSmrg  version_type=freebsd-elf
2652fc27e79cSmrg  need_lib_prefix=no
2653fc27e79cSmrg  need_version=no
2654fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2655fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2656fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2657fc27e79cSmrg  shlibpath_overrides_runpath=yes
2658fc27e79cSmrg  hardcode_into_libs=yes
2659fc27e79cSmrg  if test "$with_gnu_ld" = yes; then
2660fc27e79cSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2661fc27e79cSmrg  else
2662fc27e79cSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2663fc27e79cSmrg    case $host_os in
2664fc27e79cSmrg      sco3.2v5*)
2665fc27e79cSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2666fc27e79cSmrg	;;
2667fc27e79cSmrg    esac
2668fc27e79cSmrg  fi
2669fc27e79cSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
2670fc27e79cSmrg  ;;
2671659607e0Smrg
2672fc27e79cSmrgtpf*)
2673fc27e79cSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2674fc27e79cSmrg  version_type=linux
2675fc27e79cSmrg  need_lib_prefix=no
2676fc27e79cSmrg  need_version=no
2677fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2678fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2679fc27e79cSmrg  shlibpath_overrides_runpath=no
2680fc27e79cSmrg  hardcode_into_libs=yes
2681fc27e79cSmrg  ;;
2682659607e0Smrg
2683fc27e79cSmrguts4*)
2684fc27e79cSmrg  version_type=linux
2685fc27e79cSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2686fc27e79cSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2687fc27e79cSmrg  shlibpath_var=LD_LIBRARY_PATH
2688fc27e79cSmrg  ;;
2689659607e0Smrg
2690fc27e79cSmrg*)
2691fc27e79cSmrg  dynamic_linker=no
2692fc27e79cSmrg  ;;
2693fc27e79cSmrgesac
2694fc27e79cSmrgAC_MSG_RESULT([$dynamic_linker])
2695fc27e79cSmrgtest "$dynamic_linker" = no && can_build_shared=no
2696659607e0Smrg
2697fc27e79cSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2698fc27e79cSmrgif test "$GCC" = yes; then
2699fc27e79cSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2700fc27e79cSmrgfi
2701659607e0Smrg
2702fc27e79cSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2703fc27e79cSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2704fc27e79cSmrgfi
2705fc27e79cSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2706fc27e79cSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2707fc27e79cSmrgfi
2708659607e0Smrg
2709fc27e79cSmrg_LT_DECL([], [variables_saved_for_relink], [1],
2710fc27e79cSmrg    [Variables whose values should be saved in libtool wrapper scripts and
2711fc27e79cSmrg    restored at link time])
2712fc27e79cSmrg_LT_DECL([], [need_lib_prefix], [0],
2713fc27e79cSmrg    [Do we need the "lib" prefix for modules?])
2714fc27e79cSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2715fc27e79cSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
2716fc27e79cSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2717fc27e79cSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2718fc27e79cSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2719fc27e79cSmrg    [Is shlibpath searched before the hard-coded library search path?])
2720fc27e79cSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2721fc27e79cSmrg_LT_DECL([], [library_names_spec], [1],
2722fc27e79cSmrg    [[List of archive names.  First name is the real one, the rest are links.
2723fc27e79cSmrg    The last name is the one that the linker finds with -lNAME]])
2724fc27e79cSmrg_LT_DECL([], [soname_spec], [1],
2725fc27e79cSmrg    [[The coded name of the library, if different from the real name]])
2726fc27e79cSmrg_LT_DECL([], [postinstall_cmds], [2],
2727fc27e79cSmrg    [Command to use after installation of a shared archive])
2728fc27e79cSmrg_LT_DECL([], [postuninstall_cmds], [2],
2729fc27e79cSmrg    [Command to use after uninstallation of a shared archive])
2730fc27e79cSmrg_LT_DECL([], [finish_cmds], [2],
2731fc27e79cSmrg    [Commands used to finish a libtool library installation in a directory])
2732fc27e79cSmrg_LT_DECL([], [finish_eval], [1],
2733fc27e79cSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
2734fc27e79cSmrg    not shown]])
2735fc27e79cSmrg_LT_DECL([], [hardcode_into_libs], [0],
2736fc27e79cSmrg    [Whether we should hardcode library paths into libraries])
2737fc27e79cSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2738fc27e79cSmrg    [Compile-time system search path for libraries])
2739fc27e79cSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2740fc27e79cSmrg    [Run-time system search path for libraries])
2741fc27e79cSmrg])# _LT_SYS_DYNAMIC_LINKER
2742fc27e79cSmrg
2743fc27e79cSmrg
2744fc27e79cSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
2745fc27e79cSmrg# --------------------------
2746fc27e79cSmrg# find a file program which can recognize shared library
2747fc27e79cSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2748fc27e79cSmrg[m4_require([_LT_DECL_EGREP])dnl
2749fc27e79cSmrgAC_MSG_CHECKING([for $1])
2750fc27e79cSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2751fc27e79cSmrg[case $MAGIC_CMD in
2752fc27e79cSmrg[[\\/*] |  ?:[\\/]*])
2753fc27e79cSmrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2754fc27e79cSmrg  ;;
2755fc27e79cSmrg*)
2756fc27e79cSmrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2757fc27e79cSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2758fc27e79cSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2759fc27e79cSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2760fc27e79cSmrgdnl not every word.  This closes a longstanding sh security hole.
2761fc27e79cSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2762fc27e79cSmrg  for ac_dir in $ac_dummy; do
2763fc27e79cSmrg    IFS="$lt_save_ifs"
2764fc27e79cSmrg    test -z "$ac_dir" && ac_dir=.
2765fc27e79cSmrg    if test -f $ac_dir/$1; then
2766fc27e79cSmrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2767fc27e79cSmrg      if test -n "$file_magic_test_file"; then
2768fc27e79cSmrg	case $deplibs_check_method in
2769fc27e79cSmrg	"file_magic "*)
2770fc27e79cSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2771fc27e79cSmrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2772fc27e79cSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2773fc27e79cSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
2774fc27e79cSmrg	    :
2775fc27e79cSmrg	  else
2776fc27e79cSmrg	    cat <<_LT_EOF 1>&2
2777659607e0Smrg
2778fc27e79cSmrg*** Warning: the command libtool uses to detect shared libraries,
2779fc27e79cSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2780fc27e79cSmrg*** The result is that libtool may fail to recognize shared libraries
2781fc27e79cSmrg*** as such.  This will affect the creation of libtool libraries that
2782fc27e79cSmrg*** depend on shared libraries, but programs linked with such libtool
2783fc27e79cSmrg*** libraries will work regardless of this problem.  Nevertheless, you
2784fc27e79cSmrg*** may want to report the problem to your system manager and/or to
2785fc27e79cSmrg*** bug-libtool@gnu.org
2786659607e0Smrg
2787fc27e79cSmrg_LT_EOF
2788fc27e79cSmrg	  fi ;;
2789fc27e79cSmrg	esac
2790fc27e79cSmrg      fi
2791fc27e79cSmrg      break
2792fc27e79cSmrg    fi
2793fc27e79cSmrg  done
2794fc27e79cSmrg  IFS="$lt_save_ifs"
2795fc27e79cSmrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2796fc27e79cSmrg  ;;
2797fc27e79cSmrgesac])
2798fc27e79cSmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2799fc27e79cSmrgif test -n "$MAGIC_CMD"; then
2800fc27e79cSmrg  AC_MSG_RESULT($MAGIC_CMD)
2801fc27e79cSmrgelse
2802fc27e79cSmrg  AC_MSG_RESULT(no)
2803fc27e79cSmrgfi
2804fc27e79cSmrg_LT_DECL([], [MAGIC_CMD], [0],
2805fc27e79cSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
2806fc27e79cSmrg])# _LT_PATH_TOOL_PREFIX
2807659607e0Smrg
2808fc27e79cSmrg# Old name:
2809fc27e79cSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
2810fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
2811fc27e79cSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
2812659607e0Smrg
2813659607e0Smrg
2814fc27e79cSmrg# _LT_PATH_MAGIC
2815fc27e79cSmrg# --------------
2816fc27e79cSmrg# find a file program which can recognize a shared library
2817fc27e79cSmrgm4_defun([_LT_PATH_MAGIC],
2818fc27e79cSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
2819fc27e79cSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
2820fc27e79cSmrg  if test -n "$ac_tool_prefix"; then
2821fc27e79cSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
28226aab59a7Smrg  else
2823fc27e79cSmrg    MAGIC_CMD=:
2824659607e0Smrg  fi
28256aab59a7Smrgfi
2826fc27e79cSmrg])# _LT_PATH_MAGIC
2827659607e0Smrg
2828659607e0Smrg
2829fc27e79cSmrg# LT_PATH_LD
2830fc27e79cSmrg# ----------
2831fc27e79cSmrg# find the pathname to the GNU or non-GNU linker
2832fc27e79cSmrgAC_DEFUN([LT_PATH_LD],
2833fc27e79cSmrg[AC_REQUIRE([AC_PROG_CC])dnl
2834fc27e79cSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
2835fc27e79cSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
2836fc27e79cSmrgm4_require([_LT_DECL_SED])dnl
2837fc27e79cSmrgm4_require([_LT_DECL_EGREP])dnl
2838659607e0Smrg
2839fc27e79cSmrgAC_ARG_WITH([gnu-ld],
2840fc27e79cSmrg    [AS_HELP_STRING([--with-gnu-ld],
2841fc27e79cSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
2842fc27e79cSmrg    [test "$withval" = no || with_gnu_ld=yes],
2843fc27e79cSmrg    [with_gnu_ld=no])dnl
2844659607e0Smrg
2845fc27e79cSmrgac_prog=ld
2846fc27e79cSmrgif test "$GCC" = yes; then
2847fc27e79cSmrg  # Check if gcc -print-prog-name=ld gives a path.
2848fc27e79cSmrg  AC_MSG_CHECKING([for ld used by $CC])
2849fc27e79cSmrg  case $host in
2850fc27e79cSmrg  *-*-mingw*)
2851fc27e79cSmrg    # gcc leaves a trailing carriage return which upsets mingw
2852fc27e79cSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
28536aab59a7Smrg  *)
2854fc27e79cSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
28556aab59a7Smrg  esac
2856fc27e79cSmrg  case $ac_prog in
2857fc27e79cSmrg    # Accept absolute paths.
2858fc27e79cSmrg    [[\\/]]* | ?:[[\\/]]*)
2859fc27e79cSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
2860fc27e79cSmrg      # Canonicalize the pathname of ld
2861fc27e79cSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
2862fc27e79cSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
2863fc27e79cSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
2864fc27e79cSmrg      done
2865fc27e79cSmrg      test -z "$LD" && LD="$ac_prog"
2866fc27e79cSmrg      ;;
2867fc27e79cSmrg  "")
2868fc27e79cSmrg    # If it fails, then pretend we aren't using GCC.
2869fc27e79cSmrg    ac_prog=ld
2870fc27e79cSmrg    ;;
2871fc27e79cSmrg  *)
2872fc27e79cSmrg    # If it is relative, then search for the first ld in PATH.
2873fc27e79cSmrg    with_gnu_ld=unknown
2874fc27e79cSmrg    ;;
2875fc27e79cSmrg  esac
2876fc27e79cSmrgelif test "$with_gnu_ld" = yes; then
2877fc27e79cSmrg  AC_MSG_CHECKING([for GNU ld])
2878fc27e79cSmrgelse
2879fc27e79cSmrg  AC_MSG_CHECKING([for non-GNU ld])
2880fc27e79cSmrgfi
2881fc27e79cSmrgAC_CACHE_VAL(lt_cv_path_LD,
2882fc27e79cSmrg[if test -z "$LD"; then
2883fc27e79cSmrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2884fc27e79cSmrg  for ac_dir in $PATH; do
2885fc27e79cSmrg    IFS="$lt_save_ifs"
2886fc27e79cSmrg    test -z "$ac_dir" && ac_dir=.
2887fc27e79cSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2888fc27e79cSmrg      lt_cv_path_LD="$ac_dir/$ac_prog"
2889fc27e79cSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
2890fc27e79cSmrg      # but apparently some variants of GNU ld only accept -v.
2891fc27e79cSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
2892fc27e79cSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
2893fc27e79cSmrg      *GNU* | *'with BFD'*)
2894fc27e79cSmrg	test "$with_gnu_ld" != no && break
2895fc27e79cSmrg	;;
2896fc27e79cSmrg      *)
2897fc27e79cSmrg	test "$with_gnu_ld" != yes && break
2898fc27e79cSmrg	;;
2899fc27e79cSmrg      esac
2900fc27e79cSmrg    fi
2901fc27e79cSmrg  done
2902fc27e79cSmrg  IFS="$lt_save_ifs"
2903fc27e79cSmrgelse
2904fc27e79cSmrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
2905fc27e79cSmrgfi])
2906fc27e79cSmrgLD="$lt_cv_path_LD"
2907fc27e79cSmrgif test -n "$LD"; then
2908fc27e79cSmrg  AC_MSG_RESULT($LD)
2909fc27e79cSmrgelse
2910fc27e79cSmrg  AC_MSG_RESULT(no)
2911fc27e79cSmrgfi
2912fc27e79cSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2913fc27e79cSmrg_LT_PATH_LD_GNU
2914fc27e79cSmrgAC_SUBST([LD])
2915659607e0Smrg
2916fc27e79cSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
2917fc27e79cSmrg])# LT_PATH_LD
2918659607e0Smrg
2919fc27e79cSmrg# Old names:
2920fc27e79cSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
2921fc27e79cSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
2922fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
2923fc27e79cSmrgdnl AC_DEFUN([AM_PROG_LD], [])
2924fc27e79cSmrgdnl AC_DEFUN([AC_PROG_LD], [])
2925659607e0Smrg
2926659607e0Smrg
2927fc27e79cSmrg# _LT_PATH_LD_GNU
2928fc27e79cSmrg#- --------------
2929fc27e79cSmrgm4_defun([_LT_PATH_LD_GNU],
2930fc27e79cSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
2931fc27e79cSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
2932fc27e79cSmrgcase `$LD -v 2>&1 </dev/null` in
2933fc27e79cSmrg*GNU* | *'with BFD'*)
2934fc27e79cSmrg  lt_cv_prog_gnu_ld=yes
2935fc27e79cSmrg  ;;
2936fc27e79cSmrg*)
2937fc27e79cSmrg  lt_cv_prog_gnu_ld=no
2938fc27e79cSmrg  ;;
2939fc27e79cSmrgesac])
2940fc27e79cSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2941fc27e79cSmrg])# _LT_PATH_LD_GNU
2942659607e0Smrg
2943659607e0Smrg
2944fc27e79cSmrg# _LT_CMD_RELOAD
2945fc27e79cSmrg# --------------
2946fc27e79cSmrg# find reload flag for linker
2947fc27e79cSmrg#   -- PORTME Some linkers may need a different reload flag.
2948fc27e79cSmrgm4_defun([_LT_CMD_RELOAD],
2949fc27e79cSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
2950fc27e79cSmrg  lt_cv_ld_reload_flag,
2951fc27e79cSmrg  [lt_cv_ld_reload_flag='-r'])
2952fc27e79cSmrgreload_flag=$lt_cv_ld_reload_flag
2953fc27e79cSmrgcase $reload_flag in
2954fc27e79cSmrg"" | " "*) ;;
2955fc27e79cSmrg*) reload_flag=" $reload_flag" ;;
2956fc27e79cSmrgesac
2957fc27e79cSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
2958fc27e79cSmrgcase $host_os in
2959fc27e79cSmrg  darwin*)
2960fc27e79cSmrg    if test "$GCC" = yes; then
2961fc27e79cSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
2962fc27e79cSmrg    else
2963fc27e79cSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
2964fc27e79cSmrg    fi
29656aab59a7Smrg    ;;
2966fc27e79cSmrgesac
2967fc27e79cSmrg_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
2968fc27e79cSmrg_LT_DECL([], [reload_cmds], [2])dnl
2969fc27e79cSmrg])# _LT_CMD_RELOAD
2970659607e0Smrg
2971659607e0Smrg
2972fc27e79cSmrg# _LT_CHECK_MAGIC_METHOD
2973fc27e79cSmrg# ----------------------
2974fc27e79cSmrg# how to check for library dependencies
2975fc27e79cSmrg#  -- PORTME fill in with the dynamic library characteristics
2976fc27e79cSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
2977fc27e79cSmrg[m4_require([_LT_DECL_EGREP])
2978fc27e79cSmrgm4_require([_LT_DECL_OBJDUMP])
2979fc27e79cSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
2980fc27e79cSmrglt_cv_deplibs_check_method,
2981fc27e79cSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
2982fc27e79cSmrglt_cv_file_magic_test_file=
2983fc27e79cSmrglt_cv_deplibs_check_method='unknown'
2984fc27e79cSmrg# Need to set the preceding variable on all platforms that support
2985fc27e79cSmrg# interlibrary dependencies.
2986fc27e79cSmrg# 'none' -- dependencies not supported.
2987fc27e79cSmrg# `unknown' -- same as none, but documents that we really don't know.
2988fc27e79cSmrg# 'pass_all' -- all dependencies passed with no checks.
2989fc27e79cSmrg# 'test_compile' -- check by making test program.
2990fc27e79cSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
2991fc27e79cSmrg# which responds to the $file_magic_cmd with a given extended regex.
2992fc27e79cSmrg# If you have `file' or equivalent on your system and you're not sure
2993fc27e79cSmrg# whether `pass_all' will *always* work, you probably want this one.
2994659607e0Smrg
2995fc27e79cSmrgcase $host_os in
2996fc27e79cSmrgaix[[4-9]]*)
2997fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
2998fc27e79cSmrg  ;;
2999659607e0Smrg
3000fc27e79cSmrgbeos*)
3001fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
3002fc27e79cSmrg  ;;
3003659607e0Smrg
3004fc27e79cSmrgbsdi[[45]]*)
3005fc27e79cSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3006fc27e79cSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3007fc27e79cSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3008fc27e79cSmrg  ;;
3009659607e0Smrg
3010fc27e79cSmrgcygwin*)
3011fc27e79cSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3012fc27e79cSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3013fc27e79cSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3014fc27e79cSmrg  ;;
30156aab59a7Smrg
3016fc27e79cSmrgmingw* | pw32*)
3017fc27e79cSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3018fc27e79cSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3019fc27e79cSmrg  # unless we find 'file', for example because we are cross-compiling.
3020fc27e79cSmrg  if ( file / ) >/dev/null 2>&1; then
3021fc27e79cSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3022fc27e79cSmrg    lt_cv_file_magic_cmd='func_win32_libid'
3023fc27e79cSmrg  else
3024fc27e79cSmrg    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
3025fc27e79cSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3026659607e0Smrg  fi
3027fc27e79cSmrg  ;;
3028659607e0Smrg
3029fc27e79cSmrgcegcc)
3030fc27e79cSmrg  # use the weaker test based on 'objdump'. See mingw*.
3031fc27e79cSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3032fc27e79cSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3033fc27e79cSmrg  ;;
3034659607e0Smrg
3035fc27e79cSmrgdarwin* | rhapsody*)
3036fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
3037fc27e79cSmrg  ;;
3038659607e0Smrg
3039fc27e79cSmrgfreebsd* | dragonfly*)
3040fc27e79cSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3041fc27e79cSmrg    case $host_cpu in
3042fc27e79cSmrg    i*86 )
3043fc27e79cSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3044fc27e79cSmrg      # Let's accept both of them until this is cleared up.
3045fc27e79cSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3046fc27e79cSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3047fc27e79cSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3048fc27e79cSmrg      ;;
3049fc27e79cSmrg    esac
30506aab59a7Smrg  else
3051fc27e79cSmrg    lt_cv_deplibs_check_method=pass_all
30526aab59a7Smrg  fi
3053fc27e79cSmrg  ;;
3054659607e0Smrg
3055fc27e79cSmrggnu*)
3056fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
3057fc27e79cSmrg  ;;
3058659607e0Smrg
3059fc27e79cSmrghpux10.20* | hpux11*)
3060fc27e79cSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3061fc27e79cSmrg  case $host_cpu in
3062fc27e79cSmrg  ia64*)
3063fc27e79cSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3064fc27e79cSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3065fc27e79cSmrg    ;;
3066fc27e79cSmrg  hppa*64*)
3067fc27e79cSmrg    [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]']
3068fc27e79cSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3069fc27e79cSmrg    ;;
3070fc27e79cSmrg  *)
3071fc27e79cSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
3072fc27e79cSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
30736aab59a7Smrg    ;;
30746aab59a7Smrg  esac
3075fc27e79cSmrg  ;;
3076fc27e79cSmrg
3077fc27e79cSmrginterix[[3-9]]*)
3078fc27e79cSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3079fc27e79cSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3080fc27e79cSmrg  ;;
3081659607e0Smrg
3082fc27e79cSmrgirix5* | irix6* | nonstopux*)
3083fc27e79cSmrg  case $LD in
3084fc27e79cSmrg  *-32|*"-32 ") libmagic=32-bit;;
3085fc27e79cSmrg  *-n32|*"-n32 ") libmagic=N32;;
3086fc27e79cSmrg  *-64|*"-64 ") libmagic=64-bit;;
3087fc27e79cSmrg  *) libmagic=never-match;;
3088fc27e79cSmrg  esac
3089fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
3090fc27e79cSmrg  ;;
3091659607e0Smrg
3092fc27e79cSmrg# This must be Linux ELF.
3093fc27e79cSmrglinux* | k*bsd*-gnu)
3094fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
3095fc27e79cSmrg  ;;
3096fc27e79cSmrg
3097fc27e79cSmrgnetbsd*)
3098fc27e79cSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3099fc27e79cSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
31006aab59a7Smrg  else
3101fc27e79cSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
31026aab59a7Smrg  fi
3103fc27e79cSmrg  ;;
3104659607e0Smrg
3105fc27e79cSmrgnewos6*)
3106fc27e79cSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3107fc27e79cSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3108fc27e79cSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3109fc27e79cSmrg  ;;
3110659607e0Smrg
3111fc27e79cSmrg*nto* | *qnx*)
3112fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
31136aab59a7Smrg  ;;
3114659607e0Smrg
3115fc27e79cSmrgopenbsd*)
3116fc27e79cSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3117fc27e79cSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
31186aab59a7Smrg  else
3119fc27e79cSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
31206aab59a7Smrg  fi
3121659607e0Smrg  ;;
3122659607e0Smrg
3123fc27e79cSmrgosf3* | osf4* | osf5*)
3124fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
31256aab59a7Smrg  ;;
3126659607e0Smrg
3127fc27e79cSmrgrdos*)
3128fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
31296aab59a7Smrg  ;;
3130659607e0Smrg
3131fc27e79cSmrgsolaris*)
3132fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
31336aab59a7Smrg  ;;
31346aab59a7Smrg
3135fc27e79cSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3136fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
3137fc27e79cSmrg  ;;
31386aab59a7Smrg
3139fc27e79cSmrgsysv4 | sysv4.3*)
3140fc27e79cSmrg  case $host_vendor in
3141fc27e79cSmrg  motorola)
3142fc27e79cSmrg    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]]'
3143fc27e79cSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3144659607e0Smrg    ;;
3145fc27e79cSmrg  ncr)
3146fc27e79cSmrg    lt_cv_deplibs_check_method=pass_all
3147fc27e79cSmrg    ;;
3148fc27e79cSmrg  sequent)
3149fc27e79cSmrg    lt_cv_file_magic_cmd='/bin/file'
3150fc27e79cSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3151fc27e79cSmrg    ;;
3152fc27e79cSmrg  sni)
3153fc27e79cSmrg    lt_cv_file_magic_cmd='/bin/file'
3154fc27e79cSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3155fc27e79cSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3156fc27e79cSmrg    ;;
3157fc27e79cSmrg  siemens)
3158fc27e79cSmrg    lt_cv_deplibs_check_method=pass_all
3159fc27e79cSmrg    ;;
3160fc27e79cSmrg  pc)
3161fc27e79cSmrg    lt_cv_deplibs_check_method=pass_all
3162659607e0Smrg    ;;
31636aab59a7Smrg  esac
31646aab59a7Smrg  ;;
3165659607e0Smrg
3166fc27e79cSmrgtpf*)
3167fc27e79cSmrg  lt_cv_deplibs_check_method=pass_all
31686aab59a7Smrg  ;;
3169fc27e79cSmrgesac
3170fc27e79cSmrg])
3171fc27e79cSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3172fc27e79cSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3173fc27e79cSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3174659607e0Smrg
3175fc27e79cSmrg_LT_DECL([], [deplibs_check_method], [1],
3176fc27e79cSmrg    [Method to check whether dependent libraries are shared objects])
3177fc27e79cSmrg_LT_DECL([], [file_magic_cmd], [1],
3178fc27e79cSmrg    [Command to use when deplibs_check_method == "file_magic"])
3179fc27e79cSmrg])# _LT_CHECK_MAGIC_METHOD
3180659607e0Smrg
3181659607e0Smrg
3182fc27e79cSmrg# LT_PATH_NM
3183fc27e79cSmrg# ----------
3184fc27e79cSmrg# find the pathname to a BSD- or MS-compatible name lister
3185fc27e79cSmrgAC_DEFUN([LT_PATH_NM],
3186fc27e79cSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3187fc27e79cSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3188fc27e79cSmrg[if test -n "$NM"; then
3189fc27e79cSmrg  # Let the user override the test.
3190fc27e79cSmrg  lt_cv_path_NM="$NM"
3191fc27e79cSmrgelse
3192fc27e79cSmrg  lt_nm_to_check="${ac_tool_prefix}nm"
3193fc27e79cSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3194fc27e79cSmrg    lt_nm_to_check="$lt_nm_to_check nm"
31956aab59a7Smrg  fi
3196fc27e79cSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3197fc27e79cSmrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3198fc27e79cSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3199fc27e79cSmrg      IFS="$lt_save_ifs"
3200fc27e79cSmrg      test -z "$ac_dir" && ac_dir=.
3201fc27e79cSmrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3202fc27e79cSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3203fc27e79cSmrg	# Check to see if the nm accepts a BSD-compat flag.
3204fc27e79cSmrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3205fc27e79cSmrg	#   nm: unknown option "B" ignored
3206fc27e79cSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3207fc27e79cSmrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3208fc27e79cSmrg	*/dev/null* | *'Invalid file or object type'*)
3209fc27e79cSmrg	  lt_cv_path_NM="$tmp_nm -B"
3210fc27e79cSmrg	  break
3211fc27e79cSmrg	  ;;
3212fc27e79cSmrg	*)
3213fc27e79cSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3214fc27e79cSmrg	  */dev/null*)
3215fc27e79cSmrg	    lt_cv_path_NM="$tmp_nm -p"
3216fc27e79cSmrg	    break
3217fc27e79cSmrg	    ;;
3218fc27e79cSmrg	  *)
3219fc27e79cSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3220fc27e79cSmrg	    continue # so that we can try to find one that supports BSD flags
3221fc27e79cSmrg	    ;;
3222fc27e79cSmrg	  esac
3223fc27e79cSmrg	  ;;
3224fc27e79cSmrg	esac
3225fc27e79cSmrg      fi
3226fc27e79cSmrg    done
3227fc27e79cSmrg    IFS="$lt_save_ifs"
3228fc27e79cSmrg  done
3229fc27e79cSmrg  : ${lt_cv_path_NM=no}
3230fc27e79cSmrgfi])
3231fc27e79cSmrgif test "$lt_cv_path_NM" != "no"; then
3232fc27e79cSmrg  NM="$lt_cv_path_NM"
3233fc27e79cSmrgelse
3234fc27e79cSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3235fc27e79cSmrg  AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
3236fc27e79cSmrg  AC_SUBST([DUMPBIN])
3237fc27e79cSmrg  if test "$DUMPBIN" != ":"; then
3238fc27e79cSmrg    NM="$DUMPBIN"
3239fc27e79cSmrg  fi
3240fc27e79cSmrgfi
3241fc27e79cSmrgtest -z "$NM" && NM=nm
3242fc27e79cSmrgAC_SUBST([NM])
3243fc27e79cSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3244fc27e79cSmrg
3245fc27e79cSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3246fc27e79cSmrg  [lt_cv_nm_interface="BSD nm"
3247fc27e79cSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
3248fc27e79cSmrg  (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3249fc27e79cSmrg  (eval "$ac_compile" 2>conftest.err)
3250fc27e79cSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3251fc27e79cSmrg  (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3252fc27e79cSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3253fc27e79cSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3254fc27e79cSmrg  (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
3255fc27e79cSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3256fc27e79cSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3257fc27e79cSmrg    lt_cv_nm_interface="MS dumpbin"
3258fc27e79cSmrg  fi
3259fc27e79cSmrg  rm -f conftest*])
3260fc27e79cSmrg])# LT_PATH_NM
32616aab59a7Smrg
3262fc27e79cSmrg# Old names:
3263fc27e79cSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3264fc27e79cSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3265fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
3266fc27e79cSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3267fc27e79cSmrgdnl AC_DEFUN([AC_PROG_NM], [])
32686aab59a7Smrg
3269659607e0Smrg
3270fc27e79cSmrg# LT_LIB_M
3271fc27e79cSmrg# --------
3272fc27e79cSmrg# check for math library
3273fc27e79cSmrgAC_DEFUN([LT_LIB_M],
3274fc27e79cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3275fc27e79cSmrgLIBM=
3276fc27e79cSmrgcase $host in
3277fc27e79cSmrg*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
3278fc27e79cSmrg  # These system don't have libm, or don't need it
32796aab59a7Smrg  ;;
3280fc27e79cSmrg*-ncr-sysv4.3*)
3281fc27e79cSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3282fc27e79cSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
32836aab59a7Smrg  ;;
3284fc27e79cSmrg*)
3285fc27e79cSmrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
32866aab59a7Smrg  ;;
3287fc27e79cSmrgesac
3288fc27e79cSmrgAC_SUBST([LIBM])
3289fc27e79cSmrg])# LT_LIB_M
3290659607e0Smrg
3291fc27e79cSmrg# Old name:
3292fc27e79cSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3293fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
3294fc27e79cSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3295659607e0Smrg
3296659607e0Smrg
3297fc27e79cSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3298fc27e79cSmrg# -------------------------------
3299fc27e79cSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3300fc27e79cSmrg[m4_require([_LT_TAG_COMPILER])dnl
3301659607e0Smrg
3302fc27e79cSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3303659607e0Smrg
3304fc27e79cSmrgif test "$GCC" = yes; then
3305fc27e79cSmrg  _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
3306659607e0Smrg
3307fc27e79cSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3308fc27e79cSmrg    lt_cv_prog_compiler_rtti_exceptions,
3309fc27e79cSmrg    [-fno-rtti -fno-exceptions], [],
3310fc27e79cSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3311fc27e79cSmrgfi
3312fc27e79cSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3313fc27e79cSmrg	[Compiler flag to turn off builtin functions])
3314fc27e79cSmrg])# _LT_COMPILER_NO_RTTI
3315659607e0Smrg
3316659607e0Smrg
3317fc27e79cSmrg# _LT_CMD_GLOBAL_SYMBOLS
3318fc27e79cSmrg# ----------------------
3319fc27e79cSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3320fc27e79cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3321fc27e79cSmrgAC_REQUIRE([AC_PROG_CC])dnl
3322fc27e79cSmrgAC_REQUIRE([LT_PATH_NM])dnl
3323fc27e79cSmrgAC_REQUIRE([LT_PATH_LD])dnl
3324fc27e79cSmrgm4_require([_LT_DECL_SED])dnl
3325fc27e79cSmrgm4_require([_LT_DECL_EGREP])dnl
3326fc27e79cSmrgm4_require([_LT_TAG_COMPILER])dnl
3327fc27e79cSmrg
3328fc27e79cSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3329fc27e79cSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3330fc27e79cSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3331fc27e79cSmrg[
3332fc27e79cSmrg# These are sane defaults that work on at least a few old systems.
3333fc27e79cSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3334fc27e79cSmrg
3335fc27e79cSmrg# Character class describing NM global symbol codes.
3336fc27e79cSmrgsymcode='[[BCDEGRST]]'
3337fc27e79cSmrg
3338fc27e79cSmrg# Regexp to match symbols that can be accessed directly from C.
3339fc27e79cSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3340fc27e79cSmrg
3341fc27e79cSmrg# Define system-specific variables.
3342fc27e79cSmrgcase $host_os in
3343fc27e79cSmrgaix*)
3344fc27e79cSmrg  symcode='[[BCDT]]'
3345fc27e79cSmrg  ;;
3346fc27e79cSmrgcygwin* | mingw* | pw32* | cegcc*)
3347fc27e79cSmrg  symcode='[[ABCDGISTW]]'
3348fc27e79cSmrg  ;;
3349fc27e79cSmrghpux*)
3350fc27e79cSmrg  if test "$host_cpu" = ia64; then
3351fc27e79cSmrg    symcode='[[ABCDEGRST]]'
33526aab59a7Smrg  fi
33536aab59a7Smrg  ;;
3354fc27e79cSmrgirix* | nonstopux*)
3355fc27e79cSmrg  symcode='[[BCDEGRST]]'
33566aab59a7Smrg  ;;
3357fc27e79cSmrgosf*)
3358fc27e79cSmrg  symcode='[[BCDEGQRST]]'
33596aab59a7Smrg  ;;
33606aab59a7Smrgsolaris*)
3361fc27e79cSmrg  symcode='[[BDRT]]'
33626aab59a7Smrg  ;;
3363fc27e79cSmrgsco3.2v5*)
3364fc27e79cSmrg  symcode='[[DT]]'
33656aab59a7Smrg  ;;
3366fc27e79cSmrgsysv4.2uw2*)
3367fc27e79cSmrg  symcode='[[DT]]'
33686aab59a7Smrg  ;;
3369fc27e79cSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3370fc27e79cSmrg  symcode='[[ABDT]]'
33716aab59a7Smrg  ;;
3372fc27e79cSmrgsysv4)
3373fc27e79cSmrg  symcode='[[DFNSTU]]'
33746aab59a7Smrg  ;;
3375fc27e79cSmrgesac
3376659607e0Smrg
3377fc27e79cSmrg# If we're using GNU nm, then use its standard symbol codes.
3378fc27e79cSmrgcase `$NM -V 2>&1` in
3379fc27e79cSmrg*GNU* | *'with BFD'*)
3380fc27e79cSmrg  symcode='[[ABCDGIRSTW]]' ;;
3381fc27e79cSmrgesac
3382659607e0Smrg
3383fc27e79cSmrg# Transform an extracted symbol line into a proper C declaration.
3384fc27e79cSmrg# Some systems (esp. on ia64) link data and code symbols differently,
3385fc27e79cSmrg# so use this general approach.
3386fc27e79cSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3387fc27e79cSmrg
3388fc27e79cSmrg# Transform an extracted symbol line into symbol name and symbol address
3389fc27e79cSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3390fc27e79cSmrglt_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'"
3391fc27e79cSmrg
3392fc27e79cSmrg# Handle CRLF in mingw tool chain
3393fc27e79cSmrgopt_cr=
3394fc27e79cSmrgcase $build_os in
3395fc27e79cSmrgmingw*)
3396fc27e79cSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
33976aab59a7Smrg  ;;
33986aab59a7Smrgesac
3399659607e0Smrg
3400fc27e79cSmrg# Try without a prefix underscore, then with it.
3401fc27e79cSmrgfor ac_symprfx in "" "_"; do
3402659607e0Smrg
3403fc27e79cSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3404fc27e79cSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3405659607e0Smrg
3406fc27e79cSmrg  # Write the raw and C identifiers.
3407fc27e79cSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3408fc27e79cSmrg    # Fake it for dumpbin and say T for any non-static function
3409fc27e79cSmrg    # and D for any global variable.
3410fc27e79cSmrg    # Also find C++ and __fastcall symbols from MSVC++,
3411fc27e79cSmrg    # which start with @ or ?.
3412fc27e79cSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3413fc27e79cSmrg"     {last_section=section; section=\$ 3};"\
3414fc27e79cSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3415fc27e79cSmrg"     \$ 0!~/External *\|/{next};"\
3416fc27e79cSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3417fc27e79cSmrg"     {if(hide[section]) next};"\
3418fc27e79cSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3419fc27e79cSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3420fc27e79cSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3421fc27e79cSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3422fc27e79cSmrg"     ' prfx=^$ac_symprfx]"
3423fc27e79cSmrg  else
3424fc27e79cSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
34256aab59a7Smrg  fi
34266aab59a7Smrg
3427fc27e79cSmrg  # Check to see that the pipe works correctly.
3428fc27e79cSmrg  pipe_works=no
3429659607e0Smrg
3430fc27e79cSmrg  rm -f conftest*
3431fc27e79cSmrg  cat > conftest.$ac_ext <<_LT_EOF
3432fc27e79cSmrg#ifdef __cplusplus
3433fc27e79cSmrgextern "C" {
3434fc27e79cSmrg#endif
3435fc27e79cSmrgchar nm_test_var;
3436fc27e79cSmrgvoid nm_test_func(void);
3437fc27e79cSmrgvoid nm_test_func(void){}
3438fc27e79cSmrg#ifdef __cplusplus
3439fc27e79cSmrg}
3440fc27e79cSmrg#endif
3441fc27e79cSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
3442fc27e79cSmrg_LT_EOF
34436aab59a7Smrg
3444fc27e79cSmrg  if AC_TRY_EVAL(ac_compile); then
3445fc27e79cSmrg    # Now try to grab the symbols.
3446fc27e79cSmrg    nlist=conftest.nm
3447fc27e79cSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
3448fc27e79cSmrg      # Try sorting and uniquifying the output.
3449fc27e79cSmrg      if sort "$nlist" | uniq > "$nlist"T; then
3450fc27e79cSmrg	mv -f "$nlist"T "$nlist"
3451fc27e79cSmrg      else
3452fc27e79cSmrg	rm -f "$nlist"T
3453fc27e79cSmrg      fi
34546aab59a7Smrg
3455fc27e79cSmrg      # Make sure that we snagged all the symbols we need.
3456fc27e79cSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3457fc27e79cSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3458fc27e79cSmrg	  cat <<_LT_EOF > conftest.$ac_ext
3459fc27e79cSmrg#ifdef __cplusplus
3460fc27e79cSmrgextern "C" {
3461fc27e79cSmrg#endif
3462659607e0Smrg
3463fc27e79cSmrg_LT_EOF
3464fc27e79cSmrg	  # Now generate the symbol file.
3465fc27e79cSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
34666aab59a7Smrg
3467fc27e79cSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
34686aab59a7Smrg
3469fc27e79cSmrg/* The mapping between symbol names and symbols.  */
3470fc27e79cSmrgconst struct {
3471fc27e79cSmrg  const char *name;
3472fc27e79cSmrg  void       *address;
3473fc27e79cSmrg}
3474fc27e79cSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3475fc27e79cSmrg{
3476fc27e79cSmrg  { "@PROGRAM@", (void *) 0 },
3477fc27e79cSmrg_LT_EOF
3478fc27e79cSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3479fc27e79cSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3480fc27e79cSmrg  {0, (void *) 0}
3481fc27e79cSmrg};
34826aab59a7Smrg
3483fc27e79cSmrg/* This works around a problem in FreeBSD linker */
3484fc27e79cSmrg#ifdef FREEBSD_WORKAROUND
3485fc27e79cSmrgstatic const void *lt_preloaded_setup() {
3486fc27e79cSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
3487fc27e79cSmrg}
3488fc27e79cSmrg#endif
3489659607e0Smrg
3490fc27e79cSmrg#ifdef __cplusplus
3491fc27e79cSmrg}
3492fc27e79cSmrg#endif
3493fc27e79cSmrg_LT_EOF
3494fc27e79cSmrg	  # Now try linking the two files.
3495fc27e79cSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
3496fc27e79cSmrg	  lt_save_LIBS="$LIBS"
3497fc27e79cSmrg	  lt_save_CFLAGS="$CFLAGS"
3498fc27e79cSmrg	  LIBS="conftstm.$ac_objext"
3499fc27e79cSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3500fc27e79cSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3501fc27e79cSmrg	    pipe_works=yes
3502fc27e79cSmrg	  fi
3503fc27e79cSmrg	  LIBS="$lt_save_LIBS"
3504fc27e79cSmrg	  CFLAGS="$lt_save_CFLAGS"
3505fc27e79cSmrg	else
3506fc27e79cSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3507fc27e79cSmrg	fi
3508fc27e79cSmrg      else
3509fc27e79cSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3510fc27e79cSmrg      fi
3511fc27e79cSmrg    else
3512fc27e79cSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
35136aab59a7Smrg    fi
3514fc27e79cSmrg  else
3515fc27e79cSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3516fc27e79cSmrg    cat conftest.$ac_ext >&5
3517fc27e79cSmrg  fi
3518fc27e79cSmrg  rm -rf conftest* conftst*
3519659607e0Smrg
3520fc27e79cSmrg  # Do not use the global_symbol_pipe unless it works.
3521fc27e79cSmrg  if test "$pipe_works" = yes; then
3522fc27e79cSmrg    break
35236aab59a7Smrg  else
3524fc27e79cSmrg    lt_cv_sys_global_symbol_pipe=
35256aab59a7Smrg  fi
3526fc27e79cSmrgdone
3527fc27e79cSmrg])
3528fc27e79cSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3529fc27e79cSmrg  lt_cv_sys_global_symbol_to_cdecl=
3530fc27e79cSmrgfi
3531fc27e79cSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3532fc27e79cSmrg  AC_MSG_RESULT(failed)
3533fc27e79cSmrgelse
3534fc27e79cSmrg  AC_MSG_RESULT(ok)
35356aab59a7Smrgfi
3536659607e0Smrg
3537fc27e79cSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3538fc27e79cSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
3539fc27e79cSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3540fc27e79cSmrg    [Transform the output of nm in a proper C declaration])
3541fc27e79cSmrg_LT_DECL([global_symbol_to_c_name_address],
3542fc27e79cSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3543fc27e79cSmrg    [Transform the output of nm in a C name address pair])
3544fc27e79cSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3545fc27e79cSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3546fc27e79cSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3547fc27e79cSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
3548659607e0Smrg
3549659607e0Smrg
3550fc27e79cSmrg# _LT_COMPILER_PIC([TAGNAME])
35516aab59a7Smrg# ---------------------------
3552fc27e79cSmrgm4_defun([_LT_COMPILER_PIC],
3553fc27e79cSmrg[m4_require([_LT_TAG_COMPILER])dnl
3554fc27e79cSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3555fc27e79cSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3556fc27e79cSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3557659607e0Smrg
3558fc27e79cSmrgAC_MSG_CHECKING([for $compiler option to produce PIC])
3559fc27e79cSmrgm4_if([$1], [CXX], [
3560fc27e79cSmrg  # C++ specific cases for pic, static, wl, etc.
3561fc27e79cSmrg  if test "$GXX" = yes; then
3562fc27e79cSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3563fc27e79cSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3564659607e0Smrg
3565fc27e79cSmrg    case $host_os in
3566fc27e79cSmrg    aix*)
3567fc27e79cSmrg      # All AIX code is PIC.
3568fc27e79cSmrg      if test "$host_cpu" = ia64; then
3569fc27e79cSmrg	# AIX 5 now supports IA64 processor
3570fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3571fc27e79cSmrg      fi
35726aab59a7Smrg      ;;
3573659607e0Smrg
3574fc27e79cSmrg    amigaos*)
3575fc27e79cSmrg      case $host_cpu in
3576fc27e79cSmrg      powerpc)
3577fc27e79cSmrg            # see comment about AmigaOS4 .so support
3578fc27e79cSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3579fc27e79cSmrg        ;;
3580fc27e79cSmrg      m68k)
3581fc27e79cSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
3582fc27e79cSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
3583fc27e79cSmrg            # like `-m68040'.
3584fc27e79cSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3585fc27e79cSmrg        ;;
3586fc27e79cSmrg      esac
35876aab59a7Smrg      ;;
3588659607e0Smrg
3589fc27e79cSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3590fc27e79cSmrg      # PIC is the default for these OSes.
3591fc27e79cSmrg      ;;
3592fc27e79cSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3593fc27e79cSmrg      # This hack is so that the source file can tell whether it is being
3594fc27e79cSmrg      # built for inclusion in a dll (and should export symbols for example).
3595fc27e79cSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3596fc27e79cSmrg      # (--disable-auto-import) libraries
3597fc27e79cSmrg      m4_if([$1], [GCJ], [],
3598fc27e79cSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3599fc27e79cSmrg      ;;
3600fc27e79cSmrg    darwin* | rhapsody*)
3601fc27e79cSmrg      # PIC is the default on this platform
3602fc27e79cSmrg      # Common symbols not allowed in MH_DYLIB files
3603fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3604fc27e79cSmrg      ;;
3605fc27e79cSmrg    *djgpp*)
3606fc27e79cSmrg      # DJGPP does not support shared libraries at all
3607fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3608fc27e79cSmrg      ;;
3609fc27e79cSmrg    interix[[3-9]]*)
3610fc27e79cSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3611fc27e79cSmrg      # Instead, we relocate shared libraries at runtime.
3612fc27e79cSmrg      ;;
3613fc27e79cSmrg    sysv4*MP*)
3614fc27e79cSmrg      if test -d /usr/nec; then
3615fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
36166aab59a7Smrg      fi
36176aab59a7Smrg      ;;
3618fc27e79cSmrg    hpux*)
3619fc27e79cSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3620fc27e79cSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3621fc27e79cSmrg      # sets the default TLS model and affects inlining.
3622fc27e79cSmrg      case $host_cpu in
3623fc27e79cSmrg      hppa*64*)
36246aab59a7Smrg	;;
36256aab59a7Smrg      *)
3626fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
36276aab59a7Smrg	;;
36286aab59a7Smrg      esac
3629fc27e79cSmrg      ;;
3630fc27e79cSmrg    *qnx* | *nto*)
3631fc27e79cSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3632fc27e79cSmrg      # it will coredump.
3633fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3634fc27e79cSmrg      ;;
3635fc27e79cSmrg    *)
3636fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3637fc27e79cSmrg      ;;
3638fc27e79cSmrg    esac
3639fc27e79cSmrg  else
3640fc27e79cSmrg    case $host_os in
3641fc27e79cSmrg      aix[[4-9]]*)
3642fc27e79cSmrg	# All AIX code is PIC.
3643fc27e79cSmrg	if test "$host_cpu" = ia64; then
3644fc27e79cSmrg	  # AIX 5 now supports IA64 processor
3645fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3646fc27e79cSmrg	else
3647fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3648fc27e79cSmrg	fi
3649fc27e79cSmrg	;;
3650fc27e79cSmrg      chorus*)
3651fc27e79cSmrg	case $cc_basename in
3652fc27e79cSmrg	cxch68*)
3653fc27e79cSmrg	  # Green Hills C++ Compiler
3654fc27e79cSmrg	  # _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"
3655fc27e79cSmrg	  ;;
3656fc27e79cSmrg	esac
3657fc27e79cSmrg	;;
3658fc27e79cSmrg      dgux*)
3659fc27e79cSmrg	case $cc_basename in
3660fc27e79cSmrg	  ec++*)
3661fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3662fc27e79cSmrg	    ;;
3663fc27e79cSmrg	  ghcx*)
3664fc27e79cSmrg	    # Green Hills C++ Compiler
3665fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3666fc27e79cSmrg	    ;;
3667fc27e79cSmrg	  *)
3668fc27e79cSmrg	    ;;
3669fc27e79cSmrg	esac
3670fc27e79cSmrg	;;
3671fc27e79cSmrg      freebsd* | dragonfly*)
3672fc27e79cSmrg	# FreeBSD uses GNU C++
3673fc27e79cSmrg	;;
3674fc27e79cSmrg      hpux9* | hpux10* | hpux11*)
3675fc27e79cSmrg	case $cc_basename in
3676fc27e79cSmrg	  CC*)
3677fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3678fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3679fc27e79cSmrg	    if test "$host_cpu" != ia64; then
3680fc27e79cSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3681fc27e79cSmrg	    fi
3682fc27e79cSmrg	    ;;
3683fc27e79cSmrg	  aCC*)
3684fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3685fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3686fc27e79cSmrg	    case $host_cpu in
3687fc27e79cSmrg	    hppa*64*|ia64*)
3688fc27e79cSmrg	      # +Z the default
3689fc27e79cSmrg	      ;;
3690fc27e79cSmrg	    *)
3691fc27e79cSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3692fc27e79cSmrg	      ;;
3693fc27e79cSmrg	    esac
3694fc27e79cSmrg	    ;;
3695fc27e79cSmrg	  *)
3696fc27e79cSmrg	    ;;
3697fc27e79cSmrg	esac
3698fc27e79cSmrg	;;
3699fc27e79cSmrg      interix*)
3700fc27e79cSmrg	# This is c89, which is MS Visual C++ (no shared libs)
3701fc27e79cSmrg	# Anyone wants to do a port?
3702fc27e79cSmrg	;;
3703fc27e79cSmrg      irix5* | irix6* | nonstopux*)
3704fc27e79cSmrg	case $cc_basename in
3705fc27e79cSmrg	  CC*)
3706fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3707fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3708fc27e79cSmrg	    # CC pic flag -KPIC is the default.
3709fc27e79cSmrg	    ;;
3710fc27e79cSmrg	  *)
3711fc27e79cSmrg	    ;;
3712fc27e79cSmrg	esac
3713fc27e79cSmrg	;;
3714fc27e79cSmrg      linux* | k*bsd*-gnu)
3715fc27e79cSmrg	case $cc_basename in
3716fc27e79cSmrg	  KCC*)
3717fc27e79cSmrg	    # KAI C++ Compiler
3718fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3719fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3720fc27e79cSmrg	    ;;
3721fc27e79cSmrg	  ecpc* )
3722fc27e79cSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
3723fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3724fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3725fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3726fc27e79cSmrg	    ;;
3727fc27e79cSmrg	  icpc* )
3728fc27e79cSmrg	    # Intel C++, used to be incompatible with GCC.
3729fc27e79cSmrg	    # ICC 10 doesn't accept -KPIC any more.
3730fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3731fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3732fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3733fc27e79cSmrg	    ;;
3734fc27e79cSmrg	  pgCC* | pgcpp*)
3735fc27e79cSmrg	    # Portland Group C++ compiler
3736fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3737fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
3738fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3739fc27e79cSmrg	    ;;
3740fc27e79cSmrg	  cxx*)
3741fc27e79cSmrg	    # Compaq C++
3742fc27e79cSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3743fc27e79cSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3744fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3745fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3746fc27e79cSmrg	    ;;
3747fc27e79cSmrg	  xlc* | xlC*)
3748fc27e79cSmrg	    # IBM XL 8.0 on PPC
3749fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3750fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
3751fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
3752fc27e79cSmrg	    ;;
3753fc27e79cSmrg	  *)
3754fc27e79cSmrg	    case `$CC -V 2>&1 | sed 5q` in
3755fc27e79cSmrg	    *Sun\ C*)
3756fc27e79cSmrg	      # Sun C++ 5.9
3757fc27e79cSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3758fc27e79cSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3759fc27e79cSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3760fc27e79cSmrg	      ;;
3761fc27e79cSmrg	    esac
3762fc27e79cSmrg	    ;;
3763fc27e79cSmrg	esac
3764fc27e79cSmrg	;;
3765fc27e79cSmrg      lynxos*)
3766fc27e79cSmrg	;;
3767fc27e79cSmrg      m88k*)
3768fc27e79cSmrg	;;
3769fc27e79cSmrg      mvs*)
3770fc27e79cSmrg	case $cc_basename in
3771fc27e79cSmrg	  cxx*)
3772fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
3773fc27e79cSmrg	    ;;
3774fc27e79cSmrg	  *)
3775fc27e79cSmrg	    ;;
3776fc27e79cSmrg	esac
3777fc27e79cSmrg	;;
3778fc27e79cSmrg      netbsd*)
3779fc27e79cSmrg	;;
3780fc27e79cSmrg      *qnx* | *nto*)
3781fc27e79cSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
3782fc27e79cSmrg        # it will coredump.
3783fc27e79cSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3784fc27e79cSmrg        ;;
3785fc27e79cSmrg      osf3* | osf4* | osf5*)
3786fc27e79cSmrg	case $cc_basename in
3787fc27e79cSmrg	  KCC*)
3788fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
3789fc27e79cSmrg	    ;;
3790fc27e79cSmrg	  RCC*)
3791fc27e79cSmrg	    # Rational C++ 2.4.1
3792fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3793fc27e79cSmrg	    ;;
3794fc27e79cSmrg	  cxx*)
3795fc27e79cSmrg	    # Digital/Compaq C++
3796fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3797fc27e79cSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
3798fc27e79cSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
3799fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3800fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3801fc27e79cSmrg	    ;;
3802fc27e79cSmrg	  *)
3803fc27e79cSmrg	    ;;
3804fc27e79cSmrg	esac
3805fc27e79cSmrg	;;
3806fc27e79cSmrg      psos*)
3807fc27e79cSmrg	;;
3808fc27e79cSmrg      solaris*)
3809fc27e79cSmrg	case $cc_basename in
3810fc27e79cSmrg	  CC*)
3811fc27e79cSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
3812fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3813fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3814fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
3815fc27e79cSmrg	    ;;
3816fc27e79cSmrg	  gcx*)
3817fc27e79cSmrg	    # Green Hills C++ Compiler
3818fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
3819fc27e79cSmrg	    ;;
3820fc27e79cSmrg	  *)
3821fc27e79cSmrg	    ;;
3822fc27e79cSmrg	esac
3823fc27e79cSmrg	;;
3824fc27e79cSmrg      sunos4*)
3825fc27e79cSmrg	case $cc_basename in
3826fc27e79cSmrg	  CC*)
3827fc27e79cSmrg	    # Sun C++ 4.x
3828fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3829fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3830fc27e79cSmrg	    ;;
3831fc27e79cSmrg	  lcc*)
3832fc27e79cSmrg	    # Lucid
3833fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
3834fc27e79cSmrg	    ;;
3835fc27e79cSmrg	  *)
3836fc27e79cSmrg	    ;;
3837fc27e79cSmrg	esac
3838fc27e79cSmrg	;;
3839fc27e79cSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
3840fc27e79cSmrg	case $cc_basename in
3841fc27e79cSmrg	  CC*)
3842fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3843fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3844fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3845fc27e79cSmrg	    ;;
3846fc27e79cSmrg	esac
3847fc27e79cSmrg	;;
3848fc27e79cSmrg      tandem*)
3849fc27e79cSmrg	case $cc_basename in
3850fc27e79cSmrg	  NCC*)
3851fc27e79cSmrg	    # NonStop-UX NCC 3.20
3852fc27e79cSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
3853fc27e79cSmrg	    ;;
3854fc27e79cSmrg	  *)
3855fc27e79cSmrg	    ;;
3856fc27e79cSmrg	esac
3857fc27e79cSmrg	;;
3858fc27e79cSmrg      vxworks*)
3859fc27e79cSmrg	;;
3860fc27e79cSmrg      *)
3861fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3862fc27e79cSmrg	;;
3863fc27e79cSmrg    esac
3864fc27e79cSmrg  fi
3865fc27e79cSmrg],
3866fc27e79cSmrg[
3867fc27e79cSmrg  if test "$GCC" = yes; then
3868fc27e79cSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3869fc27e79cSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3870659607e0Smrg
3871fc27e79cSmrg    case $host_os in
3872fc27e79cSmrg      aix*)
3873fc27e79cSmrg      # All AIX code is PIC.
3874fc27e79cSmrg      if test "$host_cpu" = ia64; then
3875fc27e79cSmrg	# AIX 5 now supports IA64 processor
3876fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3877fc27e79cSmrg      fi
3878fc27e79cSmrg      ;;
3879659607e0Smrg
3880fc27e79cSmrg    amigaos*)
3881fc27e79cSmrg      case $host_cpu in
3882fc27e79cSmrg      powerpc)
3883fc27e79cSmrg            # see comment about AmigaOS4 .so support
3884fc27e79cSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3885fc27e79cSmrg        ;;
3886fc27e79cSmrg      m68k)
3887fc27e79cSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
3888fc27e79cSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
3889fc27e79cSmrg            # like `-m68040'.
3890fc27e79cSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3891fc27e79cSmrg        ;;
3892fc27e79cSmrg      esac
3893fc27e79cSmrg      ;;
3894659607e0Smrg
3895fc27e79cSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3896fc27e79cSmrg      # PIC is the default for these OSes.
3897fc27e79cSmrg      ;;
3898659607e0Smrg
3899fc27e79cSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3900fc27e79cSmrg      # This hack is so that the source file can tell whether it is being
3901fc27e79cSmrg      # built for inclusion in a dll (and should export symbols for example).
3902fc27e79cSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3903fc27e79cSmrg      # (--disable-auto-import) libraries
3904fc27e79cSmrg      m4_if([$1], [GCJ], [],
3905fc27e79cSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3906fc27e79cSmrg      ;;
3907659607e0Smrg
3908fc27e79cSmrg    darwin* | rhapsody*)
3909fc27e79cSmrg      # PIC is the default on this platform
3910fc27e79cSmrg      # Common symbols not allowed in MH_DYLIB files
3911fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3912fc27e79cSmrg      ;;
3913659607e0Smrg
3914fc27e79cSmrg    hpux*)
3915fc27e79cSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3916fc27e79cSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3917fc27e79cSmrg      # sets the default TLS model and affects inlining.
3918fc27e79cSmrg      case $host_cpu in
3919fc27e79cSmrg      hppa*64*)
3920fc27e79cSmrg	# +Z the default
3921fc27e79cSmrg	;;
3922fc27e79cSmrg      *)
3923fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3924fc27e79cSmrg	;;
3925fc27e79cSmrg      esac
3926fc27e79cSmrg      ;;
3927659607e0Smrg
3928fc27e79cSmrg    interix[[3-9]]*)
3929fc27e79cSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3930fc27e79cSmrg      # Instead, we relocate shared libraries at runtime.
3931fc27e79cSmrg      ;;
3932659607e0Smrg
3933fc27e79cSmrg    msdosdjgpp*)
3934fc27e79cSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
3935fc27e79cSmrg      # on systems that don't support them.
3936fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
3937fc27e79cSmrg      enable_shared=no
3938fc27e79cSmrg      ;;
3939659607e0Smrg
3940fc27e79cSmrg    *nto* | *qnx*)
3941fc27e79cSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3942fc27e79cSmrg      # it will coredump.
3943fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3944fc27e79cSmrg      ;;
3945659607e0Smrg
3946fc27e79cSmrg    sysv4*MP*)
3947fc27e79cSmrg      if test -d /usr/nec; then
3948fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3949fc27e79cSmrg      fi
3950fc27e79cSmrg      ;;
3951659607e0Smrg
3952fc27e79cSmrg    *)
3953fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
39546aab59a7Smrg      ;;
39556aab59a7Smrg    esac
39566aab59a7Smrg  else
3957fc27e79cSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
3958fc27e79cSmrg    case $host_os in
3959fc27e79cSmrg    aix*)
3960fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3961fc27e79cSmrg      if test "$host_cpu" = ia64; then
3962fc27e79cSmrg	# AIX 5 now supports IA64 processor
3963fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3964fc27e79cSmrg      else
3965fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3966fc27e79cSmrg      fi
3967fc27e79cSmrg      ;;
3968659607e0Smrg
3969fc27e79cSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
3970fc27e79cSmrg      # This hack is so that the source file can tell whether it is being
3971fc27e79cSmrg      # built for inclusion in a dll (and should export symbols for example).
3972fc27e79cSmrg      m4_if([$1], [GCJ], [],
3973fc27e79cSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3974fc27e79cSmrg      ;;
3975659607e0Smrg
3976fc27e79cSmrg    hpux9* | hpux10* | hpux11*)
3977fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3978fc27e79cSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
3979fc27e79cSmrg      # not for PA HP-UX.
3980fc27e79cSmrg      case $host_cpu in
3981fc27e79cSmrg      hppa*64*|ia64*)
3982fc27e79cSmrg	# +Z the default
3983fc27e79cSmrg	;;
3984fc27e79cSmrg      *)
3985fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
3986fc27e79cSmrg	;;
3987fc27e79cSmrg      esac
3988fc27e79cSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
3989fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
3990fc27e79cSmrg      ;;
3991659607e0Smrg
3992fc27e79cSmrg    irix5* | irix6* | nonstopux*)
3993fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3994fc27e79cSmrg      # PIC (with -KPIC) is the default.
3995fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
3996fc27e79cSmrg      ;;
3997659607e0Smrg
3998fc27e79cSmrg    linux* | k*bsd*-gnu)
3999fc27e79cSmrg      case $cc_basename in
4000fc27e79cSmrg      # old Intel for x86_64 which still supported -KPIC.
4001fc27e79cSmrg      ecc*)
4002fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4003fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4004fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4005fc27e79cSmrg        ;;
4006fc27e79cSmrg      # icc used to be incompatible with GCC.
4007fc27e79cSmrg      # ICC 10 doesn't accept -KPIC any more.
4008fc27e79cSmrg      icc* | ifort*)
4009fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4010fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4011fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4012fc27e79cSmrg        ;;
4013fc27e79cSmrg      # Lahey Fortran 8.1.
4014fc27e79cSmrg      lf95*)
4015fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4016fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4017fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4018fc27e79cSmrg	;;
4019fc27e79cSmrg      pgcc* | pgf77* | pgf90* | pgf95*)
4020fc27e79cSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4021fc27e79cSmrg	# which looks to be a dead project)
4022fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4023fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4024fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4025fc27e79cSmrg        ;;
4026fc27e79cSmrg      ccc*)
4027fc27e79cSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4028fc27e79cSmrg        # All Alpha code is PIC.
4029fc27e79cSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4030fc27e79cSmrg        ;;
4031fc27e79cSmrg      xl*)
4032fc27e79cSmrg	# IBM XL C 8.0/Fortran 10.1 on PPC
4033fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4034fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4035fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4036fc27e79cSmrg	;;
4037fc27e79cSmrg      *)
4038fc27e79cSmrg	case `$CC -V 2>&1 | sed 5q` in
4039fc27e79cSmrg	*Sun\ C*)
4040fc27e79cSmrg	  # Sun C 5.9
4041fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4042fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4043fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4044fc27e79cSmrg	  ;;
4045fc27e79cSmrg	*Sun\ F*)
4046fc27e79cSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4047fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4048fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4049fc27e79cSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4050fc27e79cSmrg	  ;;
4051fc27e79cSmrg	esac
4052fc27e79cSmrg	;;
4053fc27e79cSmrg      esac
4054fc27e79cSmrg      ;;
4055659607e0Smrg
4056fc27e79cSmrg    newsos6)
4057fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4058fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4059fc27e79cSmrg      ;;
4060659607e0Smrg
4061fc27e79cSmrg    *nto* | *qnx*)
4062fc27e79cSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4063fc27e79cSmrg      # it will coredump.
4064fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4065fc27e79cSmrg      ;;
4066659607e0Smrg
4067fc27e79cSmrg    osf3* | osf4* | osf5*)
4068fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4069fc27e79cSmrg      # All OSF/1 code is PIC.
4070fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4071fc27e79cSmrg      ;;
4072659607e0Smrg
4073fc27e79cSmrg    rdos*)
4074fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4075fc27e79cSmrg      ;;
4076659607e0Smrg
4077fc27e79cSmrg    solaris*)
4078fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4079fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4080fc27e79cSmrg      case $cc_basename in
4081fc27e79cSmrg      f77* | f90* | f95*)
4082fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4083fc27e79cSmrg      *)
4084fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4085fc27e79cSmrg      esac
4086fc27e79cSmrg      ;;
4087659607e0Smrg
4088fc27e79cSmrg    sunos4*)
4089fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4090fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4091fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4092fc27e79cSmrg      ;;
4093659607e0Smrg
4094fc27e79cSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4095fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4096fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4097fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4098fc27e79cSmrg      ;;
4099659607e0Smrg
4100fc27e79cSmrg    sysv4*MP*)
4101fc27e79cSmrg      if test -d /usr/nec ;then
4102fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4103fc27e79cSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4104fc27e79cSmrg      fi
4105fc27e79cSmrg      ;;
4106fc27e79cSmrg
4107fc27e79cSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4108fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4109fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4110fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4111fc27e79cSmrg      ;;
4112fc27e79cSmrg
4113fc27e79cSmrg    unicos*)
4114fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4115fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4116fc27e79cSmrg      ;;
4117fc27e79cSmrg
4118fc27e79cSmrg    uts4*)
4119fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4120fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4121fc27e79cSmrg      ;;
4122fc27e79cSmrg
4123fc27e79cSmrg    *)
4124fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4125fc27e79cSmrg      ;;
4126fc27e79cSmrg    esac
4127fc27e79cSmrg  fi
4128fc27e79cSmrg])
4129fc27e79cSmrgcase $host_os in
4130fc27e79cSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
4131fc27e79cSmrg  *djgpp*)
4132fc27e79cSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
41336aab59a7Smrg    ;;
4134fc27e79cSmrg  *)
4135fc27e79cSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
41366aab59a7Smrg    ;;
41376aab59a7Smrgesac
4138fc27e79cSmrgAC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4139fc27e79cSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4140fc27e79cSmrg	[How to pass a linker flag through the compiler])
4141659607e0Smrg
4142fc27e79cSmrg#
4143fc27e79cSmrg# Check to make sure the PIC flag actually works.
4144fc27e79cSmrg#
4145fc27e79cSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4146fc27e79cSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4147fc27e79cSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4148fc27e79cSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4149fc27e79cSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4150fc27e79cSmrg     "" | " "*) ;;
4151fc27e79cSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4152fc27e79cSmrg     esac],
4153fc27e79cSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4154fc27e79cSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4155fc27e79cSmrgfi
4156fc27e79cSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4157fc27e79cSmrg	[Additional compiler flags for building library objects])
4158659607e0Smrg
4159fc27e79cSmrg#
4160fc27e79cSmrg# Check to make sure the static flag actually works.
4161fc27e79cSmrg#
4162fc27e79cSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4163fc27e79cSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4164fc27e79cSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4165fc27e79cSmrg  $lt_tmp_static_flag,
4166fc27e79cSmrg  [],
4167fc27e79cSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4168fc27e79cSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4169fc27e79cSmrg	[Compiler flag to prevent dynamic linking])
4170fc27e79cSmrg])# _LT_COMPILER_PIC
4171659607e0Smrg
4172659607e0Smrg
4173fc27e79cSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4174fc27e79cSmrg# ----------------------------
4175fc27e79cSmrg# See if the linker supports building shared libraries.
4176fc27e79cSmrgm4_defun([_LT_LINKER_SHLIBS],
4177fc27e79cSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4178fc27e79cSmrgAC_REQUIRE([LT_PATH_NM])dnl
4179fc27e79cSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4180fc27e79cSmrgm4_require([_LT_DECL_EGREP])dnl
4181fc27e79cSmrgm4_require([_LT_DECL_SED])dnl
4182fc27e79cSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4183fc27e79cSmrgm4_require([_LT_TAG_COMPILER])dnl
4184fc27e79cSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4185fc27e79cSmrgm4_if([$1], [CXX], [
4186fc27e79cSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4187fc27e79cSmrg  case $host_os in
4188fc27e79cSmrg  aix[[4-9]]*)
4189fc27e79cSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4190fc27e79cSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4191fc27e79cSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4192fc27e79cSmrg      _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'
4193fc27e79cSmrg    else
4194fc27e79cSmrg      _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'
4195fc27e79cSmrg    fi
4196fc27e79cSmrg    ;;
4197fc27e79cSmrg  pw32*)
4198fc27e79cSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
41996aab59a7Smrg  ;;
4200fc27e79cSmrg  cygwin* | mingw* | cegcc*)
4201fc27e79cSmrg    _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'
42026aab59a7Smrg  ;;
4203fc27e79cSmrg  *)
4204fc27e79cSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
42056aab59a7Smrg  ;;
42066aab59a7Smrg  esac
4207fc27e79cSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4208fc27e79cSmrg], [
4209fc27e79cSmrg  runpath_var=
4210fc27e79cSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4211fc27e79cSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4212fc27e79cSmrg  _LT_TAGVAR(archive_cmds, $1)=
4213fc27e79cSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4214fc27e79cSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4215fc27e79cSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4216fc27e79cSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4217fc27e79cSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4218fc27e79cSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4219fc27e79cSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4220fc27e79cSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4221fc27e79cSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4222fc27e79cSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
4223fc27e79cSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4224fc27e79cSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4225fc27e79cSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4226fc27e79cSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4227fc27e79cSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4228fc27e79cSmrg  _LT_TAGVAR(module_cmds, $1)=
4229fc27e79cSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4230fc27e79cSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4231fc27e79cSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4232fc27e79cSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4233fc27e79cSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4234fc27e79cSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4235fc27e79cSmrg  # included in the symbol list
4236fc27e79cSmrg  _LT_TAGVAR(include_expsyms, $1)=
4237fc27e79cSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4238fc27e79cSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4239fc27e79cSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4240fc27e79cSmrg  # as well as any symbol that contains `d'.
4241fc27e79cSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4242fc27e79cSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4243fc27e79cSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4244fc27e79cSmrg  # the symbol is explicitly referenced.  Since portable code cannot
4245fc27e79cSmrg  # rely on this symbol name, it's probably fine to never include it in
4246fc27e79cSmrg  # preloaded symbol tables.
4247fc27e79cSmrg  # Exclude shared library initialization/finalization symbols.
4248fc27e79cSmrgdnl Note also adjust exclude_expsyms for C++ above.
4249fc27e79cSmrg  extract_expsyms_cmds=
4250659607e0Smrg
4251fc27e79cSmrg  case $host_os in
4252fc27e79cSmrg  cygwin* | mingw* | pw32* | cegcc*)
4253fc27e79cSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4254fc27e79cSmrg    # When not using gcc, we currently assume that we are using
4255fc27e79cSmrg    # Microsoft Visual C++.
4256fc27e79cSmrg    if test "$GCC" != yes; then
4257fc27e79cSmrg      with_gnu_ld=no
4258fc27e79cSmrg    fi
4259fc27e79cSmrg    ;;
4260fc27e79cSmrg  interix*)
4261fc27e79cSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4262fc27e79cSmrg    with_gnu_ld=yes
4263fc27e79cSmrg    ;;
4264fc27e79cSmrg  openbsd*)
4265fc27e79cSmrg    with_gnu_ld=no
4266fc27e79cSmrg    ;;
4267fc27e79cSmrg  esac
4268659607e0Smrg
4269fc27e79cSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
4270fc27e79cSmrg  if test "$with_gnu_ld" = yes; then
4271fc27e79cSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4272fc27e79cSmrg    wlarc='${wl}'
4273659607e0Smrg
4274fc27e79cSmrg    # Set some defaults for GNU ld with shared library support. These
4275fc27e79cSmrg    # are reset later if shared libraries are not supported. Putting them
4276fc27e79cSmrg    # here allows them to be overridden if necessary.
4277fc27e79cSmrg    runpath_var=LD_RUN_PATH
4278fc27e79cSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4279fc27e79cSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4280fc27e79cSmrg    # ancient GNU ld didn't support --whole-archive et. al.
4281fc27e79cSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4282fc27e79cSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4283fc27e79cSmrg    else
4284fc27e79cSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4285fc27e79cSmrg    fi
4286fc27e79cSmrg    supports_anon_versioning=no
4287fc27e79cSmrg    case `$LD -v 2>&1` in
4288fc27e79cSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4289fc27e79cSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4290fc27e79cSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4291fc27e79cSmrg      *\ 2.11.*) ;; # other 2.11 versions
4292fc27e79cSmrg      *) supports_anon_versioning=yes ;;
4293fc27e79cSmrg    esac
4294659607e0Smrg
4295fc27e79cSmrg    # See if GNU ld supports shared libraries.
4296fc27e79cSmrg    case $host_os in
4297fc27e79cSmrg    aix[[3-9]]*)
4298fc27e79cSmrg      # On AIX/PPC, the GNU linker is very broken
4299fc27e79cSmrg      if test "$host_cpu" != ia64; then
4300fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4301fc27e79cSmrg	cat <<_LT_EOF 1>&2
4302659607e0Smrg
4303fc27e79cSmrg*** Warning: the GNU linker, at least up to release 2.9.1, is reported
4304fc27e79cSmrg*** to be unable to reliably create shared libraries on AIX.
4305fc27e79cSmrg*** Therefore, libtool is disabling shared libraries support.  If you
4306fc27e79cSmrg*** really care for shared libraries, you may want to modify your PATH
4307fc27e79cSmrg*** so that a non-GNU linker is found, and then restart.
4308659607e0Smrg
4309fc27e79cSmrg_LT_EOF
4310fc27e79cSmrg      fi
4311fc27e79cSmrg      ;;
4312659607e0Smrg
4313fc27e79cSmrg    amigaos*)
4314fc27e79cSmrg      case $host_cpu in
4315fc27e79cSmrg      powerpc)
4316fc27e79cSmrg            # see comment about AmigaOS4 .so support
4317fc27e79cSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4318fc27e79cSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4319fc27e79cSmrg        ;;
4320fc27e79cSmrg      m68k)
4321fc27e79cSmrg            _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)'
4322fc27e79cSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4323fc27e79cSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4324fc27e79cSmrg        ;;
4325fc27e79cSmrg      esac
4326fc27e79cSmrg      ;;
4327659607e0Smrg
4328fc27e79cSmrg    beos*)
4329fc27e79cSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4330fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4331fc27e79cSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4332fc27e79cSmrg	# support --undefined.  This deserves some investigation.  FIXME
4333fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4334fc27e79cSmrg      else
4335fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4336fc27e79cSmrg      fi
4337fc27e79cSmrg      ;;
4338659607e0Smrg
4339fc27e79cSmrg    cygwin* | mingw* | pw32* | cegcc*)
4340fc27e79cSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4341fc27e79cSmrg      # as there is no search path for DLLs.
4342fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4343fc27e79cSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4344fc27e79cSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
4345fc27e79cSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4346fc27e79cSmrg      _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'
4347fc27e79cSmrg
4348fc27e79cSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4349fc27e79cSmrg        _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'
4350fc27e79cSmrg	# If the export-symbols file already is a .def file (1st line
4351fc27e79cSmrg	# is EXPORTS), use it as is; otherwise, prepend...
4352fc27e79cSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4353fc27e79cSmrg	  cp $export_symbols $output_objdir/$soname.def;
4354fc27e79cSmrg	else
4355fc27e79cSmrg	  echo EXPORTS > $output_objdir/$soname.def;
4356fc27e79cSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
4357fc27e79cSmrg	fi~
4358fc27e79cSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4359fc27e79cSmrg      else
4360fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4361fc27e79cSmrg      fi
4362fc27e79cSmrg      ;;
4363659607e0Smrg
4364fc27e79cSmrg    interix[[3-9]]*)
4365fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
4366fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4367fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4368fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4369fc27e79cSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4370fc27e79cSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4371fc27e79cSmrg      # default) and relocated if they conflict, which is a slow very memory
4372fc27e79cSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4373fc27e79cSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4374fc27e79cSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4375fc27e79cSmrg      _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'
4376fc27e79cSmrg      _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'
4377fc27e79cSmrg      ;;
4378659607e0Smrg
4379fc27e79cSmrg    gnu* | linux* | tpf* | k*bsd*-gnu)
4380fc27e79cSmrg      tmp_diet=no
4381fc27e79cSmrg      if test "$host_os" = linux-dietlibc; then
4382fc27e79cSmrg	case $cc_basename in
4383fc27e79cSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4384fc27e79cSmrg	esac
4385fc27e79cSmrg      fi
4386fc27e79cSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4387fc27e79cSmrg	 && test "$tmp_diet" = no
4388fc27e79cSmrg      then
4389fc27e79cSmrg	tmp_addflag=
4390fc27e79cSmrg	tmp_sharedflag='-shared'
4391fc27e79cSmrg	case $cc_basename,$host_cpu in
4392fc27e79cSmrg        pgcc*)				# Portland Group C compiler
4393fc27e79cSmrg	  _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'
4394fc27e79cSmrg	  tmp_addflag=' $pic_flag'
4395fc27e79cSmrg	  ;;
4396fc27e79cSmrg	pgf77* | pgf90* | pgf95*)	# Portland Group f77 and f90 compilers
4397fc27e79cSmrg	  _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'
4398fc27e79cSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4399fc27e79cSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4400fc27e79cSmrg	  tmp_addflag=' -i_dynamic' ;;
4401fc27e79cSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4402fc27e79cSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4403fc27e79cSmrg	ifc* | ifort*)			# Intel Fortran compiler
4404fc27e79cSmrg	  tmp_addflag=' -nofor_main' ;;
4405fc27e79cSmrg	lf95*)				# Lahey Fortran 8.1
4406fc27e79cSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4407fc27e79cSmrg	  tmp_sharedflag='--shared' ;;
4408fc27e79cSmrg	xl[[cC]]*)			# IBM XL C 8.0 on PPC (deal with xlf below)
4409fc27e79cSmrg	  tmp_sharedflag='-qmkshrobj'
4410fc27e79cSmrg	  tmp_addflag= ;;
4411fc27e79cSmrg	esac
4412fc27e79cSmrg	case `$CC -V 2>&1 | sed 5q` in
4413fc27e79cSmrg	*Sun\ C*)			# Sun C 5.9
4414fc27e79cSmrg	  _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'
4415fc27e79cSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4416fc27e79cSmrg	  tmp_sharedflag='-G' ;;
4417fc27e79cSmrg	*Sun\ F*)			# Sun Fortran 8.3
4418fc27e79cSmrg	  tmp_sharedflag='-G' ;;
4419fc27e79cSmrg	esac
4420fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4421659607e0Smrg
4422fc27e79cSmrg        if test "x$supports_anon_versioning" = xyes; then
4423fc27e79cSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4424fc27e79cSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4425fc27e79cSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4426fc27e79cSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4427fc27e79cSmrg        fi
4428659607e0Smrg
4429fc27e79cSmrg	case $cc_basename in
4430fc27e79cSmrg	xlf*)
4431fc27e79cSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4432fc27e79cSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4433fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4434fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
4435fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
4436fc27e79cSmrg	  if test "x$supports_anon_versioning" = xyes; then
4437fc27e79cSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4438fc27e79cSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4439fc27e79cSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4440fc27e79cSmrg	      $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4441fc27e79cSmrg	  fi
4442fc27e79cSmrg	  ;;
4443fc27e79cSmrg	esac
4444fc27e79cSmrg      else
4445fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
4446fc27e79cSmrg      fi
4447fc27e79cSmrg      ;;
4448659607e0Smrg
4449fc27e79cSmrg    netbsd*)
4450fc27e79cSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4451fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4452fc27e79cSmrg	wlarc=
4453fc27e79cSmrg      else
4454fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4455fc27e79cSmrg	_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'
4456fc27e79cSmrg      fi
4457fc27e79cSmrg      ;;
4458659607e0Smrg
4459fc27e79cSmrg    solaris*)
4460fc27e79cSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4461fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4462fc27e79cSmrg	cat <<_LT_EOF 1>&2
4463659607e0Smrg
4464fc27e79cSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4465fc27e79cSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
4466fc27e79cSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4467fc27e79cSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4468fc27e79cSmrg*** your PATH or compiler configuration so that the native linker is
4469fc27e79cSmrg*** used, and then restart.
4470659607e0Smrg
4471fc27e79cSmrg_LT_EOF
4472fc27e79cSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4473fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4474fc27e79cSmrg	_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'
4475fc27e79cSmrg      else
4476fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4477fc27e79cSmrg      fi
4478fc27e79cSmrg      ;;
4479659607e0Smrg
4480fc27e79cSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4481fc27e79cSmrg      case `$LD -v 2>&1` in
4482fc27e79cSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4483fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4484fc27e79cSmrg	cat <<_LT_EOF 1>&2
4485659607e0Smrg
4486fc27e79cSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4487fc27e79cSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4488fc27e79cSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4489fc27e79cSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4490fc27e79cSmrg*** your PATH or compiler configuration so that the native linker is
4491fc27e79cSmrg*** used, and then restart.
4492659607e0Smrg
4493fc27e79cSmrg_LT_EOF
4494fc27e79cSmrg	;;
4495fc27e79cSmrg	*)
4496fc27e79cSmrg	  # For security reasons, it is highly recommended that you always
4497fc27e79cSmrg	  # use absolute paths for naming shared libraries, and exclude the
4498fc27e79cSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4499fc27e79cSmrg	  # requires that you compile everything twice, which is a pain.
4500fc27e79cSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4501fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4502fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4503fc27e79cSmrg	    _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'
4504fc27e79cSmrg	  else
4505fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4506fc27e79cSmrg	  fi
4507fc27e79cSmrg	;;
4508fc27e79cSmrg      esac
4509fc27e79cSmrg      ;;
4510659607e0Smrg
4511fc27e79cSmrg    sunos4*)
4512fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4513fc27e79cSmrg      wlarc=
4514fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4515fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4516fc27e79cSmrg      ;;
4517659607e0Smrg
4518fc27e79cSmrg    *)
4519fc27e79cSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4520fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4521fc27e79cSmrg	_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'
4522fc27e79cSmrg      else
4523fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4524fc27e79cSmrg      fi
4525fc27e79cSmrg      ;;
4526fc27e79cSmrg    esac
4527659607e0Smrg
4528fc27e79cSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4529fc27e79cSmrg      runpath_var=
4530fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4531fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4532fc27e79cSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
45336aab59a7Smrg    fi
45346aab59a7Smrg  else
4535fc27e79cSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
4536fc27e79cSmrg    case $host_os in
4537fc27e79cSmrg    aix3*)
4538fc27e79cSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4539fc27e79cSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4540fc27e79cSmrg      _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'
4541fc27e79cSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
4542fc27e79cSmrg      # are no directories specified by -L.
4543fc27e79cSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4544fc27e79cSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4545fc27e79cSmrg	# Neither direct hardcoding nor static linking is supported with a
4546fc27e79cSmrg	# broken collect2.
4547fc27e79cSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4548fc27e79cSmrg      fi
4549fc27e79cSmrg      ;;
4550659607e0Smrg
4551fc27e79cSmrg    aix[[4-9]]*)
4552fc27e79cSmrg      if test "$host_cpu" = ia64; then
4553fc27e79cSmrg	# On IA64, the linker does run time linking by default, so we don't
4554fc27e79cSmrg	# have to do anything special.
4555fc27e79cSmrg	aix_use_runtimelinking=no
4556fc27e79cSmrg	exp_sym_flag='-Bexport'
4557fc27e79cSmrg	no_entry_flag=""
4558fc27e79cSmrg      else
4559fc27e79cSmrg	# If we're using GNU nm, then we don't want the "-C" option.
4560fc27e79cSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4561fc27e79cSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4562fc27e79cSmrg	  _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'
4563fc27e79cSmrg	else
4564fc27e79cSmrg	  _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'
4565fc27e79cSmrg	fi
4566fc27e79cSmrg	aix_use_runtimelinking=no
4567659607e0Smrg
4568fc27e79cSmrg	# Test if we are trying to use run time linking or normal
4569fc27e79cSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
4570fc27e79cSmrg	# need to do runtime linking.
4571fc27e79cSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
4572fc27e79cSmrg	  for ld_flag in $LDFLAGS; do
4573fc27e79cSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
45746aab59a7Smrg	    aix_use_runtimelinking=yes
45756aab59a7Smrg	    break
4576fc27e79cSmrg	  fi
4577fc27e79cSmrg	  done
4578fc27e79cSmrg	  ;;
4579fc27e79cSmrg	esac
4580659607e0Smrg
4581fc27e79cSmrg	exp_sym_flag='-bexport'
4582fc27e79cSmrg	no_entry_flag='-bnoentry'
4583fc27e79cSmrg      fi
4584659607e0Smrg
4585fc27e79cSmrg      # When large executables or shared objects are built, AIX ld can
4586fc27e79cSmrg      # have problems creating the table of contents.  If linking a library
4587fc27e79cSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
4588fc27e79cSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
4589fc27e79cSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
4590659607e0Smrg
4591fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)=''
4592fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4593fc27e79cSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4594fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
4595fc27e79cSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4596fc27e79cSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
4597659607e0Smrg
4598fc27e79cSmrg      if test "$GCC" = yes; then
4599fc27e79cSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
4600fc27e79cSmrg	# We only want to do this on AIX 4.2 and lower, the check
4601fc27e79cSmrg	# below for broken collect2 doesn't work under 4.3+
4602fc27e79cSmrg	  collect2name=`${CC} -print-prog-name=collect2`
4603fc27e79cSmrg	  if test -f "$collect2name" &&
4604fc27e79cSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
4605fc27e79cSmrg	  then
46066aab59a7Smrg	  # We have reworked collect2
4607fc27e79cSmrg	  :
4608fc27e79cSmrg	  else
46096aab59a7Smrg	  # We have old collect2
4610fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
46116aab59a7Smrg	  # It fails to find uninstalled libraries when the uninstalled
46126aab59a7Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
46136aab59a7Smrg	  # to unsupported forces relinking
4614fc27e79cSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4615fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4616fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4617fc27e79cSmrg	  fi
4618fc27e79cSmrg	  ;;
4619fc27e79cSmrg	esac
4620fc27e79cSmrg	shared_flag='-shared'
4621fc27e79cSmrg	if test "$aix_use_runtimelinking" = yes; then
4622fc27e79cSmrg	  shared_flag="$shared_flag "'${wl}-G'
46236aab59a7Smrg	fi
4624fc27e79cSmrg      else
4625fc27e79cSmrg	# not using gcc
4626fc27e79cSmrg	if test "$host_cpu" = ia64; then
46276aab59a7Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
46286aab59a7Smrg	# chokes on -Wl,-G. The following line is correct:
4629fc27e79cSmrg	  shared_flag='-G'
46306aab59a7Smrg	else
4631fc27e79cSmrg	  if test "$aix_use_runtimelinking" = yes; then
4632fc27e79cSmrg	    shared_flag='${wl}-G'
4633fc27e79cSmrg	  else
4634fc27e79cSmrg	    shared_flag='${wl}-bM:SRE'
4635fc27e79cSmrg	  fi
46366aab59a7Smrg	fi
46376aab59a7Smrg      fi
4638659607e0Smrg
4639fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
4640fc27e79cSmrg      # It seems that -bexpall does not export symbols beginning with
4641fc27e79cSmrg      # underscore (_), so it is better to generate a list of symbols to export.
4642fc27e79cSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4643fc27e79cSmrg      if test "$aix_use_runtimelinking" = yes; then
4644fc27e79cSmrg	# Warning - without using the other runtime loading flags (-brtl),
46456aab59a7Smrg	# -berok will link without error, but may produce a broken library.
4646fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
4647fc27e79cSmrg        # Determine the default libpath from the value encoded in an
4648fc27e79cSmrg        # empty executable.
4649fc27e79cSmrg        _LT_SYS_MODULE_PATH_AIX
4650fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4651fc27e79cSmrg        _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"
4652fc27e79cSmrg      else
4653fc27e79cSmrg	if test "$host_cpu" = ia64; then
4654fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
4655fc27e79cSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
4656fc27e79cSmrg	  _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"
4657fc27e79cSmrg	else
4658fc27e79cSmrg	 # Determine the default libpath from the value encoded in an
4659fc27e79cSmrg	 # empty executable.
4660fc27e79cSmrg	 _LT_SYS_MODULE_PATH_AIX
4661fc27e79cSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
4662fc27e79cSmrg	  # Warning - without using the other run time loading flags,
4663fc27e79cSmrg	  # -berok will link without error, but may produce a broken library.
4664fc27e79cSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
4665fc27e79cSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
4666fc27e79cSmrg	  # Exported symbols can be pulled into shared objects from archives
4667fc27e79cSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
4668fc27e79cSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
4669fc27e79cSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
4670fc27e79cSmrg	  _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'
4671fc27e79cSmrg	fi
46726aab59a7Smrg      fi
4673fc27e79cSmrg      ;;
4674659607e0Smrg
4675fc27e79cSmrg    amigaos*)
4676fc27e79cSmrg      case $host_cpu in
4677fc27e79cSmrg      powerpc)
4678fc27e79cSmrg            # see comment about AmigaOS4 .so support
4679fc27e79cSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4680fc27e79cSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4681fc27e79cSmrg        ;;
4682fc27e79cSmrg      m68k)
4683fc27e79cSmrg            _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)'
4684fc27e79cSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4685fc27e79cSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4686fc27e79cSmrg        ;;
4687fc27e79cSmrg      esac
4688fc27e79cSmrg      ;;
4689659607e0Smrg
4690fc27e79cSmrg    bsdi[[45]]*)
4691fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
4692fc27e79cSmrg      ;;
4693659607e0Smrg
4694fc27e79cSmrg    cygwin* | mingw* | pw32* | cegcc*)
4695fc27e79cSmrg      # When not using gcc, we currently assume that we are using
4696fc27e79cSmrg      # Microsoft Visual C++.
4697fc27e79cSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
4698fc27e79cSmrg      # no search path for DLLs.
4699fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
4700fc27e79cSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4701fc27e79cSmrg      # Tell ltmain to make .lib files, not .a files.
4702fc27e79cSmrg      libext=lib
4703fc27e79cSmrg      # Tell ltmain to make .dll files, not .so files.
4704fc27e79cSmrg      shrext_cmds=".dll"
4705fc27e79cSmrg      # FIXME: Setting linknames here is a bad hack.
4706fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
4707fc27e79cSmrg      # The linker will automatically build a .lib file if we build a DLL.
4708fc27e79cSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
4709fc27e79cSmrg      # FIXME: Should let the user specify the lib program.
4710fc27e79cSmrg      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
4711fc27e79cSmrg      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
4712fc27e79cSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4713fc27e79cSmrg      ;;
4714659607e0Smrg
4715fc27e79cSmrg    darwin* | rhapsody*)
4716fc27e79cSmrg      _LT_DARWIN_LINKER_FEATURES($1)
47176aab59a7Smrg      ;;
4718fc27e79cSmrg
4719fc27e79cSmrg    dgux*)
4720fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4721fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4722fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47236aab59a7Smrg      ;;
4724fc27e79cSmrg
4725fc27e79cSmrg    freebsd1*)
4726fc27e79cSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
47276aab59a7Smrg      ;;
4728659607e0Smrg
4729fc27e79cSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
4730fc27e79cSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
4731fc27e79cSmrg    # does not break anything, and helps significantly (at the cost of a little
4732fc27e79cSmrg    # extra space).
4733fc27e79cSmrg    freebsd2.2*)
4734fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
4735fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4736fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4737fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47386aab59a7Smrg      ;;
4739fc27e79cSmrg
4740fc27e79cSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
4741fc27e79cSmrg    freebsd2*)
4742fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4743fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4744fc27e79cSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4745fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
47466aab59a7Smrg      ;;
4747659607e0Smrg
4748fc27e79cSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
4749fc27e79cSmrg    freebsd* | dragonfly*)
4750fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
4751fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4752fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4753fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4754fc27e79cSmrg      ;;
4755fc27e79cSmrg
4756fc27e79cSmrg    hpux9*)
4757fc27e79cSmrg      if test "$GCC" = yes; then
4758fc27e79cSmrg	_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'
4759fc27e79cSmrg      else
4760fc27e79cSmrg	_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'
4761fc27e79cSmrg      fi
4762fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4763fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4764fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4765fc27e79cSmrg
4766fc27e79cSmrg      # hardcode_minus_L: Not really in the search PATH,
4767fc27e79cSmrg      # but as the default location of the library.
4768fc27e79cSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4769fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4770fc27e79cSmrg      ;;
4771fc27e79cSmrg
4772fc27e79cSmrg    hpux10*)
4773fc27e79cSmrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4774fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
4775fc27e79cSmrg      else
4776fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
4777fc27e79cSmrg      fi
4778fc27e79cSmrg      if test "$with_gnu_ld" = no; then
4779fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4780fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
4781fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4782fc27e79cSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4783fc27e79cSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4784fc27e79cSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4785fc27e79cSmrg	# hardcode_minus_L: Not really in the search PATH,
4786fc27e79cSmrg	# but as the default location of the library.
4787fc27e79cSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
4788fc27e79cSmrg      fi
4789fc27e79cSmrg      ;;
4790fc27e79cSmrg
4791fc27e79cSmrg    hpux11*)
4792fc27e79cSmrg      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
4793fc27e79cSmrg	case $host_cpu in
4794fc27e79cSmrg	hppa*64*)
4795fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4796fc27e79cSmrg	  ;;
4797fc27e79cSmrg	ia64*)
4798fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
47996aab59a7Smrg	  ;;
48006aab59a7Smrg	*)
4801fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48026aab59a7Smrg	  ;;
48036aab59a7Smrg	esac
4804fc27e79cSmrg      else
4805fc27e79cSmrg	case $host_cpu in
4806fc27e79cSmrg	hppa*64*)
4807fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
48086aab59a7Smrg	  ;;
4809fc27e79cSmrg	ia64*)
4810fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
4811fc27e79cSmrg	  ;;
4812fc27e79cSmrg	*)
4813fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
48146aab59a7Smrg	  ;;
48156aab59a7Smrg	esac
4816fc27e79cSmrg      fi
4817fc27e79cSmrg      if test "$with_gnu_ld" = no; then
4818fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
4819fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
4820659607e0Smrg
4821fc27e79cSmrg	case $host_cpu in
4822fc27e79cSmrg	hppa*64*|ia64*)
4823fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
4824fc27e79cSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4825fc27e79cSmrg	  ;;
4826fc27e79cSmrg	*)
4827fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
4828fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4829fc27e79cSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4830659607e0Smrg
4831fc27e79cSmrg	  # hardcode_minus_L: Not really in the search PATH,
4832fc27e79cSmrg	  # but as the default location of the library.
4833fc27e79cSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
4834fc27e79cSmrg	  ;;
4835fc27e79cSmrg	esac
4836fc27e79cSmrg      fi
4837fc27e79cSmrg      ;;
4838659607e0Smrg
4839fc27e79cSmrg    irix5* | irix6* | nonstopux*)
4840fc27e79cSmrg      if test "$GCC" = yes; then
4841fc27e79cSmrg	_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'
4842fc27e79cSmrg	# Try to use the -exported_symbol ld option, if it does not
4843fc27e79cSmrg	# work, assume that -exports_file does not work either and
4844fc27e79cSmrg	# implicitly export all symbols.
4845fc27e79cSmrg        save_LDFLAGS="$LDFLAGS"
4846fc27e79cSmrg        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
4847fc27e79cSmrg        AC_LINK_IFELSE(int foo(void) {},
4848fc27e79cSmrg          _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'
4849fc27e79cSmrg        )
4850fc27e79cSmrg        LDFLAGS="$save_LDFLAGS"
4851fc27e79cSmrg      else
4852fc27e79cSmrg	_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'
4853fc27e79cSmrg	_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'
4854fc27e79cSmrg      fi
4855fc27e79cSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4856fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4857fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4858fc27e79cSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
4859fc27e79cSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4860fc27e79cSmrg      ;;
4861659607e0Smrg
4862fc27e79cSmrg    netbsd*)
4863fc27e79cSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4864fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
4865fc27e79cSmrg      else
4866fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
4867fc27e79cSmrg      fi
4868fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4869fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4870fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4871fc27e79cSmrg      ;;
4872659607e0Smrg
4873fc27e79cSmrg    newsos6)
4874fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
4875fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4876fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4877fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4878fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4879fc27e79cSmrg      ;;
4880659607e0Smrg
4881fc27e79cSmrg    *nto* | *qnx*)
4882fc27e79cSmrg      ;;
4883659607e0Smrg
4884fc27e79cSmrg    openbsd*)
4885fc27e79cSmrg      if test -f /usr/libexec/ld.so; then
4886fc27e79cSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
4887fc27e79cSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4888fc27e79cSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
4889fc27e79cSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
4890fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4891fc27e79cSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
4892fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4893fc27e79cSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
48946aab59a7Smrg	else
4895fc27e79cSmrg	  case $host_os in
4896fc27e79cSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
4897fc27e79cSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4898fc27e79cSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4899fc27e79cSmrg	     ;;
4900fc27e79cSmrg	   *)
4901fc27e79cSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
4902fc27e79cSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4903fc27e79cSmrg	     ;;
4904fc27e79cSmrg	  esac
49056aab59a7Smrg	fi
4906fc27e79cSmrg      else
4907fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4908fc27e79cSmrg      fi
4909fc27e79cSmrg      ;;
4910fc27e79cSmrg
4911fc27e79cSmrg    os2*)
4912fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4913fc27e79cSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4914fc27e79cSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4915fc27e79cSmrg      _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'
4916fc27e79cSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
4917fc27e79cSmrg      ;;
4918fc27e79cSmrg
4919fc27e79cSmrg    osf3*)
4920fc27e79cSmrg      if test "$GCC" = yes; then
4921fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4922fc27e79cSmrg	_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'
4923fc27e79cSmrg      else
4924fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4925fc27e79cSmrg	_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'
4926fc27e79cSmrg      fi
4927fc27e79cSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4928fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4929fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4930fc27e79cSmrg      ;;
4931659607e0Smrg
4932fc27e79cSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
4933fc27e79cSmrg      if test "$GCC" = yes; then
4934fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
4935fc27e79cSmrg	_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'
4936fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4937fc27e79cSmrg      else
4938fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
4939fc27e79cSmrg	_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'
4940fc27e79cSmrg	_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~
4941fc27e79cSmrg	$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'
4942659607e0Smrg
4943fc27e79cSmrg	# Both c and cxx compiler support -rpath directly
4944fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
4945fc27e79cSmrg      fi
4946fc27e79cSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
4947fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
4948fc27e79cSmrg      ;;
4949659607e0Smrg
4950fc27e79cSmrg    solaris*)
4951fc27e79cSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
4952fc27e79cSmrg      if test "$GCC" = yes; then
4953fc27e79cSmrg	wlarc='${wl}'
4954fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
4955fc27e79cSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4956fc27e79cSmrg	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4957fc27e79cSmrg      else
4958fc27e79cSmrg	case `$CC -V 2>&1` in
4959fc27e79cSmrg	*"Compilers 5.0"*)
4960fc27e79cSmrg	  wlarc=''
4961fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
4962fc27e79cSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4963fc27e79cSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
4964fc27e79cSmrg	  ;;
4965fc27e79cSmrg	*)
4966fc27e79cSmrg	  wlarc='${wl}'
4967fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
4968fc27e79cSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
4969fc27e79cSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
4970fc27e79cSmrg	  ;;
4971fc27e79cSmrg	esac
4972fc27e79cSmrg      fi
4973fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
4974fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4975fc27e79cSmrg      case $host_os in
4976fc27e79cSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
4977fc27e79cSmrg      *)
4978fc27e79cSmrg	# The compiler driver will combine and reorder linker options,
4979fc27e79cSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
4980fc27e79cSmrg	# but is careful enough not to reorder.
4981fc27e79cSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
4982fc27e79cSmrg	if test "$GCC" = yes; then
4983fc27e79cSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
4984659607e0Smrg	else
4985fc27e79cSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
4986659607e0Smrg	fi
49876aab59a7Smrg	;;
4988fc27e79cSmrg      esac
4989fc27e79cSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4990fc27e79cSmrg      ;;
4991fc27e79cSmrg
4992fc27e79cSmrg    sunos4*)
4993fc27e79cSmrg      if test "x$host_vendor" = xsequent; then
4994fc27e79cSmrg	# Use $CC to link under sequent, because it throws in some extra .o
4995fc27e79cSmrg	# files that make .init and .fini sections work.
4996fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
4997fc27e79cSmrg      else
4998fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
4999fc27e79cSmrg      fi
5000fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5001fc27e79cSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5002fc27e79cSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5003fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5004fc27e79cSmrg      ;;
5005fc27e79cSmrg
5006fc27e79cSmrg    sysv4)
5007fc27e79cSmrg      case $host_vendor in
5008fc27e79cSmrg	sni)
5009fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5010fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
50116aab59a7Smrg	;;
5012fc27e79cSmrg	siemens)
5013fc27e79cSmrg	  ## LD is ld it makes a PLAMLIB
5014fc27e79cSmrg	  ## CC just makes a GrossModule.
5015fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5016fc27e79cSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5017fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5018fc27e79cSmrg        ;;
5019fc27e79cSmrg	motorola)
5020fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5021fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
50226aab59a7Smrg	;;
5023fc27e79cSmrg      esac
5024fc27e79cSmrg      runpath_var='LD_RUN_PATH'
5025fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5026fc27e79cSmrg      ;;
5027659607e0Smrg
5028fc27e79cSmrg    sysv4.3*)
5029fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5030fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5031fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5032fc27e79cSmrg      ;;
5033659607e0Smrg
5034fc27e79cSmrg    sysv4*MP*)
5035fc27e79cSmrg      if test -d /usr/nec; then
5036fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5037fc27e79cSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5038fc27e79cSmrg	runpath_var=LD_RUN_PATH
5039fc27e79cSmrg	hardcode_runpath_var=yes
5040fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5041fc27e79cSmrg      fi
5042fc27e79cSmrg      ;;
5043659607e0Smrg
5044fc27e79cSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5045fc27e79cSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5046fc27e79cSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5047fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5048fc27e79cSmrg      runpath_var='LD_RUN_PATH'
50496aab59a7Smrg
5050fc27e79cSmrg      if test "$GCC" = yes; then
5051fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5052fc27e79cSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5053fc27e79cSmrg      else
5054fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5055fc27e79cSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5056fc27e79cSmrg      fi
5057fc27e79cSmrg      ;;
50586aab59a7Smrg
5059fc27e79cSmrg    sysv5* | sco3.2v5* | sco5v6*)
5060fc27e79cSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
5061fc27e79cSmrg      # link with -lc, and that would cause any symbols used from libc to
5062fc27e79cSmrg      # always be unresolved, which means just about no library would
5063fc27e79cSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
5064fc27e79cSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
5065fc27e79cSmrg      # as -z defs.
5066fc27e79cSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5067fc27e79cSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5068fc27e79cSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5069fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5070fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5071fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5072fc27e79cSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5073fc27e79cSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5074fc27e79cSmrg      runpath_var='LD_RUN_PATH'
50756aab59a7Smrg
5076fc27e79cSmrg      if test "$GCC" = yes; then
5077fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5078fc27e79cSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5079fc27e79cSmrg      else
5080fc27e79cSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5081fc27e79cSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5082fc27e79cSmrg      fi
5083fc27e79cSmrg      ;;
5084fc27e79cSmrg
5085fc27e79cSmrg    uts4*)
5086fc27e79cSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5087fc27e79cSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5088fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5089fc27e79cSmrg      ;;
5090fc27e79cSmrg
5091fc27e79cSmrg    *)
5092fc27e79cSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
5093fc27e79cSmrg      ;;
5094659607e0Smrg    esac
5095659607e0Smrg
5096fc27e79cSmrg    if test x$host_vendor = xsni; then
5097fc27e79cSmrg      case $host in
5098fc27e79cSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5099fc27e79cSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5100fc27e79cSmrg	;;
5101fc27e79cSmrg      esac
5102fc27e79cSmrg    fi
5103fc27e79cSmrg  fi
5104fc27e79cSmrg])
5105fc27e79cSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5106fc27e79cSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5107659607e0Smrg
5108fc27e79cSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5109659607e0Smrg
5110fc27e79cSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5111fc27e79cSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5112fc27e79cSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
5113fc27e79cSmrg    [The commands to extract the exported symbol list from a shared archive])
5114659607e0Smrg
5115fc27e79cSmrg#
5116fc27e79cSmrg# Do we need to explicitly link libc?
5117fc27e79cSmrg#
5118fc27e79cSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5119fc27e79cSmrgx|xyes)
5120fc27e79cSmrg  # Assume -lc should be added
5121fc27e79cSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5122659607e0Smrg
5123fc27e79cSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5124fc27e79cSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
5125fc27e79cSmrg    *'~'*)
5126fc27e79cSmrg      # FIXME: we may have to deal with multi-command sequences.
5127fc27e79cSmrg      ;;
5128fc27e79cSmrg    '$CC '*)
5129fc27e79cSmrg      # Test whether the compiler implicitly links with -lc since on some
5130fc27e79cSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5131fc27e79cSmrg      # to ld, don't add -lc before -lgcc.
5132fc27e79cSmrg      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
5133fc27e79cSmrg      $RM conftest*
5134fc27e79cSmrg      echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5135659607e0Smrg
5136fc27e79cSmrg      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5137fc27e79cSmrg        soname=conftest
5138fc27e79cSmrg        lib=conftest
5139fc27e79cSmrg        libobjs=conftest.$ac_objext
5140fc27e79cSmrg        deplibs=
5141fc27e79cSmrg        wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5142fc27e79cSmrg	pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5143fc27e79cSmrg        compiler_flags=-v
5144fc27e79cSmrg        linker_flags=-v
5145fc27e79cSmrg        verstring=
5146fc27e79cSmrg        output_objdir=.
5147fc27e79cSmrg        libname=conftest
5148fc27e79cSmrg        lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5149fc27e79cSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=
5150fc27e79cSmrg        if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5151fc27e79cSmrg        then
5152fc27e79cSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5153fc27e79cSmrg        else
5154fc27e79cSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5155fc27e79cSmrg        fi
5156fc27e79cSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5157fc27e79cSmrg      else
5158fc27e79cSmrg        cat conftest.err 1>&5
5159fc27e79cSmrg      fi
5160fc27e79cSmrg      $RM conftest*
5161fc27e79cSmrg      AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
5162fc27e79cSmrg      ;;
51636aab59a7Smrg    esac
5164fc27e79cSmrg  fi
51656aab59a7Smrg  ;;
51666aab59a7Smrgesac
5167659607e0Smrg
5168fc27e79cSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5169fc27e79cSmrg    [Whether or not to add -lc for building shared libraries])
5170fc27e79cSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5171fc27e79cSmrg    [enable_shared_with_static_runtimes], [0],
5172fc27e79cSmrg    [Whether or not to disallow shared libs when runtime libs are static])
5173fc27e79cSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5174fc27e79cSmrg    [Compiler flag to allow reflexive dlopens])
5175fc27e79cSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5176fc27e79cSmrg    [Compiler flag to generate shared objects directly from archives])
5177fc27e79cSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
5178fc27e79cSmrg    [Whether the compiler copes with passing no objects directly])
5179fc27e79cSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5180fc27e79cSmrg    [Create an old-style archive from a shared archive])
5181fc27e79cSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5182fc27e79cSmrg    [Create a temporary old-style archive to link instead of a shared archive])
5183fc27e79cSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5184fc27e79cSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5185fc27e79cSmrg_LT_TAGDECL([], [module_cmds], [2],
5186fc27e79cSmrg    [Commands used to build a loadable module if different from building
5187fc27e79cSmrg    a shared archive.])
5188fc27e79cSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5189fc27e79cSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
5190fc27e79cSmrg    [Whether we are building with GNU ld or not])
5191fc27e79cSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5192fc27e79cSmrg    [Flag that allows shared libraries with undefined symbols to be built])
5193fc27e79cSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
5194fc27e79cSmrg    [Flag that enforces no undefined symbols])
5195fc27e79cSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5196fc27e79cSmrg    [Flag to hardcode $libdir into a binary during linking.
5197fc27e79cSmrg    This must work even if $libdir does not exist])
5198fc27e79cSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
5199fc27e79cSmrg    [[If ld is used when linking, flag to hardcode $libdir into a binary
5200fc27e79cSmrg    during linking.  This must work even if $libdir does not exist]])
5201fc27e79cSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5202fc27e79cSmrg    [Whether we need a single "-rpath" flag with a separated argument])
5203fc27e79cSmrg_LT_TAGDECL([], [hardcode_direct], [0],
5204fc27e79cSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5205fc27e79cSmrg    DIR into the resulting binary])
5206fc27e79cSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5207fc27e79cSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5208fc27e79cSmrg    DIR into the resulting binary and the resulting library dependency is
5209fc27e79cSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5210fc27e79cSmrg    library is relocated])
5211fc27e79cSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5212fc27e79cSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5213fc27e79cSmrg    into the resulting binary])
5214fc27e79cSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5215fc27e79cSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5216fc27e79cSmrg    into the resulting binary])
5217fc27e79cSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
5218fc27e79cSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5219fc27e79cSmrg    into the library and all subsequent libraries and executables linked
5220fc27e79cSmrg    against it])
5221fc27e79cSmrg_LT_TAGDECL([], [inherit_rpath], [0],
5222fc27e79cSmrg    [Set to yes if linker adds runtime paths of dependent libraries
5223fc27e79cSmrg    to runtime path list])
5224fc27e79cSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
5225fc27e79cSmrg    [Whether libtool must link a program against all its dependency libraries])
5226fc27e79cSmrg_LT_TAGDECL([], [fix_srcfile_path], [1],
5227fc27e79cSmrg    [Fix the shell variable $srcfile for the compiler])
5228fc27e79cSmrg_LT_TAGDECL([], [always_export_symbols], [0],
5229fc27e79cSmrg    [Set to "yes" if exported symbols are required])
5230fc27e79cSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5231fc27e79cSmrg    [The commands to list exported symbols])
5232fc27e79cSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
5233fc27e79cSmrg    [Symbols that should not be listed in the preloaded symbols])
5234fc27e79cSmrg_LT_TAGDECL([], [include_expsyms], [1],
5235fc27e79cSmrg    [Symbols that must always be exported])
5236fc27e79cSmrg_LT_TAGDECL([], [prelink_cmds], [2],
5237fc27e79cSmrg    [Commands necessary for linking programs (against libraries) with templates])
5238fc27e79cSmrg_LT_TAGDECL([], [file_list_spec], [1],
5239fc27e79cSmrg    [Specify filename containing input files])
5240fc27e79cSmrgdnl FIXME: Not yet implemented
5241fc27e79cSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5242fc27e79cSmrgdnl    [Compiler flag to generate thread safe objects])
5243fc27e79cSmrg])# _LT_LINKER_SHLIBS
5244fc27e79cSmrg
5245fc27e79cSmrg
5246fc27e79cSmrg# _LT_LANG_C_CONFIG([TAG])
5247fc27e79cSmrg# ------------------------
5248fc27e79cSmrg# Ensure that the configuration variables for a C compiler are suitably
5249fc27e79cSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5250fc27e79cSmrg# the compiler configuration to `libtool'.
5251fc27e79cSmrgm4_defun([_LT_LANG_C_CONFIG],
5252fc27e79cSmrg[m4_require([_LT_DECL_EGREP])dnl
5253fc27e79cSmrglt_save_CC="$CC"
5254fc27e79cSmrgAC_LANG_PUSH(C)
5255659607e0Smrg
5256fc27e79cSmrg# Source file extension for C test sources.
5257fc27e79cSmrgac_ext=c
5258659607e0Smrg
5259fc27e79cSmrg# Object file extension for compiled C test sources.
52606aab59a7Smrgobjext=o
5261fc27e79cSmrg_LT_TAGVAR(objext, $1)=$objext
5262659607e0Smrg
52636aab59a7Smrg# Code to be used in simple compile tests
5264fc27e79cSmrglt_simple_compile_test_code="int some_variable = 0;"
5265659607e0Smrg
52666aab59a7Smrg# Code to be used in simple link tests
5267fc27e79cSmrglt_simple_link_test_code='int main(){return(0);}'
5268659607e0Smrg
5269fc27e79cSmrg_LT_TAG_COMPILER
5270fc27e79cSmrg# Save the default compiler, since it gets overwritten when the other
5271fc27e79cSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5272fc27e79cSmrgcompiler_DEFAULT=$CC
5273659607e0Smrg
52746aab59a7Smrg# save warnings/boilerplate of simple test code
52756aab59a7Smrg_LT_COMPILER_BOILERPLATE
52766aab59a7Smrg_LT_LINKER_BOILERPLATE
5277659607e0Smrg
5278fc27e79cSmrgif test -n "$compiler"; then
5279fc27e79cSmrg  _LT_COMPILER_NO_RTTI($1)
5280fc27e79cSmrg  _LT_COMPILER_PIC($1)
5281fc27e79cSmrg  _LT_COMPILER_C_O($1)
5282fc27e79cSmrg  _LT_COMPILER_FILE_LOCKS($1)
5283fc27e79cSmrg  _LT_LINKER_SHLIBS($1)
5284fc27e79cSmrg  _LT_SYS_DYNAMIC_LINKER($1)
5285fc27e79cSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5286fc27e79cSmrg  LT_SYS_DLOPEN_SELF
5287fc27e79cSmrg  _LT_CMD_STRIPLIB
5288fc27e79cSmrg
5289fc27e79cSmrg  # Report which library types will actually be built
5290fc27e79cSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5291fc27e79cSmrg  AC_MSG_RESULT([$can_build_shared])
5292fc27e79cSmrg
5293fc27e79cSmrg  AC_MSG_CHECKING([whether to build shared libraries])
5294fc27e79cSmrg  test "$can_build_shared" = "no" && enable_shared=no
5295fc27e79cSmrg
5296fc27e79cSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
5297fc27e79cSmrg  # are all built from PIC.
5298fc27e79cSmrg  case $host_os in
5299fc27e79cSmrg  aix3*)
53006aab59a7Smrg    test "$enable_shared" = yes && enable_static=no
5301fc27e79cSmrg    if test -n "$RANLIB"; then
5302fc27e79cSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5303fc27e79cSmrg      postinstall_cmds='$RANLIB $lib'
5304fc27e79cSmrg    fi
5305fc27e79cSmrg    ;;
5306659607e0Smrg
5307fc27e79cSmrg  aix[[4-9]]*)
5308fc27e79cSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5309fc27e79cSmrg      test "$enable_shared" = yes && enable_static=no
5310fc27e79cSmrg    fi
5311fc27e79cSmrg    ;;
5312fc27e79cSmrg  esac
5313fc27e79cSmrg  AC_MSG_RESULT([$enable_shared])
5314659607e0Smrg
5315fc27e79cSmrg  AC_MSG_CHECKING([whether to build static libraries])
5316fc27e79cSmrg  # Make sure either enable_shared or enable_static is yes.
5317fc27e79cSmrg  test "$enable_shared" = yes || enable_static=yes
5318fc27e79cSmrg  AC_MSG_RESULT([$enable_static])
5319659607e0Smrg
5320fc27e79cSmrg  _LT_CONFIG($1)
5321fc27e79cSmrgfi
53226aab59a7SmrgAC_LANG_POP
53236aab59a7SmrgCC="$lt_save_CC"
5324fc27e79cSmrg])# _LT_LANG_C_CONFIG
5325659607e0Smrg
5326659607e0Smrg
5327fc27e79cSmrg# _LT_PROG_CXX
5328fc27e79cSmrg# ------------
5329fc27e79cSmrg# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
5330fc27e79cSmrg# compiler, we have our own version here.
5331fc27e79cSmrgm4_defun([_LT_PROG_CXX],
5332fc27e79cSmrg[
5333fc27e79cSmrgpushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
5334fc27e79cSmrgAC_PROG_CXX
5335fc27e79cSmrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5336fc27e79cSmrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5337fc27e79cSmrg    (test "X$CXX" != "Xg++"))) ; then
5338fc27e79cSmrg  AC_PROG_CXXCPP
5339fc27e79cSmrgelse
5340fc27e79cSmrg  _lt_caught_CXX_error=yes
5341fc27e79cSmrgfi
5342fc27e79cSmrgpopdef([AC_MSG_ERROR])
5343fc27e79cSmrg])# _LT_PROG_CXX
5344659607e0Smrg
5345fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
5346fc27e79cSmrgdnl AC_DEFUN([_LT_PROG_CXX], [])
5347659607e0Smrg
5348659607e0Smrg
5349fc27e79cSmrg# _LT_LANG_CXX_CONFIG([TAG])
5350fc27e79cSmrg# --------------------------
5351fc27e79cSmrg# Ensure that the configuration variables for a C++ compiler are suitably
5352fc27e79cSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5353fc27e79cSmrg# the compiler configuration to `libtool'.
5354fc27e79cSmrgm4_defun([_LT_LANG_CXX_CONFIG],
5355fc27e79cSmrg[AC_REQUIRE([_LT_PROG_CXX])dnl
5356fc27e79cSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
5357fc27e79cSmrgm4_require([_LT_DECL_EGREP])dnl
5358fc27e79cSmrg
5359fc27e79cSmrgAC_LANG_PUSH(C++)
5360fc27e79cSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5361fc27e79cSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
5362fc27e79cSmrg_LT_TAGVAR(always_export_symbols, $1)=no
5363fc27e79cSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5364fc27e79cSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
5365fc27e79cSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5366fc27e79cSmrg_LT_TAGVAR(hardcode_direct, $1)=no
5367fc27e79cSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5368fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5369fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
5370fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5371fc27e79cSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5372fc27e79cSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5373fc27e79cSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
5374fc27e79cSmrg_LT_TAGVAR(inherit_rpath, $1)=no
5375fc27e79cSmrg_LT_TAGVAR(module_cmds, $1)=
5376fc27e79cSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
5377fc27e79cSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5378fc27e79cSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5379fc27e79cSmrg_LT_TAGVAR(no_undefined_flag, $1)=
5380fc27e79cSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5381fc27e79cSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5382659607e0Smrg
5383fc27e79cSmrg# Source file extension for C++ test sources.
5384fc27e79cSmrgac_ext=cpp
5385659607e0Smrg
5386fc27e79cSmrg# Object file extension for compiled C++ test sources.
5387fc27e79cSmrgobjext=o
5388fc27e79cSmrg_LT_TAGVAR(objext, $1)=$objext
5389fc27e79cSmrg
5390fc27e79cSmrg# No sense in running all these tests if we already determined that
5391fc27e79cSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5392fc27e79cSmrg# are currently assumed to apply to all compilers on this platform,
5393fc27e79cSmrg# and will be corrupted by setting them based on a non-working compiler.
5394fc27e79cSmrgif test "$_lt_caught_CXX_error" != yes; then
5395fc27e79cSmrg  # Code to be used in simple compile tests
5396fc27e79cSmrg  lt_simple_compile_test_code="int some_variable = 0;"
5397fc27e79cSmrg
5398fc27e79cSmrg  # Code to be used in simple link tests
5399fc27e79cSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5400fc27e79cSmrg
5401fc27e79cSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5402fc27e79cSmrg  _LT_TAG_COMPILER
5403fc27e79cSmrg
5404fc27e79cSmrg  # save warnings/boilerplate of simple test code
5405fc27e79cSmrg  _LT_COMPILER_BOILERPLATE
5406fc27e79cSmrg  _LT_LINKER_BOILERPLATE
5407fc27e79cSmrg
5408fc27e79cSmrg  # Allow CC to be a program name with arguments.
5409fc27e79cSmrg  lt_save_CC=$CC
5410fc27e79cSmrg  lt_save_LD=$LD
5411fc27e79cSmrg  lt_save_GCC=$GCC
5412fc27e79cSmrg  GCC=$GXX
5413fc27e79cSmrg  lt_save_with_gnu_ld=$with_gnu_ld
5414fc27e79cSmrg  lt_save_path_LD=$lt_cv_path_LD
5415fc27e79cSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5416fc27e79cSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5417fc27e79cSmrg  else
5418fc27e79cSmrg    $as_unset lt_cv_prog_gnu_ld
5419fc27e79cSmrg  fi
5420fc27e79cSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5421fc27e79cSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5422fc27e79cSmrg  else
5423fc27e79cSmrg    $as_unset lt_cv_path_LD
5424fc27e79cSmrg  fi
5425fc27e79cSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
5426fc27e79cSmrg  CC=${CXX-"c++"}
5427fc27e79cSmrg  compiler=$CC
5428fc27e79cSmrg  _LT_TAGVAR(compiler, $1)=$CC
5429fc27e79cSmrg  _LT_CC_BASENAME([$compiler])
5430659607e0Smrg
5431fc27e79cSmrg  if test -n "$compiler"; then
5432fc27e79cSmrg    # We don't want -fno-exception when compiling C++ code, so set the
5433fc27e79cSmrg    # no_builtin_flag separately
5434fc27e79cSmrg    if test "$GXX" = yes; then
5435fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5436fc27e79cSmrg    else
5437fc27e79cSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5438fc27e79cSmrg    fi
5439659607e0Smrg
5440fc27e79cSmrg    if test "$GXX" = yes; then
5441fc27e79cSmrg      # Set up default GNU C++ configuration
5442659607e0Smrg
5443fc27e79cSmrg      LT_PATH_LD
5444659607e0Smrg
5445fc27e79cSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5446fc27e79cSmrg      # archiving commands below assume that GNU ld is being used.
5447fc27e79cSmrg      if test "$with_gnu_ld" = yes; then
5448fc27e79cSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5449fc27e79cSmrg        _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'
5450659607e0Smrg
5451fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5452fc27e79cSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5453659607e0Smrg
5454fc27e79cSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5455fc27e79cSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5456fc27e79cSmrg        #     investigate it a little bit more. (MM)
5457fc27e79cSmrg        wlarc='${wl}'
5458659607e0Smrg
5459fc27e79cSmrg        # ancient GNU ld didn't support --whole-archive et. al.
5460fc27e79cSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5461fc27e79cSmrg	  $GREP 'no-whole-archive' > /dev/null; then
5462fc27e79cSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5463fc27e79cSmrg        else
5464fc27e79cSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5465fc27e79cSmrg        fi
5466fc27e79cSmrg      else
5467fc27e79cSmrg        with_gnu_ld=no
5468fc27e79cSmrg        wlarc=
5469fc27e79cSmrg
5470fc27e79cSmrg        # A generic and very simple default shared library creation
5471fc27e79cSmrg        # command for GNU C++ for the case where it uses the native
5472fc27e79cSmrg        # linker, instead of GNU ld.  If possible, this setting should
5473fc27e79cSmrg        # overridden to take advantage of the native linker features on
5474fc27e79cSmrg        # the platform it is being used on.
5475fc27e79cSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5476fc27e79cSmrg      fi
5477659607e0Smrg
5478fc27e79cSmrg      # Commands to make compiler produce verbose output that lists
5479fc27e79cSmrg      # what "hidden" libraries, object files and flags are used when
5480fc27e79cSmrg      # linking a shared library.
5481fc27e79cSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
5482659607e0Smrg
5483fc27e79cSmrg    else
5484fc27e79cSmrg      GXX=no
5485fc27e79cSmrg      with_gnu_ld=no
5486fc27e79cSmrg      wlarc=
5487fc27e79cSmrg    fi
5488659607e0Smrg
5489fc27e79cSmrg    # PORTME: fill in a description of your system's C++ link characteristics
5490fc27e79cSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5491fc27e79cSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5492fc27e79cSmrg    case $host_os in
5493fc27e79cSmrg      aix3*)
5494fc27e79cSmrg        # FIXME: insert proper C++ library support
5495fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5496fc27e79cSmrg        ;;
5497fc27e79cSmrg      aix[[4-9]]*)
5498fc27e79cSmrg        if test "$host_cpu" = ia64; then
5499fc27e79cSmrg          # On IA64, the linker does run time linking by default, so we don't
5500fc27e79cSmrg          # have to do anything special.
5501fc27e79cSmrg          aix_use_runtimelinking=no
5502fc27e79cSmrg          exp_sym_flag='-Bexport'
5503fc27e79cSmrg          no_entry_flag=""
5504fc27e79cSmrg        else
5505fc27e79cSmrg          aix_use_runtimelinking=no
5506fc27e79cSmrg
5507fc27e79cSmrg          # Test if we are trying to use run time linking or normal
5508fc27e79cSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5509fc27e79cSmrg          # need to do runtime linking.
5510fc27e79cSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5511fc27e79cSmrg	    for ld_flag in $LDFLAGS; do
5512fc27e79cSmrg	      case $ld_flag in
5513fc27e79cSmrg	      *-brtl*)
5514fc27e79cSmrg	        aix_use_runtimelinking=yes
5515fc27e79cSmrg	        break
5516fc27e79cSmrg	        ;;
5517fc27e79cSmrg	      esac
5518fc27e79cSmrg	    done
5519fc27e79cSmrg	    ;;
5520fc27e79cSmrg          esac
5521659607e0Smrg
5522fc27e79cSmrg          exp_sym_flag='-bexport'
5523fc27e79cSmrg          no_entry_flag='-bnoentry'
5524fc27e79cSmrg        fi
5525659607e0Smrg
5526fc27e79cSmrg        # When large executables or shared objects are built, AIX ld can
5527fc27e79cSmrg        # have problems creating the table of contents.  If linking a library
5528fc27e79cSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
5529fc27e79cSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5530fc27e79cSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5531fc27e79cSmrg
5532fc27e79cSmrg        _LT_TAGVAR(archive_cmds, $1)=''
5533fc27e79cSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5534fc27e79cSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5535fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5536fc27e79cSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
5537fc27e79cSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5538fc27e79cSmrg
5539fc27e79cSmrg        if test "$GXX" = yes; then
5540fc27e79cSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
5541fc27e79cSmrg          # We only want to do this on AIX 4.2 and lower, the check
5542fc27e79cSmrg          # below for broken collect2 doesn't work under 4.3+
5543fc27e79cSmrg	  collect2name=`${CC} -print-prog-name=collect2`
5544fc27e79cSmrg	  if test -f "$collect2name" &&
5545fc27e79cSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5546fc27e79cSmrg	  then
5547fc27e79cSmrg	    # We have reworked collect2
5548fc27e79cSmrg	    :
5549fc27e79cSmrg	  else
5550fc27e79cSmrg	    # We have old collect2
5551fc27e79cSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
5552fc27e79cSmrg	    # It fails to find uninstalled libraries when the uninstalled
5553fc27e79cSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
5554fc27e79cSmrg	    # to unsupported forces relinking
5555fc27e79cSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
5556fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5557fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
5558fc27e79cSmrg	  fi
5559fc27e79cSmrg          esac
5560fc27e79cSmrg          shared_flag='-shared'
5561fc27e79cSmrg	  if test "$aix_use_runtimelinking" = yes; then
5562fc27e79cSmrg	    shared_flag="$shared_flag "'${wl}-G'
5563fc27e79cSmrg	  fi
5564fc27e79cSmrg        else
5565fc27e79cSmrg          # not using gcc
5566fc27e79cSmrg          if test "$host_cpu" = ia64; then
5567fc27e79cSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5568fc27e79cSmrg	  # chokes on -Wl,-G. The following line is correct:
5569fc27e79cSmrg	  shared_flag='-G'
5570fc27e79cSmrg          else
5571fc27e79cSmrg	    if test "$aix_use_runtimelinking" = yes; then
5572fc27e79cSmrg	      shared_flag='${wl}-G'
5573fc27e79cSmrg	    else
5574fc27e79cSmrg	      shared_flag='${wl}-bM:SRE'
5575fc27e79cSmrg	    fi
5576fc27e79cSmrg          fi
5577fc27e79cSmrg        fi
5578659607e0Smrg
5579fc27e79cSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5580fc27e79cSmrg        # It seems that -bexpall does not export symbols beginning with
5581fc27e79cSmrg        # underscore (_), so it is better to generate a list of symbols to
5582fc27e79cSmrg	# export.
5583fc27e79cSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
5584fc27e79cSmrg        if test "$aix_use_runtimelinking" = yes; then
5585fc27e79cSmrg          # Warning - without using the other runtime loading flags (-brtl),
5586fc27e79cSmrg          # -berok will link without error, but may produce a broken library.
5587fc27e79cSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5588fc27e79cSmrg          # Determine the default libpath from the value encoded in an empty
5589fc27e79cSmrg          # executable.
5590fc27e79cSmrg          _LT_SYS_MODULE_PATH_AIX
5591fc27e79cSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5592fc27e79cSmrg
5593fc27e79cSmrg          _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"
5594fc27e79cSmrg        else
5595fc27e79cSmrg          if test "$host_cpu" = ia64; then
5596fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5597fc27e79cSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5598fc27e79cSmrg	    _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"
5599fc27e79cSmrg          else
5600fc27e79cSmrg	    # Determine the default libpath from the value encoded in an
5601fc27e79cSmrg	    # empty executable.
5602fc27e79cSmrg	    _LT_SYS_MODULE_PATH_AIX
5603fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5604fc27e79cSmrg	    # Warning - without using the other run time loading flags,
5605fc27e79cSmrg	    # -berok will link without error, but may produce a broken library.
5606fc27e79cSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5607fc27e79cSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5608fc27e79cSmrg	    # Exported symbols can be pulled into shared objects from archives
5609fc27e79cSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5610fc27e79cSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5611fc27e79cSmrg	    # This is similar to how AIX traditionally builds its shared
5612fc27e79cSmrg	    # libraries.
5613fc27e79cSmrg	    _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'
5614fc27e79cSmrg          fi
5615fc27e79cSmrg        fi
5616fc27e79cSmrg        ;;
5617659607e0Smrg
5618fc27e79cSmrg      beos*)
5619fc27e79cSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5620fc27e79cSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5621fc27e79cSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5622fc27e79cSmrg	  # support --undefined.  This deserves some investigation.  FIXME
5623fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5624fc27e79cSmrg	else
5625fc27e79cSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5626fc27e79cSmrg	fi
5627fc27e79cSmrg	;;
5628659607e0Smrg
5629fc27e79cSmrg      chorus*)
5630fc27e79cSmrg        case $cc_basename in
5631fc27e79cSmrg          *)
5632fc27e79cSmrg	  # FIXME: insert proper C++ library support
5633fc27e79cSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
5634fc27e79cSmrg	  ;;
5635fc27e79cSmrg        esac
5636fc27e79cSmrg        ;;
5637659607e0Smrg
5638fc27e79cSmrg      cygwin* | mingw* | pw32* | cegcc*)
5639fc27e79cSmrg        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5640fc27e79cSmrg        # as there is no search path for DLLs.
5641fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5642fc27e79cSmrg        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5643fc27e79cSmrg        _LT_TAGVAR(always_export_symbols, $1)=no
5644fc27e79cSmrg        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5645fc27e79cSmrg
5646fc27e79cSmrg        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5647fc27e79cSmrg          _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'
5648fc27e79cSmrg          # If the export-symbols file already is a .def file (1st line
5649fc27e79cSmrg          # is EXPORTS), use it as is; otherwise, prepend...
5650fc27e79cSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5651fc27e79cSmrg	    cp $export_symbols $output_objdir/$soname.def;
5652fc27e79cSmrg          else
5653fc27e79cSmrg	    echo EXPORTS > $output_objdir/$soname.def;
5654fc27e79cSmrg	    cat $export_symbols >> $output_objdir/$soname.def;
5655fc27e79cSmrg          fi~
5656fc27e79cSmrg          $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'
5657fc27e79cSmrg        else
5658fc27e79cSmrg          _LT_TAGVAR(ld_shlibs, $1)=no
5659fc27e79cSmrg        fi
5660fc27e79cSmrg        ;;
5661fc27e79cSmrg      darwin* | rhapsody*)
5662fc27e79cSmrg        _LT_DARWIN_LINKER_FEATURES($1)
5663fc27e79cSmrg	;;
5664659607e0Smrg
5665fc27e79cSmrg      dgux*)
5666fc27e79cSmrg        case $cc_basename in
5667fc27e79cSmrg          ec++*)
5668fc27e79cSmrg	    # FIXME: insert proper C++ library support
5669fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5670fc27e79cSmrg	    ;;
5671fc27e79cSmrg          ghcx*)
5672fc27e79cSmrg	    # Green Hills C++ Compiler
5673fc27e79cSmrg	    # FIXME: insert proper C++ library support
5674fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5675fc27e79cSmrg	    ;;
5676fc27e79cSmrg          *)
5677fc27e79cSmrg	    # FIXME: insert proper C++ library support
5678fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5679fc27e79cSmrg	    ;;
5680fc27e79cSmrg        esac
5681fc27e79cSmrg        ;;
5682659607e0Smrg
5683fc27e79cSmrg      freebsd[[12]]*)
5684fc27e79cSmrg        # C++ shared libraries reported to be fairly broken before
5685fc27e79cSmrg	# switch to ELF
5686fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5687fc27e79cSmrg        ;;
5688659607e0Smrg
5689fc27e79cSmrg      freebsd-elf*)
5690fc27e79cSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5691fc27e79cSmrg        ;;
5692659607e0Smrg
5693fc27e79cSmrg      freebsd* | dragonfly*)
5694fc27e79cSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
5695fc27e79cSmrg        # conventions
5696fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
5697fc27e79cSmrg        ;;
5698659607e0Smrg
5699fc27e79cSmrg      gnu*)
5700fc27e79cSmrg        ;;
5701659607e0Smrg
5702fc27e79cSmrg      hpux9*)
5703fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5704fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5705fc27e79cSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5706fc27e79cSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
5707fc27e79cSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5708fc27e79cSmrg				             # but as the default
5709fc27e79cSmrg				             # location of the library.
5710fc27e79cSmrg
5711fc27e79cSmrg        case $cc_basename in
5712fc27e79cSmrg          CC*)
5713fc27e79cSmrg            # FIXME: insert proper C++ library support
5714fc27e79cSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
5715fc27e79cSmrg            ;;
5716fc27e79cSmrg          aCC*)
5717fc27e79cSmrg            _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'
5718fc27e79cSmrg            # Commands to make compiler produce verbose output that lists
5719fc27e79cSmrg            # what "hidden" libraries, object files and flags are used when
5720fc27e79cSmrg            # linking a shared library.
5721fc27e79cSmrg            #
5722fc27e79cSmrg            # There doesn't appear to be a way to prevent this compiler from
5723fc27e79cSmrg            # explicitly linking system object files so we need to strip them
5724fc27e79cSmrg            # from the output so that they don't get included in the library
5725fc27e79cSmrg            # dependencies.
5726fc27e79cSmrg            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'
5727fc27e79cSmrg            ;;
5728fc27e79cSmrg          *)
5729fc27e79cSmrg            if test "$GXX" = yes; then
5730fc27e79cSmrg              _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'
5731fc27e79cSmrg            else
5732fc27e79cSmrg              # FIXME: insert proper C++ library support
5733fc27e79cSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
5734fc27e79cSmrg            fi
5735fc27e79cSmrg            ;;
5736fc27e79cSmrg        esac
5737fc27e79cSmrg        ;;
5738659607e0Smrg
5739fc27e79cSmrg      hpux10*|hpux11*)
5740fc27e79cSmrg        if test $with_gnu_ld = no; then
5741fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5742fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5743fc27e79cSmrg
5744fc27e79cSmrg          case $host_cpu in
5745fc27e79cSmrg            hppa*64*|ia64*)
5746fc27e79cSmrg              ;;
5747fc27e79cSmrg            *)
5748fc27e79cSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5749fc27e79cSmrg              ;;
5750fc27e79cSmrg          esac
5751fc27e79cSmrg        fi
5752fc27e79cSmrg        case $host_cpu in
5753fc27e79cSmrg          hppa*64*|ia64*)
5754fc27e79cSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
5755fc27e79cSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5756fc27e79cSmrg            ;;
5757fc27e79cSmrg          *)
5758fc27e79cSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
5759fc27e79cSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5760fc27e79cSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
5761fc27e79cSmrg					         # but as the default
5762fc27e79cSmrg					         # location of the library.
5763fc27e79cSmrg            ;;
5764fc27e79cSmrg        esac
5765659607e0Smrg
5766fc27e79cSmrg        case $cc_basename in
5767fc27e79cSmrg          CC*)
5768fc27e79cSmrg	    # FIXME: insert proper C++ library support
5769fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5770fc27e79cSmrg	    ;;
5771fc27e79cSmrg          aCC*)
5772fc27e79cSmrg	    case $host_cpu in
5773fc27e79cSmrg	      hppa*64*)
5774fc27e79cSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5775fc27e79cSmrg	        ;;
5776fc27e79cSmrg	      ia64*)
5777fc27e79cSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5778fc27e79cSmrg	        ;;
5779fc27e79cSmrg	      *)
5780fc27e79cSmrg	        _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'
5781fc27e79cSmrg	        ;;
5782fc27e79cSmrg	    esac
5783fc27e79cSmrg	    # Commands to make compiler produce verbose output that lists
5784fc27e79cSmrg	    # what "hidden" libraries, object files and flags are used when
5785fc27e79cSmrg	    # linking a shared library.
5786fc27e79cSmrg	    #
5787fc27e79cSmrg	    # There doesn't appear to be a way to prevent this compiler from
5788fc27e79cSmrg	    # explicitly linking system object files so we need to strip them
5789fc27e79cSmrg	    # from the output so that they don't get included in the library
5790fc27e79cSmrg	    # dependencies.
5791fc27e79cSmrg	    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'
5792fc27e79cSmrg	    ;;
5793fc27e79cSmrg          *)
5794fc27e79cSmrg	    if test "$GXX" = yes; then
5795fc27e79cSmrg	      if test $with_gnu_ld = no; then
5796fc27e79cSmrg	        case $host_cpu in
5797fc27e79cSmrg	          hppa*64*)
5798fc27e79cSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5799fc27e79cSmrg	            ;;
5800fc27e79cSmrg	          ia64*)
5801fc27e79cSmrg	            _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'
5802fc27e79cSmrg	            ;;
5803fc27e79cSmrg	          *)
5804fc27e79cSmrg	            _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'
5805fc27e79cSmrg	            ;;
5806fc27e79cSmrg	        esac
5807fc27e79cSmrg	      fi
5808fc27e79cSmrg	    else
5809fc27e79cSmrg	      # FIXME: insert proper C++ library support
5810fc27e79cSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
5811fc27e79cSmrg	    fi
5812fc27e79cSmrg	    ;;
5813fc27e79cSmrg        esac
5814fc27e79cSmrg        ;;
5815659607e0Smrg
5816fc27e79cSmrg      interix[[3-9]]*)
5817fc27e79cSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
5818fc27e79cSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5819fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5820fc27e79cSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5821fc27e79cSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5822fc27e79cSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
5823fc27e79cSmrg	# default) and relocated if they conflict, which is a slow very memory
5824fc27e79cSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
5825fc27e79cSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5826fc27e79cSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5827fc27e79cSmrg	_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'
5828fc27e79cSmrg	_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'
5829fc27e79cSmrg	;;
5830fc27e79cSmrg      irix5* | irix6*)
5831fc27e79cSmrg        case $cc_basename in
5832fc27e79cSmrg          CC*)
5833fc27e79cSmrg	    # SGI C++
5834fc27e79cSmrg	    _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'
5835fc27e79cSmrg
5836fc27e79cSmrg	    # Archives containing C++ object files must be created using
5837fc27e79cSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
5838fc27e79cSmrg	    # necessary to make sure instantiated templates are included
5839fc27e79cSmrg	    # in the archive.
5840fc27e79cSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
5841fc27e79cSmrg	    ;;
5842fc27e79cSmrg          *)
5843fc27e79cSmrg	    if test "$GXX" = yes; then
5844fc27e79cSmrg	      if test "$with_gnu_ld" = no; then
5845fc27e79cSmrg	        _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'
5846fc27e79cSmrg	      else
5847fc27e79cSmrg	        _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'
5848fc27e79cSmrg	      fi
5849fc27e79cSmrg	    fi
5850fc27e79cSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
5851fc27e79cSmrg	    ;;
5852fc27e79cSmrg        esac
5853fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5854fc27e79cSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5855fc27e79cSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
5856fc27e79cSmrg        ;;
5857659607e0Smrg
5858fc27e79cSmrg      linux* | k*bsd*-gnu)
5859fc27e79cSmrg        case $cc_basename in
5860fc27e79cSmrg          KCC*)
5861fc27e79cSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
5862659607e0Smrg
5863fc27e79cSmrg	    # KCC will only create a shared library if the output file
5864fc27e79cSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
5865fc27e79cSmrg	    # to its proper name (with version) after linking.
5866fc27e79cSmrg	    _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'
5867fc27e79cSmrg	    _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'
5868fc27e79cSmrg	    # Commands to make compiler produce verbose output that lists
5869fc27e79cSmrg	    # what "hidden" libraries, object files and flags are used when
5870fc27e79cSmrg	    # linking a shared library.
5871fc27e79cSmrg	    #
5872fc27e79cSmrg	    # There doesn't appear to be a way to prevent this compiler from
5873fc27e79cSmrg	    # explicitly linking system object files so we need to strip them
5874fc27e79cSmrg	    # from the output so that they don't get included in the library
5875fc27e79cSmrg	    # dependencies.
5876fc27e79cSmrg	    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'
5877fc27e79cSmrg
5878fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5879fc27e79cSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5880fc27e79cSmrg
5881fc27e79cSmrg	    # Archives containing C++ object files must be created using
5882fc27e79cSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
5883fc27e79cSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
5884fc27e79cSmrg	    ;;
5885fc27e79cSmrg	  icpc* | ecpc* )
5886fc27e79cSmrg	    # Intel C++
5887fc27e79cSmrg	    with_gnu_ld=yes
5888fc27e79cSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
5889fc27e79cSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
5890fc27e79cSmrg	    # earlier do not add the objects themselves.
5891fc27e79cSmrg	    case `$CC -V 2>&1` in
5892fc27e79cSmrg	      *"Version 7."*)
5893fc27e79cSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5894fc27e79cSmrg		_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'
5895fc27e79cSmrg		;;
5896fc27e79cSmrg	      *)  # Version 8.0 or newer
5897fc27e79cSmrg	        tmp_idyn=
5898fc27e79cSmrg	        case $host_cpu in
5899fc27e79cSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
5900fc27e79cSmrg		esac
5901fc27e79cSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5902fc27e79cSmrg		_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'
5903fc27e79cSmrg		;;
5904fc27e79cSmrg	    esac
5905fc27e79cSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5906fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5907fc27e79cSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5908fc27e79cSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5909fc27e79cSmrg	    ;;
5910fc27e79cSmrg          pgCC* | pgcpp*)
5911fc27e79cSmrg            # Portland Group C++ compiler
5912fc27e79cSmrg	    case `$CC -V` in
5913fc27e79cSmrg	    *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
5914fc27e79cSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
5915fc27e79cSmrg		rm -rf $tpldir~
5916fc27e79cSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
5917fc27e79cSmrg		compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
5918fc27e79cSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
5919fc27e79cSmrg		rm -rf $tpldir~
5920fc27e79cSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
5921fc27e79cSmrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
5922fc27e79cSmrg		$RANLIB $oldlib'
5923fc27e79cSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
5924fc27e79cSmrg		rm -rf $tpldir~
5925fc27e79cSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5926fc27e79cSmrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5927fc27e79cSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
5928fc27e79cSmrg		rm -rf $tpldir~
5929fc27e79cSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
5930fc27e79cSmrg		$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'
5931fc27e79cSmrg	      ;;
5932fc27e79cSmrg	    *) # Version 6 will use weak symbols
5933fc27e79cSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
5934fc27e79cSmrg	      _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'
5935fc27e79cSmrg	      ;;
5936fc27e79cSmrg	    esac
5937659607e0Smrg
5938fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
5939fc27e79cSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5940fc27e79cSmrg	    _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'
5941fc27e79cSmrg            ;;
5942fc27e79cSmrg	  cxx*)
5943fc27e79cSmrg	    # Compaq C++
5944fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5945fc27e79cSmrg	    _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'
5946659607e0Smrg
5947fc27e79cSmrg	    runpath_var=LD_RUN_PATH
5948fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5949fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5950659607e0Smrg
5951fc27e79cSmrg	    # Commands to make compiler produce verbose output that lists
5952fc27e79cSmrg	    # what "hidden" libraries, object files and flags are used when
5953fc27e79cSmrg	    # linking a shared library.
5954fc27e79cSmrg	    #
5955fc27e79cSmrg	    # There doesn't appear to be a way to prevent this compiler from
5956fc27e79cSmrg	    # explicitly linking system object files so we need to strip them
5957fc27e79cSmrg	    # from the output so that they don't get included in the library
5958fc27e79cSmrg	    # dependencies.
5959fc27e79cSmrg	    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'
5960fc27e79cSmrg	    ;;
5961fc27e79cSmrg	  xl*)
5962fc27e79cSmrg	    # IBM XL 8.0 on PPC, with GNU ld
5963fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5964fc27e79cSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5965fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5966fc27e79cSmrg	    if test "x$supports_anon_versioning" = xyes; then
5967fc27e79cSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5968fc27e79cSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5969fc27e79cSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
5970fc27e79cSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
5971fc27e79cSmrg	    fi
5972fc27e79cSmrg	    ;;
5973fc27e79cSmrg	  *)
5974fc27e79cSmrg	    case `$CC -V 2>&1 | sed 5q` in
5975fc27e79cSmrg	    *Sun\ C*)
5976fc27e79cSmrg	      # Sun C++ 5.9
5977fc27e79cSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
5978fc27e79cSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
5979fc27e79cSmrg	      _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'
5980fc27e79cSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5981fc27e79cSmrg	      _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'
5982fc27e79cSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
5983fc27e79cSmrg
5984fc27e79cSmrg	      # Not sure whether something based on
5985fc27e79cSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
5986fc27e79cSmrg	      # would be better.
5987fc27e79cSmrg	      output_verbose_link_cmd='echo'
5988fc27e79cSmrg
5989fc27e79cSmrg	      # Archives containing C++ object files must be created using
5990fc27e79cSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
5991fc27e79cSmrg	      # necessary to make sure instantiated templates are included
5992fc27e79cSmrg	      # in the archive.
5993fc27e79cSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
5994fc27e79cSmrg	      ;;
5995fc27e79cSmrg	    esac
5996fc27e79cSmrg	    ;;
5997fc27e79cSmrg	esac
5998fc27e79cSmrg	;;
5999659607e0Smrg
6000fc27e79cSmrg      lynxos*)
6001fc27e79cSmrg        # FIXME: insert proper C++ library support
6002fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6003fc27e79cSmrg	;;
6004659607e0Smrg
6005fc27e79cSmrg      m88k*)
6006fc27e79cSmrg        # FIXME: insert proper C++ library support
6007fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6008fc27e79cSmrg	;;
6009659607e0Smrg
6010fc27e79cSmrg      mvs*)
6011fc27e79cSmrg        case $cc_basename in
6012fc27e79cSmrg          cxx*)
6013fc27e79cSmrg	    # FIXME: insert proper C++ library support
6014fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6015fc27e79cSmrg	    ;;
6016fc27e79cSmrg	  *)
6017fc27e79cSmrg	    # FIXME: insert proper C++ library support
6018fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6019fc27e79cSmrg	    ;;
6020fc27e79cSmrg	esac
6021fc27e79cSmrg	;;
6022659607e0Smrg
6023fc27e79cSmrg      netbsd*)
6024fc27e79cSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6025fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6026fc27e79cSmrg	  wlarc=
6027fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6028fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6029fc27e79cSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6030fc27e79cSmrg	fi
6031fc27e79cSmrg	# Workaround some broken pre-1.5 toolchains
6032fc27e79cSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6033fc27e79cSmrg	;;
6034659607e0Smrg
6035fc27e79cSmrg      *nto* | *qnx*)
6036fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6037fc27e79cSmrg	;;
6038659607e0Smrg
6039fc27e79cSmrg      openbsd2*)
6040fc27e79cSmrg        # C++ shared libraries are fairly broken
6041fc27e79cSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6042fc27e79cSmrg	;;
6043659607e0Smrg
6044fc27e79cSmrg      openbsd*)
6045fc27e79cSmrg	if test -f /usr/libexec/ld.so; then
6046fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6047fc27e79cSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6048fc27e79cSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6049fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6050fc27e79cSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6051fc27e79cSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6052fc27e79cSmrg	    _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'
6053fc27e79cSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6054fc27e79cSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6055fc27e79cSmrg	  fi
6056fc27e79cSmrg	  output_verbose_link_cmd=echo
6057fc27e79cSmrg	else
6058fc27e79cSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6059fc27e79cSmrg	fi
6060fc27e79cSmrg	;;
6061659607e0Smrg
6062fc27e79cSmrg      osf3* | osf4* | osf5*)
6063fc27e79cSmrg        case $cc_basename in
6064fc27e79cSmrg          KCC*)
6065fc27e79cSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6066fc27e79cSmrg
6067fc27e79cSmrg	    # KCC will only create a shared library if the output file
6068fc27e79cSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6069fc27e79cSmrg	    # to its proper name (with version) after linking.
6070fc27e79cSmrg	    _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'
6071fc27e79cSmrg
6072fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6073fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6074fc27e79cSmrg
6075fc27e79cSmrg	    # Archives containing C++ object files must be created using
6076fc27e79cSmrg	    # the KAI C++ compiler.
6077fc27e79cSmrg	    case $host in
6078fc27e79cSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6079fc27e79cSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6080fc27e79cSmrg	    esac
6081fc27e79cSmrg	    ;;
6082fc27e79cSmrg          RCC*)
6083fc27e79cSmrg	    # Rational C++ 2.4.1
6084fc27e79cSmrg	    # FIXME: insert proper C++ library support
6085fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6086fc27e79cSmrg	    ;;
6087fc27e79cSmrg          cxx*)
6088fc27e79cSmrg	    case $host in
6089fc27e79cSmrg	      osf3*)
6090fc27e79cSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6091fc27e79cSmrg	        _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'
6092fc27e79cSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6093fc27e79cSmrg		;;
6094fc27e79cSmrg	      *)
6095fc27e79cSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6096fc27e79cSmrg	        _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'
6097fc27e79cSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6098fc27e79cSmrg	          echo "-hidden">> $lib.exp~
6099fc27e79cSmrg	          $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~
6100fc27e79cSmrg	          $RM $lib.exp'
6101fc27e79cSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6102fc27e79cSmrg		;;
6103fc27e79cSmrg	    esac
6104659607e0Smrg
6105fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6106659607e0Smrg
6107fc27e79cSmrg	    # Commands to make compiler produce verbose output that lists
6108fc27e79cSmrg	    # what "hidden" libraries, object files and flags are used when
6109fc27e79cSmrg	    # linking a shared library.
6110fc27e79cSmrg	    #
6111fc27e79cSmrg	    # There doesn't appear to be a way to prevent this compiler from
6112fc27e79cSmrg	    # explicitly linking system object files so we need to strip them
6113fc27e79cSmrg	    # from the output so that they don't get included in the library
6114fc27e79cSmrg	    # dependencies.
6115fc27e79cSmrg	    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'
6116fc27e79cSmrg	    ;;
6117fc27e79cSmrg	  *)
6118fc27e79cSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6119fc27e79cSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6120fc27e79cSmrg	      case $host in
6121fc27e79cSmrg	        osf3*)
6122fc27e79cSmrg	          _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'
6123fc27e79cSmrg		  ;;
6124fc27e79cSmrg	        *)
6125fc27e79cSmrg	          _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'
6126fc27e79cSmrg		  ;;
6127fc27e79cSmrg	      esac
6128fc27e79cSmrg
6129fc27e79cSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6130fc27e79cSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6131fc27e79cSmrg
6132fc27e79cSmrg	      # Commands to make compiler produce verbose output that lists
6133fc27e79cSmrg	      # what "hidden" libraries, object files and flags are used when
6134fc27e79cSmrg	      # linking a shared library.
6135fc27e79cSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6136fc27e79cSmrg
6137fc27e79cSmrg	    else
6138fc27e79cSmrg	      # FIXME: insert proper C++ library support
6139fc27e79cSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6140fc27e79cSmrg	    fi
6141fc27e79cSmrg	    ;;
6142fc27e79cSmrg        esac
6143fc27e79cSmrg        ;;
6144659607e0Smrg
6145fc27e79cSmrg      psos*)
6146fc27e79cSmrg        # FIXME: insert proper C++ library support
6147fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6148fc27e79cSmrg        ;;
6149659607e0Smrg
6150fc27e79cSmrg      sunos4*)
6151fc27e79cSmrg        case $cc_basename in
6152fc27e79cSmrg          CC*)
6153fc27e79cSmrg	    # Sun C++ 4.x
6154fc27e79cSmrg	    # FIXME: insert proper C++ library support
6155fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6156fc27e79cSmrg	    ;;
6157fc27e79cSmrg          lcc*)
6158fc27e79cSmrg	    # Lucid
6159fc27e79cSmrg	    # FIXME: insert proper C++ library support
6160fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6161fc27e79cSmrg	    ;;
6162fc27e79cSmrg          *)
6163fc27e79cSmrg	    # FIXME: insert proper C++ library support
6164fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6165fc27e79cSmrg	    ;;
6166fc27e79cSmrg        esac
6167fc27e79cSmrg        ;;
6168659607e0Smrg
6169fc27e79cSmrg      solaris*)
6170fc27e79cSmrg        case $cc_basename in
6171fc27e79cSmrg          CC*)
6172fc27e79cSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
6173fc27e79cSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6174fc27e79cSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6175fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6176fc27e79cSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6177fc27e79cSmrg	      $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'
6178fc27e79cSmrg
6179fc27e79cSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6180fc27e79cSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6181fc27e79cSmrg	    case $host_os in
6182fc27e79cSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6183fc27e79cSmrg	      *)
6184fc27e79cSmrg		# The compiler driver will combine and reorder linker options,
6185fc27e79cSmrg		# but understands `-z linker_flag'.
6186fc27e79cSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6187fc27e79cSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6188fc27e79cSmrg	        ;;
6189fc27e79cSmrg	    esac
6190fc27e79cSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6191659607e0Smrg
6192fc27e79cSmrg	    output_verbose_link_cmd='echo'
6193659607e0Smrg
6194fc27e79cSmrg	    # Archives containing C++ object files must be created using
6195fc27e79cSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6196fc27e79cSmrg	    # necessary to make sure instantiated templates are included
6197fc27e79cSmrg	    # in the archive.
6198fc27e79cSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6199fc27e79cSmrg	    ;;
6200fc27e79cSmrg          gcx*)
6201fc27e79cSmrg	    # Green Hills C++ Compiler
6202fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6203659607e0Smrg
6204fc27e79cSmrg	    # The C++ compiler must be used to create the archive.
6205fc27e79cSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6206fc27e79cSmrg	    ;;
6207fc27e79cSmrg          *)
6208fc27e79cSmrg	    # GNU C++ compiler with Solaris linker
6209fc27e79cSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6210fc27e79cSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6211fc27e79cSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6212fc27e79cSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6213fc27e79cSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6214fc27e79cSmrg		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6215fc27e79cSmrg
6216fc27e79cSmrg	        # Commands to make compiler produce verbose output that lists
6217fc27e79cSmrg	        # what "hidden" libraries, object files and flags are used when
6218fc27e79cSmrg	        # linking a shared library.
6219fc27e79cSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6220fc27e79cSmrg	      else
6221fc27e79cSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6222fc27e79cSmrg	        # platform.
6223fc27e79cSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6224fc27e79cSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6225fc27e79cSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6226fc27e79cSmrg
6227fc27e79cSmrg	        # Commands to make compiler produce verbose output that lists
6228fc27e79cSmrg	        # what "hidden" libraries, object files and flags are used when
6229fc27e79cSmrg	        # linking a shared library.
6230fc27e79cSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
6231fc27e79cSmrg	      fi
6232fc27e79cSmrg
6233fc27e79cSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6234fc27e79cSmrg	      case $host_os in
6235fc27e79cSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6236fc27e79cSmrg		*)
6237fc27e79cSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6238fc27e79cSmrg		  ;;
6239fc27e79cSmrg	      esac
6240fc27e79cSmrg	    fi
6241fc27e79cSmrg	    ;;
6242fc27e79cSmrg        esac
6243fc27e79cSmrg        ;;
6244659607e0Smrg
6245fc27e79cSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6246fc27e79cSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6247fc27e79cSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6248fc27e79cSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6249fc27e79cSmrg      runpath_var='LD_RUN_PATH'
6250659607e0Smrg
6251fc27e79cSmrg      case $cc_basename in
6252fc27e79cSmrg        CC*)
6253fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6254fc27e79cSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6255fc27e79cSmrg	  ;;
6256fc27e79cSmrg	*)
6257fc27e79cSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6258fc27e79cSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6259fc27e79cSmrg	  ;;
6260fc27e79cSmrg      esac
6261fc27e79cSmrg      ;;
6262659607e0Smrg
6263fc27e79cSmrg      sysv5* | sco3.2v5* | sco5v6*)
6264fc27e79cSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
6265fc27e79cSmrg	# link with -lc, and that would cause any symbols used from libc to
6266fc27e79cSmrg	# always be unresolved, which means just about no library would
6267fc27e79cSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
6268fc27e79cSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
6269fc27e79cSmrg	# as -z defs.
6270fc27e79cSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6271fc27e79cSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6272fc27e79cSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6273fc27e79cSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6274fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6275fc27e79cSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6276fc27e79cSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6277fc27e79cSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6278fc27e79cSmrg	runpath_var='LD_RUN_PATH'
6279659607e0Smrg
6280fc27e79cSmrg	case $cc_basename in
6281fc27e79cSmrg          CC*)
6282fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6283fc27e79cSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6284fc27e79cSmrg	    ;;
6285fc27e79cSmrg	  *)
6286fc27e79cSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6287fc27e79cSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6288fc27e79cSmrg	    ;;
6289fc27e79cSmrg	esac
6290fc27e79cSmrg      ;;
6291659607e0Smrg
6292fc27e79cSmrg      tandem*)
6293fc27e79cSmrg        case $cc_basename in
6294fc27e79cSmrg          NCC*)
6295fc27e79cSmrg	    # NonStop-UX NCC 3.20
6296fc27e79cSmrg	    # FIXME: insert proper C++ library support
6297fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6298fc27e79cSmrg	    ;;
6299fc27e79cSmrg          *)
6300fc27e79cSmrg	    # FIXME: insert proper C++ library support
6301fc27e79cSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6302fc27e79cSmrg	    ;;
6303fc27e79cSmrg        esac
6304fc27e79cSmrg        ;;
6305659607e0Smrg
6306fc27e79cSmrg      vxworks*)
6307fc27e79cSmrg        # FIXME: insert proper C++ library support
6308fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6309fc27e79cSmrg        ;;
6310659607e0Smrg
6311fc27e79cSmrg      *)
6312fc27e79cSmrg        # FIXME: insert proper C++ library support
6313fc27e79cSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6314fc27e79cSmrg        ;;
6315fc27e79cSmrg    esac
6316659607e0Smrg
6317fc27e79cSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6318fc27e79cSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6319fc27e79cSmrg
6320fc27e79cSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
6321fc27e79cSmrg    _LT_TAGVAR(LD, $1)="$LD"
6322fc27e79cSmrg
6323fc27e79cSmrg    ## CAVEAT EMPTOR:
6324fc27e79cSmrg    ## There is no encapsulation within the following macros, do not change
6325fc27e79cSmrg    ## the running order or otherwise move them around unless you know exactly
6326fc27e79cSmrg    ## what you are doing...
6327fc27e79cSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6328fc27e79cSmrg    _LT_COMPILER_PIC($1)
6329fc27e79cSmrg    _LT_COMPILER_C_O($1)
6330fc27e79cSmrg    _LT_COMPILER_FILE_LOCKS($1)
6331fc27e79cSmrg    _LT_LINKER_SHLIBS($1)
6332fc27e79cSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6333fc27e79cSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6334fc27e79cSmrg
6335fc27e79cSmrg    _LT_CONFIG($1)
6336fc27e79cSmrg  fi # test -n "$compiler"
6337fc27e79cSmrg
6338fc27e79cSmrg  CC=$lt_save_CC
6339fc27e79cSmrg  LDCXX=$LD
6340fc27e79cSmrg  LD=$lt_save_LD
6341fc27e79cSmrg  GCC=$lt_save_GCC
6342fc27e79cSmrg  with_gnu_ld=$lt_save_with_gnu_ld
6343fc27e79cSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6344fc27e79cSmrg  lt_cv_path_LD=$lt_save_path_LD
6345fc27e79cSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6346fc27e79cSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6347fc27e79cSmrgfi # test "$_lt_caught_CXX_error" != yes
6348659607e0Smrg
6349fc27e79cSmrgAC_LANG_POP
6350fc27e79cSmrg])# _LT_LANG_CXX_CONFIG
6351659607e0Smrg
6352659607e0Smrg
6353fc27e79cSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6354fc27e79cSmrg# ---------------------------------
6355fc27e79cSmrg# Figure out "hidden" library dependencies from verbose
6356fc27e79cSmrg# compiler output when linking a shared library.
6357fc27e79cSmrg# Parse the compiler output and extract the necessary
6358fc27e79cSmrg# objects, libraries and library flags.
6359fc27e79cSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6360fc27e79cSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6361fc27e79cSmrg# Dependencies to place before and after the object being linked:
6362fc27e79cSmrg_LT_TAGVAR(predep_objects, $1)=
6363fc27e79cSmrg_LT_TAGVAR(postdep_objects, $1)=
6364fc27e79cSmrg_LT_TAGVAR(predeps, $1)=
6365fc27e79cSmrg_LT_TAGVAR(postdeps, $1)=
6366fc27e79cSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6367659607e0Smrg
6368fc27e79cSmrgdnl we can't use the lt_simple_compile_test_code here,
6369fc27e79cSmrgdnl because it contains code intended for an executable,
6370fc27e79cSmrgdnl not a library.  It's possible we should let each
6371fc27e79cSmrgdnl tag define a new lt_????_link_test_code variable,
6372fc27e79cSmrgdnl but it's only used here...
6373fc27e79cSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6374fc27e79cSmrgint a;
6375fc27e79cSmrgvoid foo (void) { a = 0; }
6376fc27e79cSmrg_LT_EOF
6377fc27e79cSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6378fc27e79cSmrgclass Foo
6379fc27e79cSmrg{
6380fc27e79cSmrgpublic:
6381fc27e79cSmrg  Foo (void) { a = 0; }
6382fc27e79cSmrgprivate:
6383fc27e79cSmrg  int a;
6384fc27e79cSmrg};
6385fc27e79cSmrg_LT_EOF
6386fc27e79cSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6387fc27e79cSmrg      subroutine foo
6388fc27e79cSmrg      implicit none
6389fc27e79cSmrg      integer*4 a
6390fc27e79cSmrg      a=0
6391fc27e79cSmrg      return
6392fc27e79cSmrg      end
6393fc27e79cSmrg_LT_EOF
6394fc27e79cSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6395fc27e79cSmrg      subroutine foo
6396fc27e79cSmrg      implicit none
6397fc27e79cSmrg      integer a
6398fc27e79cSmrg      a=0
6399fc27e79cSmrg      return
6400fc27e79cSmrg      end
6401fc27e79cSmrg_LT_EOF
6402fc27e79cSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6403fc27e79cSmrgpublic class foo {
6404fc27e79cSmrg  private int a;
6405fc27e79cSmrg  public void bar (void) {
6406fc27e79cSmrg    a = 0;
6407fc27e79cSmrg  }
6408fc27e79cSmrg};
6409fc27e79cSmrg_LT_EOF
6410fc27e79cSmrg])
6411fc27e79cSmrgdnl Parse the compiler output and extract the necessary
6412fc27e79cSmrgdnl objects, libraries and library flags.
6413fc27e79cSmrgif AC_TRY_EVAL(ac_compile); then
6414fc27e79cSmrg  # Parse the compiler output and extract the necessary
6415fc27e79cSmrg  # objects, libraries and library flags.
6416659607e0Smrg
6417fc27e79cSmrg  # Sentinel used to keep track of whether or not we are before
6418fc27e79cSmrg  # the conftest object file.
6419fc27e79cSmrg  pre_test_object_deps_done=no
6420659607e0Smrg
6421fc27e79cSmrg  for p in `eval "$output_verbose_link_cmd"`; do
6422fc27e79cSmrg    case $p in
6423659607e0Smrg
6424fc27e79cSmrg    -L* | -R* | -l*)
6425fc27e79cSmrg       # Some compilers place space between "-{L,R}" and the path.
6426fc27e79cSmrg       # Remove the space.
6427fc27e79cSmrg       if test $p = "-L" ||
6428fc27e79cSmrg          test $p = "-R"; then
6429fc27e79cSmrg	 prev=$p
6430fc27e79cSmrg	 continue
6431fc27e79cSmrg       else
6432fc27e79cSmrg	 prev=
6433fc27e79cSmrg       fi
6434659607e0Smrg
6435fc27e79cSmrg       if test "$pre_test_object_deps_done" = no; then
6436fc27e79cSmrg	 case $p in
6437fc27e79cSmrg	 -L* | -R*)
6438fc27e79cSmrg	   # Internal compiler library paths should come after those
6439fc27e79cSmrg	   # provided the user.  The postdeps already come after the
6440fc27e79cSmrg	   # user supplied libs so there is no need to process them.
6441fc27e79cSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
6442fc27e79cSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
6443fc27e79cSmrg	   else
6444fc27e79cSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
6445fc27e79cSmrg	   fi
6446fc27e79cSmrg	   ;;
6447fc27e79cSmrg	 # The "-l" case would never come before the object being
6448fc27e79cSmrg	 # linked, so don't bother handling this case.
6449fc27e79cSmrg	 esac
6450fc27e79cSmrg       else
6451fc27e79cSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
6452fc27e79cSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
6453fc27e79cSmrg	 else
6454fc27e79cSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
6455fc27e79cSmrg	 fi
6456fc27e79cSmrg       fi
6457fc27e79cSmrg       ;;
6458659607e0Smrg
6459fc27e79cSmrg    *.$objext)
6460fc27e79cSmrg       # This assumes that the test object file only shows up
6461fc27e79cSmrg       # once in the compiler output.
6462fc27e79cSmrg       if test "$p" = "conftest.$objext"; then
6463fc27e79cSmrg	 pre_test_object_deps_done=yes
6464fc27e79cSmrg	 continue
6465fc27e79cSmrg       fi
6466659607e0Smrg
6467fc27e79cSmrg       if test "$pre_test_object_deps_done" = no; then
6468fc27e79cSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
6469fc27e79cSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
6470fc27e79cSmrg	 else
6471fc27e79cSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
6472fc27e79cSmrg	 fi
6473fc27e79cSmrg       else
6474fc27e79cSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
6475fc27e79cSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
6476fc27e79cSmrg	 else
6477fc27e79cSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
6478fc27e79cSmrg	 fi
6479fc27e79cSmrg       fi
6480fc27e79cSmrg       ;;
6481659607e0Smrg
6482fc27e79cSmrg    *) ;; # Ignore the rest.
64836aab59a7Smrg
6484fc27e79cSmrg    esac
6485fc27e79cSmrg  done
64866aab59a7Smrg
6487fc27e79cSmrg  # Clean up.
6488fc27e79cSmrg  rm -f a.out a.exe
6489fc27e79cSmrgelse
6490fc27e79cSmrg  echo "libtool.m4: error: problem compiling $1 test program"
6491fc27e79cSmrgfi
64926aab59a7Smrg
6493fc27e79cSmrg$RM -f confest.$objext
64946aab59a7Smrg
6495fc27e79cSmrg# PORTME: override above test on systems where it is broken
6496fc27e79cSmrgm4_if([$1], [CXX],
6497fc27e79cSmrg[case $host_os in
6498fc27e79cSmrginterix[[3-9]]*)
6499fc27e79cSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
6500fc27e79cSmrg  # hack all around it, let's just trust "g++" to DTRT.
6501fc27e79cSmrg  _LT_TAGVAR(predep_objects,$1)=
6502fc27e79cSmrg  _LT_TAGVAR(postdep_objects,$1)=
6503fc27e79cSmrg  _LT_TAGVAR(postdeps,$1)=
6504fc27e79cSmrg  ;;
65056aab59a7Smrg
6506fc27e79cSmrglinux*)
6507fc27e79cSmrg  case `$CC -V 2>&1 | sed 5q` in
6508fc27e79cSmrg  *Sun\ C*)
6509fc27e79cSmrg    # Sun C++ 5.9
6510fc27e79cSmrg
6511fc27e79cSmrg    # The more standards-conforming stlport4 library is
6512fc27e79cSmrg    # incompatible with the Cstd library. Avoid specifying
6513fc27e79cSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
6514fc27e79cSmrg    # -library=stlport4 depends on it.
6515fc27e79cSmrg    case " $CXX $CXXFLAGS " in
6516fc27e79cSmrg    *" -library=stlport4 "*)
6517fc27e79cSmrg      solaris_use_stlport4=yes
6518fc27e79cSmrg      ;;
6519fc27e79cSmrg    esac
65206aab59a7Smrg
6521fc27e79cSmrg    if test "$solaris_use_stlport4" != yes; then
6522fc27e79cSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6523fc27e79cSmrg    fi
6524fc27e79cSmrg    ;;
6525fc27e79cSmrg  esac
6526fc27e79cSmrg  ;;
65276aab59a7Smrg
6528fc27e79cSmrgsolaris*)
6529fc27e79cSmrg  case $cc_basename in
6530fc27e79cSmrg  CC*)
6531fc27e79cSmrg    # The more standards-conforming stlport4 library is
6532fc27e79cSmrg    # incompatible with the Cstd library. Avoid specifying
6533fc27e79cSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
6534fc27e79cSmrg    # -library=stlport4 depends on it.
6535fc27e79cSmrg    case " $CXX $CXXFLAGS " in
6536fc27e79cSmrg    *" -library=stlport4 "*)
6537fc27e79cSmrg      solaris_use_stlport4=yes
6538fc27e79cSmrg      ;;
6539fc27e79cSmrg    esac
65406aab59a7Smrg
6541fc27e79cSmrg    # Adding this requires a known-good setup of shared libraries for
6542fc27e79cSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
6543fc27e79cSmrg    # archive will be linked into the output, leading to subtle bugs.
6544fc27e79cSmrg    if test "$solaris_use_stlport4" != yes; then
6545fc27e79cSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
6546fc27e79cSmrg    fi
6547fc27e79cSmrg    ;;
6548fc27e79cSmrg  esac
6549fc27e79cSmrg  ;;
6550fc27e79cSmrgesac
6551fc27e79cSmrg])
65526aab59a7Smrg
6553fc27e79cSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
6554fc27e79cSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
6555fc27e79cSmrgesac
6556fc27e79cSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
6557fc27e79cSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
6558fc27e79cSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
6559fc27e79cSmrgfi
6560fc27e79cSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
6561fc27e79cSmrg    [The directories searched by this compiler when creating a shared library])
6562fc27e79cSmrg_LT_TAGDECL([], [predep_objects], [1],
6563fc27e79cSmrg    [Dependencies to place before and after the objects being linked to
6564fc27e79cSmrg    create a shared library])
6565fc27e79cSmrg_LT_TAGDECL([], [postdep_objects], [1])
6566fc27e79cSmrg_LT_TAGDECL([], [predeps], [1])
6567fc27e79cSmrg_LT_TAGDECL([], [postdeps], [1])
6568fc27e79cSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
6569fc27e79cSmrg    [The library search path used internally by the compiler when linking
6570fc27e79cSmrg    a shared library])
6571fc27e79cSmrg])# _LT_SYS_HIDDEN_LIBDEPS
6572fc27e79cSmrg
6573fc27e79cSmrg
6574fc27e79cSmrg# _LT_PROG_F77
6575fc27e79cSmrg# ------------
6576fc27e79cSmrg# Since AC_PROG_F77 is broken, in that it returns the empty string
6577fc27e79cSmrg# if there is no fortran compiler, we have our own version here.
6578fc27e79cSmrgm4_defun([_LT_PROG_F77],
6579fc27e79cSmrg[
6580fc27e79cSmrgpushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
6581fc27e79cSmrgAC_PROG_F77
6582fc27e79cSmrgif test -z "$F77" || test "X$F77" = "Xno"; then
6583fc27e79cSmrg  _lt_disable_F77=yes
6584fc27e79cSmrgfi
6585fc27e79cSmrgpopdef([AC_MSG_ERROR])
6586fc27e79cSmrg])# _LT_PROG_F77
65876aab59a7Smrg
6588fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
6589fc27e79cSmrgdnl AC_DEFUN([_LT_PROG_F77], [])
65906aab59a7Smrg
65916aab59a7Smrg
6592fc27e79cSmrg# _LT_LANG_F77_CONFIG([TAG])
6593fc27e79cSmrg# --------------------------
6594fc27e79cSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
6595fc27e79cSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6596fc27e79cSmrg# to write the compiler configuration to `libtool'.
6597fc27e79cSmrgm4_defun([_LT_LANG_F77_CONFIG],
6598fc27e79cSmrg[AC_REQUIRE([_LT_PROG_F77])dnl
6599fc27e79cSmrgAC_LANG_PUSH(Fortran 77)
66006aab59a7Smrg
6601fc27e79cSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6602fc27e79cSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6603fc27e79cSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6604fc27e79cSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6605fc27e79cSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6606fc27e79cSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6607fc27e79cSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6608fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6609fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6610fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6611fc27e79cSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6612fc27e79cSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6613fc27e79cSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6614fc27e79cSmrg_LT_TAGVAR(module_cmds, $1)=
6615fc27e79cSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6616fc27e79cSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6617fc27e79cSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6618fc27e79cSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6619fc27e79cSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6620fc27e79cSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
66216aab59a7Smrg
6622fc27e79cSmrg# Source file extension for f77 test sources.
6623fc27e79cSmrgac_ext=f
66246aab59a7Smrg
6625fc27e79cSmrg# Object file extension for compiled f77 test sources.
6626fc27e79cSmrgobjext=o
6627fc27e79cSmrg_LT_TAGVAR(objext, $1)=$objext
6628fc27e79cSmrg
6629fc27e79cSmrg# No sense in running all these tests if we already determined that
6630fc27e79cSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
6631fc27e79cSmrg# are currently assumed to apply to all compilers on this platform,
6632fc27e79cSmrg# and will be corrupted by setting them based on a non-working compiler.
6633fc27e79cSmrgif test "$_lt_disable_F77" != yes; then
6634fc27e79cSmrg  # Code to be used in simple compile tests
6635fc27e79cSmrg  lt_simple_compile_test_code="\
6636fc27e79cSmrg      subroutine t
6637fc27e79cSmrg      return
6638fc27e79cSmrg      end
6639fc27e79cSmrg"
66406aab59a7Smrg
6641fc27e79cSmrg  # Code to be used in simple link tests
6642fc27e79cSmrg  lt_simple_link_test_code="\
6643fc27e79cSmrg      program t
6644fc27e79cSmrg      end
6645fc27e79cSmrg"
66466aab59a7Smrg
6647fc27e79cSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6648fc27e79cSmrg  _LT_TAG_COMPILER
66496aab59a7Smrg
6650fc27e79cSmrg  # save warnings/boilerplate of simple test code
6651fc27e79cSmrg  _LT_COMPILER_BOILERPLATE
6652fc27e79cSmrg  _LT_LINKER_BOILERPLATE
66536aab59a7Smrg
6654fc27e79cSmrg  # Allow CC to be a program name with arguments.
6655fc27e79cSmrg  lt_save_CC="$CC"
6656fc27e79cSmrg  lt_save_GCC=$GCC
6657fc27e79cSmrg  CC=${F77-"f77"}
6658fc27e79cSmrg  compiler=$CC
6659fc27e79cSmrg  _LT_TAGVAR(compiler, $1)=$CC
6660fc27e79cSmrg  _LT_CC_BASENAME([$compiler])
6661fc27e79cSmrg  GCC=$G77
6662fc27e79cSmrg  if test -n "$compiler"; then
6663fc27e79cSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6664fc27e79cSmrg    AC_MSG_RESULT([$can_build_shared])
66656aab59a7Smrg
6666fc27e79cSmrg    AC_MSG_CHECKING([whether to build shared libraries])
6667fc27e79cSmrg    test "$can_build_shared" = "no" && enable_shared=no
66686aab59a7Smrg
6669fc27e79cSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
6670fc27e79cSmrg    # are all built from PIC.
6671fc27e79cSmrg    case $host_os in
6672fc27e79cSmrg      aix3*)
6673fc27e79cSmrg        test "$enable_shared" = yes && enable_static=no
6674fc27e79cSmrg        if test -n "$RANLIB"; then
6675fc27e79cSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6676fc27e79cSmrg          postinstall_cmds='$RANLIB $lib'
6677fc27e79cSmrg        fi
6678fc27e79cSmrg        ;;
6679fc27e79cSmrg      aix[[4-9]]*)
6680fc27e79cSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6681fc27e79cSmrg	  test "$enable_shared" = yes && enable_static=no
6682fc27e79cSmrg	fi
6683fc27e79cSmrg        ;;
6684fc27e79cSmrg    esac
6685fc27e79cSmrg    AC_MSG_RESULT([$enable_shared])
6686fc27e79cSmrg
6687fc27e79cSmrg    AC_MSG_CHECKING([whether to build static libraries])
6688fc27e79cSmrg    # Make sure either enable_shared or enable_static is yes.
6689fc27e79cSmrg    test "$enable_shared" = yes || enable_static=yes
6690fc27e79cSmrg    AC_MSG_RESULT([$enable_static])
6691fc27e79cSmrg
6692fc27e79cSmrg    _LT_TAGVAR(GCC, $1)="$G77"
6693fc27e79cSmrg    _LT_TAGVAR(LD, $1)="$LD"
6694fc27e79cSmrg
6695fc27e79cSmrg    ## CAVEAT EMPTOR:
6696fc27e79cSmrg    ## There is no encapsulation within the following macros, do not change
6697fc27e79cSmrg    ## the running order or otherwise move them around unless you know exactly
6698fc27e79cSmrg    ## what you are doing...
6699fc27e79cSmrg    _LT_COMPILER_PIC($1)
6700fc27e79cSmrg    _LT_COMPILER_C_O($1)
6701fc27e79cSmrg    _LT_COMPILER_FILE_LOCKS($1)
6702fc27e79cSmrg    _LT_LINKER_SHLIBS($1)
6703fc27e79cSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6704fc27e79cSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6705fc27e79cSmrg
6706fc27e79cSmrg    _LT_CONFIG($1)
6707fc27e79cSmrg  fi # test -n "$compiler"
6708fc27e79cSmrg
6709fc27e79cSmrg  GCC=$lt_save_GCC
6710fc27e79cSmrg  CC="$lt_save_CC"
6711fc27e79cSmrgfi # test "$_lt_disable_F77" != yes
67126aab59a7Smrg
6713fc27e79cSmrgAC_LANG_POP
6714fc27e79cSmrg])# _LT_LANG_F77_CONFIG
67156aab59a7Smrg
67166aab59a7Smrg
6717fc27e79cSmrg# _LT_PROG_FC
6718fc27e79cSmrg# -----------
6719fc27e79cSmrg# Since AC_PROG_FC is broken, in that it returns the empty string
6720fc27e79cSmrg# if there is no fortran compiler, we have our own version here.
6721fc27e79cSmrgm4_defun([_LT_PROG_FC],
6722fc27e79cSmrg[
6723fc27e79cSmrgpushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
6724fc27e79cSmrgAC_PROG_FC
6725fc27e79cSmrgif test -z "$FC" || test "X$FC" = "Xno"; then
6726fc27e79cSmrg  _lt_disable_FC=yes
67276aab59a7Smrgfi
6728fc27e79cSmrgpopdef([AC_MSG_ERROR])
6729fc27e79cSmrg])# _LT_PROG_FC
67306aab59a7Smrg
6731fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
6732fc27e79cSmrgdnl AC_DEFUN([_LT_PROG_FC], [])
67336aab59a7Smrg
6734659607e0Smrg
6735fc27e79cSmrg# _LT_LANG_FC_CONFIG([TAG])
6736fc27e79cSmrg# -------------------------
6737fc27e79cSmrg# Ensure that the configuration variables for a Fortran compiler are
6738fc27e79cSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
6739fc27e79cSmrg# to write the compiler configuration to `libtool'.
6740fc27e79cSmrgm4_defun([_LT_LANG_FC_CONFIG],
6741fc27e79cSmrg[AC_REQUIRE([_LT_PROG_FC])dnl
6742fc27e79cSmrgAC_LANG_PUSH(Fortran)
6743fc27e79cSmrg
6744fc27e79cSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6745fc27e79cSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6746fc27e79cSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6747fc27e79cSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6748fc27e79cSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6749fc27e79cSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6750fc27e79cSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6751fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6752fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
6753fc27e79cSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6754fc27e79cSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6755fc27e79cSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6756fc27e79cSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6757fc27e79cSmrg_LT_TAGVAR(module_cmds, $1)=
6758fc27e79cSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6759fc27e79cSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6760fc27e79cSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6761fc27e79cSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6762fc27e79cSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6763fc27e79cSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6764fc27e79cSmrg
6765fc27e79cSmrg# Source file extension for fc test sources.
6766fc27e79cSmrgac_ext=${ac_fc_srcext-f}
6767fc27e79cSmrg
6768fc27e79cSmrg# Object file extension for compiled fc test sources.
6769fc27e79cSmrgobjext=o
6770fc27e79cSmrg_LT_TAGVAR(objext, $1)=$objext
6771fc27e79cSmrg
6772fc27e79cSmrg# No sense in running all these tests if we already determined that
6773fc27e79cSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
6774fc27e79cSmrg# are currently assumed to apply to all compilers on this platform,
6775fc27e79cSmrg# and will be corrupted by setting them based on a non-working compiler.
6776fc27e79cSmrgif test "$_lt_disable_FC" != yes; then
6777fc27e79cSmrg  # Code to be used in simple compile tests
6778fc27e79cSmrg  lt_simple_compile_test_code="\
6779fc27e79cSmrg      subroutine t
6780fc27e79cSmrg      return
6781fc27e79cSmrg      end
6782fc27e79cSmrg"
6783659607e0Smrg
6784fc27e79cSmrg  # Code to be used in simple link tests
6785fc27e79cSmrg  lt_simple_link_test_code="\
6786fc27e79cSmrg      program t
6787fc27e79cSmrg      end
6788fc27e79cSmrg"
6789659607e0Smrg
6790fc27e79cSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6791fc27e79cSmrg  _LT_TAG_COMPILER
6792659607e0Smrg
6793fc27e79cSmrg  # save warnings/boilerplate of simple test code
6794fc27e79cSmrg  _LT_COMPILER_BOILERPLATE
6795fc27e79cSmrg  _LT_LINKER_BOILERPLATE
67966aab59a7Smrg
6797fc27e79cSmrg  # Allow CC to be a program name with arguments.
6798fc27e79cSmrg  lt_save_CC="$CC"
6799fc27e79cSmrg  lt_save_GCC=$GCC
6800fc27e79cSmrg  CC=${FC-"f95"}
6801fc27e79cSmrg  compiler=$CC
6802fc27e79cSmrg  GCC=$ac_cv_fc_compiler_gnu
6803659607e0Smrg
6804fc27e79cSmrg  _LT_TAGVAR(compiler, $1)=$CC
6805fc27e79cSmrg  _LT_CC_BASENAME([$compiler])
6806659607e0Smrg
6807fc27e79cSmrg  if test -n "$compiler"; then
6808fc27e79cSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
6809fc27e79cSmrg    AC_MSG_RESULT([$can_build_shared])
6810659607e0Smrg
6811fc27e79cSmrg    AC_MSG_CHECKING([whether to build shared libraries])
6812fc27e79cSmrg    test "$can_build_shared" = "no" && enable_shared=no
6813659607e0Smrg
6814fc27e79cSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
6815fc27e79cSmrg    # are all built from PIC.
6816fc27e79cSmrg    case $host_os in
6817fc27e79cSmrg      aix3*)
6818fc27e79cSmrg        test "$enable_shared" = yes && enable_static=no
6819fc27e79cSmrg        if test -n "$RANLIB"; then
6820fc27e79cSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
6821fc27e79cSmrg          postinstall_cmds='$RANLIB $lib'
6822fc27e79cSmrg        fi
6823fc27e79cSmrg        ;;
6824fc27e79cSmrg      aix[[4-9]]*)
6825fc27e79cSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
6826fc27e79cSmrg	  test "$enable_shared" = yes && enable_static=no
6827fc27e79cSmrg	fi
6828fc27e79cSmrg        ;;
6829fc27e79cSmrg    esac
6830fc27e79cSmrg    AC_MSG_RESULT([$enable_shared])
6831fc27e79cSmrg
6832fc27e79cSmrg    AC_MSG_CHECKING([whether to build static libraries])
6833fc27e79cSmrg    # Make sure either enable_shared or enable_static is yes.
6834fc27e79cSmrg    test "$enable_shared" = yes || enable_static=yes
6835fc27e79cSmrg    AC_MSG_RESULT([$enable_static])
6836fc27e79cSmrg
6837fc27e79cSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
6838fc27e79cSmrg    _LT_TAGVAR(LD, $1)="$LD"
6839fc27e79cSmrg
6840fc27e79cSmrg    ## CAVEAT EMPTOR:
6841fc27e79cSmrg    ## There is no encapsulation within the following macros, do not change
6842fc27e79cSmrg    ## the running order or otherwise move them around unless you know exactly
6843fc27e79cSmrg    ## what you are doing...
6844fc27e79cSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6845fc27e79cSmrg    _LT_COMPILER_PIC($1)
6846fc27e79cSmrg    _LT_COMPILER_C_O($1)
6847fc27e79cSmrg    _LT_COMPILER_FILE_LOCKS($1)
6848fc27e79cSmrg    _LT_LINKER_SHLIBS($1)
6849fc27e79cSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6850fc27e79cSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6851fc27e79cSmrg
6852fc27e79cSmrg    _LT_CONFIG($1)
6853fc27e79cSmrg  fi # test -n "$compiler"
6854fc27e79cSmrg
6855fc27e79cSmrg  GCC=$lt_save_GCC
6856fc27e79cSmrg  CC="$lt_save_CC"
6857fc27e79cSmrgfi # test "$_lt_disable_FC" != yes
68586aab59a7Smrg
6859fc27e79cSmrgAC_LANG_POP
6860fc27e79cSmrg])# _LT_LANG_FC_CONFIG
68616aab59a7Smrg
68626aab59a7Smrg
6863fc27e79cSmrg# _LT_LANG_GCJ_CONFIG([TAG])
6864fc27e79cSmrg# --------------------------
6865fc27e79cSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
6866fc27e79cSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6867fc27e79cSmrg# to write the compiler configuration to `libtool'.
6868fc27e79cSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
6869fc27e79cSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
6870fc27e79cSmrgAC_LANG_SAVE
68716aab59a7Smrg
6872fc27e79cSmrg# Source file extension for Java test sources.
6873fc27e79cSmrgac_ext=java
68746aab59a7Smrg
6875fc27e79cSmrg# Object file extension for compiled Java test sources.
6876fc27e79cSmrgobjext=o
6877fc27e79cSmrg_LT_TAGVAR(objext, $1)=$objext
68786aab59a7Smrg
6879fc27e79cSmrg# Code to be used in simple compile tests
6880fc27e79cSmrglt_simple_compile_test_code="class foo {}"
68816aab59a7Smrg
6882fc27e79cSmrg# Code to be used in simple link tests
6883fc27e79cSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
68846aab59a7Smrg
6885fc27e79cSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6886fc27e79cSmrg_LT_TAG_COMPILER
68876aab59a7Smrg
6888fc27e79cSmrg# save warnings/boilerplate of simple test code
6889fc27e79cSmrg_LT_COMPILER_BOILERPLATE
6890fc27e79cSmrg_LT_LINKER_BOILERPLATE
68916aab59a7Smrg
6892fc27e79cSmrg# Allow CC to be a program name with arguments.
6893fc27e79cSmrglt_save_CC="$CC"
6894fc27e79cSmrglt_save_GCC=$GCC
6895fc27e79cSmrgGCC=yes
6896fc27e79cSmrgCC=${GCJ-"gcj"}
6897fc27e79cSmrgcompiler=$CC
6898fc27e79cSmrg_LT_TAGVAR(compiler, $1)=$CC
6899fc27e79cSmrg_LT_TAGVAR(LD, $1)="$LD"
6900fc27e79cSmrg_LT_CC_BASENAME([$compiler])
69016aab59a7Smrg
6902fc27e79cSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
6903fc27e79cSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
69046aab59a7Smrg
6905fc27e79cSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
69066aab59a7Smrg
6907fc27e79cSmrgif test -n "$compiler"; then
6908fc27e79cSmrg  _LT_COMPILER_NO_RTTI($1)
6909fc27e79cSmrg  _LT_COMPILER_PIC($1)
6910fc27e79cSmrg  _LT_COMPILER_C_O($1)
6911fc27e79cSmrg  _LT_COMPILER_FILE_LOCKS($1)
6912fc27e79cSmrg  _LT_LINKER_SHLIBS($1)
6913fc27e79cSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
69146aab59a7Smrg
6915fc27e79cSmrg  _LT_CONFIG($1)
6916fc27e79cSmrgfi
69176aab59a7Smrg
6918fc27e79cSmrgAC_LANG_RESTORE
69196aab59a7Smrg
6920fc27e79cSmrgGCC=$lt_save_GCC
6921fc27e79cSmrgCC="$lt_save_CC"
6922fc27e79cSmrg])# _LT_LANG_GCJ_CONFIG
69236aab59a7Smrg
6924fc27e79cSmrg
6925fc27e79cSmrg# _LT_LANG_RC_CONFIG([TAG])
6926fc27e79cSmrg# -------------------------
6927fc27e79cSmrg# Ensure that the configuration variables for the Windows resource compiler
6928fc27e79cSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
6929fc27e79cSmrg# to write the compiler configuration to `libtool'.
6930fc27e79cSmrgm4_defun([_LT_LANG_RC_CONFIG],
6931fc27e79cSmrg[AC_REQUIRE([LT_PROG_RC])dnl
6932fc27e79cSmrgAC_LANG_SAVE
6933fc27e79cSmrg
6934fc27e79cSmrg# Source file extension for RC test sources.
6935fc27e79cSmrgac_ext=rc
6936fc27e79cSmrg
6937fc27e79cSmrg# Object file extension for compiled RC test sources.
6938fc27e79cSmrgobjext=o
6939fc27e79cSmrg_LT_TAGVAR(objext, $1)=$objext
6940fc27e79cSmrg
6941fc27e79cSmrg# Code to be used in simple compile tests
6942fc27e79cSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
6943fc27e79cSmrg
6944fc27e79cSmrg# Code to be used in simple link tests
6945fc27e79cSmrglt_simple_link_test_code="$lt_simple_compile_test_code"
6946fc27e79cSmrg
6947fc27e79cSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
6948fc27e79cSmrg_LT_TAG_COMPILER
6949fc27e79cSmrg
6950fc27e79cSmrg# save warnings/boilerplate of simple test code
6951fc27e79cSmrg_LT_COMPILER_BOILERPLATE
6952fc27e79cSmrg_LT_LINKER_BOILERPLATE
6953fc27e79cSmrg
6954fc27e79cSmrg# Allow CC to be a program name with arguments.
6955fc27e79cSmrglt_save_CC="$CC"
6956fc27e79cSmrglt_save_GCC=$GCC
6957fc27e79cSmrgGCC=
6958fc27e79cSmrgCC=${RC-"windres"}
6959fc27e79cSmrgcompiler=$CC
6960fc27e79cSmrg_LT_TAGVAR(compiler, $1)=$CC
6961fc27e79cSmrg_LT_CC_BASENAME([$compiler])
6962fc27e79cSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
6963fc27e79cSmrg
6964fc27e79cSmrgif test -n "$compiler"; then
6965fc27e79cSmrg  :
6966fc27e79cSmrg  _LT_CONFIG($1)
6967fc27e79cSmrgfi
6968fc27e79cSmrg
6969fc27e79cSmrgGCC=$lt_save_GCC
6970fc27e79cSmrgAC_LANG_RESTORE
6971fc27e79cSmrgCC="$lt_save_CC"
6972fc27e79cSmrg])# _LT_LANG_RC_CONFIG
6973fc27e79cSmrg
6974fc27e79cSmrg
6975fc27e79cSmrg# LT_PROG_GCJ
6976fc27e79cSmrg# -----------
6977fc27e79cSmrgAC_DEFUN([LT_PROG_GCJ],
6978fc27e79cSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
6979fc27e79cSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
6980fc27e79cSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
6981fc27e79cSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
6982fc27e79cSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
6983fc27e79cSmrg])
6984fc27e79cSmrg
6985fc27e79cSmrg# Old name:
6986fc27e79cSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
6987fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
6988fc27e79cSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
6989fc27e79cSmrg
6990fc27e79cSmrg
6991fc27e79cSmrg# LT_PROG_RC
6992fc27e79cSmrg# ----------
6993fc27e79cSmrgAC_DEFUN([LT_PROG_RC],
6994fc27e79cSmrg[AC_CHECK_TOOL(RC, windres,)
6995fc27e79cSmrg])
6996fc27e79cSmrg
6997fc27e79cSmrg# Old name:
6998fc27e79cSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
6999fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7000fc27e79cSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7001fc27e79cSmrg
7002fc27e79cSmrg
7003fc27e79cSmrg# _LT_DECL_EGREP
7004fc27e79cSmrg# --------------
7005fc27e79cSmrg# If we don't have a new enough Autoconf to choose the best grep
7006fc27e79cSmrg# available, choose the one first in the user's PATH.
7007fc27e79cSmrgm4_defun([_LT_DECL_EGREP],
7008fc27e79cSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7009fc27e79cSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7010fc27e79cSmrgtest -z "$GREP" && GREP=grep
7011fc27e79cSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7012fc27e79cSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7013fc27e79cSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7014fc27e79cSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7015fc27e79cSmrgAC_SUBST([GREP])
7016fc27e79cSmrg])
7017fc27e79cSmrg
7018fc27e79cSmrg
7019fc27e79cSmrg# _LT_DECL_OBJDUMP
7020fc27e79cSmrg# --------------
7021fc27e79cSmrg# If we don't have a new enough Autoconf to choose the best objdump
7022fc27e79cSmrg# available, choose the one first in the user's PATH.
7023fc27e79cSmrgm4_defun([_LT_DECL_OBJDUMP],
7024fc27e79cSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7025fc27e79cSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7026fc27e79cSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7027fc27e79cSmrgAC_SUBST([OBJDUMP])
7028fc27e79cSmrg])
7029fc27e79cSmrg
7030fc27e79cSmrg
7031fc27e79cSmrg# _LT_DECL_SED
7032fc27e79cSmrg# ------------
7033fc27e79cSmrg# Check for a fully-functional sed program, that truncates
7034fc27e79cSmrg# as few characters as possible.  Prefer GNU sed if found.
7035fc27e79cSmrgm4_defun([_LT_DECL_SED],
7036fc27e79cSmrg[AC_PROG_SED
7037fc27e79cSmrgtest -z "$SED" && SED=sed
7038fc27e79cSmrgXsed="$SED -e 1s/^X//"
7039fc27e79cSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7040fc27e79cSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7041fc27e79cSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7042fc27e79cSmrg])# _LT_DECL_SED
7043fc27e79cSmrg
7044fc27e79cSmrgm4_ifndef([AC_PROG_SED], [
7045fc27e79cSmrg# NOTE: This macro has been submitted for inclusion into   #
7046fc27e79cSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7047fc27e79cSmrg#  a released version of Autoconf we should remove this    #
7048fc27e79cSmrg#  macro and use it instead.                               #
7049fc27e79cSmrg
7050fc27e79cSmrgm4_defun([AC_PROG_SED],
7051fc27e79cSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7052fc27e79cSmrgAC_CACHE_VAL(lt_cv_path_SED,
7053fc27e79cSmrg[# Loop through the user's path and test for sed and gsed.
7054fc27e79cSmrg# Then use that list of sed's as ones to test for truncation.
7055fc27e79cSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7056fc27e79cSmrgfor as_dir in $PATH
7057fc27e79cSmrgdo
7058fc27e79cSmrg  IFS=$as_save_IFS
7059fc27e79cSmrg  test -z "$as_dir" && as_dir=.
7060fc27e79cSmrg  for lt_ac_prog in sed gsed; do
7061fc27e79cSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
7062fc27e79cSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7063fc27e79cSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7064fc27e79cSmrg      fi
7065fc27e79cSmrg    done
7066fc27e79cSmrg  done
7067fc27e79cSmrgdone
7068fc27e79cSmrgIFS=$as_save_IFS
7069fc27e79cSmrglt_ac_max=0
7070fc27e79cSmrglt_ac_count=0
7071fc27e79cSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7072fc27e79cSmrg# along with /bin/sed that truncates output.
7073fc27e79cSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7074fc27e79cSmrg  test ! -f $lt_ac_sed && continue
7075fc27e79cSmrg  cat /dev/null > conftest.in
7076fc27e79cSmrg  lt_ac_count=0
7077fc27e79cSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7078fc27e79cSmrg  # Check for GNU sed and select it if it is found.
7079fc27e79cSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7080fc27e79cSmrg    lt_cv_path_SED=$lt_ac_sed
70816aab59a7Smrg    break
70826aab59a7Smrg  fi
7083fc27e79cSmrg  while true; do
7084fc27e79cSmrg    cat conftest.in conftest.in >conftest.tmp
7085fc27e79cSmrg    mv conftest.tmp conftest.in
7086fc27e79cSmrg    cp conftest.in conftest.nl
7087fc27e79cSmrg    echo >>conftest.nl
7088fc27e79cSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7089fc27e79cSmrg    cmp -s conftest.out conftest.nl || break
7090fc27e79cSmrg    # 10000 chars as input seems more than enough
7091fc27e79cSmrg    test $lt_ac_count -gt 10 && break
7092fc27e79cSmrg    lt_ac_count=`expr $lt_ac_count + 1`
7093fc27e79cSmrg    if test $lt_ac_count -gt $lt_ac_max; then
7094fc27e79cSmrg      lt_ac_max=$lt_ac_count
7095fc27e79cSmrg      lt_cv_path_SED=$lt_ac_sed
7096fc27e79cSmrg    fi
7097fc27e79cSmrg  done
70986aab59a7Smrgdone
70996aab59a7Smrg])
7100fc27e79cSmrgSED=$lt_cv_path_SED
7101fc27e79cSmrgAC_SUBST([SED])
7102fc27e79cSmrgAC_MSG_RESULT([$SED])
7103fc27e79cSmrg])#AC_PROG_SED
7104fc27e79cSmrg])#m4_ifndef
7105fc27e79cSmrg
7106fc27e79cSmrg# Old name:
7107fc27e79cSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7108fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7109fc27e79cSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7110fc27e79cSmrg
7111fc27e79cSmrg
7112fc27e79cSmrg# _LT_CHECK_SHELL_FEATURES
7113fc27e79cSmrg# ------------------------
7114fc27e79cSmrg# Find out whether the shell is Bourne or XSI compatible,
7115fc27e79cSmrg# or has some other useful features.
7116fc27e79cSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7117fc27e79cSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7118fc27e79cSmrg# Try some XSI features
7119fc27e79cSmrgxsi_shell=no
7120fc27e79cSmrg( _lt_dummy="a/b/c"
7121fc27e79cSmrg  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
7122fc27e79cSmrg      = c,a/b,, \
7123fc27e79cSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7124fc27e79cSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7125fc27e79cSmrg  && xsi_shell=yes
7126fc27e79cSmrgAC_MSG_RESULT([$xsi_shell])
7127fc27e79cSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7128fc27e79cSmrg
7129fc27e79cSmrgAC_MSG_CHECKING([whether the shell understands "+="])
7130fc27e79cSmrglt_shell_append=no
7131fc27e79cSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7132fc27e79cSmrg    >/dev/null 2>&1 \
7133fc27e79cSmrg  && lt_shell_append=yes
7134fc27e79cSmrgAC_MSG_RESULT([$lt_shell_append])
7135fc27e79cSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7136fc27e79cSmrg
7137fc27e79cSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7138fc27e79cSmrg  lt_unset=unset
71396aab59a7Smrgelse
7140fc27e79cSmrg  lt_unset=false
71416aab59a7Smrgfi
7142fc27e79cSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7143fc27e79cSmrg
7144fc27e79cSmrg# test EBCDIC or ASCII
7145fc27e79cSmrgcase `echo X|tr X '\101'` in
7146fc27e79cSmrg A) # ASCII based system
7147fc27e79cSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7148fc27e79cSmrg  lt_SP2NL='tr \040 \012'
7149fc27e79cSmrg  lt_NL2SP='tr \015\012 \040\040'
7150fc27e79cSmrg  ;;
7151fc27e79cSmrg *) # EBCDIC based system
7152fc27e79cSmrg  lt_SP2NL='tr \100 \n'
7153fc27e79cSmrg  lt_NL2SP='tr \r\n \100\100'
7154fc27e79cSmrg  ;;
7155fc27e79cSmrgesac
7156fc27e79cSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7157fc27e79cSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7158fc27e79cSmrg])# _LT_CHECK_SHELL_FEATURES
71596aab59a7Smrg
71606aab59a7Smrg
7161fc27e79cSmrg# _LT_PROG_XSI_SHELLFNS
7162fc27e79cSmrg# ---------------------
7163fc27e79cSmrg# Bourne and XSI compatible variants of some useful shell functions.
7164fc27e79cSmrgm4_defun([_LT_PROG_XSI_SHELLFNS],
7165fc27e79cSmrg[case $xsi_shell in
7166fc27e79cSmrg  yes)
7167fc27e79cSmrg    cat << \_LT_EOF >> "$cfgfile"
7168fc27e79cSmrg
7169fc27e79cSmrg# func_dirname file append nondir_replacement
7170fc27e79cSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7171fc27e79cSmrg# otherwise set result to NONDIR_REPLACEMENT.
7172fc27e79cSmrgfunc_dirname ()
7173fc27e79cSmrg{
7174fc27e79cSmrg  case ${1} in
7175fc27e79cSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
7176fc27e79cSmrg    *  ) func_dirname_result="${3}" ;;
7177fc27e79cSmrg  esac
7178fc27e79cSmrg}
71796aab59a7Smrg
7180fc27e79cSmrg# func_basename file
7181fc27e79cSmrgfunc_basename ()
7182fc27e79cSmrg{
7183fc27e79cSmrg  func_basename_result="${1##*/}"
7184fc27e79cSmrg}
71856aab59a7Smrg
7186fc27e79cSmrg# func_dirname_and_basename file append nondir_replacement
7187fc27e79cSmrg# perform func_basename and func_dirname in a single function
7188fc27e79cSmrg# call:
7189fc27e79cSmrg#   dirname:  Compute the dirname of FILE.  If nonempty,
7190fc27e79cSmrg#             add APPEND to the result, otherwise set result
7191fc27e79cSmrg#             to NONDIR_REPLACEMENT.
7192fc27e79cSmrg#             value returned in "$func_dirname_result"
7193fc27e79cSmrg#   basename: Compute filename of FILE.
7194fc27e79cSmrg#             value retuned in "$func_basename_result"
7195fc27e79cSmrg# Implementation must be kept synchronized with func_dirname
7196fc27e79cSmrg# and func_basename. For efficiency, we do not delegate to
7197fc27e79cSmrg# those functions but instead duplicate the functionality here.
7198fc27e79cSmrgfunc_dirname_and_basename ()
7199fc27e79cSmrg{
7200fc27e79cSmrg  case ${1} in
7201fc27e79cSmrg    */*) func_dirname_result="${1%/*}${2}" ;;
7202fc27e79cSmrg    *  ) func_dirname_result="${3}" ;;
7203fc27e79cSmrg  esac
7204fc27e79cSmrg  func_basename_result="${1##*/}"
7205fc27e79cSmrg}
7206fc27e79cSmrg
7207fc27e79cSmrg# func_stripname prefix suffix name
7208fc27e79cSmrg# strip PREFIX and SUFFIX off of NAME.
7209fc27e79cSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7210fc27e79cSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7211fc27e79cSmrg# dot (in which case that matches only a dot).
7212fc27e79cSmrgfunc_stripname ()
7213fc27e79cSmrg{
7214fc27e79cSmrg  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7215fc27e79cSmrg  # positional parameters, so assign one to ordinary parameter first.
7216fc27e79cSmrg  func_stripname_result=${3}
7217fc27e79cSmrg  func_stripname_result=${func_stripname_result#"${1}"}
7218fc27e79cSmrg  func_stripname_result=${func_stripname_result%"${2}"}
7219fc27e79cSmrg}
7220fc27e79cSmrg
7221fc27e79cSmrg# func_opt_split
7222fc27e79cSmrgfunc_opt_split ()
7223fc27e79cSmrg{
7224fc27e79cSmrg  func_opt_split_opt=${1%%=*}
7225fc27e79cSmrg  func_opt_split_arg=${1#*=}
7226fc27e79cSmrg}
7227fc27e79cSmrg
7228fc27e79cSmrg# func_lo2o object
7229fc27e79cSmrgfunc_lo2o ()
7230fc27e79cSmrg{
7231fc27e79cSmrg  case ${1} in
7232fc27e79cSmrg    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7233fc27e79cSmrg    *)    func_lo2o_result=${1} ;;
7234fc27e79cSmrg  esac
7235fc27e79cSmrg}
7236fc27e79cSmrg
7237fc27e79cSmrg# func_xform libobj-or-source
7238fc27e79cSmrgfunc_xform ()
7239fc27e79cSmrg{
7240fc27e79cSmrg  func_xform_result=${1%.*}.lo
7241fc27e79cSmrg}
7242fc27e79cSmrg
7243fc27e79cSmrg# func_arith arithmetic-term...
7244fc27e79cSmrgfunc_arith ()
7245fc27e79cSmrg{
7246fc27e79cSmrg  func_arith_result=$(( $[*] ))
7247fc27e79cSmrg}
7248fc27e79cSmrg
7249fc27e79cSmrg# func_len string
7250fc27e79cSmrg# STRING may not start with a hyphen.
7251fc27e79cSmrgfunc_len ()
7252fc27e79cSmrg{
7253fc27e79cSmrg  func_len_result=${#1}
7254fc27e79cSmrg}
7255fc27e79cSmrg
7256fc27e79cSmrg_LT_EOF
7257fc27e79cSmrg    ;;
7258fc27e79cSmrg  *) # Bourne compatible functions.
7259fc27e79cSmrg    cat << \_LT_EOF >> "$cfgfile"
7260fc27e79cSmrg
7261fc27e79cSmrg# func_dirname file append nondir_replacement
7262fc27e79cSmrg# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
7263fc27e79cSmrg# otherwise set result to NONDIR_REPLACEMENT.
7264fc27e79cSmrgfunc_dirname ()
7265fc27e79cSmrg{
7266fc27e79cSmrg  # Extract subdirectory from the argument.
7267fc27e79cSmrg  func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
7268fc27e79cSmrg  if test "X$func_dirname_result" = "X${1}"; then
7269fc27e79cSmrg    func_dirname_result="${3}"
7270fc27e79cSmrg  else
7271fc27e79cSmrg    func_dirname_result="$func_dirname_result${2}"
7272fc27e79cSmrg  fi
7273fc27e79cSmrg}
7274fc27e79cSmrg
7275fc27e79cSmrg# func_basename file
7276fc27e79cSmrgfunc_basename ()
7277fc27e79cSmrg{
7278fc27e79cSmrg  func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
7279fc27e79cSmrg}
7280fc27e79cSmrg
7281fc27e79cSmrgdnl func_dirname_and_basename
7282fc27e79cSmrgdnl A portable version of this function is already defined in general.m4sh
7283fc27e79cSmrgdnl so there is no need for it here.
7284fc27e79cSmrg
7285fc27e79cSmrg# func_stripname prefix suffix name
7286fc27e79cSmrg# strip PREFIX and SUFFIX off of NAME.
7287fc27e79cSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7288fc27e79cSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7289fc27e79cSmrg# dot (in which case that matches only a dot).
7290fc27e79cSmrg# func_strip_suffix prefix name
7291fc27e79cSmrgfunc_stripname ()
7292fc27e79cSmrg{
7293fc27e79cSmrg  case ${2} in
7294fc27e79cSmrg    .*) func_stripname_result=`$ECHO "X${3}" \
7295fc27e79cSmrg           | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
7296fc27e79cSmrg    *)  func_stripname_result=`$ECHO "X${3}" \
7297fc27e79cSmrg           | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
7298fc27e79cSmrg  esac
7299fc27e79cSmrg}
7300fc27e79cSmrg
7301fc27e79cSmrg# sed scripts:
7302fc27e79cSmrgmy_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
7303fc27e79cSmrgmy_sed_long_arg='1s/^-[[^=]]*=//'
7304fc27e79cSmrg
7305fc27e79cSmrg# func_opt_split
7306fc27e79cSmrgfunc_opt_split ()
7307fc27e79cSmrg{
7308fc27e79cSmrg  func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
7309fc27e79cSmrg  func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
7310fc27e79cSmrg}
7311fc27e79cSmrg
7312fc27e79cSmrg# func_lo2o object
7313fc27e79cSmrgfunc_lo2o ()
7314fc27e79cSmrg{
7315fc27e79cSmrg  func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
7316fc27e79cSmrg}
7317fc27e79cSmrg
7318fc27e79cSmrg# func_xform libobj-or-source
7319fc27e79cSmrgfunc_xform ()
7320fc27e79cSmrg{
7321fc27e79cSmrg  func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
7322fc27e79cSmrg}
7323fc27e79cSmrg
7324fc27e79cSmrg# func_arith arithmetic-term...
7325fc27e79cSmrgfunc_arith ()
7326fc27e79cSmrg{
7327fc27e79cSmrg  func_arith_result=`expr "$[@]"`
7328fc27e79cSmrg}
7329fc27e79cSmrg
7330fc27e79cSmrg# func_len string
7331fc27e79cSmrg# STRING may not start with a hyphen.
7332fc27e79cSmrgfunc_len ()
7333fc27e79cSmrg{
7334fc27e79cSmrg  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
7335fc27e79cSmrg}
7336fc27e79cSmrg
7337fc27e79cSmrg_LT_EOF
7338fc27e79cSmrgesac
7339fc27e79cSmrg
7340fc27e79cSmrgcase $lt_shell_append in
7341fc27e79cSmrg  yes)
7342fc27e79cSmrg    cat << \_LT_EOF >> "$cfgfile"
7343fc27e79cSmrg
7344fc27e79cSmrg# func_append var value
7345fc27e79cSmrg# Append VALUE to the end of shell variable VAR.
7346fc27e79cSmrgfunc_append ()
7347fc27e79cSmrg{
7348fc27e79cSmrg  eval "$[1]+=\$[2]"
7349fc27e79cSmrg}
7350fc27e79cSmrg_LT_EOF
7351fc27e79cSmrg    ;;
7352fc27e79cSmrg  *)
7353fc27e79cSmrg    cat << \_LT_EOF >> "$cfgfile"
7354fc27e79cSmrg
7355fc27e79cSmrg# func_append var value
7356fc27e79cSmrg# Append VALUE to the end of shell variable VAR.
7357fc27e79cSmrgfunc_append ()
7358fc27e79cSmrg{
7359fc27e79cSmrg  eval "$[1]=\$$[1]\$[2]"
7360fc27e79cSmrg}
7361fc27e79cSmrg
7362fc27e79cSmrg_LT_EOF
7363fc27e79cSmrg    ;;
7364fc27e79cSmrg  esac
7365fc27e79cSmrg])
7366fc27e79cSmrg
7367fc27e79cSmrg# Helper functions for option handling.                    -*- Autoconf -*-
7368fc27e79cSmrg#
7369fc27e79cSmrg#   Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7370fc27e79cSmrg#   Written by Gary V. Vaughan, 2004
7371fc27e79cSmrg#
7372fc27e79cSmrg# This file is free software; the Free Software Foundation gives
7373fc27e79cSmrg# unlimited permission to copy and/or distribute it, with or without
7374fc27e79cSmrg# modifications, as long as this notice is preserved.
7375fc27e79cSmrg
7376fc27e79cSmrg# serial 6 ltoptions.m4
7377fc27e79cSmrg
7378fc27e79cSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7379fc27e79cSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
7380fc27e79cSmrg
7381fc27e79cSmrg
7382fc27e79cSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
7383fc27e79cSmrg# ------------------------------------------
7384fc27e79cSmrgm4_define([_LT_MANGLE_OPTION],
7385fc27e79cSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
7386fc27e79cSmrg
7387fc27e79cSmrg
7388fc27e79cSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
7389fc27e79cSmrg# ---------------------------------------
7390fc27e79cSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
7391fc27e79cSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
7392fc27e79cSmrg# saved as a flag.
7393fc27e79cSmrgm4_define([_LT_SET_OPTION],
7394fc27e79cSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
7395fc27e79cSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
7396fc27e79cSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
7397fc27e79cSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
7398fc27e79cSmrg])
7399fc27e79cSmrg
7400fc27e79cSmrg
7401fc27e79cSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
7402fc27e79cSmrg# ------------------------------------------------------------
7403fc27e79cSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
7404fc27e79cSmrgm4_define([_LT_IF_OPTION],
7405fc27e79cSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
7406fc27e79cSmrg
7407fc27e79cSmrg
7408fc27e79cSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
7409fc27e79cSmrg# -------------------------------------------------------
7410fc27e79cSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
7411fc27e79cSmrg# are set.
7412fc27e79cSmrgm4_define([_LT_UNLESS_OPTIONS],
7413fc27e79cSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7414fc27e79cSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
7415fc27e79cSmrg		      [m4_define([$0_found])])])[]dnl
7416fc27e79cSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
7417fc27e79cSmrg])[]dnl
7418fc27e79cSmrg])
7419fc27e79cSmrg
7420fc27e79cSmrg
7421fc27e79cSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
7422fc27e79cSmrg# ----------------------------------------
7423fc27e79cSmrg# OPTION-LIST is a space-separated list of Libtool options associated
7424fc27e79cSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
7425fc27e79cSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
7426fc27e79cSmrg# the unknown option and exit.
7427fc27e79cSmrgm4_defun([_LT_SET_OPTIONS],
7428fc27e79cSmrg[# Set options
7429fc27e79cSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
7430fc27e79cSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
7431fc27e79cSmrg
7432fc27e79cSmrgm4_if([$1],[LT_INIT],[
7433fc27e79cSmrg  dnl
7434fc27e79cSmrg  dnl Simply set some default values (i.e off) if boolean options were not
7435fc27e79cSmrg  dnl specified:
7436fc27e79cSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
7437fc27e79cSmrg  ])
7438fc27e79cSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
7439fc27e79cSmrg  ])
7440fc27e79cSmrg  dnl
7441fc27e79cSmrg  dnl If no reference was made to various pairs of opposing options, then
7442fc27e79cSmrg  dnl we run the default mode handler for the pair.  For example, if neither
7443fc27e79cSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
7444fc27e79cSmrg  dnl archives by default:
7445fc27e79cSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
7446fc27e79cSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
7447fc27e79cSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
7448fc27e79cSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
7449fc27e79cSmrg  		   [_LT_ENABLE_FAST_INSTALL])
7450fc27e79cSmrg  ])
7451fc27e79cSmrg])# _LT_SET_OPTIONS
7452fc27e79cSmrg
7453fc27e79cSmrg
7454fc27e79cSmrg
7455fc27e79cSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
7456fc27e79cSmrg# -----------------------------------------
7457fc27e79cSmrgm4_define([_LT_MANGLE_DEFUN],
7458fc27e79cSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
7459fc27e79cSmrg
7460fc27e79cSmrg
7461fc27e79cSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
7462fc27e79cSmrg# -----------------------------------------------
7463fc27e79cSmrgm4_define([LT_OPTION_DEFINE],
7464fc27e79cSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
7465fc27e79cSmrg])# LT_OPTION_DEFINE
7466fc27e79cSmrg
7467fc27e79cSmrg
7468fc27e79cSmrg# dlopen
7469fc27e79cSmrg# ------
7470fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
7471fc27e79cSmrg])
7472fc27e79cSmrg
7473fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
7474fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
7475fc27e79cSmrgAC_DIAGNOSE([obsolete],
7476fc27e79cSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7477fc27e79cSmrgput the `dlopen' option into LT_INIT's first parameter.])
7478fc27e79cSmrg])
7479fc27e79cSmrg
7480fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7481fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
7482fc27e79cSmrg
7483fc27e79cSmrg
7484fc27e79cSmrg# win32-dll
7485fc27e79cSmrg# ---------
7486fc27e79cSmrg# Declare package support for building win32 dll's.
7487fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
7488fc27e79cSmrg[enable_win32_dll=yes
7489fc27e79cSmrg
7490fc27e79cSmrgcase $host in
7491fc27e79cSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
7492fc27e79cSmrg  AC_CHECK_TOOL(AS, as, false)
7493fc27e79cSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7494fc27e79cSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
7495fc27e79cSmrg  ;;
7496fc27e79cSmrgesac
7497fc27e79cSmrg
7498fc27e79cSmrgtest -z "$AS" && AS=as
7499fc27e79cSmrg_LT_DECL([], [AS],      [0], [Assembler program])dnl
7500fc27e79cSmrg
7501fc27e79cSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7502fc27e79cSmrg_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
7503fc27e79cSmrg
7504fc27e79cSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7505fc27e79cSmrg_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
7506fc27e79cSmrg])# win32-dll
7507fc27e79cSmrg
7508fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
7509fc27e79cSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7510fc27e79cSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
7511fc27e79cSmrgAC_DIAGNOSE([obsolete],
7512fc27e79cSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7513fc27e79cSmrgput the `win32-dll' option into LT_INIT's first parameter.])
7514fc27e79cSmrg])
7515fc27e79cSmrg
7516fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7517fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
7518fc27e79cSmrg
7519fc27e79cSmrg
7520fc27e79cSmrg# _LT_ENABLE_SHARED([DEFAULT])
7521fc27e79cSmrg# ----------------------------
7522fc27e79cSmrg# implement the --enable-shared flag, and supports the `shared' and
7523fc27e79cSmrg# `disable-shared' LT_INIT options.
7524fc27e79cSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7525fc27e79cSmrgm4_define([_LT_ENABLE_SHARED],
7526fc27e79cSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
7527fc27e79cSmrgAC_ARG_ENABLE([shared],
7528fc27e79cSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
7529fc27e79cSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
7530fc27e79cSmrg    [p=${PACKAGE-default}
7531fc27e79cSmrg    case $enableval in
7532fc27e79cSmrg    yes) enable_shared=yes ;;
7533fc27e79cSmrg    no) enable_shared=no ;;
7534fc27e79cSmrg    *)
7535fc27e79cSmrg      enable_shared=no
7536fc27e79cSmrg      # Look at the argument we got.  We use all the common list separators.
7537fc27e79cSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7538fc27e79cSmrg      for pkg in $enableval; do
7539fc27e79cSmrg	IFS="$lt_save_ifs"
7540fc27e79cSmrg	if test "X$pkg" = "X$p"; then
7541fc27e79cSmrg	  enable_shared=yes
7542fc27e79cSmrg	fi
7543fc27e79cSmrg      done
7544fc27e79cSmrg      IFS="$lt_save_ifs"
7545fc27e79cSmrg      ;;
7546fc27e79cSmrg    esac],
7547fc27e79cSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
7548fc27e79cSmrg
7549fc27e79cSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
7550fc27e79cSmrg	[Whether or not to build shared libraries])
7551fc27e79cSmrg])# _LT_ENABLE_SHARED
7552fc27e79cSmrg
7553fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
7554fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
7555fc27e79cSmrg
7556fc27e79cSmrg# Old names:
7557fc27e79cSmrgAC_DEFUN([AC_ENABLE_SHARED],
7558fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
7559fc27e79cSmrg])
7560fc27e79cSmrg
7561fc27e79cSmrgAC_DEFUN([AC_DISABLE_SHARED],
7562fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
7563fc27e79cSmrg])
7564fc27e79cSmrg
7565fc27e79cSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
7566fc27e79cSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
7567fc27e79cSmrg
7568fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7569fc27e79cSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
7570fc27e79cSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
7571fc27e79cSmrg
7572fc27e79cSmrg
7573fc27e79cSmrg
7574fc27e79cSmrg# _LT_ENABLE_STATIC([DEFAULT])
7575fc27e79cSmrg# ----------------------------
7576fc27e79cSmrg# implement the --enable-static flag, and support the `static' and
7577fc27e79cSmrg# `disable-static' LT_INIT options.
7578fc27e79cSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7579fc27e79cSmrgm4_define([_LT_ENABLE_STATIC],
7580fc27e79cSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
7581fc27e79cSmrgAC_ARG_ENABLE([static],
7582fc27e79cSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
7583fc27e79cSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
7584fc27e79cSmrg    [p=${PACKAGE-default}
7585fc27e79cSmrg    case $enableval in
7586fc27e79cSmrg    yes) enable_static=yes ;;
7587fc27e79cSmrg    no) enable_static=no ;;
7588fc27e79cSmrg    *)
7589fc27e79cSmrg     enable_static=no
7590fc27e79cSmrg      # Look at the argument we got.  We use all the common list separators.
7591fc27e79cSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7592fc27e79cSmrg      for pkg in $enableval; do
7593fc27e79cSmrg	IFS="$lt_save_ifs"
7594fc27e79cSmrg	if test "X$pkg" = "X$p"; then
7595fc27e79cSmrg	  enable_static=yes
7596fc27e79cSmrg	fi
7597fc27e79cSmrg      done
7598fc27e79cSmrg      IFS="$lt_save_ifs"
7599fc27e79cSmrg      ;;
7600fc27e79cSmrg    esac],
7601fc27e79cSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
7602fc27e79cSmrg
7603fc27e79cSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
7604fc27e79cSmrg	[Whether or not to build static libraries])
7605fc27e79cSmrg])# _LT_ENABLE_STATIC
7606fc27e79cSmrg
7607fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
7608fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
7609fc27e79cSmrg
7610fc27e79cSmrg# Old names:
7611fc27e79cSmrgAC_DEFUN([AC_ENABLE_STATIC],
7612fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
7613fc27e79cSmrg])
7614fc27e79cSmrg
7615fc27e79cSmrgAC_DEFUN([AC_DISABLE_STATIC],
7616fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
7617fc27e79cSmrg])
7618fc27e79cSmrg
7619fc27e79cSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
7620fc27e79cSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
7621fc27e79cSmrg
7622fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7623fc27e79cSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
7624fc27e79cSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
7625fc27e79cSmrg
7626fc27e79cSmrg
7627fc27e79cSmrg
7628fc27e79cSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
7629fc27e79cSmrg# ----------------------------------
7630fc27e79cSmrg# implement the --enable-fast-install flag, and support the `fast-install'
7631fc27e79cSmrg# and `disable-fast-install' LT_INIT options.
7632fc27e79cSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
7633fc27e79cSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
7634fc27e79cSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
7635fc27e79cSmrgAC_ARG_ENABLE([fast-install],
7636fc27e79cSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
7637fc27e79cSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
7638fc27e79cSmrg    [p=${PACKAGE-default}
7639fc27e79cSmrg    case $enableval in
7640fc27e79cSmrg    yes) enable_fast_install=yes ;;
7641fc27e79cSmrg    no) enable_fast_install=no ;;
7642fc27e79cSmrg    *)
7643fc27e79cSmrg      enable_fast_install=no
7644fc27e79cSmrg      # Look at the argument we got.  We use all the common list separators.
7645fc27e79cSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7646fc27e79cSmrg      for pkg in $enableval; do
7647fc27e79cSmrg	IFS="$lt_save_ifs"
7648fc27e79cSmrg	if test "X$pkg" = "X$p"; then
7649fc27e79cSmrg	  enable_fast_install=yes
7650fc27e79cSmrg	fi
7651fc27e79cSmrg      done
7652fc27e79cSmrg      IFS="$lt_save_ifs"
7653fc27e79cSmrg      ;;
7654fc27e79cSmrg    esac],
7655fc27e79cSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
7656fc27e79cSmrg
7657fc27e79cSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
7658fc27e79cSmrg	 [Whether or not to optimize for fast installation])dnl
7659fc27e79cSmrg])# _LT_ENABLE_FAST_INSTALL
7660fc27e79cSmrg
7661fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
7662fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
7663fc27e79cSmrg
7664fc27e79cSmrg# Old names:
7665fc27e79cSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
7666fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
7667fc27e79cSmrgAC_DIAGNOSE([obsolete],
7668fc27e79cSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7669fc27e79cSmrgthe `fast-install' option into LT_INIT's first parameter.])
7670fc27e79cSmrg])
7671fc27e79cSmrg
7672fc27e79cSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
7673fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
7674fc27e79cSmrgAC_DIAGNOSE([obsolete],
7675fc27e79cSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
7676fc27e79cSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
7677fc27e79cSmrg])
7678fc27e79cSmrg
7679fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7680fc27e79cSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
7681fc27e79cSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
7682fc27e79cSmrg
7683fc27e79cSmrg
7684fc27e79cSmrg# _LT_WITH_PIC([MODE])
7685fc27e79cSmrg# --------------------
7686fc27e79cSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
7687fc27e79cSmrg# LT_INIT options.
7688fc27e79cSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
7689fc27e79cSmrgm4_define([_LT_WITH_PIC],
7690fc27e79cSmrg[AC_ARG_WITH([pic],
7691fc27e79cSmrg    [AS_HELP_STRING([--with-pic],
7692fc27e79cSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
7693fc27e79cSmrg    [pic_mode="$withval"],
7694fc27e79cSmrg    [pic_mode=default])
7695fc27e79cSmrg
7696fc27e79cSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
7697fc27e79cSmrg
7698fc27e79cSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
7699fc27e79cSmrg])# _LT_WITH_PIC
7700fc27e79cSmrg
7701fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
7702fc27e79cSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
7703fc27e79cSmrg
7704fc27e79cSmrg# Old name:
7705fc27e79cSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
7706fc27e79cSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
7707fc27e79cSmrgAC_DIAGNOSE([obsolete],
7708fc27e79cSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
7709fc27e79cSmrgput the `pic-only' option into LT_INIT's first parameter.])
7710fc27e79cSmrg])
7711fc27e79cSmrg
7712fc27e79cSmrgdnl aclocal-1.4 backwards compatibility:
7713fc27e79cSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
7714fc27e79cSmrg
7715fc27e79cSmrg
7716fc27e79cSmrgm4_define([_LTDL_MODE], [])
7717fc27e79cSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
7718fc27e79cSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
7719fc27e79cSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
7720fc27e79cSmrg		 [m4_define([_LTDL_MODE], [recursive])])
7721fc27e79cSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
7722fc27e79cSmrg		 [m4_define([_LTDL_MODE], [subproject])])
7723fc27e79cSmrg
7724fc27e79cSmrgm4_define([_LTDL_TYPE], [])
7725fc27e79cSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
7726fc27e79cSmrg		 [m4_define([_LTDL_TYPE], [installable])])
7727fc27e79cSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
7728fc27e79cSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
7729fc27e79cSmrg
7730fc27e79cSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
7731fc27e79cSmrg#
7732fc27e79cSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
7733fc27e79cSmrg# Written by Gary V. Vaughan, 2004
7734fc27e79cSmrg#
7735fc27e79cSmrg# This file is free software; the Free Software Foundation gives
7736fc27e79cSmrg# unlimited permission to copy and/or distribute it, with or without
7737fc27e79cSmrg# modifications, as long as this notice is preserved.
7738fc27e79cSmrg
7739fc27e79cSmrg# serial 6 ltsugar.m4
7740fc27e79cSmrg
7741fc27e79cSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7742fc27e79cSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
7743fc27e79cSmrg
7744fc27e79cSmrg
7745fc27e79cSmrg# lt_join(SEP, ARG1, [ARG2...])
7746fc27e79cSmrg# -----------------------------
7747fc27e79cSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
7748fc27e79cSmrg# associated separator.
7749fc27e79cSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
7750fc27e79cSmrg# versions in m4sugar had bugs.
7751fc27e79cSmrgm4_define([lt_join],
7752fc27e79cSmrg[m4_if([$#], [1], [],
7753fc27e79cSmrg       [$#], [2], [[$2]],
7754fc27e79cSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
7755fc27e79cSmrgm4_define([_lt_join],
7756fc27e79cSmrg[m4_if([$#$2], [2], [],
7757fc27e79cSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
7758fc27e79cSmrg
7759fc27e79cSmrg
7760fc27e79cSmrg# lt_car(LIST)
7761fc27e79cSmrg# lt_cdr(LIST)
7762fc27e79cSmrg# ------------
7763fc27e79cSmrg# Manipulate m4 lists.
7764fc27e79cSmrg# These macros are necessary as long as will still need to support
7765fc27e79cSmrg# Autoconf-2.59 which quotes differently.
7766fc27e79cSmrgm4_define([lt_car], [[$1]])
7767fc27e79cSmrgm4_define([lt_cdr],
7768fc27e79cSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
7769fc27e79cSmrg       [$#], 1, [],
7770fc27e79cSmrg       [m4_dquote(m4_shift($@))])])
7771fc27e79cSmrgm4_define([lt_unquote], $1)
7772fc27e79cSmrg
7773fc27e79cSmrg
7774fc27e79cSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
7775fc27e79cSmrg# ------------------------------------------
7776fc27e79cSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
7777fc27e79cSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
7778fc27e79cSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
7779fc27e79cSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
7780fc27e79cSmrg# than defined and empty).
7781fc27e79cSmrg#
7782fc27e79cSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
7783fc27e79cSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
7784fc27e79cSmrgm4_define([lt_append],
7785fc27e79cSmrg[m4_define([$1],
7786fc27e79cSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
7787fc27e79cSmrg
7788fc27e79cSmrg
7789fc27e79cSmrg
7790fc27e79cSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
7791fc27e79cSmrg# ----------------------------------------------------------
7792fc27e79cSmrg# Produce a SEP delimited list of all paired combinations of elements of
7793fc27e79cSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
7794fc27e79cSmrg# has the form PREFIXmINFIXSUFFIXn.
7795fc27e79cSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
7796fc27e79cSmrgm4_define([lt_combine],
7797fc27e79cSmrg[m4_if(m4_eval([$# > 3]), [1],
7798fc27e79cSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
7799fc27e79cSmrg[[m4_foreach([_Lt_prefix], [$2],
7800fc27e79cSmrg	     [m4_foreach([_Lt_suffix],
7801fc27e79cSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
7802fc27e79cSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
7803fc27e79cSmrg
7804fc27e79cSmrg
7805fc27e79cSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
7806fc27e79cSmrg# -----------------------------------------------------------------------
7807fc27e79cSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
7808fc27e79cSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
7809fc27e79cSmrgm4_define([lt_if_append_uniq],
7810fc27e79cSmrg[m4_ifdef([$1],
7811fc27e79cSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
7812fc27e79cSmrg		 [lt_append([$1], [$2], [$3])$4],
7813fc27e79cSmrg		 [$5])],
7814fc27e79cSmrg	  [lt_append([$1], [$2], [$3])$4])])
7815fc27e79cSmrg
7816fc27e79cSmrg
7817fc27e79cSmrg# lt_dict_add(DICT, KEY, VALUE)
7818fc27e79cSmrg# -----------------------------
7819fc27e79cSmrgm4_define([lt_dict_add],
7820fc27e79cSmrg[m4_define([$1($2)], [$3])])
7821fc27e79cSmrg
7822fc27e79cSmrg
7823fc27e79cSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
7824fc27e79cSmrg# --------------------------------------------
7825fc27e79cSmrgm4_define([lt_dict_add_subkey],
7826fc27e79cSmrg[m4_define([$1($2:$3)], [$4])])
7827fc27e79cSmrg
7828fc27e79cSmrg
7829fc27e79cSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
7830fc27e79cSmrg# ----------------------------------
7831fc27e79cSmrgm4_define([lt_dict_fetch],
7832fc27e79cSmrg[m4_ifval([$3],
7833fc27e79cSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
7834fc27e79cSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
7835fc27e79cSmrg
7836fc27e79cSmrg
7837fc27e79cSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
7838fc27e79cSmrg# -----------------------------------------------------------------
7839fc27e79cSmrgm4_define([lt_if_dict_fetch],
7840fc27e79cSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
7841fc27e79cSmrg	[$5],
7842fc27e79cSmrg    [$6])])
7843fc27e79cSmrg
7844fc27e79cSmrg
7845fc27e79cSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
7846fc27e79cSmrg# --------------------------------------------------------------
7847fc27e79cSmrgm4_define([lt_dict_filter],
7848fc27e79cSmrg[m4_if([$5], [], [],
7849fc27e79cSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
7850fc27e79cSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
7851fc27e79cSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
7852fc27e79cSmrg])
7853fc27e79cSmrg
7854fc27e79cSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
7855fc27e79cSmrg#
7856fc27e79cSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
7857fc27e79cSmrg#   Written by Scott James Remnant, 2004
7858fc27e79cSmrg#
7859fc27e79cSmrg# This file is free software; the Free Software Foundation gives
7860fc27e79cSmrg# unlimited permission to copy and/or distribute it, with or without
7861fc27e79cSmrg# modifications, as long as this notice is preserved.
7862fc27e79cSmrg
7863fc27e79cSmrg# Generated from ltversion.in.
7864fc27e79cSmrg
7865fc27e79cSmrg# serial 3012 ltversion.m4
7866fc27e79cSmrg# This file is part of GNU Libtool
7867fc27e79cSmrg
7868fc27e79cSmrgm4_define([LT_PACKAGE_VERSION], [2.2.6])
7869fc27e79cSmrgm4_define([LT_PACKAGE_REVISION], [1.3012])
7870fc27e79cSmrg
7871fc27e79cSmrgAC_DEFUN([LTVERSION_VERSION],
7872fc27e79cSmrg[macro_version='2.2.6'
7873fc27e79cSmrgmacro_revision='1.3012'
7874fc27e79cSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
7875fc27e79cSmrg_LT_DECL(, macro_revision, 0)
7876fc27e79cSmrg])
7877fc27e79cSmrg
7878fc27e79cSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
7879fc27e79cSmrg#
7880fc27e79cSmrg#   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
7881fc27e79cSmrg#   Written by Scott James Remnant, 2004.
7882fc27e79cSmrg#
7883fc27e79cSmrg# This file is free software; the Free Software Foundation gives
7884fc27e79cSmrg# unlimited permission to copy and/or distribute it, with or without
7885fc27e79cSmrg# modifications, as long as this notice is preserved.
7886fc27e79cSmrg
7887fc27e79cSmrg# serial 4 lt~obsolete.m4
7888fc27e79cSmrg
7889fc27e79cSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
7890fc27e79cSmrg#
7891fc27e79cSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
7892fc27e79cSmrg# which have later been changed to m4_define as they aren't part of the
7893fc27e79cSmrg# exported API, or moved to Autoconf or Automake where they belong.
7894fc27e79cSmrg#
7895fc27e79cSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
7896fc27e79cSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
7897fc27e79cSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
7898fc27e79cSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
7899fc27e79cSmrg# and doesn't know about Autoconf macros at all.)
7900fc27e79cSmrg#
7901fc27e79cSmrg# So we provide this file, which has a silly filename so it's always
7902fc27e79cSmrg# included after everything else.  This provides aclocal with the
7903fc27e79cSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
7904fc27e79cSmrg# because those macros already exist, or will be overwritten later.
7905fc27e79cSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
7906fc27e79cSmrg#
7907fc27e79cSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
7908fc27e79cSmrg# Yes, that means every name once taken will need to remain here until
7909fc27e79cSmrg# we give up compatibility with versions before 1.7, at which point
7910fc27e79cSmrg# we need to keep only those names which we still refer to.
7911fc27e79cSmrg
7912fc27e79cSmrg# This is to help aclocal find these macros, as it can't see m4_define.
7913fc27e79cSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
7914fc27e79cSmrg
7915fc27e79cSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
7916fc27e79cSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
7917fc27e79cSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
7918fc27e79cSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
7919fc27e79cSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
7920fc27e79cSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
7921fc27e79cSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
7922fc27e79cSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
7923fc27e79cSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
7924fc27e79cSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
7925fc27e79cSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
7926fc27e79cSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
7927fc27e79cSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
7928fc27e79cSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
7929fc27e79cSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
7930fc27e79cSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
7931fc27e79cSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
7932fc27e79cSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
7933fc27e79cSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
7934fc27e79cSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
7935fc27e79cSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
7936fc27e79cSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
7937fc27e79cSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
7938fc27e79cSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
7939fc27e79cSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
7940fc27e79cSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
7941fc27e79cSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
7942fc27e79cSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
7943fc27e79cSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
7944fc27e79cSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
7945fc27e79cSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
7946fc27e79cSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
7947fc27e79cSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
7948fc27e79cSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
7949fc27e79cSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
7950fc27e79cSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
7951fc27e79cSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
7952fc27e79cSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
7953fc27e79cSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
7954fc27e79cSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
7955fc27e79cSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
7956fc27e79cSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
7957fc27e79cSmrgm4_ifndef([AC_LIBTOOL_RC],		[AC_DEFUN([AC_LIBTOOL_RC])])
7958fc27e79cSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
7959fc27e79cSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
7960fc27e79cSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
7961fc27e79cSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
7962fc27e79cSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
7963fc27e79cSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
7964fc27e79cSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
7965fc27e79cSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
7966fc27e79cSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
7967fc27e79cSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
7968fc27e79cSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
7969fc27e79cSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
7970fc27e79cSmrg
7971fc27e79cSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
7972fc27e79cSmrg# 
7973fc27e79cSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
7974fc27e79cSmrg#
7975fc27e79cSmrg# This program is free software; you can redistribute it and/or modify
7976fc27e79cSmrg# it under the terms of the GNU General Public License as published by
7977fc27e79cSmrg# the Free Software Foundation; either version 2 of the License, or
7978fc27e79cSmrg# (at your option) any later version.
7979fc27e79cSmrg#
7980fc27e79cSmrg# This program is distributed in the hope that it will be useful, but
7981fc27e79cSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
7982fc27e79cSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
7983fc27e79cSmrg# General Public License for more details.
7984fc27e79cSmrg#
7985fc27e79cSmrg# You should have received a copy of the GNU General Public License
7986fc27e79cSmrg# along with this program; if not, write to the Free Software
7987fc27e79cSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
7988fc27e79cSmrg#
7989fc27e79cSmrg# As a special exception to the GNU General Public License, if you
7990fc27e79cSmrg# distribute this file as part of a program that contains a
7991fc27e79cSmrg# configuration script generated by Autoconf, you may include it under
7992fc27e79cSmrg# the same distribution terms that you use for the rest of that program.
7993fc27e79cSmrg
7994fc27e79cSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
7995fc27e79cSmrg# ----------------------------------
7996fc27e79cSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
7997fc27e79cSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
7998fc27e79cSmrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
7999fc27e79cSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
8000fc27e79cSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8001fc27e79cSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8002fc27e79cSmrgfi
8003fc27e79cSmrgif test -n "$PKG_CONFIG"; then
8004fc27e79cSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
8005fc27e79cSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8006fc27e79cSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8007fc27e79cSmrg		AC_MSG_RESULT([yes])
80086aab59a7Smrg	else
8009fc27e79cSmrg		AC_MSG_RESULT([no])
8010fc27e79cSmrg		PKG_CONFIG=""
80116aab59a7Smrg	fi
8012fc27e79cSmrg		
8013fc27e79cSmrgfi[]dnl
8014fc27e79cSmrg])# PKG_PROG_PKG_CONFIG
8015fc27e79cSmrg
8016fc27e79cSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8017fc27e79cSmrg#
8018fc27e79cSmrg# Check to see whether a particular set of modules exists.  Similar
8019fc27e79cSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8020fc27e79cSmrg#
8021fc27e79cSmrg#
8022fc27e79cSmrg# Similar to PKG_CHECK_MODULES, make sure that the first instance of
8023fc27e79cSmrg# this or PKG_CHECK_MODULES is called, or make sure to call
8024fc27e79cSmrg# PKG_CHECK_EXISTS manually
8025fc27e79cSmrg# --------------------------------------------------------------
8026fc27e79cSmrgAC_DEFUN([PKG_CHECK_EXISTS],
8027fc27e79cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8028fc27e79cSmrgif test -n "$PKG_CONFIG" && \
8029fc27e79cSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8030fc27e79cSmrg  m4_ifval([$2], [$2], [:])
8031fc27e79cSmrgm4_ifvaln([$3], [else
8032fc27e79cSmrg  $3])dnl
8033fc27e79cSmrgfi])
8034fc27e79cSmrg
8035fc27e79cSmrg
8036fc27e79cSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8037fc27e79cSmrg# ---------------------------------------------
8038fc27e79cSmrgm4_define([_PKG_CONFIG],
8039fc27e79cSmrg[if test -n "$$1"; then
8040fc27e79cSmrg    pkg_cv_[]$1="$$1"
8041fc27e79cSmrg elif test -n "$PKG_CONFIG"; then
8042fc27e79cSmrg    PKG_CHECK_EXISTS([$3],
8043fc27e79cSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8044fc27e79cSmrg		     [pkg_failed=yes])
8045fc27e79cSmrg else
8046fc27e79cSmrg    pkg_failed=untried
8047fc27e79cSmrgfi[]dnl
8048fc27e79cSmrg])# _PKG_CONFIG
8049fc27e79cSmrg
8050fc27e79cSmrg# _PKG_SHORT_ERRORS_SUPPORTED
8051fc27e79cSmrg# -----------------------------
8052fc27e79cSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8053fc27e79cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8054fc27e79cSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8055fc27e79cSmrg        _pkg_short_errors_supported=yes
8056fc27e79cSmrgelse
8057fc27e79cSmrg        _pkg_short_errors_supported=no
8058fc27e79cSmrgfi[]dnl
8059fc27e79cSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
8060fc27e79cSmrg
8061fc27e79cSmrg
8062fc27e79cSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8063fc27e79cSmrg# [ACTION-IF-NOT-FOUND])
8064fc27e79cSmrg#
8065fc27e79cSmrg#
8066fc27e79cSmrg# Note that if there is a possibility the first call to
8067fc27e79cSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8068fc27e79cSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8069fc27e79cSmrg#
8070fc27e79cSmrg#
8071fc27e79cSmrg# --------------------------------------------------------------
8072fc27e79cSmrgAC_DEFUN([PKG_CHECK_MODULES],
8073fc27e79cSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8074fc27e79cSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8075fc27e79cSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8076fc27e79cSmrg
8077fc27e79cSmrgpkg_failed=no
8078fc27e79cSmrgAC_MSG_CHECKING([for $1])
8079fc27e79cSmrg
8080fc27e79cSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8081fc27e79cSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8082fc27e79cSmrg
8083fc27e79cSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8084fc27e79cSmrgand $1[]_LIBS to avoid the need to call pkg-config.
8085fc27e79cSmrgSee the pkg-config man page for more details.])
8086fc27e79cSmrg
8087fc27e79cSmrgif test $pkg_failed = yes; then
8088fc27e79cSmrg        _PKG_SHORT_ERRORS_SUPPORTED
8089fc27e79cSmrg        if test $_pkg_short_errors_supported = yes; then
8090fc27e79cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
8091fc27e79cSmrg        else 
8092fc27e79cSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
8093fc27e79cSmrg        fi
8094fc27e79cSmrg	# Put the nasty error message in config.log where it belongs
8095fc27e79cSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8096fc27e79cSmrg
8097fc27e79cSmrg	ifelse([$4], , [AC_MSG_ERROR(dnl
8098fc27e79cSmrg[Package requirements ($2) were not met:
8099fc27e79cSmrg
8100fc27e79cSmrg$$1_PKG_ERRORS
8101fc27e79cSmrg
8102fc27e79cSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8103fc27e79cSmrginstalled software in a non-standard prefix.
8104fc27e79cSmrg
8105fc27e79cSmrg_PKG_TEXT
8106fc27e79cSmrg])],
8107fc27e79cSmrg		[AC_MSG_RESULT([no])
8108fc27e79cSmrg                $4])
8109fc27e79cSmrgelif test $pkg_failed = untried; then
8110fc27e79cSmrg	ifelse([$4], , [AC_MSG_FAILURE(dnl
8111fc27e79cSmrg[The pkg-config script could not be found or is too old.  Make sure it
8112fc27e79cSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
8113fc27e79cSmrgpath to pkg-config.
8114fc27e79cSmrg
8115fc27e79cSmrg_PKG_TEXT
8116fc27e79cSmrg
8117fc27e79cSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
8118fc27e79cSmrg		[$4])
8119fc27e79cSmrgelse
8120fc27e79cSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8121fc27e79cSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8122fc27e79cSmrg        AC_MSG_RESULT([yes])
8123fc27e79cSmrg	ifelse([$3], , :, [$3])
8124fc27e79cSmrgfi[]dnl
8125fc27e79cSmrg])# PKG_CHECK_MODULES
8126fc27e79cSmrg
8127fc27e79cSmrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
8128fc27e79cSmrg#
8129fc27e79cSmrg# This file is free software; the Free Software Foundation
8130fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8131fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8132fc27e79cSmrg
8133fc27e79cSmrg# AM_AUTOMAKE_VERSION(VERSION)
8134fc27e79cSmrg# ----------------------------
8135fc27e79cSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
8136fc27e79cSmrg# generated from the m4 files accompanying Automake X.Y.
8137fc27e79cSmrg# (This private macro should not be called outside this file.)
8138fc27e79cSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8139fc27e79cSmrg[am__api_version='1.11'
8140fc27e79cSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
8141fc27e79cSmrgdnl require some minimum version.  Point them to the right macro.
8142fc27e79cSmrgm4_if([$1], [1.11], [],
8143fc27e79cSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
8144fc27e79cSmrg])
8145fc27e79cSmrg
8146fc27e79cSmrg# _AM_AUTOCONF_VERSION(VERSION)
8147fc27e79cSmrg# -----------------------------
8148fc27e79cSmrg# aclocal traces this macro to find the Autoconf version.
8149fc27e79cSmrg# This is a private macro too.  Using m4_define simplifies
8150fc27e79cSmrg# the logic in aclocal, which can simply ignore this definition.
8151fc27e79cSmrgm4_define([_AM_AUTOCONF_VERSION], [])
8152fc27e79cSmrg
8153fc27e79cSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
8154fc27e79cSmrg# -------------------------------
8155fc27e79cSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
8156fc27e79cSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
8157fc27e79cSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8158fc27e79cSmrg[AM_AUTOMAKE_VERSION([1.11])dnl
8159fc27e79cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
8160fc27e79cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
8161fc27e79cSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
8162fc27e79cSmrg
8163fc27e79cSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
8164fc27e79cSmrg
8165fc27e79cSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8166fc27e79cSmrg#
8167fc27e79cSmrg# This file is free software; the Free Software Foundation
8168fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8169fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8170fc27e79cSmrg
8171fc27e79cSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8172fc27e79cSmrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
8173fc27e79cSmrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
8174fc27e79cSmrg#
8175fc27e79cSmrg# Of course, Automake must honor this variable whenever it calls a
8176fc27e79cSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
8177fc27e79cSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
8178fc27e79cSmrg# depending on how configure is run.  This is pretty annoying, since
8179fc27e79cSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
8180fc27e79cSmrg# source directory, any form will work fine, but in subdirectories a
8181fc27e79cSmrg# relative path needs to be adjusted first.
8182fc27e79cSmrg#
8183fc27e79cSmrg# $ac_aux_dir/missing
8184fc27e79cSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
8185fc27e79cSmrg# $top_srcdir/$ac_aux_dir/missing
8186fc27e79cSmrg#    fails if $ac_aux_dir is absolute,
8187fc27e79cSmrg#    fails when called from a subdirectory in a VPATH build with
8188fc27e79cSmrg#          a relative $ac_aux_dir
8189fc27e79cSmrg#
8190fc27e79cSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
8191fc27e79cSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8192fc27e79cSmrg# harmless because $srcdir is `.', but things will broke when you
8193fc27e79cSmrg# start a VPATH build or use an absolute $srcdir.
8194fc27e79cSmrg#
8195fc27e79cSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
8196fc27e79cSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
8197fc27e79cSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
8198fc27e79cSmrg# and then we would define $MISSING as
8199fc27e79cSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
8200fc27e79cSmrg# This will work as long as MISSING is not called from configure, because
8201fc27e79cSmrg# unfortunately $(top_srcdir) has no meaning in configure.
8202fc27e79cSmrg# However there are other variables, like CC, which are often used in
8203fc27e79cSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
8204fc27e79cSmrg#
8205fc27e79cSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
8206fc27e79cSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
8207fc27e79cSmrg# configured tree to be moved without reconfiguration.
8208fc27e79cSmrg
8209fc27e79cSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
8210fc27e79cSmrg[dnl Rely on autoconf to set up CDPATH properly.
8211fc27e79cSmrgAC_PREREQ([2.50])dnl
8212fc27e79cSmrg# expand $ac_aux_dir to an absolute path
8213fc27e79cSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
8214fc27e79cSmrg])
8215fc27e79cSmrg
8216fc27e79cSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
8217fc27e79cSmrg
8218fc27e79cSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
8219fc27e79cSmrg# Free Software Foundation, Inc.
8220fc27e79cSmrg#
8221fc27e79cSmrg# This file is free software; the Free Software Foundation
8222fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8223fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8224fc27e79cSmrg
8225fc27e79cSmrg# serial 9
8226fc27e79cSmrg
8227fc27e79cSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
8228fc27e79cSmrg# -------------------------------------
8229fc27e79cSmrg# Define a conditional.
8230fc27e79cSmrgAC_DEFUN([AM_CONDITIONAL],
8231fc27e79cSmrg[AC_PREREQ(2.52)dnl
8232fc27e79cSmrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
8233fc27e79cSmrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
8234fc27e79cSmrgAC_SUBST([$1_TRUE])dnl
8235fc27e79cSmrgAC_SUBST([$1_FALSE])dnl
8236fc27e79cSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
8237fc27e79cSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
8238fc27e79cSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
8239fc27e79cSmrgif $2; then
8240fc27e79cSmrg  $1_TRUE=
8241fc27e79cSmrg  $1_FALSE='#'
8242fc27e79cSmrgelse
8243fc27e79cSmrg  $1_TRUE='#'
8244fc27e79cSmrg  $1_FALSE=
8245fc27e79cSmrgfi
8246fc27e79cSmrgAC_CONFIG_COMMANDS_PRE(
8247fc27e79cSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
8248fc27e79cSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
8249fc27e79cSmrgUsually this means the macro was only invoked conditionally.]])
8250fc27e79cSmrgfi])])
8251fc27e79cSmrg
8252fc27e79cSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
8253fc27e79cSmrg# Free Software Foundation, Inc.
8254fc27e79cSmrg#
8255fc27e79cSmrg# This file is free software; the Free Software Foundation
8256fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8257fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8258fc27e79cSmrg
8259fc27e79cSmrg# serial 10
8260fc27e79cSmrg
8261fc27e79cSmrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
8262fc27e79cSmrg# written in clear, in which case automake, when reading aclocal.m4,
8263fc27e79cSmrg# will think it sees a *use*, and therefore will trigger all it's
8264fc27e79cSmrg# C support machinery.  Also note that it means that autoscan, seeing
8265fc27e79cSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8266fc27e79cSmrg
8267fc27e79cSmrg
8268fc27e79cSmrg# _AM_DEPENDENCIES(NAME)
8269fc27e79cSmrg# ----------------------
8270fc27e79cSmrg# See how the compiler implements dependency checking.
8271fc27e79cSmrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
8272fc27e79cSmrg# We try a few techniques and use that to set a single cache variable.
8273fc27e79cSmrg#
8274fc27e79cSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
8275fc27e79cSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
8276fc27e79cSmrg# dependency, and given that the user is not expected to run this macro,
8277fc27e79cSmrg# just rely on AC_PROG_CC.
8278fc27e79cSmrgAC_DEFUN([_AM_DEPENDENCIES],
8279fc27e79cSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
8280fc27e79cSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
8281fc27e79cSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
8282fc27e79cSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8283fc27e79cSmrg
8284fc27e79cSmrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
8285fc27e79cSmrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
8286fc27e79cSmrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8287fc27e79cSmrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
8288fc27e79cSmrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8289fc27e79cSmrg                   [depcc="$$1"   am_compiler_list=])
8290fc27e79cSmrg
8291fc27e79cSmrgAC_CACHE_CHECK([dependency style of $depcc],
8292fc27e79cSmrg               [am_cv_$1_dependencies_compiler_type],
8293fc27e79cSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
8294fc27e79cSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
8295fc27e79cSmrg  # making bogus files that we don't know about and never remove.  For
8296fc27e79cSmrg  # instance it was reported that on HP-UX the gcc test will end up
8297fc27e79cSmrg  # making a dummy file named `D' -- because `-MD' means `put the output
8298fc27e79cSmrg  # in D'.
8299fc27e79cSmrg  mkdir conftest.dir
8300fc27e79cSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
8301fc27e79cSmrg  # using a relative directory.
8302fc27e79cSmrg  cp "$am_depcomp" conftest.dir
8303fc27e79cSmrg  cd conftest.dir
8304fc27e79cSmrg  # We will build objects and dependencies in a subdirectory because
8305fc27e79cSmrg  # it helps to detect inapplicable dependency modes.  For instance
8306fc27e79cSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
8307fc27e79cSmrg  # side effect of compilation, but ICC will put the dependencies in
8308fc27e79cSmrg  # the current directory while Tru64 will put them in the object
8309fc27e79cSmrg  # directory.
8310fc27e79cSmrg  mkdir sub
8311fc27e79cSmrg
8312fc27e79cSmrg  am_cv_$1_dependencies_compiler_type=none
8313fc27e79cSmrg  if test "$am_compiler_list" = ""; then
8314fc27e79cSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
83156aab59a7Smrg  fi
8316fc27e79cSmrg  am__universal=false
8317fc27e79cSmrg  m4_case([$1], [CC],
8318fc27e79cSmrg    [case " $depcc " in #(
8319fc27e79cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8320fc27e79cSmrg     esac],
8321fc27e79cSmrg    [CXX],
8322fc27e79cSmrg    [case " $depcc " in #(
8323fc27e79cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
8324fc27e79cSmrg     esac])
83256aab59a7Smrg
8326fc27e79cSmrg  for depmode in $am_compiler_list; do
8327fc27e79cSmrg    # Setup a source with many dependencies, because some compilers
8328fc27e79cSmrg    # like to wrap large dependency lists on column 80 (with \), and
8329fc27e79cSmrg    # we should not choose a depcomp mode which is confused by this.
8330fc27e79cSmrg    #
8331fc27e79cSmrg    # We need to recreate these files for each test, as the compiler may
8332fc27e79cSmrg    # overwrite some of them when testing with obscure command lines.
8333fc27e79cSmrg    # This happens at least with the AIX C compiler.
8334fc27e79cSmrg    : > sub/conftest.c
8335fc27e79cSmrg    for i in 1 2 3 4 5 6; do
8336fc27e79cSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
8337fc27e79cSmrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
8338fc27e79cSmrg      # Solaris 8's {/usr,}/bin/sh.
8339fc27e79cSmrg      touch sub/conftst$i.h
8340fc27e79cSmrg    done
8341fc27e79cSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
8342fc27e79cSmrg
8343fc27e79cSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
8344fc27e79cSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
8345fc27e79cSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
8346fc27e79cSmrg    # versions had trouble with output in subdirs
8347fc27e79cSmrg    am__obj=sub/conftest.${OBJEXT-o}
8348fc27e79cSmrg    am__minus_obj="-o $am__obj"
8349fc27e79cSmrg    case $depmode in
8350fc27e79cSmrg    gcc)
8351fc27e79cSmrg      # This depmode causes a compiler race in universal mode.
8352fc27e79cSmrg      test "$am__universal" = false || continue
8353fc27e79cSmrg      ;;
8354fc27e79cSmrg    nosideeffect)
8355fc27e79cSmrg      # after this tag, mechanisms are not by side-effect, so they'll
8356fc27e79cSmrg      # only be used when explicitly requested
8357fc27e79cSmrg      if test "x$enable_dependency_tracking" = xyes; then
8358fc27e79cSmrg	continue
8359fc27e79cSmrg      else
8360fc27e79cSmrg	break
83616aab59a7Smrg      fi
83626aab59a7Smrg      ;;
8363fc27e79cSmrg    msvisualcpp | msvcmsys)
8364fc27e79cSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
8365fc27e79cSmrg      # not run yet.  These depmodes are late enough in the game, and
8366fc27e79cSmrg      # so weak that their functioning should not be impacted.
8367fc27e79cSmrg      am__obj=conftest.${OBJEXT-o}
8368fc27e79cSmrg      am__minus_obj=
83696aab59a7Smrg      ;;
8370fc27e79cSmrg    none) break ;;
8371fc27e79cSmrg    esac
8372fc27e79cSmrg    if depmode=$depmode \
8373fc27e79cSmrg       source=sub/conftest.c object=$am__obj \
8374fc27e79cSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
8375fc27e79cSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
8376fc27e79cSmrg         >/dev/null 2>conftest.err &&
8377fc27e79cSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
8378fc27e79cSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
8379fc27e79cSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
8380fc27e79cSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
8381fc27e79cSmrg      # icc doesn't choke on unknown options, it will just issue warnings
8382fc27e79cSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
8383fc27e79cSmrg      # that says an option was ignored or not supported.
8384fc27e79cSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
8385fc27e79cSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
8386fc27e79cSmrg      # The diagnosis changed in icc 8.0:
8387fc27e79cSmrg      #   icc: Command line remark: option '-MP' not supported
8388fc27e79cSmrg      if (grep 'ignoring option' conftest.err ||
8389fc27e79cSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
8390fc27e79cSmrg        am_cv_$1_dependencies_compiler_type=$depmode
8391fc27e79cSmrg        break
8392fc27e79cSmrg      fi
8393fc27e79cSmrg    fi
8394fc27e79cSmrg  done
8395659607e0Smrg
8396fc27e79cSmrg  cd ..
8397fc27e79cSmrg  rm -rf conftest.dir
8398fc27e79cSmrgelse
8399fc27e79cSmrg  am_cv_$1_dependencies_compiler_type=none
8400fc27e79cSmrgfi
8401fc27e79cSmrg])
8402fc27e79cSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
8403fc27e79cSmrgAM_CONDITIONAL([am__fastdep$1], [
8404fc27e79cSmrg  test "x$enable_dependency_tracking" != xno \
8405fc27e79cSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
8406fc27e79cSmrg])
8407659607e0Smrg
8408659607e0Smrg
8409fc27e79cSmrg# AM_SET_DEPDIR
8410fc27e79cSmrg# -------------
8411fc27e79cSmrg# Choose a directory name for dependency files.
8412fc27e79cSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
8413fc27e79cSmrgAC_DEFUN([AM_SET_DEPDIR],
8414fc27e79cSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
8415fc27e79cSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
8416fc27e79cSmrg])
8417659607e0Smrg
8418659607e0Smrg
8419fc27e79cSmrg# AM_DEP_TRACK
8420fc27e79cSmrg# ------------
8421fc27e79cSmrgAC_DEFUN([AM_DEP_TRACK],
8422fc27e79cSmrg[AC_ARG_ENABLE(dependency-tracking,
8423fc27e79cSmrg[  --disable-dependency-tracking  speeds up one-time build
8424fc27e79cSmrg  --enable-dependency-tracking   do not reject slow dependency extractors])
8425fc27e79cSmrgif test "x$enable_dependency_tracking" != xno; then
8426fc27e79cSmrg  am_depcomp="$ac_aux_dir/depcomp"
8427fc27e79cSmrg  AMDEPBACKSLASH='\'
8428fc27e79cSmrgfi
8429fc27e79cSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
8430fc27e79cSmrgAC_SUBST([AMDEPBACKSLASH])dnl
8431fc27e79cSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
8432fc27e79cSmrg])
8433659607e0Smrg
8434fc27e79cSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
8435659607e0Smrg
8436fc27e79cSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
8437fc27e79cSmrg# Free Software Foundation, Inc.
8438fc27e79cSmrg#
8439fc27e79cSmrg# This file is free software; the Free Software Foundation
8440fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8441fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8442659607e0Smrg
8443fc27e79cSmrg#serial 5
8444fc27e79cSmrg
8445fc27e79cSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
8446fc27e79cSmrg# ------------------------------
8447fc27e79cSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
8448fc27e79cSmrg[{
8449fc27e79cSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
8450fc27e79cSmrg  # are listed without --file.  Let's play safe and only enable the eval
8451fc27e79cSmrg  # if we detect the quoting.
8452fc27e79cSmrg  case $CONFIG_FILES in
8453fc27e79cSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
8454fc27e79cSmrg  *)   set x $CONFIG_FILES ;;
8455fc27e79cSmrg  esac
8456fc27e79cSmrg  shift
8457fc27e79cSmrg  for mf
8458fc27e79cSmrg  do
8459fc27e79cSmrg    # Strip MF so we end up with the name of the file.
8460fc27e79cSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
8461fc27e79cSmrg    # Check whether this is an Automake generated Makefile or not.
8462fc27e79cSmrg    # We used to match only the files named `Makefile.in', but
8463fc27e79cSmrg    # some people rename them; so instead we look at the file content.
8464fc27e79cSmrg    # Grep'ing the first line is not enough: some people post-process
8465fc27e79cSmrg    # each Makefile.in and add a new line on top of each file to say so.
8466fc27e79cSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
8467fc27e79cSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
8468fc27e79cSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
8469fc27e79cSmrg      dirpart=`AS_DIRNAME("$mf")`
8470fc27e79cSmrg    else
8471fc27e79cSmrg      continue
8472fc27e79cSmrg    fi
8473fc27e79cSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
8474fc27e79cSmrg    # from the Makefile without running `make'.
8475fc27e79cSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
8476fc27e79cSmrg    test -z "$DEPDIR" && continue
8477fc27e79cSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
8478fc27e79cSmrg    test -z "am__include" && continue
8479fc27e79cSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
8480fc27e79cSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
8481fc27e79cSmrg    U=`sed -n 's/^U = //p' < "$mf"`
8482fc27e79cSmrg    # Find all dependency output files, they are included files with
8483fc27e79cSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
8484fc27e79cSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
8485fc27e79cSmrg    # expansion.
8486fc27e79cSmrg    for file in `sed -n "
8487fc27e79cSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
8488fc27e79cSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
8489fc27e79cSmrg      # Make sure the directory exists.
8490fc27e79cSmrg      test -f "$dirpart/$file" && continue
8491fc27e79cSmrg      fdir=`AS_DIRNAME(["$file"])`
8492fc27e79cSmrg      AS_MKDIR_P([$dirpart/$fdir])
8493fc27e79cSmrg      # echo "creating $dirpart/$file"
8494fc27e79cSmrg      echo '# dummy' > "$dirpart/$file"
8495fc27e79cSmrg    done
8496fc27e79cSmrg  done
8497fc27e79cSmrg}
8498fc27e79cSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
8499fc27e79cSmrg
8500fc27e79cSmrg
8501fc27e79cSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
8502fc27e79cSmrg# -----------------------------
8503fc27e79cSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
8504fc27e79cSmrg#
8505fc27e79cSmrg# This code is only required when automatic dependency tracking
8506fc27e79cSmrg# is enabled.  FIXME.  This creates each `.P' file that we will
8507fc27e79cSmrg# need in order to bootstrap the dependency handling code.
8508fc27e79cSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
8509fc27e79cSmrg[AC_CONFIG_COMMANDS([depfiles],
8510fc27e79cSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
8511fc27e79cSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
8512fc27e79cSmrg])
8513fc27e79cSmrg
8514fc27e79cSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
8515fc27e79cSmrg# Free Software Foundation, Inc.
8516fc27e79cSmrg#
8517fc27e79cSmrg# This file is free software; the Free Software Foundation
8518fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8519fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8520fc27e79cSmrg
8521fc27e79cSmrg# serial 8
8522fc27e79cSmrg
8523fc27e79cSmrg# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
8524fc27e79cSmrgAU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
8525fc27e79cSmrg
8526fc27e79cSmrg# Do all the work for Automake.                             -*- Autoconf -*-
8527fc27e79cSmrg
8528fc27e79cSmrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
8529fc27e79cSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
8530fc27e79cSmrg#
8531fc27e79cSmrg# This file is free software; the Free Software Foundation
8532fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8533fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8534fc27e79cSmrg
8535fc27e79cSmrg# serial 16
8536fc27e79cSmrg
8537fc27e79cSmrg# This macro actually does too much.  Some checks are only needed if
8538fc27e79cSmrg# your package does certain things.  But this isn't really a big deal.
8539fc27e79cSmrg
8540fc27e79cSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
8541fc27e79cSmrg# AM_INIT_AUTOMAKE([OPTIONS])
8542fc27e79cSmrg# -----------------------------------------------
8543fc27e79cSmrg# The call with PACKAGE and VERSION arguments is the old style
8544fc27e79cSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
8545fc27e79cSmrg# and VERSION should now be passed to AC_INIT and removed from
8546fc27e79cSmrg# the call to AM_INIT_AUTOMAKE.
8547fc27e79cSmrg# We support both call styles for the transition.  After
8548fc27e79cSmrg# the next Automake release, Autoconf can make the AC_INIT
8549fc27e79cSmrg# arguments mandatory, and then we can depend on a new Autoconf
8550fc27e79cSmrg# release and drop the old call support.
8551fc27e79cSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
8552fc27e79cSmrg[AC_PREREQ([2.62])dnl
8553fc27e79cSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
8554fc27e79cSmrgdnl the ones we care about.
8555fc27e79cSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
8556fc27e79cSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
8557fc27e79cSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
8558fc27e79cSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
8559fc27e79cSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
8560fc27e79cSmrg  # is not polluted with repeated "-I."
8561fc27e79cSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
8562fc27e79cSmrg  # test to see if srcdir already configured
8563fc27e79cSmrg  if test -f $srcdir/config.status; then
8564fc27e79cSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
8565fc27e79cSmrg  fi
8566fc27e79cSmrgfi
8567fc27e79cSmrg
8568fc27e79cSmrg# test whether we have cygpath
8569fc27e79cSmrgif test -z "$CYGPATH_W"; then
8570fc27e79cSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
8571fc27e79cSmrg    CYGPATH_W='cygpath -w'
85726aab59a7Smrg  else
8573fc27e79cSmrg    CYGPATH_W=echo
8574fc27e79cSmrg  fi
8575fc27e79cSmrgfi
8576fc27e79cSmrgAC_SUBST([CYGPATH_W])
8577fc27e79cSmrg
8578fc27e79cSmrg# Define the identity of the package.
8579fc27e79cSmrgdnl Distinguish between old-style and new-style calls.
8580fc27e79cSmrgm4_ifval([$2],
8581fc27e79cSmrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
8582fc27e79cSmrg AC_SUBST([PACKAGE], [$1])dnl
8583fc27e79cSmrg AC_SUBST([VERSION], [$2])],
8584fc27e79cSmrg[_AM_SET_OPTIONS([$1])dnl
8585fc27e79cSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
8586fc27e79cSmrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
8587fc27e79cSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
8588fc27e79cSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
8589fc27e79cSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
8590fc27e79cSmrg
8591fc27e79cSmrg_AM_IF_OPTION([no-define],,
8592fc27e79cSmrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
8593fc27e79cSmrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
8594fc27e79cSmrg
8595fc27e79cSmrg# Some tools Automake needs.
8596fc27e79cSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
8597fc27e79cSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
8598fc27e79cSmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
8599fc27e79cSmrgAM_MISSING_PROG(AUTOCONF, autoconf)
8600fc27e79cSmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
8601fc27e79cSmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
8602fc27e79cSmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
8603fc27e79cSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
8604fc27e79cSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
8605fc27e79cSmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
8606fc27e79cSmrg# We need awk for the "check" target.  The system "awk" is bad on
8607fc27e79cSmrg# some platforms.
8608fc27e79cSmrgAC_REQUIRE([AC_PROG_AWK])dnl
8609fc27e79cSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
8610fc27e79cSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
8611fc27e79cSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
8612fc27e79cSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
8613fc27e79cSmrg			     [_AM_PROG_TAR([v7])])])
8614fc27e79cSmrg_AM_IF_OPTION([no-dependencies],,
8615fc27e79cSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
8616fc27e79cSmrg		  [_AM_DEPENDENCIES(CC)],
8617fc27e79cSmrg		  [define([AC_PROG_CC],
8618fc27e79cSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
8619fc27e79cSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
8620fc27e79cSmrg		  [_AM_DEPENDENCIES(CXX)],
8621fc27e79cSmrg		  [define([AC_PROG_CXX],
8622fc27e79cSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
8623fc27e79cSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
8624fc27e79cSmrg		  [_AM_DEPENDENCIES(OBJC)],
8625fc27e79cSmrg		  [define([AC_PROG_OBJC],
8626fc27e79cSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
8627fc27e79cSmrg])
8628fc27e79cSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
8629fc27e79cSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
8630fc27e79cSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
8631fc27e79cSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
8632fc27e79cSmrgAC_CONFIG_COMMANDS_PRE(dnl
8633fc27e79cSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
8634fc27e79cSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
8635fc27e79cSmrg])
8636fc27e79cSmrg
8637fc27e79cSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
8638fc27e79cSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
8639fc27e79cSmrgdnl mangled by Autoconf and run in a shell conditional statement.
8640fc27e79cSmrgm4_define([_AC_COMPILER_EXEEXT],
8641fc27e79cSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
8642fc27e79cSmrg
8643fc27e79cSmrg
8644fc27e79cSmrg# When config.status generates a header, we must update the stamp-h file.
8645fc27e79cSmrg# This file resides in the same directory as the config header
8646fc27e79cSmrg# that is generated.  The stamp files are numbered to have different names.
8647fc27e79cSmrg
8648fc27e79cSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
8649fc27e79cSmrg# loop where config.status creates the headers, so we can generate
8650fc27e79cSmrg# our stamp files there.
8651fc27e79cSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
8652fc27e79cSmrg[# Compute $1's index in $config_headers.
8653fc27e79cSmrg_am_arg=$1
8654fc27e79cSmrg_am_stamp_count=1
8655fc27e79cSmrgfor _am_header in $config_headers :; do
8656fc27e79cSmrg  case $_am_header in
8657fc27e79cSmrg    $_am_arg | $_am_arg:* )
8658fc27e79cSmrg      break ;;
8659fc27e79cSmrg    * )
8660fc27e79cSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
8661fc27e79cSmrg  esac
8662fc27e79cSmrgdone
8663fc27e79cSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
8664659607e0Smrg
8665fc27e79cSmrg# Copyright (C) 2001, 2003, 2005, 2008  Free Software Foundation, Inc.
8666fc27e79cSmrg#
8667fc27e79cSmrg# This file is free software; the Free Software Foundation
8668fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8669fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8670659607e0Smrg
8671fc27e79cSmrg# AM_PROG_INSTALL_SH
8672fc27e79cSmrg# ------------------
8673fc27e79cSmrg# Define $install_sh.
8674fc27e79cSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
8675fc27e79cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8676fc27e79cSmrgif test x"${install_sh}" != xset; then
8677fc27e79cSmrg  case $am_aux_dir in
8678fc27e79cSmrg  *\ * | *\	*)
8679fc27e79cSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
8680fc27e79cSmrg  *)
8681fc27e79cSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
8682fc27e79cSmrg  esac
8683fc27e79cSmrgfi
8684fc27e79cSmrgAC_SUBST(install_sh)])
8685659607e0Smrg
8686fc27e79cSmrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
8687fc27e79cSmrg#
8688fc27e79cSmrg# This file is free software; the Free Software Foundation
8689fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8690fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8691659607e0Smrg
8692fc27e79cSmrg# serial 2
8693659607e0Smrg
8694fc27e79cSmrg# Check whether the underlying file-system supports filenames
8695fc27e79cSmrg# with a leading dot.  For instance MS-DOS doesn't.
8696fc27e79cSmrgAC_DEFUN([AM_SET_LEADING_DOT],
8697fc27e79cSmrg[rm -rf .tst 2>/dev/null
8698fc27e79cSmrgmkdir .tst 2>/dev/null
8699fc27e79cSmrgif test -d .tst; then
8700fc27e79cSmrg  am__leading_dot=.
8701fc27e79cSmrgelse
8702fc27e79cSmrg  am__leading_dot=_
8703fc27e79cSmrgfi
8704fc27e79cSmrgrmdir .tst 2>/dev/null
8705fc27e79cSmrgAC_SUBST([am__leading_dot])])
8706659607e0Smrg
8707fc27e79cSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
8708fc27e79cSmrg# From Jim Meyering
8709659607e0Smrg
8710fc27e79cSmrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
8711fc27e79cSmrg# Free Software Foundation, Inc.
8712fc27e79cSmrg#
8713fc27e79cSmrg# This file is free software; the Free Software Foundation
8714fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8715fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8716659607e0Smrg
8717fc27e79cSmrg# serial 5
8718659607e0Smrg
8719fc27e79cSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
8720fc27e79cSmrg# ----------------------------------
8721fc27e79cSmrg# Control maintainer-specific portions of Makefiles.
8722fc27e79cSmrg# Default is to disable them, unless `enable' is passed literally.
8723fc27e79cSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
8724fc27e79cSmrg# can override the default with the --enable/--disable switch.
8725fc27e79cSmrgAC_DEFUN([AM_MAINTAINER_MODE],
8726fc27e79cSmrg[m4_case(m4_default([$1], [disable]),
8727fc27e79cSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
8728fc27e79cSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
8729fc27e79cSmrg       [m4_define([am_maintainer_other], [enable])
8730fc27e79cSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
8731fc27e79cSmrgAC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
8732fc27e79cSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
8733fc27e79cSmrg  AC_ARG_ENABLE([maintainer-mode],
8734fc27e79cSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
8735fc27e79cSmrg			  (and sometimes confusing) to the casual installer],
8736fc27e79cSmrg      [USE_MAINTAINER_MODE=$enableval],
8737fc27e79cSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
8738fc27e79cSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
8739fc27e79cSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
8740fc27e79cSmrg  MAINT=$MAINTAINER_MODE_TRUE
8741fc27e79cSmrg  AC_SUBST([MAINT])dnl
8742fc27e79cSmrg]
8743fc27e79cSmrg)
8744659607e0Smrg
8745fc27e79cSmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
8746659607e0Smrg
8747fc27e79cSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
8748659607e0Smrg
8749fc27e79cSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
8750fc27e79cSmrg#
8751fc27e79cSmrg# This file is free software; the Free Software Foundation
8752fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8753fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8754659607e0Smrg
8755fc27e79cSmrg# serial 4
8756659607e0Smrg
8757fc27e79cSmrg# AM_MAKE_INCLUDE()
8758fc27e79cSmrg# -----------------
8759fc27e79cSmrg# Check to see how make treats includes.
8760fc27e79cSmrgAC_DEFUN([AM_MAKE_INCLUDE],
8761fc27e79cSmrg[am_make=${MAKE-make}
8762fc27e79cSmrgcat > confinc << 'END'
8763fc27e79cSmrgam__doit:
8764fc27e79cSmrg	@echo this is the am__doit target
8765fc27e79cSmrg.PHONY: am__doit
8766fc27e79cSmrgEND
8767fc27e79cSmrg# If we don't find an include directive, just comment out the code.
8768fc27e79cSmrgAC_MSG_CHECKING([for style of include used by $am_make])
8769fc27e79cSmrgam__include="#"
8770fc27e79cSmrgam__quote=
8771fc27e79cSmrg_am_result=none
8772fc27e79cSmrg# First try GNU make style include.
8773fc27e79cSmrgecho "include confinc" > confmf
8774fc27e79cSmrg# Ignore all kinds of additional output from `make'.
8775fc27e79cSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
8776fc27e79cSmrg*the\ am__doit\ target*)
8777fc27e79cSmrg  am__include=include
8778fc27e79cSmrg  am__quote=
8779fc27e79cSmrg  _am_result=GNU
8780fc27e79cSmrg  ;;
8781fc27e79cSmrgesac
8782fc27e79cSmrg# Now try BSD make style include.
8783fc27e79cSmrgif test "$am__include" = "#"; then
8784fc27e79cSmrg   echo '.include "confinc"' > confmf
8785fc27e79cSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
8786fc27e79cSmrg   *the\ am__doit\ target*)
8787fc27e79cSmrg     am__include=.include
8788fc27e79cSmrg     am__quote="\""
8789fc27e79cSmrg     _am_result=BSD
8790fc27e79cSmrg     ;;
8791fc27e79cSmrg   esac
8792fc27e79cSmrgfi
8793fc27e79cSmrgAC_SUBST([am__include])
8794fc27e79cSmrgAC_SUBST([am__quote])
8795fc27e79cSmrgAC_MSG_RESULT([$_am_result])
8796fc27e79cSmrgrm -f confinc confmf
8797659607e0Smrg])
8798659607e0Smrg
8799fc27e79cSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
8800659607e0Smrg
8801fc27e79cSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
8802fc27e79cSmrg# Free Software Foundation, Inc.
88036aab59a7Smrg#
8804fc27e79cSmrg# This file is free software; the Free Software Foundation
8805fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8806fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8807659607e0Smrg
8808fc27e79cSmrg# serial 6
8809659607e0Smrg
8810fc27e79cSmrg# AM_MISSING_PROG(NAME, PROGRAM)
8811fc27e79cSmrg# ------------------------------
8812fc27e79cSmrgAC_DEFUN([AM_MISSING_PROG],
8813fc27e79cSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
8814fc27e79cSmrg$1=${$1-"${am_missing_run}$2"}
8815fc27e79cSmrgAC_SUBST($1)])
8816fc27e79cSmrg
8817fc27e79cSmrg
8818fc27e79cSmrg# AM_MISSING_HAS_RUN
8819fc27e79cSmrg# ------------------
8820fc27e79cSmrg# Define MISSING if not defined so far and test if it supports --run.
8821fc27e79cSmrg# If it does, set am_missing_run to use it, otherwise, to nothing.
8822fc27e79cSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
8823fc27e79cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
8824fc27e79cSmrgAC_REQUIRE_AUX_FILE([missing])dnl
8825fc27e79cSmrgif test x"${MISSING+set}" != xset; then
8826fc27e79cSmrg  case $am_aux_dir in
8827fc27e79cSmrg  *\ * | *\	*)
8828fc27e79cSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
88296aab59a7Smrg  *)
8830fc27e79cSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
88316aab59a7Smrg  esac
8832fc27e79cSmrgfi
8833fc27e79cSmrg# Use eval to expand $SHELL
8834fc27e79cSmrgif eval "$MISSING --run true"; then
8835fc27e79cSmrg  am_missing_run="$MISSING --run "
8836fc27e79cSmrgelse
8837fc27e79cSmrg  am_missing_run=
8838fc27e79cSmrg  AC_MSG_WARN([`missing' script is too old or missing])
8839fc27e79cSmrgfi
8840fc27e79cSmrg])
88416aab59a7Smrg
8842fc27e79cSmrg# Copyright (C) 2003, 2004, 2005, 2006  Free Software Foundation, Inc.
8843fc27e79cSmrg#
8844fc27e79cSmrg# This file is free software; the Free Software Foundation
8845fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8846fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
88476aab59a7Smrg
8848fc27e79cSmrg# AM_PROG_MKDIR_P
8849fc27e79cSmrg# ---------------
8850fc27e79cSmrg# Check for `mkdir -p'.
8851fc27e79cSmrgAC_DEFUN([AM_PROG_MKDIR_P],
8852fc27e79cSmrg[AC_PREREQ([2.60])dnl
8853fc27e79cSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
8854fc27e79cSmrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
8855fc27e79cSmrgdnl while keeping a definition of mkdir_p for backward compatibility.
8856fc27e79cSmrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
8857fc27e79cSmrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
8858fc27e79cSmrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
8859fc27e79cSmrgdnl adjustment using top_builddir (which is defined more often than
8860fc27e79cSmrgdnl MKDIR_P).
8861fc27e79cSmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
8862fc27e79cSmrgcase $mkdir_p in
8863fc27e79cSmrg  [[\\/$]]* | ?:[[\\/]]*) ;;
8864fc27e79cSmrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
8865fc27e79cSmrgesac
8866fc27e79cSmrg])
8867659607e0Smrg
8868fc27e79cSmrg# Helper functions for option handling.                     -*- Autoconf -*-
8869659607e0Smrg
8870fc27e79cSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2008  Free Software Foundation, Inc.
8871fc27e79cSmrg#
8872fc27e79cSmrg# This file is free software; the Free Software Foundation
8873fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8874fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8875659607e0Smrg
8876fc27e79cSmrg# serial 4
8877659607e0Smrg
8878fc27e79cSmrg# _AM_MANGLE_OPTION(NAME)
8879fc27e79cSmrg# -----------------------
8880fc27e79cSmrgAC_DEFUN([_AM_MANGLE_OPTION],
8881fc27e79cSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
8882659607e0Smrg
8883fc27e79cSmrg# _AM_SET_OPTION(NAME)
8884fc27e79cSmrg# ------------------------------
8885fc27e79cSmrg# Set option NAME.  Presently that only means defining a flag for this option.
8886fc27e79cSmrgAC_DEFUN([_AM_SET_OPTION],
8887fc27e79cSmrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
8888659607e0Smrg
8889fc27e79cSmrg# _AM_SET_OPTIONS(OPTIONS)
8890fc27e79cSmrg# ----------------------------------
8891fc27e79cSmrg# OPTIONS is a space-separated list of Automake options.
8892fc27e79cSmrgAC_DEFUN([_AM_SET_OPTIONS],
8893fc27e79cSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
8894659607e0Smrg
8895fc27e79cSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
8896fc27e79cSmrg# -------------------------------------------
8897fc27e79cSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8898fc27e79cSmrgAC_DEFUN([_AM_IF_OPTION],
8899fc27e79cSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
8900659607e0Smrg
8901fc27e79cSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
8902659607e0Smrg
8903fc27e79cSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
8904fc27e79cSmrg# Free Software Foundation, Inc.
8905fc27e79cSmrg#
8906fc27e79cSmrg# This file is free software; the Free Software Foundation
8907fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8908fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8909659607e0Smrg
8910fc27e79cSmrg# serial 5
8911659607e0Smrg
8912fc27e79cSmrg# AM_SANITY_CHECK
8913fc27e79cSmrg# ---------------
8914fc27e79cSmrgAC_DEFUN([AM_SANITY_CHECK],
8915fc27e79cSmrg[AC_MSG_CHECKING([whether build environment is sane])
8916fc27e79cSmrg# Just in case
8917fc27e79cSmrgsleep 1
8918fc27e79cSmrgecho timestamp > conftest.file
8919fc27e79cSmrg# Reject unsafe characters in $srcdir or the absolute working directory
8920fc27e79cSmrg# name.  Accept space and tab only in the latter.
8921fc27e79cSmrgam_lf='
8922fc27e79cSmrg'
8923fc27e79cSmrgcase `pwd` in
8924fc27e79cSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
8925fc27e79cSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
8926fc27e79cSmrgesac
8927fc27e79cSmrgcase $srcdir in
8928fc27e79cSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
8929fc27e79cSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
8930fc27e79cSmrgesac
8931659607e0Smrg
8932fc27e79cSmrg# Do `set' in a subshell so we don't clobber the current shell's
8933fc27e79cSmrg# arguments.  Must try -L first in case configure is actually a
8934fc27e79cSmrg# symlink; some systems play weird games with the mod time of symlinks
8935fc27e79cSmrg# (eg FreeBSD returns the mod time of the symlink's containing
8936fc27e79cSmrg# directory).
8937fc27e79cSmrgif (
8938fc27e79cSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
8939fc27e79cSmrg   if test "$[*]" = "X"; then
8940fc27e79cSmrg      # -L didn't work.
8941fc27e79cSmrg      set X `ls -t "$srcdir/configure" conftest.file`
8942fc27e79cSmrg   fi
8943fc27e79cSmrg   rm -f conftest.file
8944fc27e79cSmrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
8945fc27e79cSmrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
8946659607e0Smrg
8947fc27e79cSmrg      # If neither matched, then we have a broken ls.  This can happen
8948fc27e79cSmrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
8949fc27e79cSmrg      # broken ls alias from the environment.  This has actually
8950fc27e79cSmrg      # happened.  Such a system could not be considered "sane".
8951fc27e79cSmrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
8952fc27e79cSmrgalias in your environment])
8953fc27e79cSmrg   fi
8954659607e0Smrg
8955fc27e79cSmrg   test "$[2]" = conftest.file
8956fc27e79cSmrg   )
8957fc27e79cSmrgthen
8958fc27e79cSmrg   # Ok.
8959fc27e79cSmrg   :
8960fc27e79cSmrgelse
8961fc27e79cSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
8962fc27e79cSmrgCheck your system clock])
8963fc27e79cSmrgfi
8964fc27e79cSmrgAC_MSG_RESULT(yes)])
8965659607e0Smrg
8966fc27e79cSmrg# Copyright (C) 2009  Free Software Foundation, Inc.
8967fc27e79cSmrg#
8968fc27e79cSmrg# This file is free software; the Free Software Foundation
8969fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8970fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8971659607e0Smrg
8972fc27e79cSmrg# serial 1
8973659607e0Smrg
8974fc27e79cSmrg# AM_SILENT_RULES([DEFAULT])
8975fc27e79cSmrg# --------------------------
8976fc27e79cSmrg# Enable less verbose build rules; with the default set to DEFAULT
8977fc27e79cSmrg# (`yes' being less verbose, `no' or empty being verbose).
8978fc27e79cSmrgAC_DEFUN([AM_SILENT_RULES],
8979fc27e79cSmrg[AC_ARG_ENABLE([silent-rules],
8980fc27e79cSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
8981fc27e79cSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
8982fc27e79cSmrgcase $enable_silent_rules in
8983fc27e79cSmrgyes) AM_DEFAULT_VERBOSITY=0;;
8984fc27e79cSmrgno)  AM_DEFAULT_VERBOSITY=1;;
8985fc27e79cSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
8986fc27e79cSmrgesac
8987fc27e79cSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
8988fc27e79cSmrgAM_BACKSLASH='\'
8989fc27e79cSmrgAC_SUBST([AM_BACKSLASH])dnl
8990fc27e79cSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
8991fc27e79cSmrg])
89926aab59a7Smrg
8993fc27e79cSmrg# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
8994fc27e79cSmrg#
8995fc27e79cSmrg# This file is free software; the Free Software Foundation
8996fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
8997fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
8998659607e0Smrg
8999fc27e79cSmrg# AM_PROG_INSTALL_STRIP
9000fc27e79cSmrg# ---------------------
9001fc27e79cSmrg# One issue with vendor `install' (even GNU) is that you can't
9002fc27e79cSmrg# specify the program used to strip binaries.  This is especially
9003fc27e79cSmrg# annoying in cross-compiling environments, where the build's strip
9004fc27e79cSmrg# is unlikely to handle the host's binaries.
9005fc27e79cSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9006fc27e79cSmrg# always use install-sh in `make install-strip', and initialize
9007fc27e79cSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
9008fc27e79cSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
9009fc27e79cSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9010fc27e79cSmrg# Installed binaries are usually stripped using `strip' when the user
9011fc27e79cSmrg# run `make install-strip'.  However `strip' might not be the right
9012fc27e79cSmrg# tool to use in cross-compilation environments, therefore Automake
9013fc27e79cSmrg# will honor the `STRIP' environment variable to overrule this program.
9014fc27e79cSmrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
9015fc27e79cSmrgif test "$cross_compiling" != no; then
9016fc27e79cSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
9017fc27e79cSmrgfi
9018fc27e79cSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
9019fc27e79cSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
9020659607e0Smrg
9021fc27e79cSmrg# Copyright (C) 2006, 2008  Free Software Foundation, Inc.
9022fc27e79cSmrg#
9023fc27e79cSmrg# This file is free software; the Free Software Foundation
9024fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
9025fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
9026659607e0Smrg
9027fc27e79cSmrg# serial 2
9028659607e0Smrg
9029fc27e79cSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
9030fc27e79cSmrg# ---------------------------
9031fc27e79cSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
9032fc27e79cSmrg# This macro is traced by Automake.
9033fc27e79cSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9034659607e0Smrg
9035fc27e79cSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9036fc27e79cSmrg# ---------------------------
9037fc27e79cSmrg# Public sister of _AM_SUBST_NOTMAKE.
9038fc27e79cSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9039659607e0Smrg
9040fc27e79cSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9041659607e0Smrg
9042fc27e79cSmrg# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
9043fc27e79cSmrg#
9044fc27e79cSmrg# This file is free software; the Free Software Foundation
9045fc27e79cSmrg# gives unlimited permission to copy and/or distribute it,
9046fc27e79cSmrg# with or without modifications, as long as this notice is preserved.
9047659607e0Smrg
9048fc27e79cSmrg# serial 2
9049659607e0Smrg
9050fc27e79cSmrg# _AM_PROG_TAR(FORMAT)
9051fc27e79cSmrg# --------------------
9052fc27e79cSmrg# Check how to create a tarball in format FORMAT.
9053fc27e79cSmrg# FORMAT should be one of `v7', `ustar', or `pax'.
9054fc27e79cSmrg#
9055fc27e79cSmrg# Substitute a variable $(am__tar) that is a command
9056fc27e79cSmrg# writing to stdout a FORMAT-tarball containing the directory
9057fc27e79cSmrg# $tardir.
9058fc27e79cSmrg#     tardir=directory && $(am__tar) > result.tar
9059fc27e79cSmrg#
9060fc27e79cSmrg# Substitute a variable $(am__untar) that extract such
9061fc27e79cSmrg# a tarball read from stdin.
9062fc27e79cSmrg#     $(am__untar) < result.tar
9063fc27e79cSmrgAC_DEFUN([_AM_PROG_TAR],
9064fc27e79cSmrg[# Always define AMTAR for backward compatibility.
9065fc27e79cSmrgAM_MISSING_PROG([AMTAR], [tar])
9066fc27e79cSmrgm4_if([$1], [v7],
9067fc27e79cSmrg     [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
9068fc27e79cSmrg     [m4_case([$1], [ustar],, [pax],,
9069fc27e79cSmrg              [m4_fatal([Unknown tar format])])
9070fc27e79cSmrgAC_MSG_CHECKING([how to create a $1 tar archive])
9071fc27e79cSmrg# Loop over all known methods to create a tar archive until one works.
9072fc27e79cSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9073fc27e79cSmrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
9074fc27e79cSmrg# Do not fold the above two line into one, because Tru64 sh and
9075fc27e79cSmrg# Solaris sh will not grok spaces in the rhs of `-'.
9076fc27e79cSmrgfor _am_tool in $_am_tools
9077fc27e79cSmrgdo
9078fc27e79cSmrg  case $_am_tool in
9079fc27e79cSmrg  gnutar)
9080fc27e79cSmrg    for _am_tar in tar gnutar gtar;
9081fc27e79cSmrg    do
9082fc27e79cSmrg      AM_RUN_LOG([$_am_tar --version]) && break
9083fc27e79cSmrg    done
9084fc27e79cSmrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9085fc27e79cSmrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9086fc27e79cSmrg    am__untar="$_am_tar -xf -"
9087fc27e79cSmrg    ;;
9088fc27e79cSmrg  plaintar)
9089fc27e79cSmrg    # Must skip GNU tar: if it does not support --format= it doesn't create
9090fc27e79cSmrg    # ustar tarball either.
9091fc27e79cSmrg    (tar --version) >/dev/null 2>&1 && continue
9092fc27e79cSmrg    am__tar='tar chf - "$$tardir"'
9093fc27e79cSmrg    am__tar_='tar chf - "$tardir"'
9094fc27e79cSmrg    am__untar='tar xf -'
9095fc27e79cSmrg    ;;
9096fc27e79cSmrg  pax)
9097fc27e79cSmrg    am__tar='pax -L -x $1 -w "$$tardir"'
9098fc27e79cSmrg    am__tar_='pax -L -x $1 -w "$tardir"'
9099fc27e79cSmrg    am__untar='pax -r'
9100fc27e79cSmrg    ;;
9101fc27e79cSmrg  cpio)
9102fc27e79cSmrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9103fc27e79cSmrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9104fc27e79cSmrg    am__untar='cpio -i -H $1 -d'
9105fc27e79cSmrg    ;;
9106fc27e79cSmrg  none)
9107fc27e79cSmrg    am__tar=false
9108fc27e79cSmrg    am__tar_=false
9109fc27e79cSmrg    am__untar=false
9110fc27e79cSmrg    ;;
9111fc27e79cSmrg  esac
9112659607e0Smrg
9113fc27e79cSmrg  # If the value was cached, stop now.  We just wanted to have am__tar
9114fc27e79cSmrg  # and am__untar set.
9115fc27e79cSmrg  test -n "${am_cv_prog_tar_$1}" && break
9116659607e0Smrg
9117fc27e79cSmrg  # tar/untar a dummy directory, and stop if the command works
9118fc27e79cSmrg  rm -rf conftest.dir
9119fc27e79cSmrg  mkdir conftest.dir
9120fc27e79cSmrg  echo GrepMe > conftest.dir/file
9121fc27e79cSmrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9122fc27e79cSmrg  rm -rf conftest.dir
9123fc27e79cSmrg  if test -s conftest.tar; then
9124fc27e79cSmrg    AM_RUN_LOG([$am__untar <conftest.tar])
9125fc27e79cSmrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9126fc27e79cSmrg  fi
9127fc27e79cSmrgdone
9128fc27e79cSmrgrm -rf conftest.dir
9129659607e0Smrg
9130fc27e79cSmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9131fc27e79cSmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
9132fc27e79cSmrgAC_SUBST([am__tar])
9133fc27e79cSmrgAC_SUBST([am__untar])
9134fc27e79cSmrg]) # _AM_PROG_TAR
91356aab59a7Smrg
9136fc27e79cSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9137fc27e79cSmrgdnl
9138fc27e79cSmrgdnl Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
9139fc27e79cSmrgdnl 
9140fc27e79cSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9141fc27e79cSmrgdnl copy of this software and associated documentation files (the
9142fc27e79cSmrgdnl "Software"), to deal in the Software without restriction, including
9143fc27e79cSmrgdnl without limitation the rights to use, copy, modify, merge, publish,
9144fc27e79cSmrgdnl distribute, and/or sell copies of the Software, and to permit persons
9145fc27e79cSmrgdnl to whom the Software is furnished to do so, provided that the above
9146fc27e79cSmrgdnl copyright notice(s) and this permission notice appear in all copies of
9147fc27e79cSmrgdnl the Software and that both the above copyright notice(s) and this
9148fc27e79cSmrgdnl permission notice appear in supporting documentation.
9149fc27e79cSmrgdnl
9150fc27e79cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9151fc27e79cSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9152fc27e79cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
9153fc27e79cSmrgdnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
9154fc27e79cSmrgdnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
9155fc27e79cSmrgdnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
9156fc27e79cSmrgdnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
9157fc27e79cSmrgdnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
9158fc27e79cSmrgdnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
9159fc27e79cSmrgdnl
9160fc27e79cSmrgdnl Except as contained in this notice, the name of a copyright holder
9161fc27e79cSmrgdnl shall not be used in advertising or otherwise to promote the sale, use
9162fc27e79cSmrgdnl or other dealings in this Software without prior written authorization
9163fc27e79cSmrgdnl of the copyright holder.
9164659607e0Smrg
9165fc27e79cSmrg# XORG_MACROS_VERSION(required-version)
9166fc27e79cSmrg# -------------------------------------
9167fc27e79cSmrg# Minimum version: 1.1.0
9168fc27e79cSmrg#
9169fc27e79cSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9170fc27e79cSmrg# your configure.ac with the minimum required version, such as:
9171fc27e79cSmrg# XORG_MACROS_VERSION(1.1)
9172fc27e79cSmrg#
9173fc27e79cSmrg# To ensure that this macro is defined, also add:
9174fc27e79cSmrg# m4_ifndef([XORG_MACROS_VERSION],
9175fc27e79cSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9176fc27e79cSmrg#
9177fc27e79cSmrg#
9178fc27e79cSmrg# See the "minimum version" comment for each macro you use to see what 
9179fc27e79cSmrg# version you require.
9180fc27e79cSmrgm4_defun([XORG_MACROS_VERSION],[
9181fc27e79cSmrgm4_define([vers_have], [1.3.0])
9182fc27e79cSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9183fc27e79cSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9184fc27e79cSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9185fc27e79cSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9186fc27e79cSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9187fc27e79cSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9188fc27e79cSmrgm4_undefine([vers_have])
9189fc27e79cSmrgm4_undefine([maj_have])
9190fc27e79cSmrgm4_undefine([maj_needed])
9191fc27e79cSmrg]) # XORG_MACROS_VERSION
9192659607e0Smrg
9193fc27e79cSmrg# XORG_PROG_RAWCPP()
9194fc27e79cSmrg# ------------------
9195fc27e79cSmrg# Minimum version: 1.0.0
9196fc27e79cSmrg#
9197fc27e79cSmrg# Find cpp program and necessary flags for use in pre-processing text files
9198fc27e79cSmrg# such as man pages and config files
9199fc27e79cSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9200fc27e79cSmrgAC_REQUIRE([AC_PROG_CPP])
9201fc27e79cSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
9202fc27e79cSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9203659607e0Smrg
9204fc27e79cSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9205fc27e79cSmrg# which is not the best choice for supporting other OS'es, but covers most
9206fc27e79cSmrg# of the ones we need for now.
9207fc27e79cSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9208fc27e79cSmrgAC_LANG_CONFTEST([Does cpp redefine unix ?])
9209fc27e79cSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9210fc27e79cSmrg	AC_MSG_RESULT([no])
9211fc27e79cSmrgelse
9212fc27e79cSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9213fc27e79cSmrg		RAWCPPFLAGS=-undef
9214fc27e79cSmrg		AC_MSG_RESULT([yes])
9215fc27e79cSmrg	# under Cygwin unix is still defined even with -undef
9216fc27e79cSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9217fc27e79cSmrg		RAWCPPFLAGS="-undef -ansi"
9218fc27e79cSmrg		AC_MSG_RESULT([yes, with -ansi])
9219fc27e79cSmrg	else
9220fc27e79cSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9221fc27e79cSmrg	fi
9222fc27e79cSmrgfi
9223fc27e79cSmrgrm -f conftest.$ac_ext
9224fc27e79cSmrg
9225fc27e79cSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9226fc27e79cSmrgAC_LANG_CONFTEST([Does cpp preserve   "whitespace"?])
9227fc27e79cSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9228fc27e79cSmrg	AC_MSG_RESULT([no])
9229fc27e79cSmrgelse
9230fc27e79cSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9231fc27e79cSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9232fc27e79cSmrg		AC_MSG_RESULT([yes])
9233fc27e79cSmrg	else
9234fc27e79cSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9235fc27e79cSmrg	fi
9236fc27e79cSmrgfi
9237fc27e79cSmrgrm -f conftest.$ac_ext
9238fc27e79cSmrgAC_SUBST(RAWCPPFLAGS)
9239fc27e79cSmrg]) # XORG_PROG_RAWCPP
9240659607e0Smrg
9241fc27e79cSmrg# XORG_MANPAGE_SECTIONS()
9242fc27e79cSmrg# -----------------------
9243fc27e79cSmrg# Minimum version: 1.0.0
9244fc27e79cSmrg#
9245fc27e79cSmrg# Determine which sections man pages go in for the different man page types
9246fc27e79cSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9247fc27e79cSmrg# Not sure if there's any better way than just hardcoding by OS name.
9248fc27e79cSmrg# Override default settings by setting environment variables
9249659607e0Smrg
9250fc27e79cSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9251fc27e79cSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9252659607e0Smrg
9253fc27e79cSmrgif test x$APP_MAN_SUFFIX = x    ; then
9254fc27e79cSmrg    APP_MAN_SUFFIX=1
9255fc27e79cSmrgfi
9256fc27e79cSmrgif test x$APP_MAN_DIR = x    ; then
9257fc27e79cSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9258fc27e79cSmrgfi
9259659607e0Smrg
9260fc27e79cSmrgif test x$LIB_MAN_SUFFIX = x    ; then
9261fc27e79cSmrg    LIB_MAN_SUFFIX=3
9262fc27e79cSmrgfi
9263fc27e79cSmrgif test x$LIB_MAN_DIR = x    ; then
9264fc27e79cSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9265fc27e79cSmrgfi
9266659607e0Smrg
9267fc27e79cSmrgif test x$FILE_MAN_SUFFIX = x    ; then
9268fc27e79cSmrg    case $host_os in
9269fc27e79cSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9270fc27e79cSmrg	*)		FILE_MAN_SUFFIX=5  ;;
9271fc27e79cSmrg    esac
9272fc27e79cSmrgfi
9273fc27e79cSmrgif test x$FILE_MAN_DIR = x    ; then
9274fc27e79cSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9275fc27e79cSmrgfi
9276659607e0Smrg
9277fc27e79cSmrgif test x$MISC_MAN_SUFFIX = x    ; then
9278fc27e79cSmrg    case $host_os in
9279fc27e79cSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9280fc27e79cSmrg	*)		MISC_MAN_SUFFIX=7  ;;
9281fc27e79cSmrg    esac
9282fc27e79cSmrgfi
9283fc27e79cSmrgif test x$MISC_MAN_DIR = x    ; then
9284fc27e79cSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9285fc27e79cSmrgfi
9286659607e0Smrg
9287fc27e79cSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9288fc27e79cSmrg    case $host_os in
9289fc27e79cSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9290fc27e79cSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9291fc27e79cSmrg    esac
9292fc27e79cSmrgfi
9293fc27e79cSmrgif test x$DRIVER_MAN_DIR = x    ; then
9294fc27e79cSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9295fc27e79cSmrgfi
9296659607e0Smrg
9297fc27e79cSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9298fc27e79cSmrg    case $host_os in
9299fc27e79cSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9300fc27e79cSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9301fc27e79cSmrg    esac
9302fc27e79cSmrgfi
9303fc27e79cSmrgif test x$ADMIN_MAN_DIR = x    ; then
9304fc27e79cSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9305fc27e79cSmrgfi
9306659607e0Smrg
9307659607e0Smrg
9308fc27e79cSmrgAC_SUBST([APP_MAN_SUFFIX])
9309fc27e79cSmrgAC_SUBST([LIB_MAN_SUFFIX])
9310fc27e79cSmrgAC_SUBST([FILE_MAN_SUFFIX])
9311fc27e79cSmrgAC_SUBST([MISC_MAN_SUFFIX])
9312fc27e79cSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9313fc27e79cSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9314fc27e79cSmrgAC_SUBST([APP_MAN_DIR])
9315fc27e79cSmrgAC_SUBST([LIB_MAN_DIR])
9316fc27e79cSmrgAC_SUBST([FILE_MAN_DIR])
9317fc27e79cSmrgAC_SUBST([MISC_MAN_DIR])
9318fc27e79cSmrgAC_SUBST([DRIVER_MAN_DIR])
9319fc27e79cSmrgAC_SUBST([ADMIN_MAN_DIR])
9320fc27e79cSmrg]) # XORG_MANPAGE_SECTIONS
9321659607e0Smrg
9322fc27e79cSmrg# XORG_CHECK_LINUXDOC
9323fc27e79cSmrg# -------------------
9324fc27e79cSmrg# Minimum version: 1.0.0
9325fc27e79cSmrg#
9326fc27e79cSmrg# Defines the variable MAKE_TEXT if the necessary tools and
9327fc27e79cSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9328fc27e79cSmrg# Whether or not the necessary tools and files are found can be checked
9329fc27e79cSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9330fc27e79cSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9331fc27e79cSmrgif test x$XORG_SGML_PATH = x ; then
9332fc27e79cSmrg    XORG_SGML_PATH=$prefix/share/sgml
9333fc27e79cSmrgfi
9334fc27e79cSmrgHAVE_DEFS_ENT=
9335659607e0Smrg
9336fc27e79cSmrgif test x"$cross_compiling" = x"yes" ; then
9337fc27e79cSmrg  HAVE_DEFS_ENT=no
9338fc27e79cSmrgelse
9339fc27e79cSmrg  AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9340fc27e79cSmrgfi
9341659607e0Smrg
9342fc27e79cSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9343fc27e79cSmrgAC_PATH_PROG(PS2PDF, ps2pdf)
9344659607e0Smrg
9345fc27e79cSmrgAC_MSG_CHECKING([Whether to build documentation])
9346659607e0Smrg
9347fc27e79cSmrgif test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
9348fc27e79cSmrg   BUILDDOC=yes
9349fc27e79cSmrgelse
9350fc27e79cSmrg   BUILDDOC=no
9351fc27e79cSmrgfi
9352659607e0Smrg
9353fc27e79cSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9354659607e0Smrg
9355fc27e79cSmrgAC_MSG_RESULT([$BUILDDOC])
9356659607e0Smrg
9357fc27e79cSmrgAC_MSG_CHECKING([Whether to build pdf documentation])
9358659607e0Smrg
9359fc27e79cSmrgif test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
9360fc27e79cSmrg   BUILDPDFDOC=yes
9361fc27e79cSmrgelse
9362fc27e79cSmrg   BUILDPDFDOC=no
9363fc27e79cSmrgfi
9364659607e0Smrg
9365fc27e79cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9366659607e0Smrg
9367fc27e79cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9368659607e0Smrg
9369fc27e79cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
9370fc27e79cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9371fc27e79cSmrgMAKE_PDF="$PS2PDF"
9372fc27e79cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9373659607e0Smrg
9374fc27e79cSmrgAC_SUBST(MAKE_TEXT)
9375fc27e79cSmrgAC_SUBST(MAKE_PS)
9376fc27e79cSmrgAC_SUBST(MAKE_PDF)
9377fc27e79cSmrgAC_SUBST(MAKE_HTML)
9378fc27e79cSmrg]) # XORG_CHECK_LINUXDOC
9379659607e0Smrg
9380fc27e79cSmrg# XORG_CHECK_DOCBOOK
9381fc27e79cSmrg# -------------------
9382fc27e79cSmrg# Minimum version: 1.0.0
9383fc27e79cSmrg#
9384fc27e79cSmrg# Checks for the ability to build output formats from SGML DocBook source.
9385fc27e79cSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9386fc27e79cSmrg# indicates whether the necessary tools and files are found and, if set,
9387fc27e79cSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9388fc27e79cSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9389fc27e79cSmrgif test x$XORG_SGML_PATH = x ; then
9390fc27e79cSmrg    XORG_SGML_PATH=$prefix/share/sgml
9391fc27e79cSmrgfi
9392fc27e79cSmrgHAVE_DEFS_ENT=
9393fc27e79cSmrgBUILDTXTDOC=no
9394fc27e79cSmrgBUILDPDFDOC=no
9395fc27e79cSmrgBUILDPSDOC=no
9396fc27e79cSmrgBUILDHTMLDOC=no
9397659607e0Smrg
9398fc27e79cSmrgAC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
9399659607e0Smrg
9400fc27e79cSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9401fc27e79cSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9402fc27e79cSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9403fc27e79cSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9404659607e0Smrg
9405fc27e79cSmrgAC_MSG_CHECKING([Whether to build text documentation])
9406fc27e79cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
9407fc27e79cSmrg   test x$BUILD_TXTDOC != xno; then
9408fc27e79cSmrg	BUILDTXTDOC=yes
9409fc27e79cSmrgfi
9410fc27e79cSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9411fc27e79cSmrgAC_MSG_RESULT([$BUILDTXTDOC])
9412659607e0Smrg
9413fc27e79cSmrgAC_MSG_CHECKING([Whether to build PDF documentation])
9414fc27e79cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
9415fc27e79cSmrg   test x$BUILD_PDFDOC != xno; then
9416fc27e79cSmrg	BUILDPDFDOC=yes
9417fc27e79cSmrgfi
9418fc27e79cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9419fc27e79cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9420659607e0Smrg
9421fc27e79cSmrgAC_MSG_CHECKING([Whether to build PostScript documentation])
9422fc27e79cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
9423fc27e79cSmrg   test x$BUILD_PSDOC != xno; then
9424fc27e79cSmrg	BUILDPSDOC=yes
9425fc27e79cSmrgfi
9426fc27e79cSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9427fc27e79cSmrgAC_MSG_RESULT([$BUILDPSDOC])
9428659607e0Smrg
9429fc27e79cSmrgAC_MSG_CHECKING([Whether to build HTML documentation])
9430fc27e79cSmrgif test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
9431fc27e79cSmrg   test x$BUILD_HTMLDOC != xno; then
9432fc27e79cSmrg	BUILDHTMLDOC=yes
9433fc27e79cSmrgfi
9434fc27e79cSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9435fc27e79cSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
94366aab59a7Smrg
9437fc27e79cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9438fc27e79cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9439fc27e79cSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9440fc27e79cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9441659607e0Smrg
9442fc27e79cSmrgAC_SUBST(MAKE_TEXT)
9443fc27e79cSmrgAC_SUBST(MAKE_PS)
9444fc27e79cSmrgAC_SUBST(MAKE_PDF)
9445fc27e79cSmrgAC_SUBST(MAKE_HTML)
9446fc27e79cSmrg]) # XORG_CHECK_DOCBOOK
9447659607e0Smrg
9448fc27e79cSmrg# XORG_CHECK_MALLOC_ZERO
9449fc27e79cSmrg# ----------------------
9450fc27e79cSmrg# Minimum version: 1.0.0
94516aab59a7Smrg#
9452fc27e79cSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
9453fc27e79cSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
9454fc27e79cSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
9455fc27e79cSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
9456fc27e79cSmrgAC_ARG_ENABLE(malloc0returnsnull,
9457fc27e79cSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
9458fc27e79cSmrg		       [malloc(0) returns NULL (default: auto)]),
9459fc27e79cSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
9460fc27e79cSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
9461659607e0Smrg
9462fc27e79cSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
9463fc27e79cSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
9464fc27e79cSmrg	AC_RUN_IFELSE([
9465fc27e79cSmrgchar *malloc();
9466fc27e79cSmrgchar *realloc();
9467fc27e79cSmrgchar *calloc();
9468fc27e79cSmrgmain() {
9469fc27e79cSmrg    char *m0, *r0, *c0, *p;
9470fc27e79cSmrg    m0 = malloc(0);
9471fc27e79cSmrg    p = malloc(10);
9472fc27e79cSmrg    r0 = realloc(p,0);
9473fc27e79cSmrg    c0 = calloc(0);
9474fc27e79cSmrg    exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
9475fc27e79cSmrg}],
9476fc27e79cSmrg		[MALLOC_ZERO_RETURNS_NULL=yes],
9477fc27e79cSmrg		[MALLOC_ZERO_RETURNS_NULL=no])
9478fc27e79cSmrgfi
9479fc27e79cSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
9480659607e0Smrg
9481fc27e79cSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
9482fc27e79cSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
9483fc27e79cSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
9484fc27e79cSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
9485fc27e79cSmrgelse
9486fc27e79cSmrg	MALLOC_ZERO_CFLAGS=""
9487fc27e79cSmrg	XMALLOC_ZERO_CFLAGS=""
9488fc27e79cSmrg	XTMALLOC_ZERO_CFLAGS=""
9489fc27e79cSmrgfi
9490659607e0Smrg
9491fc27e79cSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
9492fc27e79cSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
9493fc27e79cSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
9494fc27e79cSmrg]) # XORG_CHECK_MALLOC_ZERO
9495659607e0Smrg
9496fc27e79cSmrg# XORG_WITH_LINT()
9497fc27e79cSmrg# ----------------
9498fc27e79cSmrg# Minimum version: 1.1.0
9499fc27e79cSmrg#
9500fc27e79cSmrg# Sets up flags for source checkers such as lint and sparse if --with-lint
9501fc27e79cSmrg# is specified.   (Use --with-lint=sparse for sparse.)
9502fc27e79cSmrg# Sets $LINT to name of source checker passed with --with-lint (default: lint)
9503fc27e79cSmrg# Sets $LINT_FLAGS to flags to pass to source checker
9504fc27e79cSmrg# Sets LINT automake conditional if enabled (default: disabled)
9505fc27e79cSmrg#
9506fc27e79cSmrgAC_DEFUN([XORG_WITH_LINT],[
9507659607e0Smrg
9508fc27e79cSmrg# Allow checking code with lint, sparse, etc.
9509fc27e79cSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
9510fc27e79cSmrg		[Use a lint-style source code checker (default: disabled)])],
9511fc27e79cSmrg		[use_lint=$withval], [use_lint=no])
9512fc27e79cSmrgif test "x$use_lint" = "xyes" ; then
9513fc27e79cSmrg	LINT="lint"
9514fc27e79cSmrgelse
9515fc27e79cSmrg	LINT="$use_lint"
9516fc27e79cSmrgfi
9517fc27e79cSmrgif test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
9518fc27e79cSmrg    case $LINT in
9519fc27e79cSmrg	lint|*/lint)
9520fc27e79cSmrg	    case $host_os in
9521fc27e79cSmrg		solaris*)
9522fc27e79cSmrg			LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
9523fc27e79cSmrg			;;
9524fc27e79cSmrg	    esac
9525fc27e79cSmrg	    ;;
9526fc27e79cSmrg    esac
9527fc27e79cSmrgfi
9528659607e0Smrg
9529fc27e79cSmrgAC_SUBST(LINT)
9530fc27e79cSmrgAC_SUBST(LINT_FLAGS)
9531fc27e79cSmrgAM_CONDITIONAL(LINT, [test x$LINT != xno])
95326aab59a7Smrg
9533fc27e79cSmrg]) # XORG_WITH_LINT
95346aab59a7Smrg
9535fc27e79cSmrg# XORG_LINT_LIBRARY(LIBNAME)
9536fc27e79cSmrg# --------------------------
9537fc27e79cSmrg# Minimum version: 1.1.0
95386aab59a7Smrg#
9539fc27e79cSmrg# Sets up flags for building lint libraries for checking programs that call
9540fc27e79cSmrg# functions in the library.
9541fc27e79cSmrg# Disabled by default, enable with --enable-lint-library
9542fc27e79cSmrg# Sets: 
9543fc27e79cSmrg#	@LINTLIB@		- name of lint library file to make
9544fc27e79cSmrg#	MAKE_LINT_LIB		- automake conditional
9545659607e0Smrg#
9546659607e0Smrg
9547fc27e79cSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
9548fc27e79cSmrgAC_REQUIRE([XORG_WITH_LINT])
9549fc27e79cSmrg# Build lint "library" for more indepth checks of programs calling this library
9550fc27e79cSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
9551fc27e79cSmrg	[Create lint library (default: disabled)])],
9552fc27e79cSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
9553fc27e79cSmrgif test "x$make_lint_lib" != "xno" ; then
9554fc27e79cSmrg	if test "x$LINT" = "xno" ; then
9555fc27e79cSmrg		AC_MSG_ERROR([Cannot make lint library without --with-lint])
9556fc27e79cSmrg	fi
9557fc27e79cSmrg	if test "x$make_lint_lib" = "xyes" ; then
9558fc27e79cSmrg		LINTLIB=llib-l$1.ln
95596aab59a7Smrg	else
9560fc27e79cSmrg		LINTLIB=$make_lint_lib
95616aab59a7Smrg	fi
9562fc27e79cSmrgfi
9563fc27e79cSmrgAC_SUBST(LINTLIB)
9564fc27e79cSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
9565659607e0Smrg
9566fc27e79cSmrg]) # XORG_LINT_LIBRARY
9567fc27e79cSmrg
9568fc27e79cSmrg# XORG_CWARNFLAGS
9569fc27e79cSmrg# ---------------
9570fc27e79cSmrg# Minimum version: 1.2.0
95716aab59a7Smrg#
9572fc27e79cSmrg# Defines CWARNFLAGS to enable C compiler warnings.
95736aab59a7Smrg#
9574fc27e79cSmrgAC_DEFUN([XORG_CWARNFLAGS], [
9575fc27e79cSmrgAC_REQUIRE([AC_PROG_CC])
9576fc27e79cSmrgif  test "x$GCC" = xyes ; then
9577fc27e79cSmrg    CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
9578fc27e79cSmrg-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
9579fc27e79cSmrg-Wbad-function-cast"
9580fc27e79cSmrg    case `$CC -dumpversion` in
9581fc27e79cSmrg    3.4.* | 4.*)
9582fc27e79cSmrg	CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
9583fc27e79cSmrg	;;
9584fc27e79cSmrg    esac
9585659607e0Smrgelse
9586fc27e79cSmrg    AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9587fc27e79cSmrg    if test "x$SUNCC" = "xyes"; then
9588fc27e79cSmrg	CWARNFLAGS="-v"
9589fc27e79cSmrg    fi
9590fc27e79cSmrgfi
9591fc27e79cSmrgAC_SUBST(CWARNFLAGS)
9592fc27e79cSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9593fc27e79cSmrg]) # XORG_CWARNFLAGS
9594659607e0Smrg
9595fc27e79cSmrg# XORG_STRICT_OPTION
9596fc27e79cSmrg# -----------------------
9597fc27e79cSmrg# Minimum version: 1.3.0
9598659607e0Smrg#
9599fc27e79cSmrg# Add configure option to enable strict compilation
9600fc27e79cSmrgAC_DEFUN([XORG_STRICT_OPTION], [
9601fc27e79cSmrgAC_REQUIRE([AC_PROG_CC])
9602fc27e79cSmrgAC_REQUIRE([AC_PROG_CC_C99])
9603fc27e79cSmrgAC_REQUIRE([XORG_CWARNFLAGS])
9604fc27e79cSmrg
9605fc27e79cSmrgAC_ARG_ENABLE(strict-compilation,
9606fc27e79cSmrg			  AS_HELP_STRING([--enable-strict-compilation],
9607fc27e79cSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
9608fc27e79cSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
9609fc27e79cSmrgif test "x$STRICT_COMPILE" = "xyes"; then
9610fc27e79cSmrg	AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
9611fc27e79cSmrg	AC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
9612fc27e79cSmrg	if test "x$GCC" = xyes ; then
9613fc27e79cSmrg		STRICT_CFLAGS="-pedantic -Werror"
9614fc27e79cSmrg	elif test "x$SUNCC" = "xyes"; then
9615fc27e79cSmrg		STRICT_CFLAGS="-errwarn"
9616fc27e79cSmrg    elif test "x$INTELCC" = "xyes"; then
9617fc27e79cSmrg		STRICT_CFLAGS="-Werror"
9618fc27e79cSmrg	fi
9619fc27e79cSmrgfi
9620fc27e79cSmrgCWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
9621fc27e79cSmrgAC_SUBST([CWARNFLAGS])
9622fc27e79cSmrg]) # XORG_STRICT_OPTION
9623fc27e79cSmrg
9624fc27e79cSmrg# XORG_DEFAULT_OPTIONS
9625fc27e79cSmrg# --------------------
9626fc27e79cSmrg# Minimum version: 1.3.0
96276aab59a7Smrg#
9628fc27e79cSmrg# Defines default options for X.Org modules.
96296aab59a7Smrg#
9630fc27e79cSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
9631fc27e79cSmrgXORG_CWARNFLAGS
9632fc27e79cSmrgXORG_STRICT_OPTION
9633fc27e79cSmrgXORG_RELEASE_VERSION
9634fc27e79cSmrgXORG_CHANGELOG
9635fc27e79cSmrgXORG_MANPAGE_SECTIONS
9636fc27e79cSmrg]) # XORG_DEFAULT_OPTIONS
9637fc27e79cSmrgdnl Copyright 2005 Red Hat, Inc
9638fc27e79cSmrgdnl
9639fc27e79cSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9640fc27e79cSmrgdnl documentation for any purpose is hereby granted without fee, provided that
9641fc27e79cSmrgdnl the above copyright notice appear in all copies and that both that
9642fc27e79cSmrgdnl copyright notice and this permission notice appear in supporting
9643fc27e79cSmrgdnl documentation.
9644fc27e79cSmrgdnl
9645fc27e79cSmrgdnl The above copyright notice and this permission notice shall be included
9646fc27e79cSmrgdnl in all copies or substantial portions of the Software.
9647fc27e79cSmrgdnl
9648fc27e79cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9649fc27e79cSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9650fc27e79cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9651fc27e79cSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9652fc27e79cSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9653fc27e79cSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9654fc27e79cSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
9655fc27e79cSmrgdnl
9656fc27e79cSmrgdnl Except as contained in this notice, the name of the copyright holders shall
9657fc27e79cSmrgdnl not be used in advertising or otherwise to promote the sale, use or
9658fc27e79cSmrgdnl other dealings in this Software without prior written authorization
9659fc27e79cSmrgdnl from the copyright holders.
9660fc27e79cSmrgdnl
9661659607e0Smrg
9662fc27e79cSmrg# XORG_RELEASE_VERSION
9663fc27e79cSmrg# --------------------
9664fc27e79cSmrg# Adds --with/without-release-string and changes the PACKAGE and
9665fc27e79cSmrg# PACKAGE_TARNAME to use "$PACKAGE{_TARNAME}-$RELEASE_VERSION".  If
9666fc27e79cSmrg# no option is given, PACKAGE and PACKAGE_TARNAME are unchanged.  Also
9667fc27e79cSmrg# defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
9668fc27e79cSmrg 
9669fc27e79cSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
9670fc27e79cSmrg	AC_ARG_WITH(release-version,
9671fc27e79cSmrg			AS_HELP_STRING([--with-release-version=STRING],
9672fc27e79cSmrg				[Use release version string in package name]),
9673fc27e79cSmrg			[RELEASE_VERSION="$withval"],
9674fc27e79cSmrg			[RELEASE_VERSION=""])
9675fc27e79cSmrg	if test "x$RELEASE_VERSION" != "x"; then
9676fc27e79cSmrg		PACKAGE="$PACKAGE-$RELEASE_VERSION"
9677fc27e79cSmrg		PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
9678fc27e79cSmrg		AC_MSG_NOTICE([Building with package name set to $PACKAGE])
9679fc27e79cSmrg	fi
9680fc27e79cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
9681fc27e79cSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
9682fc27e79cSmrg		[Major version of this package])
9683fc27e79cSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
9684fc27e79cSmrg	if test "x$PVM" = "x"; then
9685fc27e79cSmrg		PVM="0"
9686fc27e79cSmrg	fi
9687fc27e79cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
9688fc27e79cSmrg		[$PVM],
9689fc27e79cSmrg		[Minor version of this package])
9690fc27e79cSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
9691fc27e79cSmrg	if test "x$PVP" = "x"; then
9692fc27e79cSmrg		PVP="0"
9693fc27e79cSmrg	fi
9694fc27e79cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
9695fc27e79cSmrg		[$PVP],
9696fc27e79cSmrg		[Patch version of this package])
9697fc27e79cSmrg])
9698659607e0Smrg
9699fc27e79cSmrg# XORG_CHANGELOG()
9700fc27e79cSmrg# ----------------
9701fc27e79cSmrg# Minimum version: 1.2.0
9702fc27e79cSmrg#
9703fc27e79cSmrg# Defines the variable CHANGELOG_CMD as the command to generate
9704fc27e79cSmrg# ChangeLog from git.
9705fc27e79cSmrg#
9706fc27e79cSmrg# Arrange that distcleancheck ignores ChangeLog left over by distclean.
9707fc27e79cSmrg#
9708fc27e79cSmrgAC_DEFUN([XORG_CHANGELOG], [
9709fc27e79cSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
9710fc27e79cSmrgmv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
9711fc27e79cSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
9712fc27e79cSmrgAC_SUBST([CHANGELOG_CMD])
9713fc27e79cSmrgAC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
9714fc27e79cSmrg]) # XORG_CHANGELOG
9715659607e0Smrg
9716fc27e79cSmrgdnl Copyright 2005 Red Hat, Inc
9717fc27e79cSmrgdnl 
9718fc27e79cSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
9719fc27e79cSmrgdnl documentation for any purpose is hereby granted without fee, provided that
9720fc27e79cSmrgdnl the above copyright notice appear in all copies and that both that
9721fc27e79cSmrgdnl copyright notice and this permission notice appear in supporting
9722fc27e79cSmrgdnl documentation.
9723fc27e79cSmrgdnl 
9724fc27e79cSmrgdnl The above copyright notice and this permission notice shall be included
9725fc27e79cSmrgdnl in all copies or substantial portions of the Software.
9726fc27e79cSmrgdnl 
9727fc27e79cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
9728fc27e79cSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
9729fc27e79cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
9730fc27e79cSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
9731fc27e79cSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
9732fc27e79cSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
9733fc27e79cSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
9734fc27e79cSmrgdnl 
9735fc27e79cSmrgdnl Except as contained in this notice, the name of the copyright holders shall
9736fc27e79cSmrgdnl not be used in advertising or otherwise to promote the sale, use or
9737fc27e79cSmrgdnl other dealings in this Software without prior written authorization
9738fc27e79cSmrgdnl from the copyright holders.
9739fc27e79cSmrgdnl 
9740659607e0Smrg
9741fc27e79cSmrg# XORG_DRIVER_CHECK_EXT()
9742fc27e79cSmrg# --------------------------
9743fc27e79cSmrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
9744fc27e79cSmrg# is defined, then add $1 to $REQUIRED_MODULES.
9745659607e0Smrg
9746fc27e79cSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
9747fc27e79cSmrg	SAVE_CFLAGS="$CFLAGS"
9748fc27e79cSmrg	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
9749fc27e79cSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
9750fc27e79cSmrg#include "xorg-server.h"
9751fc27e79cSmrg#if !defined $1
9752fc27e79cSmrg#error $1 not defined
9753fc27e79cSmrg#endif
9754fc27e79cSmrg		]])],
9755fc27e79cSmrg		[_EXT_CHECK=yes],
9756fc27e79cSmrg		[_EXT_CHECK=no])
9757fc27e79cSmrg	CFLAGS="$SAVE_CFLAGS"
9758fc27e79cSmrg	AC_MSG_CHECKING([if $1 is defined])
9759fc27e79cSmrg	AC_MSG_RESULT([$_EXT_CHECK])
9760fc27e79cSmrg	if test "$_EXT_CHECK" != no; then
9761fc27e79cSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
9762fc27e79cSmrg	fi
9763fc27e79cSmrg])
9764659607e0Smrg
9765