aclocal.m4 revision 0bb88ba4
10bb88ba4Smrg# generated automatically by aclocal 1.11.3 -*- Autoconf -*-
2fe5e51b7Smrg
3fe5e51b7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
40bb88ba4Smrg# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
50bb88ba4Smrg# Inc.
6fe5e51b7Smrg# This file is free software; the Free Software Foundation
7fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
8fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
9fe5e51b7Smrg
10fe5e51b7Smrg# This program is distributed in the hope that it will be useful,
11fe5e51b7Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
12fe5e51b7Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13fe5e51b7Smrg# PARTICULAR PURPOSE.
14fe5e51b7Smrg
15eda3803bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16eda3803bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
170bb88ba4Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
180bb88ba4Smrg[m4_warning([this file was generated for autoconf 2.68.
19eda3803bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20eda3803bSmrgIf you have problems, you may need to regenerate the build system entirely.
21eda3803bSmrgTo do so, use the procedure documented by the package, typically `autoreconf'.])])
22fe5e51b7Smrg
23fe5e51b7Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24a31a186aSmrg#
25a31a186aSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
260bb88ba4Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
270bb88ba4Smrg#                 Foundation, Inc.
28a31a186aSmrg#   Written by Gordon Matzigkeit, 1996
29a31a186aSmrg#
30a31a186aSmrg# This file is free software; the Free Software Foundation gives
31a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
32a31a186aSmrg# modifications, as long as this notice is preserved.
33a31a186aSmrg
34a31a186aSmrgm4_define([_LT_COPYING], [dnl
35a31a186aSmrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
360bb88ba4Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
370bb88ba4Smrg#                 Foundation, Inc.
38a31a186aSmrg#   Written by Gordon Matzigkeit, 1996
39a31a186aSmrg#
40a31a186aSmrg#   This file is part of GNU Libtool.
41a31a186aSmrg#
42a31a186aSmrg# GNU Libtool is free software; you can redistribute it and/or
43a31a186aSmrg# modify it under the terms of the GNU General Public License as
44a31a186aSmrg# published by the Free Software Foundation; either version 2 of
45a31a186aSmrg# the License, or (at your option) any later version.
46a31a186aSmrg#
47a31a186aSmrg# As a special exception to the GNU General Public License,
48a31a186aSmrg# if you distribute this file as part of a program or library that
49a31a186aSmrg# is built using GNU Libtool, you may include this file under the
50a31a186aSmrg# same distribution terms that you use for the rest of that program.
51a31a186aSmrg#
52a31a186aSmrg# GNU Libtool is distributed in the hope that it will be useful,
53a31a186aSmrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
54a31a186aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
55a31a186aSmrg# GNU General Public License for more details.
56a31a186aSmrg#
57a31a186aSmrg# You should have received a copy of the GNU General Public License
58a31a186aSmrg# along with GNU Libtool; see the file COPYING.  If not, a copy
59a31a186aSmrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60a31a186aSmrg# obtained by writing to the Free Software Foundation, Inc.,
61a31a186aSmrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62a31a186aSmrg])
63fe5e51b7Smrg
640bb88ba4Smrg# serial 57 LT_INIT
65fe5e51b7Smrg
66fe5e51b7Smrg
67a31a186aSmrg# LT_PREREQ(VERSION)
68a31a186aSmrg# ------------------
69a31a186aSmrg# Complain and exit if this libtool version is less that VERSION.
70a31a186aSmrgm4_defun([LT_PREREQ],
71a31a186aSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72a31a186aSmrg       [m4_default([$3],
73a31a186aSmrg		   [m4_fatal([Libtool version $1 or higher is required],
74a31a186aSmrg		             63)])],
75a31a186aSmrg       [$2])])
76eda3803bSmrg
77eda3803bSmrg
78a31a186aSmrg# _LT_CHECK_BUILDDIR
79a31a186aSmrg# ------------------
80a31a186aSmrg# Complain if the absolute build directory name contains unusual characters
81a31a186aSmrgm4_defun([_LT_CHECK_BUILDDIR],
82a31a186aSmrg[case `pwd` in
83a31a186aSmrg  *\ * | *\	*)
84a31a186aSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85a31a186aSmrgesac
86a31a186aSmrg])
87a31a186aSmrg
88a31a186aSmrg
89a31a186aSmrg# LT_INIT([OPTIONS])
90a31a186aSmrg# ------------------
91a31a186aSmrgAC_DEFUN([LT_INIT],
92a31a186aSmrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
930bb88ba4SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94a31a186aSmrgAC_BEFORE([$0], [LT_LANG])dnl
95a31a186aSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
96a31a186aSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
97a31a186aSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
98a31a186aSmrg
99a31a186aSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
100a31a186aSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101a31a186aSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102a31a186aSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103a31a186aSmrgdnl unless we require an AC_DEFUNed macro:
104a31a186aSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
105a31a186aSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
106a31a186aSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
107a31a186aSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
108a31a186aSmrgm4_require([_LT_PROG_LTMAIN])dnl
109a31a186aSmrg
1100bb88ba4Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1110bb88ba4Smrg
112a31a186aSmrgdnl Parse OPTIONS
113a31a186aSmrg_LT_SET_OPTIONS([$0], [$1])
114fe5e51b7Smrg
115fe5e51b7Smrg# This can be used to rebuild libtool when needed
116a31a186aSmrgLIBTOOL_DEPS="$ltmain"
117fe5e51b7Smrg
118fe5e51b7Smrg# Always use our own libtool.
119fe5e51b7SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
120fe5e51b7SmrgAC_SUBST(LIBTOOL)dnl
121fe5e51b7Smrg
122a31a186aSmrg_LT_SETUP
123eda3803bSmrg
124a31a186aSmrg# Only expand once:
125a31a186aSmrgm4_define([LT_INIT])
126a31a186aSmrg])# LT_INIT
127eda3803bSmrg
128a31a186aSmrg# Old names:
129a31a186aSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130a31a186aSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
132a31a186aSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133a31a186aSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134a31a186aSmrg
135a31a186aSmrg
136a31a186aSmrg# _LT_CC_BASENAME(CC)
137a31a186aSmrg# -------------------
138a31a186aSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
139a31a186aSmrgm4_defun([_LT_CC_BASENAME],
140a31a186aSmrg[for cc_temp in $1""; do
141a31a186aSmrg  case $cc_temp in
142a31a186aSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143a31a186aSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144a31a186aSmrg    \-*) ;;
145a31a186aSmrg    *) break;;
146a31a186aSmrg  esac
147a31a186aSmrgdone
1480bb88ba4Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149a31a186aSmrg])
150a31a186aSmrg
151a31a186aSmrg
152a31a186aSmrg# _LT_FILEUTILS_DEFAULTS
153a31a186aSmrg# ----------------------
154a31a186aSmrg# It is okay to use these file commands and assume they have been set
155a31a186aSmrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156a31a186aSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
157a31a186aSmrg[: ${CP="cp -f"}
158a31a186aSmrg: ${MV="mv -f"}
159a31a186aSmrg: ${RM="rm -f"}
160a31a186aSmrg])# _LT_FILEUTILS_DEFAULTS
161a31a186aSmrg
162a31a186aSmrg
163a31a186aSmrg# _LT_SETUP
164a31a186aSmrg# ---------
165a31a186aSmrgm4_defun([_LT_SETUP],
166a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
167fe5e51b7SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1680bb88ba4SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1690bb88ba4SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1700bb88ba4Smrg
1710bb88ba4Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1720bb88ba4Smrgdnl
173a31a186aSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
174a31a186aSmrg_LT_DECL([], [host], [0])dnl
175a31a186aSmrg_LT_DECL([], [host_os], [0])dnl
176a31a186aSmrgdnl
177a31a186aSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
178a31a186aSmrg_LT_DECL([], [build], [0])dnl
179a31a186aSmrg_LT_DECL([], [build_os], [0])dnl
180a31a186aSmrgdnl
181fe5e51b7SmrgAC_REQUIRE([AC_PROG_CC])dnl
182a31a186aSmrgAC_REQUIRE([LT_PATH_LD])dnl
183a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
184a31a186aSmrgdnl
185fe5e51b7SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
186a31a186aSmrgtest -z "$LN_S" && LN_S="ln -s"
187a31a186aSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
188eda3803bSmrgdnl
189a31a186aSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
190a31a186aSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191a31a186aSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192a31a186aSmrgdnl
193a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
194a31a186aSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1950bb88ba4Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196a31a186aSmrgm4_require([_LT_CMD_RELOAD])dnl
197a31a186aSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1980bb88ba4Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199a31a186aSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
200a31a186aSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
2010bb88ba4Smrgm4_require([_LT_WITH_SYSROOT])dnl
202a31a186aSmrg
203a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([
204a31a186aSmrg# See if we are running on zsh, and set the options which allow our
205a31a186aSmrg# commands through without removal of \ escapes INIT.
206a31a186aSmrgif test -n "\${ZSH_VERSION+set}" ; then
207a31a186aSmrg   setopt NO_GLOB_SUBST
208a31a186aSmrgfi
209a31a186aSmrg])
210a31a186aSmrgif test -n "${ZSH_VERSION+set}" ; then
211a31a186aSmrg   setopt NO_GLOB_SUBST
212a31a186aSmrgfi
213fe5e51b7Smrg
214a31a186aSmrg_LT_CHECK_OBJDIR
215a31a186aSmrg
216a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
217fe5e51b7Smrg
218fe5e51b7Smrgcase $host_os in
219fe5e51b7Smrgaix3*)
220fe5e51b7Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
221fe5e51b7Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
222fe5e51b7Smrg  # vanish in a puff of smoke.
223fe5e51b7Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
224fe5e51b7Smrg    COLLECT_NAMES=
225fe5e51b7Smrg    export COLLECT_NAMES
226fe5e51b7Smrg  fi
227fe5e51b7Smrg  ;;
228fe5e51b7Smrgesac
229fe5e51b7Smrg
230fe5e51b7Smrg# Global variables:
231a31a186aSmrgofile=libtool
232fe5e51b7Smrgcan_build_shared=yes
233fe5e51b7Smrg
234fe5e51b7Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
235fe5e51b7Smrg# which needs '.lib').
236fe5e51b7Smrglibext=a
237fe5e51b7Smrg
238a31a186aSmrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
239643b027fSmrg
240fe5e51b7Smrgold_CC="$CC"
241fe5e51b7Smrgold_CFLAGS="$CFLAGS"
242fe5e51b7Smrg
243fe5e51b7Smrg# Set sane defaults for various variables
244fe5e51b7Smrgtest -z "$CC" && CC=cc
245fe5e51b7Smrgtest -z "$LTCC" && LTCC=$CC
246fe5e51b7Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
247fe5e51b7Smrgtest -z "$LD" && LD=ld
248fe5e51b7Smrgtest -z "$ac_objext" && ac_objext=o
249fe5e51b7Smrg
250fe5e51b7Smrg_LT_CC_BASENAME([$compiler])
251fe5e51b7Smrg
252fe5e51b7Smrg# Only perform the check for file, if the check method requires it
253a31a186aSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
254fe5e51b7Smrgcase $deplibs_check_method in
255fe5e51b7Smrgfile_magic*)
256fe5e51b7Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257a31a186aSmrg    _LT_PATH_MAGIC
258fe5e51b7Smrg  fi
259fe5e51b7Smrg  ;;
260fe5e51b7Smrgesac
261fe5e51b7Smrg
262a31a186aSmrg# Use C for the default configuration in the libtool script
263a31a186aSmrgLT_SUPPORTED_TAG([CC])
264a31a186aSmrg_LT_LANG_C_CONFIG
265a31a186aSmrg_LT_LANG_DEFAULT_CONFIG
266a31a186aSmrg_LT_CONFIG_COMMANDS
267a31a186aSmrg])# _LT_SETUP
268eda3803bSmrg
269eda3803bSmrg
2700bb88ba4Smrg# _LT_PREPARE_SED_QUOTE_VARS
2710bb88ba4Smrg# --------------------------
2720bb88ba4Smrg# Define a few sed substitution that help us do robust quoting.
2730bb88ba4Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2740bb88ba4Smrg[# Backslashify metacharacters that are still active within
2750bb88ba4Smrg# double-quoted strings.
2760bb88ba4Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2770bb88ba4Smrg
2780bb88ba4Smrg# Same as above, but do not quote variable references.
2790bb88ba4Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2800bb88ba4Smrg
2810bb88ba4Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2820bb88ba4Smrg# double_quote_subst'ed string.
2830bb88ba4Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2840bb88ba4Smrg
2850bb88ba4Smrg# Sed substitution to delay expansion of an escaped single quote.
2860bb88ba4Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2870bb88ba4Smrg
2880bb88ba4Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2890bb88ba4Smrgno_glob_subst='s/\*/\\\*/g'
2900bb88ba4Smrg])
2910bb88ba4Smrg
292a31a186aSmrg# _LT_PROG_LTMAIN
293a31a186aSmrg# ---------------
294a31a186aSmrg# Note that this code is called both from `configure', and `config.status'
295a31a186aSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
296a31a186aSmrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
297a31a186aSmrg# so we pass a copy along to make sure it has a sensible value anyway.
298a31a186aSmrgm4_defun([_LT_PROG_LTMAIN],
299a31a186aSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301a31a186aSmrgltmain="$ac_aux_dir/ltmain.sh"
302a31a186aSmrg])# _LT_PROG_LTMAIN
303eda3803bSmrg
304eda3803bSmrg
305a31a186aSmrg
306a31a186aSmrg# So that we can recreate a full libtool script including additional
307a31a186aSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308a31a186aSmrg# in macros and then make a single call at the end using the `libtool'
309a31a186aSmrg# label.
310a31a186aSmrg
311a31a186aSmrg
312a31a186aSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313a31a186aSmrg# ----------------------------------------
314a31a186aSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315a31a186aSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
316a31a186aSmrg[m4_ifval([$1],
317a31a186aSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318a31a186aSmrg                     [$1
319a31a186aSmrg])])])
320a31a186aSmrg
321a31a186aSmrg# Initialize.
322a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323a31a186aSmrg
324a31a186aSmrg
325a31a186aSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
326a31a186aSmrg# ------------------------------
327a31a186aSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328a31a186aSmrgm4_define([_LT_CONFIG_LIBTOOL],
329a31a186aSmrg[m4_ifval([$1],
330a31a186aSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331a31a186aSmrg                     [$1
332a31a186aSmrg])])])
333a31a186aSmrg
334a31a186aSmrg# Initialize.
335a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336a31a186aSmrg
337a31a186aSmrg
338a31a186aSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339a31a186aSmrg# -----------------------------------------------------
340a31a186aSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
341a31a186aSmrg[_LT_CONFIG_LIBTOOL([$1])
342a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
343a31a186aSmrg])
344a31a186aSmrg
345a31a186aSmrg
346a31a186aSmrg# _LT_FORMAT_COMMENT([COMMENT])
347a31a186aSmrg# -----------------------------
348a31a186aSmrg# Add leading comment marks to the start of each line, and a trailing
349a31a186aSmrg# full-stop to the whole comment if one is not present already.
350a31a186aSmrgm4_define([_LT_FORMAT_COMMENT],
351a31a186aSmrg[m4_ifval([$1], [
352a31a186aSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353a31a186aSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354a31a186aSmrg)])
355a31a186aSmrg
356a31a186aSmrg
357a31a186aSmrg
358a31a186aSmrg
359a31a186aSmrg
360a31a186aSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361a31a186aSmrg# -------------------------------------------------------------------
362a31a186aSmrg# CONFIGNAME is the name given to the value in the libtool script.
363a31a186aSmrg# VARNAME is the (base) name used in the configure script.
364a31a186aSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365a31a186aSmrg# VARNAME.  Any other value will be used directly.
366a31a186aSmrgm4_define([_LT_DECL],
367a31a186aSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368a31a186aSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369a31a186aSmrg	[m4_ifval([$1], [$1], [$2])])
370a31a186aSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371a31a186aSmrg    m4_ifval([$4],
372a31a186aSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373a31a186aSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
374a31a186aSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
375a31a186aSmrg])
376a31a186aSmrg
377a31a186aSmrg
378a31a186aSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379a31a186aSmrg# --------------------------------------------------------
380a31a186aSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
381a31a186aSmrg
382a31a186aSmrg
383a31a186aSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384a31a186aSmrg# ------------------------------------------------
385a31a186aSmrgm4_define([lt_decl_tag_varnames],
386a31a186aSmrg[_lt_decl_filter([tagged?], [yes], $@)])
387a31a186aSmrg
388a31a186aSmrg
389a31a186aSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390a31a186aSmrg# ---------------------------------------------------------
391a31a186aSmrgm4_define([_lt_decl_filter],
392a31a186aSmrg[m4_case([$#],
393a31a186aSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
394a31a186aSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
395a31a186aSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396a31a186aSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397a31a186aSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
398a31a186aSmrg])
399a31a186aSmrg
400a31a186aSmrg
401a31a186aSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402a31a186aSmrg# --------------------------------------------------
403a31a186aSmrgm4_define([lt_decl_quote_varnames],
404a31a186aSmrg[_lt_decl_filter([value], [1], $@)])
405a31a186aSmrg
406a31a186aSmrg
407a31a186aSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408a31a186aSmrg# ---------------------------------------------------
409a31a186aSmrgm4_define([lt_decl_dquote_varnames],
410a31a186aSmrg[_lt_decl_filter([value], [2], $@)])
411a31a186aSmrg
412a31a186aSmrg
413a31a186aSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414a31a186aSmrg# ---------------------------------------------------
415a31a186aSmrgm4_define([lt_decl_varnames_tagged],
416a31a186aSmrg[m4_assert([$# <= 2])dnl
417a31a186aSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
418a31a186aSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419a31a186aSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420a31a186aSmrgm4_define([_lt_decl_varnames_tagged],
421a31a186aSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
422a31a186aSmrg
423a31a186aSmrg
424a31a186aSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425a31a186aSmrg# ------------------------------------------------
426a31a186aSmrgm4_define([lt_decl_all_varnames],
427a31a186aSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
428a31a186aSmrg     m4_if([$2], [],
429a31a186aSmrg	   m4_quote(lt_decl_varnames),
430a31a186aSmrg	m4_quote(m4_shift($@))))[]dnl
431a31a186aSmrg])
432a31a186aSmrgm4_define([_lt_decl_all_varnames],
433a31a186aSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
434a31a186aSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
435a31a186aSmrg])
436a31a186aSmrg
437a31a186aSmrg
438a31a186aSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439a31a186aSmrg# ------------------------------------
440a31a186aSmrg# Quote a variable value, and forward it to `config.status' so that its
441a31a186aSmrg# declaration there will have the same value as in `configure'.  VARNAME
442a31a186aSmrg# must have a single quote delimited value for this to work.
443a31a186aSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4440bb88ba4Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445a31a186aSmrg
446a31a186aSmrg
447a31a186aSmrg# _LT_CONFIG_STATUS_DECLARATIONS
448a31a186aSmrg# ------------------------------
449a31a186aSmrg# We delimit libtool config variables with single quotes, so when
450a31a186aSmrg# we write them to config.status, we have to be sure to quote all
451a31a186aSmrg# embedded single quotes properly.  In configure, this macro expands
452a31a186aSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453a31a186aSmrg#
4540bb88ba4Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455a31a186aSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456a31a186aSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457a31a186aSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458a31a186aSmrg
459a31a186aSmrg
460a31a186aSmrg# _LT_LIBTOOL_TAGS
461a31a186aSmrg# ----------------
462a31a186aSmrg# Output comment and list of tags supported by the script
463a31a186aSmrgm4_defun([_LT_LIBTOOL_TAGS],
464a31a186aSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465a31a186aSmrgavailable_tags="_LT_TAGS"dnl
466a31a186aSmrg])
467a31a186aSmrg
468a31a186aSmrg
469a31a186aSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470a31a186aSmrg# -----------------------------------
471a31a186aSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
472a31a186aSmrg# expand to a commented shell variable setting:
473a31a186aSmrg#
474a31a186aSmrg#    # Some comment about what VAR is for.
475a31a186aSmrg#    visible_name=$lt_internal_name
476a31a186aSmrgm4_define([_LT_LIBTOOL_DECLARE],
477a31a186aSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478a31a186aSmrg					   [description])))[]dnl
479a31a186aSmrgm4_pushdef([_libtool_name],
480a31a186aSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481a31a186aSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482a31a186aSmrg    [0], [_libtool_name=[$]$1],
483a31a186aSmrg    [1], [_libtool_name=$lt_[]$1],
484a31a186aSmrg    [2], [_libtool_name=$lt_[]$1],
485a31a186aSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486a31a186aSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487a31a186aSmrg])
488a31a186aSmrg
489a31a186aSmrg
490a31a186aSmrg# _LT_LIBTOOL_CONFIG_VARS
491a31a186aSmrg# -----------------------
492a31a186aSmrg# Produce commented declarations of non-tagged libtool config variables
493a31a186aSmrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494a31a186aSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
495a31a186aSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
496a31a186aSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
497a31a186aSmrg[m4_foreach([_lt_var],
498a31a186aSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499a31a186aSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500a31a186aSmrg
501a31a186aSmrg
502a31a186aSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
503a31a186aSmrg# -------------------------
504a31a186aSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
505a31a186aSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506a31a186aSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507eda3803bSmrg
508eda3803bSmrg
509a31a186aSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
510a31a186aSmrg# ------------------------------
511a31a186aSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512a31a186aSmrg
513a31a186aSmrg
514a31a186aSmrg# _LT_CONFIG_COMMANDS
515fe5e51b7Smrg# -------------------
516a31a186aSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
517a31a186aSmrg# variables for single and double quote escaping we saved from calls
518a31a186aSmrg# to _LT_DECL, we can put quote escaped variables declarations
519a31a186aSmrg# into `config.status', and then the shell code to quote escape them in
520a31a186aSmrg# for loops in `config.status'.  Finally, any additional code accumulated
521a31a186aSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522a31a186aSmrgm4_defun([_LT_CONFIG_COMMANDS],
523a31a186aSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
524a31a186aSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
525a31a186aSmrg	dnl instead of duplicating it all over again into config.status,
526a31a186aSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
527a31a186aSmrg	dnl needs to know what name is stored there:
528a31a186aSmrg        [AC_CONFIG_COMMANDS([libtool],
529a31a186aSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530a31a186aSmrg    dnl If the libtool generation code is destined for config.status,
531a31a186aSmrg    dnl expand the accumulated commands and init code now:
532a31a186aSmrg    [AC_CONFIG_COMMANDS([libtool],
533a31a186aSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534a31a186aSmrg])#_LT_CONFIG_COMMANDS
535a31a186aSmrg
536a31a186aSmrg
537a31a186aSmrg# Initialize.
538a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539a31a186aSmrg[
540a31a186aSmrg
541a31a186aSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
542a31a186aSmrg# if CDPATH is set.
543a31a186aSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544a31a186aSmrg
545a31a186aSmrgsed_quote_subst='$sed_quote_subst'
546a31a186aSmrgdouble_quote_subst='$double_quote_subst'
547a31a186aSmrgdelay_variable_subst='$delay_variable_subst'
548a31a186aSmrg_LT_CONFIG_STATUS_DECLARATIONS
549a31a186aSmrgLTCC='$LTCC'
550a31a186aSmrgLTCFLAGS='$LTCFLAGS'
551a31a186aSmrgcompiler='$compiler_DEFAULT'
552a31a186aSmrg
5530bb88ba4Smrg# A function that is used when there is no print builtin or printf.
5540bb88ba4Smrgfunc_fallback_echo ()
5550bb88ba4Smrg{
5560bb88ba4Smrg  eval 'cat <<_LTECHO_EOF
5570bb88ba4Smrg\$[]1
5580bb88ba4Smrg_LTECHO_EOF'
5590bb88ba4Smrg}
5600bb88ba4Smrg
561a31a186aSmrg# Quote evaled strings.
562a31a186aSmrgfor var in lt_decl_all_varnames([[ \
563a31a186aSmrg]], lt_decl_quote_varnames); do
5640bb88ba4Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565a31a186aSmrg    *[[\\\\\\\`\\"\\\$]]*)
5660bb88ba4Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567a31a186aSmrg      ;;
568a31a186aSmrg    *)
569a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570a31a186aSmrg      ;;
571a31a186aSmrg    esac
572a31a186aSmrgdone
573a31a186aSmrg
574a31a186aSmrg# Double-quote double-evaled strings.
575a31a186aSmrgfor var in lt_decl_all_varnames([[ \
576a31a186aSmrg]], lt_decl_dquote_varnames); do
5770bb88ba4Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578a31a186aSmrg    *[[\\\\\\\`\\"\\\$]]*)
5790bb88ba4Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580a31a186aSmrg      ;;
581a31a186aSmrg    *)
582a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583a31a186aSmrg      ;;
584a31a186aSmrg    esac
585a31a186aSmrgdone
586a31a186aSmrg
587a31a186aSmrg_LT_OUTPUT_LIBTOOL_INIT
588a31a186aSmrg])
589a31a186aSmrg
5900bb88ba4Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
5910bb88ba4Smrg# ------------------------------------
5920bb88ba4Smrg# Generate a child script FILE with all initialization necessary to
5930bb88ba4Smrg# reuse the environment learned by the parent script, and make the
5940bb88ba4Smrg# file executable.  If COMMENT is supplied, it is inserted after the
5950bb88ba4Smrg# `#!' sequence but before initialization text begins.  After this
5960bb88ba4Smrg# macro, additional text can be appended to FILE to form the body of
5970bb88ba4Smrg# the child script.  The macro ends with non-zero status if the
5980bb88ba4Smrg# file could not be fully written (such as if the disk is full).
5990bb88ba4Smrgm4_ifdef([AS_INIT_GENERATED],
6000bb88ba4Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
6010bb88ba4Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
6020bb88ba4Smrg[m4_require([AS_PREPARE])]dnl
6030bb88ba4Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
6040bb88ba4Smrg[lt_write_fail=0
6050bb88ba4Smrgcat >$1 <<_ASEOF || lt_write_fail=1
6060bb88ba4Smrg#! $SHELL
6070bb88ba4Smrg# Generated by $as_me.
6080bb88ba4Smrg$2
6090bb88ba4SmrgSHELL=\${CONFIG_SHELL-$SHELL}
6100bb88ba4Smrgexport SHELL
6110bb88ba4Smrg_ASEOF
6120bb88ba4Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
6130bb88ba4SmrgAS_SHELL_SANITIZE
6140bb88ba4Smrg_AS_PREPARE
6150bb88ba4Smrgexec AS_MESSAGE_FD>&1
6160bb88ba4Smrg_ASEOF
6170bb88ba4Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
6180bb88ba4Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619a31a186aSmrg
620a31a186aSmrg# LT_OUTPUT
621a31a186aSmrg# ---------
622a31a186aSmrg# This macro allows early generation of the libtool script (before
623a31a186aSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
624a31a186aSmrg# tests.
625a31a186aSmrgAC_DEFUN([LT_OUTPUT],
626a31a186aSmrg[: ${CONFIG_LT=./config.lt}
627a31a186aSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
6280bb88ba4Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6290bb88ba4Smrg[# Run this file to recreate a libtool stub with the current configuration.])
630a31a186aSmrg
631a31a186aSmrgcat >>"$CONFIG_LT" <<\_LTEOF
6320bb88ba4Smrglt_cl_silent=false
633a31a186aSmrgexec AS_MESSAGE_LOG_FD>>config.log
634a31a186aSmrg{
635a31a186aSmrg  echo
636a31a186aSmrg  AS_BOX([Running $as_me.])
637a31a186aSmrg} >&AS_MESSAGE_LOG_FD
638a31a186aSmrg
639a31a186aSmrglt_cl_help="\
640a31a186aSmrg\`$as_me' creates a local libtool stub from the current configuration,
641a31a186aSmrgfor use in further configure time tests before the real libtool is
642a31a186aSmrggenerated.
643a31a186aSmrg
644a31a186aSmrgUsage: $[0] [[OPTIONS]]
645a31a186aSmrg
646a31a186aSmrg  -h, --help      print this help, then exit
647a31a186aSmrg  -V, --version   print version number, then exit
648a31a186aSmrg  -q, --quiet     do not print progress messages
649a31a186aSmrg  -d, --debug     don't remove temporary files
650a31a186aSmrg
651a31a186aSmrgReport bugs to <bug-libtool@gnu.org>."
652a31a186aSmrg
653a31a186aSmrglt_cl_version="\
654a31a186aSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655a31a186aSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656a31a186aSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
657a31a186aSmrg
6580bb88ba4SmrgCopyright (C) 2011 Free Software Foundation, Inc.
659a31a186aSmrgThis config.lt script is free software; the Free Software Foundation
660a31a186aSmrggives unlimited permision to copy, distribute and modify it."
661a31a186aSmrg
662a31a186aSmrgwhile test $[#] != 0
663a31a186aSmrgdo
664a31a186aSmrg  case $[1] in
665a31a186aSmrg    --version | --v* | -V )
666a31a186aSmrg      echo "$lt_cl_version"; exit 0 ;;
667a31a186aSmrg    --help | --h* | -h )
668a31a186aSmrg      echo "$lt_cl_help"; exit 0 ;;
669a31a186aSmrg    --debug | --d* | -d )
670a31a186aSmrg      debug=: ;;
671a31a186aSmrg    --quiet | --q* | --silent | --s* | -q )
672a31a186aSmrg      lt_cl_silent=: ;;
673a31a186aSmrg
674a31a186aSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
675a31a186aSmrgTry \`$[0] --help' for more information.]) ;;
676a31a186aSmrg
677a31a186aSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
678a31a186aSmrgTry \`$[0] --help' for more information.]) ;;
679a31a186aSmrg  esac
680a31a186aSmrg  shift
681a31a186aSmrgdone
682a31a186aSmrg
683a31a186aSmrgif $lt_cl_silent; then
684a31a186aSmrg  exec AS_MESSAGE_FD>/dev/null
685a31a186aSmrgfi
686a31a186aSmrg_LTEOF
687a31a186aSmrg
688a31a186aSmrgcat >>"$CONFIG_LT" <<_LTEOF
689a31a186aSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690a31a186aSmrg_LTEOF
691a31a186aSmrg
692a31a186aSmrgcat >>"$CONFIG_LT" <<\_LTEOF
693a31a186aSmrgAC_MSG_NOTICE([creating $ofile])
694a31a186aSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
695a31a186aSmrgAS_EXIT(0)
696a31a186aSmrg_LTEOF
697a31a186aSmrgchmod +x "$CONFIG_LT"
698a31a186aSmrg
699a31a186aSmrg# configure is writing to config.log, but config.lt does its own redirection,
700a31a186aSmrg# appending to config.log, which fails on DOS, as config.log is still kept
701a31a186aSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
702a31a186aSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
7030bb88ba4Smrglt_cl_success=:
7040bb88ba4Smrgtest "$silent" = yes &&
7050bb88ba4Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
7060bb88ba4Smrgexec AS_MESSAGE_LOG_FD>/dev/null
7070bb88ba4Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
7080bb88ba4Smrgexec AS_MESSAGE_LOG_FD>>config.log
7090bb88ba4Smrg$lt_cl_success || AS_EXIT(1)
710a31a186aSmrg])# LT_OUTPUT
711a31a186aSmrg
712a31a186aSmrg
713a31a186aSmrg# _LT_CONFIG(TAG)
714a31a186aSmrg# ---------------
715a31a186aSmrg# If TAG is the built-in tag, create an initial libtool script with a
716a31a186aSmrg# default configuration from the untagged config vars.  Otherwise add code
717a31a186aSmrg# to config.status for appending the configuration named by TAG from the
718a31a186aSmrg# matching tagged config vars.
719a31a186aSmrgm4_defun([_LT_CONFIG],
720a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721a31a186aSmrg_LT_CONFIG_SAVE_COMMANDS([
722a31a186aSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723a31a186aSmrg  m4_if(_LT_TAG, [C], [
724a31a186aSmrg    # See if we are running on zsh, and set the options which allow our
725a31a186aSmrg    # commands through without removal of \ escapes.
726a31a186aSmrg    if test -n "${ZSH_VERSION+set}" ; then
727a31a186aSmrg      setopt NO_GLOB_SUBST
728a31a186aSmrg    fi
729a31a186aSmrg
730a31a186aSmrg    cfgfile="${ofile}T"
731a31a186aSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732a31a186aSmrg    $RM "$cfgfile"
733a31a186aSmrg
734a31a186aSmrg    cat <<_LT_EOF >> "$cfgfile"
735a31a186aSmrg#! $SHELL
736a31a186aSmrg
737a31a186aSmrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738a31a186aSmrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739a31a186aSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740a31a186aSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741a31a186aSmrg#
742a31a186aSmrg_LT_COPYING
743a31a186aSmrg_LT_LIBTOOL_TAGS
744a31a186aSmrg
745a31a186aSmrg# ### BEGIN LIBTOOL CONFIG
746a31a186aSmrg_LT_LIBTOOL_CONFIG_VARS
747a31a186aSmrg_LT_LIBTOOL_TAG_VARS
748a31a186aSmrg# ### END LIBTOOL CONFIG
749a31a186aSmrg
750a31a186aSmrg_LT_EOF
751a31a186aSmrg
752a31a186aSmrg  case $host_os in
753a31a186aSmrg  aix3*)
754a31a186aSmrg    cat <<\_LT_EOF >> "$cfgfile"
755a31a186aSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
756a31a186aSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
757a31a186aSmrg# vanish in a puff of smoke.
758a31a186aSmrgif test "X${COLLECT_NAMES+set}" != Xset; then
759a31a186aSmrg  COLLECT_NAMES=
760a31a186aSmrg  export COLLECT_NAMES
761a31a186aSmrgfi
762a31a186aSmrg_LT_EOF
763a31a186aSmrg    ;;
764a31a186aSmrg  esac
765a31a186aSmrg
766a31a186aSmrg  _LT_PROG_LTMAIN
767a31a186aSmrg
768a31a186aSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
769a31a186aSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
770a31a186aSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
771a31a186aSmrg  # is reportedly fixed, but why not run on old versions too?
7720bb88ba4Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
7730bb88ba4Smrg     || (rm -f "$cfgfile"; exit 1)
774a31a186aSmrg
7750bb88ba4Smrg  _LT_PROG_REPLACE_SHELLFNS
776a31a186aSmrg
7770bb88ba4Smrg   mv -f "$cfgfile" "$ofile" ||
778a31a186aSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779a31a186aSmrg  chmod +x "$ofile"
780a31a186aSmrg],
781a31a186aSmrg[cat <<_LT_EOF >> "$ofile"
782a31a186aSmrg
783a31a186aSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784a31a186aSmrgdnl in a comment (ie after a #).
785a31a186aSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
786a31a186aSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787a31a186aSmrg# ### END LIBTOOL TAG CONFIG: $1
788a31a186aSmrg_LT_EOF
789a31a186aSmrg])dnl /m4_if
790a31a186aSmrg],
791a31a186aSmrg[m4_if([$1], [], [
792a31a186aSmrg    PACKAGE='$PACKAGE'
793a31a186aSmrg    VERSION='$VERSION'
794a31a186aSmrg    TIMESTAMP='$TIMESTAMP'
795a31a186aSmrg    RM='$RM'
796a31a186aSmrg    ofile='$ofile'], [])
797a31a186aSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
798a31a186aSmrg])# _LT_CONFIG
799a31a186aSmrg
800a31a186aSmrg
801a31a186aSmrg# LT_SUPPORTED_TAG(TAG)
802a31a186aSmrg# ---------------------
803a31a186aSmrg# Trace this macro to discover what tags are supported by the libtool
804a31a186aSmrg# --tag option, using:
805a31a186aSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
806a31a186aSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807a31a186aSmrg
808a31a186aSmrg
809a31a186aSmrg# C support is built-in for now
810a31a186aSmrgm4_define([_LT_LANG_C_enabled], [])
811a31a186aSmrgm4_define([_LT_TAGS], [])
812a31a186aSmrg
813a31a186aSmrg
814a31a186aSmrg# LT_LANG(LANG)
815a31a186aSmrg# -------------
816a31a186aSmrg# Enable libtool support for the given language if not already enabled.
817a31a186aSmrgAC_DEFUN([LT_LANG],
818a31a186aSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
819a31a186aSmrgm4_case([$1],
820a31a186aSmrg  [C],			[_LT_LANG(C)],
821a31a186aSmrg  [C++],		[_LT_LANG(CXX)],
8220bb88ba4Smrg  [Go],			[_LT_LANG(GO)],
823a31a186aSmrg  [Java],		[_LT_LANG(GCJ)],
824a31a186aSmrg  [Fortran 77],		[_LT_LANG(F77)],
825a31a186aSmrg  [Fortran],		[_LT_LANG(FC)],
826a31a186aSmrg  [Windows Resource],	[_LT_LANG(RC)],
827a31a186aSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828a31a186aSmrg    [_LT_LANG($1)],
829a31a186aSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
830a31a186aSmrg])# LT_LANG
831a31a186aSmrg
832a31a186aSmrg
833a31a186aSmrg# _LT_LANG(LANGNAME)
834a31a186aSmrg# ------------------
835a31a186aSmrgm4_defun([_LT_LANG],
836a31a186aSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837a31a186aSmrg  [LT_SUPPORTED_TAG([$1])dnl
838a31a186aSmrg  m4_append([_LT_TAGS], [$1 ])dnl
839a31a186aSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
840a31a186aSmrg  _LT_LANG_$1_CONFIG($1)])dnl
841a31a186aSmrg])# _LT_LANG
842a31a186aSmrg
843a31a186aSmrg
8440bb88ba4Smrgm4_ifndef([AC_PROG_GO], [
8450bb88ba4Smrg# NOTE: This macro has been submitted for inclusion into   #
8460bb88ba4Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
8470bb88ba4Smrg#  a released version of Autoconf we should remove this    #
8480bb88ba4Smrg#  macro and use it instead.                               #
8490bb88ba4Smrgm4_defun([AC_PROG_GO],
8500bb88ba4Smrg[AC_LANG_PUSH(Go)dnl
8510bb88ba4SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
8520bb88ba4SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
8530bb88ba4Smrg_AC_ARG_VAR_LDFLAGS()dnl
8540bb88ba4SmrgAC_CHECK_TOOL(GOC, gccgo)
8550bb88ba4Smrgif test -z "$GOC"; then
8560bb88ba4Smrg  if test -n "$ac_tool_prefix"; then
8570bb88ba4Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8580bb88ba4Smrg  fi
8590bb88ba4Smrgfi
8600bb88ba4Smrgif test -z "$GOC"; then
8610bb88ba4Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
8620bb88ba4Smrgfi
8630bb88ba4Smrg])#m4_defun
8640bb88ba4Smrg])#m4_ifndef
8650bb88ba4Smrg
8660bb88ba4Smrg
867a31a186aSmrg# _LT_LANG_DEFAULT_CONFIG
868a31a186aSmrg# -----------------------
869a31a186aSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
870a31a186aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871a31a186aSmrg  [LT_LANG(CXX)],
872a31a186aSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873a31a186aSmrg
874a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
875a31a186aSmrg  [LT_LANG(F77)],
876a31a186aSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877a31a186aSmrg
878a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
879a31a186aSmrg  [LT_LANG(FC)],
880a31a186aSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881a31a186aSmrg
882a31a186aSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883a31a186aSmrgdnl pulling things in needlessly.
884a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
885a31a186aSmrg  [LT_LANG(GCJ)],
886a31a186aSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887a31a186aSmrg    [LT_LANG(GCJ)],
888a31a186aSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889a31a186aSmrg      [LT_LANG(GCJ)],
890a31a186aSmrg      [m4_ifdef([AC_PROG_GCJ],
891a31a186aSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892a31a186aSmrg       m4_ifdef([A][M_PROG_GCJ],
893a31a186aSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894a31a186aSmrg       m4_ifdef([LT_PROG_GCJ],
895a31a186aSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896a31a186aSmrg
8970bb88ba4SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
8980bb88ba4Smrg  [LT_LANG(GO)],
8990bb88ba4Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
9000bb88ba4Smrg
901a31a186aSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
902a31a186aSmrg  [LT_LANG(RC)],
903a31a186aSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904a31a186aSmrg])# _LT_LANG_DEFAULT_CONFIG
905a31a186aSmrg
906a31a186aSmrg# Obsolete macros:
907a31a186aSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908a31a186aSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909a31a186aSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910a31a186aSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9110bb88ba4SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
913a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
915a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
916a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9170bb88ba4Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918a31a186aSmrg
919a31a186aSmrg
920a31a186aSmrg# _LT_TAG_COMPILER
921a31a186aSmrg# ----------------
922a31a186aSmrgm4_defun([_LT_TAG_COMPILER],
923fe5e51b7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924fe5e51b7Smrg
925a31a186aSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926a31a186aSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927a31a186aSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928a31a186aSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929a31a186aSmrg
930fe5e51b7Smrg# If no C compiler was specified, use CC.
931fe5e51b7SmrgLTCC=${LTCC-"$CC"}
932fe5e51b7Smrg
933fe5e51b7Smrg# If no C compiler flags were specified, use CFLAGS.
934fe5e51b7SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935fe5e51b7Smrg
936fe5e51b7Smrg# Allow CC to be a program name with arguments.
937fe5e51b7Smrgcompiler=$CC
938a31a186aSmrg])# _LT_TAG_COMPILER
939fe5e51b7Smrg
940fe5e51b7Smrg
941fe5e51b7Smrg# _LT_COMPILER_BOILERPLATE
942fe5e51b7Smrg# ------------------------
943fe5e51b7Smrg# Check for compiler boilerplate output or warnings with
944fe5e51b7Smrg# the simple compiler test code.
945a31a186aSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
946a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
947fe5e51b7Smrgac_outfile=conftest.$ac_objext
948fe5e51b7Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
949fe5e51b7Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950fe5e51b7Smrg_lt_compiler_boilerplate=`cat conftest.err`
951a31a186aSmrg$RM conftest*
952fe5e51b7Smrg])# _LT_COMPILER_BOILERPLATE
953fe5e51b7Smrg
954fe5e51b7Smrg
955fe5e51b7Smrg# _LT_LINKER_BOILERPLATE
956fe5e51b7Smrg# ----------------------
957fe5e51b7Smrg# Check for linker boilerplate output or warnings with
958fe5e51b7Smrg# the simple link test code.
959a31a186aSmrgm4_defun([_LT_LINKER_BOILERPLATE],
960a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
961fe5e51b7Smrgac_outfile=conftest.$ac_objext
962fe5e51b7Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
963fe5e51b7Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964fe5e51b7Smrg_lt_linker_boilerplate=`cat conftest.err`
965a31a186aSmrg$RM -r conftest*
966fe5e51b7Smrg])# _LT_LINKER_BOILERPLATE
967fe5e51b7Smrg
968eda3803bSmrg# _LT_REQUIRED_DARWIN_CHECKS
969a31a186aSmrg# -------------------------
970a31a186aSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971eda3803bSmrg  case $host_os in
972eda3803bSmrg    rhapsody* | darwin*)
973eda3803bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974eda3803bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975a31a186aSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
976a31a186aSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
977a31a186aSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978a31a186aSmrg    _LT_DECL([], [DSYMUTIL], [1],
979a31a186aSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980a31a186aSmrg    _LT_DECL([], [NMEDIT], [1],
981a31a186aSmrg      [Tool to change global to local symbols on Mac OS X])
982a31a186aSmrg    _LT_DECL([], [LIPO], [1],
983a31a186aSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
984a31a186aSmrg    _LT_DECL([], [OTOOL], [1],
985a31a186aSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986a31a186aSmrg    _LT_DECL([], [OTOOL64], [1],
987a31a186aSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988eda3803bSmrg
989eda3803bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990eda3803bSmrg      [lt_cv_apple_cc_single_mod=no
991eda3803bSmrg      if test -z "${LT_MULTI_MODULE}"; then
992a31a186aSmrg	# By default we will add the -single_module flag. You can override
993a31a186aSmrg	# by either setting the environment variable LT_MULTI_MODULE
994a31a186aSmrg	# non-empty at configure time, or by adding -multi_module to the
995a31a186aSmrg	# link flags.
996a31a186aSmrg	rm -rf libconftest.dylib*
997a31a186aSmrg	echo "int foo(void){return 1;}" > conftest.c
998a31a186aSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999a31a186aSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000a31a186aSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001a31a186aSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002a31a186aSmrg        _lt_result=$?
10030bb88ba4Smrg	# If there is a non-empty error log, and "single_module"
10040bb88ba4Smrg	# appears in it, assume the flag caused a linker warning
10050bb88ba4Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
10060bb88ba4Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
10070bb88ba4Smrg	# Otherwise, if the output was created with a 0 exit code from
10080bb88ba4Smrg	# the compiler, it worked.
10090bb88ba4Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010a31a186aSmrg	  lt_cv_apple_cc_single_mod=yes
1011a31a186aSmrg	else
1012a31a186aSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1013a31a186aSmrg	fi
1014a31a186aSmrg	rm -rf libconftest.dylib*
1015a31a186aSmrg	rm -f conftest.*
1016eda3803bSmrg      fi])
10170bb88ba4Smrg
1018eda3803bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019eda3803bSmrg      [lt_cv_ld_exported_symbols_list],
1020eda3803bSmrg      [lt_cv_ld_exported_symbols_list=no
1021eda3803bSmrg      save_LDFLAGS=$LDFLAGS
1022eda3803bSmrg      echo "_main" > conftest.sym
1023eda3803bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024eda3803bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025a31a186aSmrg	[lt_cv_ld_exported_symbols_list=yes],
1026a31a186aSmrg	[lt_cv_ld_exported_symbols_list=no])
1027a31a186aSmrg	LDFLAGS="$save_LDFLAGS"
1028eda3803bSmrg    ])
10290bb88ba4Smrg
10300bb88ba4Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10310bb88ba4Smrg      [lt_cv_ld_force_load=no
10320bb88ba4Smrg      cat > conftest.c << _LT_EOF
10330bb88ba4Smrgint forced_loaded() { return 2;}
10340bb88ba4Smrg_LT_EOF
10350bb88ba4Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10360bb88ba4Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
10370bb88ba4Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
10380bb88ba4Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10390bb88ba4Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10400bb88ba4Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10410bb88ba4Smrg      cat > conftest.c << _LT_EOF
10420bb88ba4Smrgint main() { return 0;}
10430bb88ba4Smrg_LT_EOF
10440bb88ba4Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10450bb88ba4Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10460bb88ba4Smrg      _lt_result=$?
10470bb88ba4Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
10480bb88ba4Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10490bb88ba4Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
10500bb88ba4Smrg	lt_cv_ld_force_load=yes
10510bb88ba4Smrg      else
10520bb88ba4Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10530bb88ba4Smrg      fi
10540bb88ba4Smrg        rm -f conftest.err libconftest.a conftest conftest.c
10550bb88ba4Smrg        rm -rf conftest.dSYM
10560bb88ba4Smrg    ])
1057eda3803bSmrg    case $host_os in
1058a31a186aSmrg    rhapsody* | darwin1.[[012]])
1059eda3803bSmrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060eda3803bSmrg    darwin1.*)
1061a31a186aSmrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062a31a186aSmrg    darwin*) # darwin 5.x on
1063eda3803bSmrg      # if running on 10.5 or later, the deployment target defaults
1064eda3803bSmrg      # to the OS version, if on x86, and 10.4, the deployment
1065eda3803bSmrg      # target defaults to 10.4. Don't you love it?
1066eda3803bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067a31a186aSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068a31a186aSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069a31a186aSmrg	10.[[012]]*)
1070a31a186aSmrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071a31a186aSmrg	10.*)
1072a31a186aSmrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073eda3803bSmrg      esac
1074eda3803bSmrg    ;;
1075eda3803bSmrg  esac
1076eda3803bSmrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077eda3803bSmrg      _lt_dar_single_mod='$single_module'
1078eda3803bSmrg    fi
1079eda3803bSmrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080eda3803bSmrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081eda3803bSmrg    else
1082a31a186aSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083eda3803bSmrg    fi
10840bb88ba4Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085a31a186aSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1086eda3803bSmrg    else
1087eda3803bSmrg      _lt_dsymutil=
1088eda3803bSmrg    fi
1089eda3803bSmrg    ;;
1090eda3803bSmrg  esac
1091eda3803bSmrg])
1092eda3803bSmrg
1093a31a186aSmrg
10940bb88ba4Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
10950bb88ba4Smrg# ---------------------------------
1096a31a186aSmrg# Checks for linker and compiler features on darwin
1097a31a186aSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1098a31a186aSmrg[
1099a31a186aSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100a31a186aSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101a31a186aSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1102a31a186aSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1103a31a186aSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
11040bb88ba4Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
11050bb88ba4Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
11060bb88ba4Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
11070bb88ba4Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
11080bb88ba4Smrg  else
11090bb88ba4Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11100bb88ba4Smrg  fi
1111a31a186aSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1112a31a186aSmrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113a31a186aSmrg  case $cc_basename in
1114a31a186aSmrg     ifort*) _lt_dar_can_shared=yes ;;
1115a31a186aSmrg     *) _lt_dar_can_shared=$GCC ;;
1116a31a186aSmrg  esac
1117a31a186aSmrg  if test "$_lt_dar_can_shared" = "yes"; then
11180bb88ba4Smrg    output_verbose_link_cmd=func_echo_all
1119a31a186aSmrg    _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}"
1120a31a186aSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121a31a186aSmrg    _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}"
1122a31a186aSmrg    _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}"
1123a31a186aSmrg    m4_if([$1], [CXX],
1124a31a186aSmrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125a31a186aSmrg      _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}"
1126a31a186aSmrg      _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}"
1127a31a186aSmrg    fi
1128a31a186aSmrg],[])
1129a31a186aSmrg  else
1130a31a186aSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1131a31a186aSmrg  fi
1132a31a186aSmrg])
1133a31a186aSmrg
11340bb88ba4Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
11350bb88ba4Smrg# ----------------------------------
1136fe5e51b7Smrg# Links a minimal program and checks the executable
1137fe5e51b7Smrg# for the system default hardcoded library path. In most cases,
1138fe5e51b7Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1139fe5e51b7Smrg# the location of the communication and MPI libs are included too.
1140fe5e51b7Smrg# If we don't find anything, use the default library path according
1141fe5e51b7Smrg# to the aix ld manual.
11420bb88ba4Smrg# Store the results from the different compilers for each TAGNAME.
11430bb88ba4Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1144a31a186aSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1145a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
11460bb88ba4Smrgif test "${lt_cv_aix_libpath+set}" = set; then
11470bb88ba4Smrg  aix_libpath=$lt_cv_aix_libpath
11480bb88ba4Smrgelse
11490bb88ba4Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11500bb88ba4Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
11510bb88ba4Smrg  lt_aix_libpath_sed='[
11520bb88ba4Smrg      /Import File Strings/,/^$/ {
11530bb88ba4Smrg	  /^0/ {
11540bb88ba4Smrg	      s/^0  *\([^ ]*\) *$/\1/
11550bb88ba4Smrg	      p
11560bb88ba4Smrg	  }
11570bb88ba4Smrg      }]'
11580bb88ba4Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11590bb88ba4Smrg  # Check for a 64-bit object if we didn't find anything.
11600bb88ba4Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11610bb88ba4Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11620bb88ba4Smrg  fi],[])
11630bb88ba4Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11640bb88ba4Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
11650bb88ba4Smrg  fi
11660bb88ba4Smrg  ])
11670bb88ba4Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
11680bb88ba4Smrgfi
1169a31a186aSmrg])# _LT_SYS_MODULE_PATH_AIX
1170fe5e51b7Smrg
1171fe5e51b7Smrg
1172a31a186aSmrg# _LT_SHELL_INIT(ARG)
1173a31a186aSmrg# -------------------
1174a31a186aSmrgm4_define([_LT_SHELL_INIT],
11750bb88ba4Smrg[m4_divert_text([M4SH-INIT], [$1
11760bb88ba4Smrg])])# _LT_SHELL_INIT
11770bb88ba4Smrg
1178fe5e51b7Smrg
1179fe5e51b7Smrg
1180a31a186aSmrg# _LT_PROG_ECHO_BACKSLASH
1181a31a186aSmrg# -----------------------
11820bb88ba4Smrg# Find how we can fake an echo command that does not interpret backslash.
11830bb88ba4Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
11840bb88ba4Smrg# of the generated configure script which will find a shell with a builtin
11850bb88ba4Smrg# printf (which we can use as an echo command).
1186a31a186aSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
11870bb88ba4Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11880bb88ba4SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
11890bb88ba4SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
11900bb88ba4Smrg
11910bb88ba4SmrgAC_MSG_CHECKING([how to print strings])
11920bb88ba4Smrg# Test print first, because it will be a builtin if present.
11930bb88ba4Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
11940bb88ba4Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
11950bb88ba4Smrg  ECHO='print -r --'
11960bb88ba4Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
11970bb88ba4Smrg  ECHO='printf %s\n'
1198fe5e51b7Smrgelse
11990bb88ba4Smrg  # Use this function as a fallback that always works.
12000bb88ba4Smrg  func_fallback_echo ()
12010bb88ba4Smrg  {
12020bb88ba4Smrg    eval 'cat <<_LTECHO_EOF
12030bb88ba4Smrg$[]1
12040bb88ba4Smrg_LTECHO_EOF'
12050bb88ba4Smrg  }
12060bb88ba4Smrg  ECHO='func_fallback_echo'
1207fe5e51b7Smrgfi
1208fe5e51b7Smrg
12090bb88ba4Smrg# func_echo_all arg...
12100bb88ba4Smrg# Invoke $ECHO with all args, space-separated.
12110bb88ba4Smrgfunc_echo_all ()
12120bb88ba4Smrg{
12130bb88ba4Smrg    $ECHO "$*" 
12140bb88ba4Smrg}
1215643b027fSmrg
12160bb88ba4Smrgcase "$ECHO" in
12170bb88ba4Smrg  printf*) AC_MSG_RESULT([printf]) ;;
12180bb88ba4Smrg  print*) AC_MSG_RESULT([print -r]) ;;
12190bb88ba4Smrg  *) AC_MSG_RESULT([cat]) ;;
12200bb88ba4Smrgesac
1221fe5e51b7Smrg
12220bb88ba4Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
12230bb88ba4Smrg[_AS_DETECT_SUGGESTED([
12240bb88ba4Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12250bb88ba4Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12260bb88ba4Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12270bb88ba4Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12280bb88ba4Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
12290bb88ba4Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
12300bb88ba4Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231fe5e51b7Smrg
1232a31a186aSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12330bb88ba4Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234a31a186aSmrg])# _LT_PROG_ECHO_BACKSLASH
1235fe5e51b7Smrg
1236fe5e51b7Smrg
12370bb88ba4Smrg# _LT_WITH_SYSROOT
12380bb88ba4Smrg# ----------------
12390bb88ba4SmrgAC_DEFUN([_LT_WITH_SYSROOT],
12400bb88ba4Smrg[AC_MSG_CHECKING([for sysroot])
12410bb88ba4SmrgAC_ARG_WITH([sysroot],
12420bb88ba4Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
12430bb88ba4Smrg                        (or the compiler's sysroot if not specified).],
12440bb88ba4Smrg[], [with_sysroot=no])
12450bb88ba4Smrg
12460bb88ba4Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12470bb88ba4Smrgdnl in case the user passed a directory name.
12480bb88ba4Smrglt_sysroot=
12490bb88ba4Smrgcase ${with_sysroot} in #(
12500bb88ba4Smrg yes)
12510bb88ba4Smrg   if test "$GCC" = yes; then
12520bb88ba4Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12530bb88ba4Smrg   fi
12540bb88ba4Smrg   ;; #(
12550bb88ba4Smrg /*)
12560bb88ba4Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12570bb88ba4Smrg   ;; #(
12580bb88ba4Smrg no|'')
12590bb88ba4Smrg   ;; #(
12600bb88ba4Smrg *)
12610bb88ba4Smrg   AC_MSG_RESULT([${with_sysroot}])
12620bb88ba4Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12630bb88ba4Smrg   ;;
12640bb88ba4Smrgesac
12650bb88ba4Smrg
12660bb88ba4Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
12670bb88ba4Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
12680bb88ba4Smrg[dependent libraries, and in which our libraries should be installed.])])
12690bb88ba4Smrg
1270a31a186aSmrg# _LT_ENABLE_LOCK
1271a31a186aSmrg# ---------------
1272a31a186aSmrgm4_defun([_LT_ENABLE_LOCK],
1273fe5e51b7Smrg[AC_ARG_ENABLE([libtool-lock],
1274a31a186aSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1275a31a186aSmrg    [avoid locking (might break parallel builds)])])
1276fe5e51b7Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277fe5e51b7Smrg
1278fe5e51b7Smrg# Some flags need to be propagated to the compiler or linker for good
1279fe5e51b7Smrg# libtool support.
1280fe5e51b7Smrgcase $host in
1281fe5e51b7Smrgia64-*-hpux*)
1282fe5e51b7Smrg  # Find out which ABI we are using.
1283fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1284fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1285fe5e51b7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1286a31a186aSmrg      *ELF-32*)
1287a31a186aSmrg	HPUX_IA64_MODE="32"
1288a31a186aSmrg	;;
1289a31a186aSmrg      *ELF-64*)
1290a31a186aSmrg	HPUX_IA64_MODE="64"
1291a31a186aSmrg	;;
1292fe5e51b7Smrg    esac
1293fe5e51b7Smrg  fi
1294fe5e51b7Smrg  rm -rf conftest*
1295fe5e51b7Smrg  ;;
1296fe5e51b7Smrg*-*-irix6*)
1297fe5e51b7Smrg  # Find out which ABI we are using.
12980bb88ba4Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1300a31a186aSmrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1301a31a186aSmrg      case `/usr/bin/file conftest.$ac_objext` in
1302a31a186aSmrg	*32-bit*)
1303a31a186aSmrg	  LD="${LD-ld} -melf32bsmip"
1304a31a186aSmrg	  ;;
1305a31a186aSmrg	*N32*)
1306a31a186aSmrg	  LD="${LD-ld} -melf32bmipn32"
1307a31a186aSmrg	  ;;
1308a31a186aSmrg	*64-bit*)
1309a31a186aSmrg	  LD="${LD-ld} -melf64bmip"
1310a31a186aSmrg	;;
1311a31a186aSmrg      esac
1312a31a186aSmrg    else
1313a31a186aSmrg      case `/usr/bin/file conftest.$ac_objext` in
1314a31a186aSmrg	*32-bit*)
1315a31a186aSmrg	  LD="${LD-ld} -32"
1316a31a186aSmrg	  ;;
1317a31a186aSmrg	*N32*)
1318a31a186aSmrg	  LD="${LD-ld} -n32"
1319a31a186aSmrg	  ;;
1320a31a186aSmrg	*64-bit*)
1321a31a186aSmrg	  LD="${LD-ld} -64"
1322a31a186aSmrg	  ;;
1323a31a186aSmrg      esac
1324a31a186aSmrg    fi
1325fe5e51b7Smrg  fi
1326fe5e51b7Smrg  rm -rf conftest*
1327fe5e51b7Smrg  ;;
1328fe5e51b7Smrg
1329fe5e51b7Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1330a31a186aSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1331fe5e51b7Smrg  # Find out which ABI we are using.
1332fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1333fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1334fe5e51b7Smrg    case `/usr/bin/file conftest.o` in
1335a31a186aSmrg      *32-bit*)
1336a31a186aSmrg	case $host in
1337a31a186aSmrg	  x86_64-*kfreebsd*-gnu)
1338a31a186aSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1339a31a186aSmrg	    ;;
1340a31a186aSmrg	  x86_64-*linux*)
1341a31a186aSmrg	    LD="${LD-ld} -m elf_i386"
1342a31a186aSmrg	    ;;
1343a31a186aSmrg	  ppc64-*linux*|powerpc64-*linux*)
1344a31a186aSmrg	    LD="${LD-ld} -m elf32ppclinux"
1345a31a186aSmrg	    ;;
1346a31a186aSmrg	  s390x-*linux*)
1347a31a186aSmrg	    LD="${LD-ld} -m elf_s390"
1348a31a186aSmrg	    ;;
1349a31a186aSmrg	  sparc64-*linux*)
1350a31a186aSmrg	    LD="${LD-ld} -m elf32_sparc"
1351a31a186aSmrg	    ;;
1352a31a186aSmrg	esac
1353a31a186aSmrg	;;
1354a31a186aSmrg      *64-bit*)
1355a31a186aSmrg	case $host in
1356a31a186aSmrg	  x86_64-*kfreebsd*-gnu)
1357a31a186aSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1358a31a186aSmrg	    ;;
1359a31a186aSmrg	  x86_64-*linux*)
1360a31a186aSmrg	    LD="${LD-ld} -m elf_x86_64"
1361a31a186aSmrg	    ;;
1362a31a186aSmrg	  ppc*-*linux*|powerpc*-*linux*)
1363a31a186aSmrg	    LD="${LD-ld} -m elf64ppc"
1364a31a186aSmrg	    ;;
1365a31a186aSmrg	  s390*-*linux*|s390*-*tpf*)
1366a31a186aSmrg	    LD="${LD-ld} -m elf64_s390"
1367a31a186aSmrg	    ;;
1368a31a186aSmrg	  sparc*-*linux*)
1369a31a186aSmrg	    LD="${LD-ld} -m elf64_sparc"
1370a31a186aSmrg	    ;;
1371a31a186aSmrg	esac
1372a31a186aSmrg	;;
1373fe5e51b7Smrg    esac
1374fe5e51b7Smrg  fi
1375fe5e51b7Smrg  rm -rf conftest*
1376fe5e51b7Smrg  ;;
1377fe5e51b7Smrg
1378fe5e51b7Smrg*-*-sco3.2v5*)
1379fe5e51b7Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1380fe5e51b7Smrg  SAVE_CFLAGS="$CFLAGS"
1381fe5e51b7Smrg  CFLAGS="$CFLAGS -belf"
1382fe5e51b7Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1383fe5e51b7Smrg    [AC_LANG_PUSH(C)
1384a31a186aSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1385fe5e51b7Smrg     AC_LANG_POP])
1386fe5e51b7Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
1387fe5e51b7Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1388fe5e51b7Smrg    CFLAGS="$SAVE_CFLAGS"
1389fe5e51b7Smrg  fi
1390fe5e51b7Smrg  ;;
13910bb88ba4Smrg*-*solaris*)
1392fe5e51b7Smrg  # Find out which ABI we are using.
1393fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1394fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1395fe5e51b7Smrg    case `/usr/bin/file conftest.o` in
1396fe5e51b7Smrg    *64-bit*)
1397fe5e51b7Smrg      case $lt_cv_prog_gnu_ld in
13980bb88ba4Smrg      yes*)
13990bb88ba4Smrg        case $host in
14000bb88ba4Smrg        i?86-*-solaris*)
14010bb88ba4Smrg          LD="${LD-ld} -m elf_x86_64"
14020bb88ba4Smrg          ;;
14030bb88ba4Smrg        sparc*-*-solaris*)
14040bb88ba4Smrg          LD="${LD-ld} -m elf64_sparc"
14050bb88ba4Smrg          ;;
14060bb88ba4Smrg        esac
14070bb88ba4Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14080bb88ba4Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
14090bb88ba4Smrg          LD="${LD-ld}_sol2"
14100bb88ba4Smrg        fi
14110bb88ba4Smrg        ;;
1412eda3803bSmrg      *)
1413a31a186aSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1414eda3803bSmrg	  LD="${LD-ld} -64"
1415eda3803bSmrg	fi
1416eda3803bSmrg	;;
1417fe5e51b7Smrg      esac
1418fe5e51b7Smrg      ;;
1419fe5e51b7Smrg    esac
1420fe5e51b7Smrg  fi
1421fe5e51b7Smrg  rm -rf conftest*
1422fe5e51b7Smrg  ;;
1423fe5e51b7Smrgesac
1424fe5e51b7Smrg
1425fe5e51b7Smrgneed_locks="$enable_libtool_lock"
1426a31a186aSmrg])# _LT_ENABLE_LOCK
1427a31a186aSmrg
1428a31a186aSmrg
14290bb88ba4Smrg# _LT_PROG_AR
14300bb88ba4Smrg# -----------
14310bb88ba4Smrgm4_defun([_LT_PROG_AR],
14320bb88ba4Smrg[AC_CHECK_TOOLS(AR, [ar], false)
14330bb88ba4Smrg: ${AR=ar}
14340bb88ba4Smrg: ${AR_FLAGS=cru}
14350bb88ba4Smrg_LT_DECL([], [AR], [1], [The archiver])
14360bb88ba4Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
14370bb88ba4Smrg
14380bb88ba4SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
14390bb88ba4Smrg  [lt_cv_ar_at_file=no
14400bb88ba4Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
14410bb88ba4Smrg     [echo conftest.$ac_objext > conftest.lst
14420bb88ba4Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
14430bb88ba4Smrg      AC_TRY_EVAL([lt_ar_try])
14440bb88ba4Smrg      if test "$ac_status" -eq 0; then
14450bb88ba4Smrg	# Ensure the archiver fails upon bogus file names.
14460bb88ba4Smrg	rm -f conftest.$ac_objext libconftest.a
14470bb88ba4Smrg	AC_TRY_EVAL([lt_ar_try])
14480bb88ba4Smrg	if test "$ac_status" -ne 0; then
14490bb88ba4Smrg          lt_cv_ar_at_file=@
14500bb88ba4Smrg        fi
14510bb88ba4Smrg      fi
14520bb88ba4Smrg      rm -f conftest.* libconftest.a
14530bb88ba4Smrg     ])
14540bb88ba4Smrg  ])
14550bb88ba4Smrg
14560bb88ba4Smrgif test "x$lt_cv_ar_at_file" = xno; then
14570bb88ba4Smrg  archiver_list_spec=
14580bb88ba4Smrgelse
14590bb88ba4Smrg  archiver_list_spec=$lt_cv_ar_at_file
14600bb88ba4Smrgfi
14610bb88ba4Smrg_LT_DECL([], [archiver_list_spec], [1],
14620bb88ba4Smrg  [How to feed a file listing to the archiver])
14630bb88ba4Smrg])# _LT_PROG_AR
14640bb88ba4Smrg
14650bb88ba4Smrg
1466a31a186aSmrg# _LT_CMD_OLD_ARCHIVE
1467a31a186aSmrg# -------------------
1468a31a186aSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
14690bb88ba4Smrg[_LT_PROG_AR
1470a31a186aSmrg
1471a31a186aSmrgAC_CHECK_TOOL(STRIP, strip, :)
1472a31a186aSmrgtest -z "$STRIP" && STRIP=:
1473a31a186aSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1474eda3803bSmrg
1475a31a186aSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1476a31a186aSmrgtest -z "$RANLIB" && RANLIB=:
1477a31a186aSmrg_LT_DECL([], [RANLIB], [1],
1478a31a186aSmrg    [Commands used to install an old-style archive])
1479a31a186aSmrg
1480a31a186aSmrg# Determine commands to create old-style static archives.
1481a31a186aSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1482a31a186aSmrgold_postinstall_cmds='chmod 644 $oldlib'
1483a31a186aSmrgold_postuninstall_cmds=
1484a31a186aSmrg
1485a31a186aSmrgif test -n "$RANLIB"; then
1486a31a186aSmrg  case $host_os in
1487a31a186aSmrg  openbsd*)
14880bb88ba4Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1489a31a186aSmrg    ;;
1490a31a186aSmrg  *)
14910bb88ba4Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1492a31a186aSmrg    ;;
1493a31a186aSmrg  esac
14940bb88ba4Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1495a31a186aSmrgfi
14960bb88ba4Smrg
14970bb88ba4Smrgcase $host_os in
14980bb88ba4Smrg  darwin*)
14990bb88ba4Smrg    lock_old_archive_extraction=yes ;;
15000bb88ba4Smrg  *)
15010bb88ba4Smrg    lock_old_archive_extraction=no ;;
15020bb88ba4Smrgesac
1503a31a186aSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1504a31a186aSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1505a31a186aSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1506a31a186aSmrg    [Commands used to build an old-style archive])
15070bb88ba4Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
15080bb88ba4Smrg    [Whether to use a lock for old archive extraction])
1509a31a186aSmrg])# _LT_CMD_OLD_ARCHIVE
1510fe5e51b7Smrg
1511fe5e51b7Smrg
1512a31a186aSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1513fe5e51b7Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1514fe5e51b7Smrg# ----------------------------------------------------------------
1515fe5e51b7Smrg# Check whether the given compiler option works
1516a31a186aSmrgAC_DEFUN([_LT_COMPILER_OPTION],
1517a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1518a31a186aSmrgm4_require([_LT_DECL_SED])dnl
1519fe5e51b7SmrgAC_CACHE_CHECK([$1], [$2],
1520fe5e51b7Smrg  [$2=no
1521a31a186aSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1522fe5e51b7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1523fe5e51b7Smrg   lt_compiler_flag="$3"
1524fe5e51b7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1525fe5e51b7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1526fe5e51b7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1527fe5e51b7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1528fe5e51b7Smrg   # The option is referenced via a variable to avoid confusing sed.
1529fe5e51b7Smrg   lt_compile=`echo "$ac_compile" | $SED \
1530fe5e51b7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1531fe5e51b7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1532fe5e51b7Smrg   -e 's:$: $lt_compiler_flag:'`
15330bb88ba4Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1534fe5e51b7Smrg   (eval "$lt_compile" 2>conftest.err)
1535fe5e51b7Smrg   ac_status=$?
1536fe5e51b7Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15370bb88ba4Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1538fe5e51b7Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1539fe5e51b7Smrg     # The compiler can only warn and ignore the option if not recognized
1540fe5e51b7Smrg     # So say no if there are warnings other than the usual output.
15410bb88ba4Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1542fe5e51b7Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1543fe5e51b7Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1544fe5e51b7Smrg       $2=yes
1545fe5e51b7Smrg     fi
1546fe5e51b7Smrg   fi
1547a31a186aSmrg   $RM conftest*
1548fe5e51b7Smrg])
1549fe5e51b7Smrg
1550fe5e51b7Smrgif test x"[$]$2" = xyes; then
1551a31a186aSmrg    m4_if([$5], , :, [$5])
1552fe5e51b7Smrgelse
1553a31a186aSmrg    m4_if([$6], , :, [$6])
1554fe5e51b7Smrgfi
1555a31a186aSmrg])# _LT_COMPILER_OPTION
1556fe5e51b7Smrg
1557a31a186aSmrg# Old name:
1558a31a186aSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1559a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1560a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1561eda3803bSmrg
1562a31a186aSmrg
1563a31a186aSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1564a31a186aSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1565a31a186aSmrg# ----------------------------------------------------
1566a31a186aSmrg# Check whether the given linker option works
1567a31a186aSmrgAC_DEFUN([_LT_LINKER_OPTION],
1568a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1569a31a186aSmrgm4_require([_LT_DECL_SED])dnl
1570fe5e51b7SmrgAC_CACHE_CHECK([$1], [$2],
1571fe5e51b7Smrg  [$2=no
1572fe5e51b7Smrg   save_LDFLAGS="$LDFLAGS"
1573fe5e51b7Smrg   LDFLAGS="$LDFLAGS $3"
1574fe5e51b7Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1575fe5e51b7Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1576fe5e51b7Smrg     # The linker can only warn and ignore the option if not recognized
1577fe5e51b7Smrg     # So say no if there are warnings
1578fe5e51b7Smrg     if test -s conftest.err; then
1579fe5e51b7Smrg       # Append any errors to the config.log.
1580fe5e51b7Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
15810bb88ba4Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1582fe5e51b7Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1583fe5e51b7Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1584fe5e51b7Smrg         $2=yes
1585fe5e51b7Smrg       fi
1586fe5e51b7Smrg     else
1587fe5e51b7Smrg       $2=yes
1588fe5e51b7Smrg     fi
1589fe5e51b7Smrg   fi
1590a31a186aSmrg   $RM -r conftest*
1591fe5e51b7Smrg   LDFLAGS="$save_LDFLAGS"
1592fe5e51b7Smrg])
1593fe5e51b7Smrg
1594fe5e51b7Smrgif test x"[$]$2" = xyes; then
1595a31a186aSmrg    m4_if([$4], , :, [$4])
1596fe5e51b7Smrgelse
1597a31a186aSmrg    m4_if([$5], , :, [$5])
1598fe5e51b7Smrgfi
1599a31a186aSmrg])# _LT_LINKER_OPTION
1600fe5e51b7Smrg
1601a31a186aSmrg# Old name:
1602a31a186aSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1603a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1604a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1605fe5e51b7Smrg
1606a31a186aSmrg
1607a31a186aSmrg# LT_CMD_MAX_LEN
1608a31a186aSmrg#---------------
1609a31a186aSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1610a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1611a31a186aSmrg# find the maximum length of command line arguments
1612fe5e51b7SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1613fe5e51b7SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1614fe5e51b7Smrg  i=0
1615fe5e51b7Smrg  teststring="ABCD"
1616fe5e51b7Smrg
1617fe5e51b7Smrg  case $build_os in
1618fe5e51b7Smrg  msdosdjgpp*)
1619fe5e51b7Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1620fe5e51b7Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1621fe5e51b7Smrg    # during glob expansion).  Even if it were fixed, the result of this
1622fe5e51b7Smrg    # check would be larger than it should be.
1623fe5e51b7Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1624fe5e51b7Smrg    ;;
1625fe5e51b7Smrg
1626fe5e51b7Smrg  gnu*)
1627fe5e51b7Smrg    # Under GNU Hurd, this test is not required because there is
1628fe5e51b7Smrg    # no limit to the length of command line arguments.
1629fe5e51b7Smrg    # Libtool will interpret -1 as no limit whatsoever
1630fe5e51b7Smrg    lt_cv_sys_max_cmd_len=-1;
1631fe5e51b7Smrg    ;;
1632fe5e51b7Smrg
1633a31a186aSmrg  cygwin* | mingw* | cegcc*)
1634fe5e51b7Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1635fe5e51b7Smrg    # about 5 minutes as the teststring grows exponentially.
1636fe5e51b7Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1637fe5e51b7Smrg    # you end up with a "frozen" computer, even though with patience
1638fe5e51b7Smrg    # the test eventually succeeds (with a max line length of 256k).
1639fe5e51b7Smrg    # Instead, let's just punt: use the minimum linelength reported by
1640fe5e51b7Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1641fe5e51b7Smrg    lt_cv_sys_max_cmd_len=8192;
1642fe5e51b7Smrg    ;;
1643fe5e51b7Smrg
16440bb88ba4Smrg  mint*)
16450bb88ba4Smrg    # On MiNT this can take a long time and run out of memory.
16460bb88ba4Smrg    lt_cv_sys_max_cmd_len=8192;
16470bb88ba4Smrg    ;;
16480bb88ba4Smrg
1649fe5e51b7Smrg  amigaos*)
1650fe5e51b7Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1651fe5e51b7Smrg    # So we just punt and use a minimum line length of 8192.
1652fe5e51b7Smrg    lt_cv_sys_max_cmd_len=8192;
1653fe5e51b7Smrg    ;;
1654fe5e51b7Smrg
1655fe5e51b7Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
1656fe5e51b7Smrg    # This has been around since 386BSD, at least.  Likely further.
1657fe5e51b7Smrg    if test -x /sbin/sysctl; then
1658fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1659fe5e51b7Smrg    elif test -x /usr/sbin/sysctl; then
1660fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1661fe5e51b7Smrg    else
1662fe5e51b7Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1663fe5e51b7Smrg    fi
1664fe5e51b7Smrg    # And add a safety zone
1665fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1666fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1667fe5e51b7Smrg    ;;
1668fe5e51b7Smrg
1669fe5e51b7Smrg  interix*)
1670fe5e51b7Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1671fe5e51b7Smrg    lt_cv_sys_max_cmd_len=196608
1672fe5e51b7Smrg    ;;
1673fe5e51b7Smrg
16740bb88ba4Smrg  os2*)
16750bb88ba4Smrg    # The test takes a long time on OS/2.
16760bb88ba4Smrg    lt_cv_sys_max_cmd_len=8192
16770bb88ba4Smrg    ;;
16780bb88ba4Smrg
1679fe5e51b7Smrg  osf*)
1680fe5e51b7Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1681fe5e51b7Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1682fe5e51b7Smrg    # nice to cause kernel panics so lets avoid the loop below.
1683fe5e51b7Smrg    # First set a reasonable default.
1684fe5e51b7Smrg    lt_cv_sys_max_cmd_len=16384
1685fe5e51b7Smrg    #
1686fe5e51b7Smrg    if test -x /sbin/sysconfig; then
1687fe5e51b7Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1688fe5e51b7Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1689fe5e51b7Smrg      esac
1690fe5e51b7Smrg    fi
1691fe5e51b7Smrg    ;;
1692fe5e51b7Smrg  sco3.2v5*)
1693fe5e51b7Smrg    lt_cv_sys_max_cmd_len=102400
1694fe5e51b7Smrg    ;;
1695fe5e51b7Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1696fe5e51b7Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1697fe5e51b7Smrg    if test -n "$kargmax"; then
1698a31a186aSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1699fe5e51b7Smrg    else
1700fe5e51b7Smrg      lt_cv_sys_max_cmd_len=32768
1701fe5e51b7Smrg    fi
1702fe5e51b7Smrg    ;;
1703fe5e51b7Smrg  *)
1704fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1705fe5e51b7Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1706fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1707fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1708fe5e51b7Smrg    else
1709a31a186aSmrg      # Make teststring a little bigger before we do anything with it.
1710a31a186aSmrg      # a 1K string should be a reasonable start.
1711a31a186aSmrg      for i in 1 2 3 4 5 6 7 8 ; do
1712a31a186aSmrg        teststring=$teststring$teststring
1713a31a186aSmrg      done
1714fe5e51b7Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1715a31a186aSmrg      # If test is not a shell built-in, we'll probably end up computing a
1716a31a186aSmrg      # maximum length that is only half of the actual maximum length, but
1717a31a186aSmrg      # we can't tell.
17180bb88ba4Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
17190bb88ba4Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1720fe5e51b7Smrg	      test $i != 17 # 1/2 MB should be enough
1721fe5e51b7Smrg      do
1722fe5e51b7Smrg        i=`expr $i + 1`
1723fe5e51b7Smrg        teststring=$teststring$teststring
1724fe5e51b7Smrg      done
1725a31a186aSmrg      # Only check the string length outside the loop.
1726a31a186aSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1727fe5e51b7Smrg      teststring=
1728a31a186aSmrg      # Add a significant safety factor because C++ compilers can tack on
1729a31a186aSmrg      # massive amounts of additional arguments before passing them to the
1730a31a186aSmrg      # linker.  It appears as though 1/2 is a usable value.
1731fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1732fe5e51b7Smrg    fi
1733fe5e51b7Smrg    ;;
1734fe5e51b7Smrg  esac
1735fe5e51b7Smrg])
1736fe5e51b7Smrgif test -n $lt_cv_sys_max_cmd_len ; then
1737fe5e51b7Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1738fe5e51b7Smrgelse
1739fe5e51b7Smrg  AC_MSG_RESULT(none)
1740fe5e51b7Smrgfi
1741a31a186aSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1742a31a186aSmrg_LT_DECL([], [max_cmd_len], [0],
1743a31a186aSmrg    [What is the maximum length of a command?])
1744a31a186aSmrg])# LT_CMD_MAX_LEN
1745fe5e51b7Smrg
1746a31a186aSmrg# Old name:
1747a31a186aSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1748a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1749a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1750fe5e51b7Smrg
1751a31a186aSmrg
1752a31a186aSmrg# _LT_HEADER_DLFCN
1753a31a186aSmrg# ----------------
1754a31a186aSmrgm4_defun([_LT_HEADER_DLFCN],
1755a31a186aSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1756a31a186aSmrg])# _LT_HEADER_DLFCN
1757fe5e51b7Smrg
1758fe5e51b7Smrg
1759a31a186aSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1760a31a186aSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1761a31a186aSmrg# ----------------------------------------------------------------
1762a31a186aSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1763a31a186aSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1764fe5e51b7Smrgif test "$cross_compiling" = yes; then :
1765fe5e51b7Smrg  [$4]
1766fe5e51b7Smrgelse
1767fe5e51b7Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1768fe5e51b7Smrg  lt_status=$lt_dlunknown
1769a31a186aSmrg  cat > conftest.$ac_ext <<_LT_EOF
17700bb88ba4Smrg[#line $LINENO "configure"
1771fe5e51b7Smrg#include "confdefs.h"
1772fe5e51b7Smrg
1773fe5e51b7Smrg#if HAVE_DLFCN_H
1774fe5e51b7Smrg#include <dlfcn.h>
1775fe5e51b7Smrg#endif
1776fe5e51b7Smrg
1777fe5e51b7Smrg#include <stdio.h>
1778fe5e51b7Smrg
1779fe5e51b7Smrg#ifdef RTLD_GLOBAL
1780fe5e51b7Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1781fe5e51b7Smrg#else
1782fe5e51b7Smrg#  ifdef DL_GLOBAL
1783fe5e51b7Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1784fe5e51b7Smrg#  else
1785fe5e51b7Smrg#    define LT_DLGLOBAL		0
1786fe5e51b7Smrg#  endif
1787fe5e51b7Smrg#endif
1788fe5e51b7Smrg
1789fe5e51b7Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1790fe5e51b7Smrg   find out it does not work in some platform. */
1791fe5e51b7Smrg#ifndef LT_DLLAZY_OR_NOW
1792fe5e51b7Smrg#  ifdef RTLD_LAZY
1793fe5e51b7Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1794fe5e51b7Smrg#  else
1795fe5e51b7Smrg#    ifdef DL_LAZY
1796fe5e51b7Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1797fe5e51b7Smrg#    else
1798fe5e51b7Smrg#      ifdef RTLD_NOW
1799fe5e51b7Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1800fe5e51b7Smrg#      else
1801fe5e51b7Smrg#        ifdef DL_NOW
1802fe5e51b7Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1803fe5e51b7Smrg#        else
1804fe5e51b7Smrg#          define LT_DLLAZY_OR_NOW	0
1805fe5e51b7Smrg#        endif
1806fe5e51b7Smrg#      endif
1807fe5e51b7Smrg#    endif
1808fe5e51b7Smrg#  endif
1809fe5e51b7Smrg#endif
1810fe5e51b7Smrg
18110bb88ba4Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
18120bb88ba4Smrg   correspondingly for the symbols needed.  */
18130bb88ba4Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18140bb88ba4Smrgint fnord () __attribute__((visibility("default")));
18150bb88ba4Smrg#endif
18160bb88ba4Smrg
18170bb88ba4Smrgint fnord () { return 42; }
1818fe5e51b7Smrgint main ()
1819fe5e51b7Smrg{
1820fe5e51b7Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1821fe5e51b7Smrg  int status = $lt_dlunknown;
1822fe5e51b7Smrg
1823fe5e51b7Smrg  if (self)
1824fe5e51b7Smrg    {
1825fe5e51b7Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18260bb88ba4Smrg      else
18270bb88ba4Smrg        {
18280bb88ba4Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18290bb88ba4Smrg          else puts (dlerror ());
18300bb88ba4Smrg	}
1831fe5e51b7Smrg      /* dlclose (self); */
1832fe5e51b7Smrg    }
1833fe5e51b7Smrg  else
1834fe5e51b7Smrg    puts (dlerror ());
1835fe5e51b7Smrg
1836a31a186aSmrg  return status;
1837fe5e51b7Smrg}]
1838a31a186aSmrg_LT_EOF
1839fe5e51b7Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
1840fe5e51b7Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1841fe5e51b7Smrg    lt_status=$?
1842fe5e51b7Smrg    case x$lt_status in
1843fe5e51b7Smrg      x$lt_dlno_uscore) $1 ;;
1844fe5e51b7Smrg      x$lt_dlneed_uscore) $2 ;;
1845fe5e51b7Smrg      x$lt_dlunknown|x*) $3 ;;
1846fe5e51b7Smrg    esac
1847fe5e51b7Smrg  else :
1848fe5e51b7Smrg    # compilation failed
1849fe5e51b7Smrg    $3
1850fe5e51b7Smrg  fi
1851fe5e51b7Smrgfi
1852fe5e51b7Smrgrm -fr conftest*
1853a31a186aSmrg])# _LT_TRY_DLOPEN_SELF
1854fe5e51b7Smrg
1855fe5e51b7Smrg
1856a31a186aSmrg# LT_SYS_DLOPEN_SELF
1857a31a186aSmrg# ------------------
1858a31a186aSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1859a31a186aSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1860fe5e51b7Smrgif test "x$enable_dlopen" != xyes; then
1861fe5e51b7Smrg  enable_dlopen=unknown
1862fe5e51b7Smrg  enable_dlopen_self=unknown
1863fe5e51b7Smrg  enable_dlopen_self_static=unknown
1864fe5e51b7Smrgelse
1865fe5e51b7Smrg  lt_cv_dlopen=no
1866fe5e51b7Smrg  lt_cv_dlopen_libs=
1867fe5e51b7Smrg
1868fe5e51b7Smrg  case $host_os in
1869fe5e51b7Smrg  beos*)
1870fe5e51b7Smrg    lt_cv_dlopen="load_add_on"
1871fe5e51b7Smrg    lt_cv_dlopen_libs=
1872fe5e51b7Smrg    lt_cv_dlopen_self=yes
1873fe5e51b7Smrg    ;;
1874fe5e51b7Smrg
1875a31a186aSmrg  mingw* | pw32* | cegcc*)
1876fe5e51b7Smrg    lt_cv_dlopen="LoadLibrary"
1877fe5e51b7Smrg    lt_cv_dlopen_libs=
1878a31a186aSmrg    ;;
1879fe5e51b7Smrg
1880fe5e51b7Smrg  cygwin*)
1881fe5e51b7Smrg    lt_cv_dlopen="dlopen"
1882fe5e51b7Smrg    lt_cv_dlopen_libs=
1883a31a186aSmrg    ;;
1884fe5e51b7Smrg
1885fe5e51b7Smrg  darwin*)
1886fe5e51b7Smrg  # if libdl is installed we need to link against it
1887fe5e51b7Smrg    AC_CHECK_LIB([dl], [dlopen],
1888fe5e51b7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
1889fe5e51b7Smrg    lt_cv_dlopen="dyld"
1890fe5e51b7Smrg    lt_cv_dlopen_libs=
1891fe5e51b7Smrg    lt_cv_dlopen_self=yes
1892fe5e51b7Smrg    ])
1893a31a186aSmrg    ;;
1894fe5e51b7Smrg
1895fe5e51b7Smrg  *)
1896fe5e51b7Smrg    AC_CHECK_FUNC([shl_load],
1897fe5e51b7Smrg	  [lt_cv_dlopen="shl_load"],
1898fe5e51b7Smrg      [AC_CHECK_LIB([dld], [shl_load],
1899eda3803bSmrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
1900fe5e51b7Smrg	[AC_CHECK_FUNC([dlopen],
1901fe5e51b7Smrg	      [lt_cv_dlopen="dlopen"],
1902fe5e51b7Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1903fe5e51b7Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
1904fe5e51b7Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1905fe5e51b7Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
1906fe5e51b7Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1907eda3803bSmrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
1908fe5e51b7Smrg	      ])
1909fe5e51b7Smrg	    ])
1910fe5e51b7Smrg	  ])
1911fe5e51b7Smrg	])
1912fe5e51b7Smrg      ])
1913fe5e51b7Smrg    ;;
1914fe5e51b7Smrg  esac
1915fe5e51b7Smrg
1916fe5e51b7Smrg  if test "x$lt_cv_dlopen" != xno; then
1917fe5e51b7Smrg    enable_dlopen=yes
1918fe5e51b7Smrg  else
1919fe5e51b7Smrg    enable_dlopen=no
1920fe5e51b7Smrg  fi
1921fe5e51b7Smrg
1922fe5e51b7Smrg  case $lt_cv_dlopen in
1923fe5e51b7Smrg  dlopen)
1924fe5e51b7Smrg    save_CPPFLAGS="$CPPFLAGS"
1925fe5e51b7Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1926fe5e51b7Smrg
1927fe5e51b7Smrg    save_LDFLAGS="$LDFLAGS"
1928fe5e51b7Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1929fe5e51b7Smrg
1930fe5e51b7Smrg    save_LIBS="$LIBS"
1931fe5e51b7Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1932fe5e51b7Smrg
1933fe5e51b7Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1934fe5e51b7Smrg	  lt_cv_dlopen_self, [dnl
1935a31a186aSmrg	  _LT_TRY_DLOPEN_SELF(
1936fe5e51b7Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1937fe5e51b7Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1938fe5e51b7Smrg    ])
1939fe5e51b7Smrg
1940fe5e51b7Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
1941fe5e51b7Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1942fe5e51b7Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1943a31a186aSmrg	  lt_cv_dlopen_self_static, [dnl
1944a31a186aSmrg	  _LT_TRY_DLOPEN_SELF(
1945fe5e51b7Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
1946fe5e51b7Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
1947fe5e51b7Smrg      ])
1948fe5e51b7Smrg    fi
1949fe5e51b7Smrg
1950fe5e51b7Smrg    CPPFLAGS="$save_CPPFLAGS"
1951fe5e51b7Smrg    LDFLAGS="$save_LDFLAGS"
1952fe5e51b7Smrg    LIBS="$save_LIBS"
1953fe5e51b7Smrg    ;;
1954fe5e51b7Smrg  esac
1955fe5e51b7Smrg
1956fe5e51b7Smrg  case $lt_cv_dlopen_self in
1957fe5e51b7Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
1958fe5e51b7Smrg  *) enable_dlopen_self=unknown ;;
1959fe5e51b7Smrg  esac
1960fe5e51b7Smrg
1961fe5e51b7Smrg  case $lt_cv_dlopen_self_static in
1962fe5e51b7Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
1963fe5e51b7Smrg  *) enable_dlopen_self_static=unknown ;;
1964fe5e51b7Smrg  esac
1965fe5e51b7Smrgfi
1966a31a186aSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1967a31a186aSmrg	 [Whether dlopen is supported])
1968a31a186aSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1969a31a186aSmrg	 [Whether dlopen of programs is supported])
1970a31a186aSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1971a31a186aSmrg	 [Whether dlopen of statically linked programs is supported])
1972a31a186aSmrg])# LT_SYS_DLOPEN_SELF
1973fe5e51b7Smrg
1974a31a186aSmrg# Old name:
1975a31a186aSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1976a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1977a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1978eda3803bSmrg
1979a31a186aSmrg
1980a31a186aSmrg# _LT_COMPILER_C_O([TAGNAME])
1981a31a186aSmrg# ---------------------------
1982a31a186aSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
1983a31a186aSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1984a31a186aSmrgm4_defun([_LT_COMPILER_C_O],
1985a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
1986a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1987a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
1988fe5e51b7SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1989a31a186aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1990a31a186aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1991a31a186aSmrg   $RM -r conftest 2>/dev/null
1992fe5e51b7Smrg   mkdir conftest
1993fe5e51b7Smrg   cd conftest
1994fe5e51b7Smrg   mkdir out
1995fe5e51b7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1996fe5e51b7Smrg
1997fe5e51b7Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
1998fe5e51b7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1999fe5e51b7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2000fe5e51b7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2001fe5e51b7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2002fe5e51b7Smrg   lt_compile=`echo "$ac_compile" | $SED \
2003fe5e51b7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2004fe5e51b7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2005fe5e51b7Smrg   -e 's:$: $lt_compiler_flag:'`
20060bb88ba4Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2007fe5e51b7Smrg   (eval "$lt_compile" 2>out/conftest.err)
2008fe5e51b7Smrg   ac_status=$?
2009fe5e51b7Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20100bb88ba4Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2011fe5e51b7Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2012fe5e51b7Smrg   then
2013fe5e51b7Smrg     # The compiler can only warn and ignore the option if not recognized
2014fe5e51b7Smrg     # So say no if there are warnings
20150bb88ba4Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2016fe5e51b7Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2017fe5e51b7Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2018a31a186aSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2019fe5e51b7Smrg     fi
2020fe5e51b7Smrg   fi
2021fe5e51b7Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2022a31a186aSmrg   $RM conftest*
2023fe5e51b7Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2024fe5e51b7Smrg   # template instantiation
2025a31a186aSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2026a31a186aSmrg   $RM out/* && rmdir out
2027fe5e51b7Smrg   cd ..
2028a31a186aSmrg   $RM -r conftest
2029a31a186aSmrg   $RM conftest*
2030fe5e51b7Smrg])
2031a31a186aSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2032a31a186aSmrg	[Does compiler simultaneously support -c and -o options?])
2033a31a186aSmrg])# _LT_COMPILER_C_O
2034fe5e51b7Smrg
2035fe5e51b7Smrg
2036a31a186aSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2037a31a186aSmrg# ----------------------------------
2038fe5e51b7Smrg# Check to see if we can do hard links to lock some files if needed
2039a31a186aSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2040a31a186aSmrg[m4_require([_LT_ENABLE_LOCK])dnl
2041a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2042a31a186aSmrg_LT_COMPILER_C_O([$1])
2043fe5e51b7Smrg
2044fe5e51b7Smrghard_links="nottested"
2045a31a186aSmrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
2046fe5e51b7Smrg  # do not overwrite the value of need_locks provided by the user
2047fe5e51b7Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2048fe5e51b7Smrg  hard_links=yes
2049a31a186aSmrg  $RM conftest*
2050fe5e51b7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2051fe5e51b7Smrg  touch conftest.a
2052fe5e51b7Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2053fe5e51b7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2054fe5e51b7Smrg  AC_MSG_RESULT([$hard_links])
2055fe5e51b7Smrg  if test "$hard_links" = no; then
2056fe5e51b7Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
2057fe5e51b7Smrg    need_locks=warn
2058fe5e51b7Smrg  fi
2059fe5e51b7Smrgelse
2060fe5e51b7Smrg  need_locks=no
2061fe5e51b7Smrgfi
2062a31a186aSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2063a31a186aSmrg])# _LT_COMPILER_FILE_LOCKS
2064fe5e51b7Smrg
2065fe5e51b7Smrg
2066a31a186aSmrg# _LT_CHECK_OBJDIR
2067a31a186aSmrg# ----------------
2068a31a186aSmrgm4_defun([_LT_CHECK_OBJDIR],
2069fe5e51b7Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2070fe5e51b7Smrg[rm -f .libs 2>/dev/null
2071fe5e51b7Smrgmkdir .libs 2>/dev/null
2072fe5e51b7Smrgif test -d .libs; then
2073fe5e51b7Smrg  lt_cv_objdir=.libs
2074fe5e51b7Smrgelse
2075fe5e51b7Smrg  # MS-DOS does not allow filenames that begin with a dot.
2076fe5e51b7Smrg  lt_cv_objdir=_libs
2077fe5e51b7Smrgfi
2078fe5e51b7Smrgrmdir .libs 2>/dev/null])
2079fe5e51b7Smrgobjdir=$lt_cv_objdir
2080a31a186aSmrg_LT_DECL([], [objdir], [0],
2081a31a186aSmrg         [The name of the directory that contains temporary libtool files])dnl
2082a31a186aSmrgm4_pattern_allow([LT_OBJDIR])dnl
2083a31a186aSmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2084a31a186aSmrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2085a31a186aSmrg])# _LT_CHECK_OBJDIR
2086fe5e51b7Smrg
2087fe5e51b7Smrg
2088a31a186aSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2089a31a186aSmrg# --------------------------------------
2090fe5e51b7Smrg# Check hardcoding attributes.
2091a31a186aSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2092fe5e51b7Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2093a31a186aSmrg_LT_TAGVAR(hardcode_action, $1)=
2094a31a186aSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2095a31a186aSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2096a31a186aSmrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
2097fe5e51b7Smrg
2098a31a186aSmrg  # We can hardcode non-existent directories.
2099a31a186aSmrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
2100fe5e51b7Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2101fe5e51b7Smrg     # have to relink, otherwise we might link with an installed library
2102fe5e51b7Smrg     # when we should be linking with a yet-to-be-installed one
2103a31a186aSmrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2104a31a186aSmrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
2105fe5e51b7Smrg    # Linking always hardcodes the temporary library directory.
2106a31a186aSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2107fe5e51b7Smrg  else
2108fe5e51b7Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2109a31a186aSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2110fe5e51b7Smrg  fi
2111fe5e51b7Smrgelse
2112fe5e51b7Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2113fe5e51b7Smrg  # directories.
2114a31a186aSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2115fe5e51b7Smrgfi
2116a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2117fe5e51b7Smrg
2118a31a186aSmrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2119a31a186aSmrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
2120fe5e51b7Smrg  # Fast installation is not supported
2121fe5e51b7Smrg  enable_fast_install=no
2122fe5e51b7Smrgelif test "$shlibpath_overrides_runpath" = yes ||
2123fe5e51b7Smrg     test "$enable_shared" = no; then
2124fe5e51b7Smrg  # Fast installation is not necessary
2125fe5e51b7Smrg  enable_fast_install=needless
2126fe5e51b7Smrgfi
2127a31a186aSmrg_LT_TAGDECL([], [hardcode_action], [0],
2128a31a186aSmrg    [How to hardcode a shared library path into an executable])
2129a31a186aSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2130fe5e51b7Smrg
2131fe5e51b7Smrg
2132a31a186aSmrg# _LT_CMD_STRIPLIB
2133a31a186aSmrg# ----------------
2134a31a186aSmrgm4_defun([_LT_CMD_STRIPLIB],
2135a31a186aSmrg[m4_require([_LT_DECL_EGREP])
2136a31a186aSmrgstriplib=
2137fe5e51b7Smrgold_striplib=
2138fe5e51b7SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2139a31a186aSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2140fe5e51b7Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2141fe5e51b7Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2142fe5e51b7Smrg  AC_MSG_RESULT([yes])
2143fe5e51b7Smrgelse
2144fe5e51b7Smrg# FIXME - insert some real tests, host_os isn't really good enough
2145fe5e51b7Smrg  case $host_os in
2146a31a186aSmrg  darwin*)
2147a31a186aSmrg    if test -n "$STRIP" ; then
2148a31a186aSmrg      striplib="$STRIP -x"
2149a31a186aSmrg      old_striplib="$STRIP -S"
2150a31a186aSmrg      AC_MSG_RESULT([yes])
2151a31a186aSmrg    else
2152a31a186aSmrg      AC_MSG_RESULT([no])
2153a31a186aSmrg    fi
2154a31a186aSmrg    ;;
2155a31a186aSmrg  *)
2156a31a186aSmrg    AC_MSG_RESULT([no])
2157fe5e51b7Smrg    ;;
2158fe5e51b7Smrg  esac
2159fe5e51b7Smrgfi
2160a31a186aSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2161a31a186aSmrg_LT_DECL([], [striplib], [1])
2162a31a186aSmrg])# _LT_CMD_STRIPLIB
2163fe5e51b7Smrg
2164fe5e51b7Smrg
2165a31a186aSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2166fe5e51b7Smrg# -----------------------------
2167fe5e51b7Smrg# PORTME Fill in your ld.so characteristics
2168a31a186aSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2169a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2170a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
2171a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2172a31a186aSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2173a31a186aSmrgm4_require([_LT_DECL_SED])dnl
21740bb88ba4Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2175fe5e51b7SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2176a31a186aSmrgm4_if([$1],
2177a31a186aSmrg	[], [
2178fe5e51b7Smrgif test "$GCC" = yes; then
2179fe5e51b7Smrg  case $host_os in
2180fe5e51b7Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2181fe5e51b7Smrg    *) lt_awk_arg="/^libraries:/" ;;
2182fe5e51b7Smrg  esac
21830bb88ba4Smrg  case $host_os in
21840bb88ba4Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
21850bb88ba4Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
21860bb88ba4Smrg  esac
21870bb88ba4Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
21880bb88ba4Smrg  case $lt_search_path_spec in
21890bb88ba4Smrg  *\;*)
2190fe5e51b7Smrg    # if the path contains ";" then we assume it to be the separator
2191fe5e51b7Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2192fe5e51b7Smrg    # assumed that no part of a normal pathname contains ";" but that should
2193fe5e51b7Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
21940bb88ba4Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
21950bb88ba4Smrg    ;;
21960bb88ba4Smrg  *)
21970bb88ba4Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
21980bb88ba4Smrg    ;;
21990bb88ba4Smrg  esac
2200fe5e51b7Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2201fe5e51b7Smrg  # and add multilib dir if necessary.
2202fe5e51b7Smrg  lt_tmp_lt_search_path_spec=
2203fe5e51b7Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2204fe5e51b7Smrg  for lt_sys_path in $lt_search_path_spec; do
2205fe5e51b7Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2206fe5e51b7Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2207fe5e51b7Smrg    else
2208fe5e51b7Smrg      test -d "$lt_sys_path" && \
2209fe5e51b7Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2210fe5e51b7Smrg    fi
2211fe5e51b7Smrg  done
22120bb88ba4Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2213fe5e51b7SmrgBEGIN {RS=" "; FS="/|\n";} {
2214fe5e51b7Smrg  lt_foo="";
2215fe5e51b7Smrg  lt_count=0;
2216fe5e51b7Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2217fe5e51b7Smrg    if ($lt_i != "" && $lt_i != ".") {
2218fe5e51b7Smrg      if ($lt_i == "..") {
2219fe5e51b7Smrg        lt_count++;
2220fe5e51b7Smrg      } else {
2221fe5e51b7Smrg        if (lt_count == 0) {
2222fe5e51b7Smrg          lt_foo="/" $lt_i lt_foo;
2223fe5e51b7Smrg        } else {
2224fe5e51b7Smrg          lt_count--;
2225fe5e51b7Smrg        }
2226fe5e51b7Smrg      }
2227fe5e51b7Smrg    }
2228fe5e51b7Smrg  }
2229fe5e51b7Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2230fe5e51b7Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2231fe5e51b7Smrg}'`
22320bb88ba4Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22330bb88ba4Smrg  # for these hosts.
22340bb88ba4Smrg  case $host_os in
22350bb88ba4Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
22360bb88ba4Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
22370bb88ba4Smrg  esac
22380bb88ba4Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2239fe5e51b7Smrgelse
2240fe5e51b7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2241fe5e51b7Smrgfi])
2242a31a186aSmrglibrary_names_spec=
2243a31a186aSmrglibname_spec='lib$name'
2244a31a186aSmrgsoname_spec=
2245a31a186aSmrgshrext_cmds=".so"
2246a31a186aSmrgpostinstall_cmds=
2247a31a186aSmrgpostuninstall_cmds=
2248a31a186aSmrgfinish_cmds=
2249a31a186aSmrgfinish_eval=
2250a31a186aSmrgshlibpath_var=
2251a31a186aSmrgshlibpath_overrides_runpath=unknown
2252a31a186aSmrgversion_type=none
2253a31a186aSmrgdynamic_linker="$host_os ld.so"
2254a31a186aSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2255fe5e51b7Smrgneed_lib_prefix=unknown
2256fe5e51b7Smrghardcode_into_libs=no
2257fe5e51b7Smrg
2258fe5e51b7Smrg# when you set need_version to no, make sure it does not cause -set_version
2259fe5e51b7Smrg# flags to be left without arguments
2260fe5e51b7Smrgneed_version=unknown
2261fe5e51b7Smrg
2262fe5e51b7Smrgcase $host_os in
2263fe5e51b7Smrgaix3*)
22640bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2265fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
2266fe5e51b7Smrg  shlibpath_var=LIBPATH
2267fe5e51b7Smrg
2268fe5e51b7Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2269fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2270fe5e51b7Smrg  ;;
2271fe5e51b7Smrg
2272eda3803bSmrgaix[[4-9]]*)
22730bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2274fe5e51b7Smrg  need_lib_prefix=no
2275fe5e51b7Smrg  need_version=no
2276fe5e51b7Smrg  hardcode_into_libs=yes
2277fe5e51b7Smrg  if test "$host_cpu" = ia64; then
2278fe5e51b7Smrg    # AIX 5 supports IA64
2279fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
2280fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2281fe5e51b7Smrg  else
2282fe5e51b7Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2283fe5e51b7Smrg    # for dependence libraries.  The import file would start with
2284fe5e51b7Smrg    # the line `#! .'.  This would cause the generated library to
2285fe5e51b7Smrg    # depend on `.', always an invalid library.  This was fixed in
2286fe5e51b7Smrg    # development snapshots of GCC prior to 3.0.
2287fe5e51b7Smrg    case $host_os in
2288fe5e51b7Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2289fe5e51b7Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2290fe5e51b7Smrg	   echo ' yes '
2291a31a186aSmrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
2292fe5e51b7Smrg	:
2293fe5e51b7Smrg      else
2294fe5e51b7Smrg	can_build_shared=no
2295fe5e51b7Smrg      fi
2296fe5e51b7Smrg      ;;
2297fe5e51b7Smrg    esac
2298fe5e51b7Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
2299fe5e51b7Smrg    # soname into executable. Probably we can add versioning support to
2300fe5e51b7Smrg    # collect2, so additional links can be useful in future.
2301fe5e51b7Smrg    if test "$aix_use_runtimelinking" = yes; then
2302fe5e51b7Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2303fe5e51b7Smrg      # instead of lib<name>.a to let people know that these are not
2304fe5e51b7Smrg      # typical AIX shared libraries.
2305fe5e51b7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2306fe5e51b7Smrg    else
2307fe5e51b7Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2308fe5e51b7Smrg      # and later when we are not doing run time linking.
2309fe5e51b7Smrg      library_names_spec='${libname}${release}.a $libname.a'
2310fe5e51b7Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2311fe5e51b7Smrg    fi
2312fe5e51b7Smrg    shlibpath_var=LIBPATH
2313fe5e51b7Smrg  fi
2314fe5e51b7Smrg  ;;
2315fe5e51b7Smrg
2316fe5e51b7Smrgamigaos*)
2317a31a186aSmrg  case $host_cpu in
2318a31a186aSmrg  powerpc)
2319a31a186aSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2320a31a186aSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2321a31a186aSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2322a31a186aSmrg    ;;
2323a31a186aSmrg  m68k)
2324a31a186aSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2325a31a186aSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
23260bb88ba4Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
2327a31a186aSmrg    ;;
2328a31a186aSmrg  esac
2329fe5e51b7Smrg  ;;
2330fe5e51b7Smrg
2331fe5e51b7Smrgbeos*)
2332fe5e51b7Smrg  library_names_spec='${libname}${shared_ext}'
2333fe5e51b7Smrg  dynamic_linker="$host_os ld.so"
2334fe5e51b7Smrg  shlibpath_var=LIBRARY_PATH
2335fe5e51b7Smrg  ;;
2336fe5e51b7Smrg
2337fe5e51b7Smrgbsdi[[45]]*)
23380bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2339fe5e51b7Smrg  need_version=no
2340fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2341fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2342fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2343fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2344fe5e51b7Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2345fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2346fe5e51b7Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2347fe5e51b7Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2348fe5e51b7Smrg  # libtool to hard-code these into programs
2349fe5e51b7Smrg  ;;
2350fe5e51b7Smrg
2351a31a186aSmrgcygwin* | mingw* | pw32* | cegcc*)
2352fe5e51b7Smrg  version_type=windows
2353fe5e51b7Smrg  shrext_cmds=".dll"
2354fe5e51b7Smrg  need_version=no
2355fe5e51b7Smrg  need_lib_prefix=no
2356fe5e51b7Smrg
23570bb88ba4Smrg  case $GCC,$cc_basename in
23580bb88ba4Smrg  yes,*)
23590bb88ba4Smrg    # gcc
2360fe5e51b7Smrg    library_names_spec='$libname.dll.a'
2361fe5e51b7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2362fe5e51b7Smrg    postinstall_cmds='base_file=`basename \${file}`~
2363a31a186aSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2364fe5e51b7Smrg      dldir=$destdir/`dirname \$dlpath`~
2365fe5e51b7Smrg      test -d \$dldir || mkdir -p \$dldir~
2366fe5e51b7Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2367a31a186aSmrg      chmod a+x \$dldir/$dlname~
2368a31a186aSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2369a31a186aSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2370a31a186aSmrg      fi'
2371fe5e51b7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2372fe5e51b7Smrg      dlpath=$dir/\$dldll~
2373a31a186aSmrg       $RM \$dlpath'
2374fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2375fe5e51b7Smrg
2376fe5e51b7Smrg    case $host_os in
2377fe5e51b7Smrg    cygwin*)
2378fe5e51b7Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2379fe5e51b7Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23800bb88ba4Smrgm4_if([$1], [],[
23810bb88ba4Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2382fe5e51b7Smrg      ;;
2383a31a186aSmrg    mingw* | cegcc*)
2384fe5e51b7Smrg      # MinGW DLLs use traditional 'lib' prefix
2385fe5e51b7Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2386fe5e51b7Smrg      ;;
2387fe5e51b7Smrg    pw32*)
2388fe5e51b7Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2389fe5e51b7Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2390fe5e51b7Smrg      ;;
2391fe5e51b7Smrg    esac
23920bb88ba4Smrg    dynamic_linker='Win32 ld.exe'
23930bb88ba4Smrg    ;;
23940bb88ba4Smrg
23950bb88ba4Smrg  *,cl*)
23960bb88ba4Smrg    # Native MSVC
23970bb88ba4Smrg    libname_spec='$name'
23980bb88ba4Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
23990bb88ba4Smrg    library_names_spec='${libname}.dll.lib'
24000bb88ba4Smrg
24010bb88ba4Smrg    case $build_os in
24020bb88ba4Smrg    mingw*)
24030bb88ba4Smrg      sys_lib_search_path_spec=
24040bb88ba4Smrg      lt_save_ifs=$IFS
24050bb88ba4Smrg      IFS=';'
24060bb88ba4Smrg      for lt_path in $LIB
24070bb88ba4Smrg      do
24080bb88ba4Smrg        IFS=$lt_save_ifs
24090bb88ba4Smrg        # Let DOS variable expansion print the short 8.3 style file name.
24100bb88ba4Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
24110bb88ba4Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
24120bb88ba4Smrg      done
24130bb88ba4Smrg      IFS=$lt_save_ifs
24140bb88ba4Smrg      # Convert to MSYS style.
24150bb88ba4Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
24160bb88ba4Smrg      ;;
24170bb88ba4Smrg    cygwin*)
24180bb88ba4Smrg      # Convert to unix form, then to dos form, then back to unix form
24190bb88ba4Smrg      # but this time dos style (no spaces!) so that the unix form looks
24200bb88ba4Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
24210bb88ba4Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
24220bb88ba4Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
24230bb88ba4Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24240bb88ba4Smrg      ;;
24250bb88ba4Smrg    *)
24260bb88ba4Smrg      sys_lib_search_path_spec="$LIB"
24270bb88ba4Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
24280bb88ba4Smrg        # It is most probably a Windows format PATH.
24290bb88ba4Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
24300bb88ba4Smrg      else
24310bb88ba4Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
24320bb88ba4Smrg      fi
24330bb88ba4Smrg      # FIXME: find the short name or the path components, as spaces are
24340bb88ba4Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
24350bb88ba4Smrg      ;;
24360bb88ba4Smrg    esac
24370bb88ba4Smrg
24380bb88ba4Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
24390bb88ba4Smrg    postinstall_cmds='base_file=`basename \${file}`~
24400bb88ba4Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
24410bb88ba4Smrg      dldir=$destdir/`dirname \$dlpath`~
24420bb88ba4Smrg      test -d \$dldir || mkdir -p \$dldir~
24430bb88ba4Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
24440bb88ba4Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
24450bb88ba4Smrg      dlpath=$dir/\$dldll~
24460bb88ba4Smrg       $RM \$dlpath'
24470bb88ba4Smrg    shlibpath_overrides_runpath=yes
24480bb88ba4Smrg    dynamic_linker='Win32 link.exe'
2449fe5e51b7Smrg    ;;
2450fe5e51b7Smrg
2451fe5e51b7Smrg  *)
24520bb88ba4Smrg    # Assume MSVC wrapper
2453fe5e51b7Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
24540bb88ba4Smrg    dynamic_linker='Win32 ld.exe'
2455fe5e51b7Smrg    ;;
2456fe5e51b7Smrg  esac
2457fe5e51b7Smrg  # FIXME: first we should search . and the directory the executable is in
2458fe5e51b7Smrg  shlibpath_var=PATH
2459fe5e51b7Smrg  ;;
2460fe5e51b7Smrg
2461fe5e51b7Smrgdarwin* | rhapsody*)
2462fe5e51b7Smrg  dynamic_linker="$host_os dyld"
2463fe5e51b7Smrg  version_type=darwin
2464fe5e51b7Smrg  need_lib_prefix=no
2465fe5e51b7Smrg  need_version=no
2466a31a186aSmrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
2467fe5e51b7Smrg  soname_spec='${libname}${release}${major}$shared_ext'
2468fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2469fe5e51b7Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2470fe5e51b7Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2471a31a186aSmrgm4_if([$1], [],[
2472a31a186aSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2473fe5e51b7Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2474fe5e51b7Smrg  ;;
2475fe5e51b7Smrg
2476fe5e51b7Smrgdgux*)
24770bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2478fe5e51b7Smrg  need_lib_prefix=no
2479fe5e51b7Smrg  need_version=no
2480fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
2481fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2482fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2483fe5e51b7Smrg  ;;
2484fe5e51b7Smrg
2485fe5e51b7Smrgfreebsd* | dragonfly*)
2486fe5e51b7Smrg  # DragonFly does not have aout.  When/if they implement a new
2487fe5e51b7Smrg  # versioning mechanism, adjust this.
2488fe5e51b7Smrg  if test -x /usr/bin/objformat; then
2489fe5e51b7Smrg    objformat=`/usr/bin/objformat`
2490fe5e51b7Smrg  else
2491fe5e51b7Smrg    case $host_os in
24920bb88ba4Smrg    freebsd[[23]].*) objformat=aout ;;
2493fe5e51b7Smrg    *) objformat=elf ;;
2494fe5e51b7Smrg    esac
2495fe5e51b7Smrg  fi
2496fe5e51b7Smrg  version_type=freebsd-$objformat
2497fe5e51b7Smrg  case $version_type in
2498fe5e51b7Smrg    freebsd-elf*)
2499fe5e51b7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2500fe5e51b7Smrg      need_version=no
2501fe5e51b7Smrg      need_lib_prefix=no
2502fe5e51b7Smrg      ;;
2503fe5e51b7Smrg    freebsd-*)
2504fe5e51b7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
2505fe5e51b7Smrg      need_version=yes
2506fe5e51b7Smrg      ;;
2507fe5e51b7Smrg  esac
2508fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2509fe5e51b7Smrg  case $host_os in
25100bb88ba4Smrg  freebsd2.*)
2511fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2512fe5e51b7Smrg    ;;
2513fe5e51b7Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2514fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2515fe5e51b7Smrg    hardcode_into_libs=yes
2516fe5e51b7Smrg    ;;
2517fe5e51b7Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2518fe5e51b7Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2519fe5e51b7Smrg    shlibpath_overrides_runpath=no
2520fe5e51b7Smrg    hardcode_into_libs=yes
2521fe5e51b7Smrg    ;;
2522fe5e51b7Smrg  *) # from 4.6 on, and DragonFly
2523fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2524fe5e51b7Smrg    hardcode_into_libs=yes
2525fe5e51b7Smrg    ;;
2526fe5e51b7Smrg  esac
2527fe5e51b7Smrg  ;;
2528fe5e51b7Smrg
2529fe5e51b7Smrggnu*)
25300bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2531fe5e51b7Smrg  need_lib_prefix=no
2532fe5e51b7Smrg  need_version=no
2533fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2534fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2535fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
25360bb88ba4Smrg  shlibpath_overrides_runpath=no
25370bb88ba4Smrg  hardcode_into_libs=yes
25380bb88ba4Smrg  ;;
25390bb88ba4Smrg
25400bb88ba4Smrghaiku*)
25410bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
25420bb88ba4Smrg  need_lib_prefix=no
25430bb88ba4Smrg  need_version=no
25440bb88ba4Smrg  dynamic_linker="$host_os runtime_loader"
25450bb88ba4Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
25460bb88ba4Smrg  soname_spec='${libname}${release}${shared_ext}$major'
25470bb88ba4Smrg  shlibpath_var=LIBRARY_PATH
25480bb88ba4Smrg  shlibpath_overrides_runpath=yes
25490bb88ba4Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2550fe5e51b7Smrg  hardcode_into_libs=yes
2551fe5e51b7Smrg  ;;
2552fe5e51b7Smrg
2553fe5e51b7Smrghpux9* | hpux10* | hpux11*)
2554fe5e51b7Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2555fe5e51b7Smrg  # link against other versions.
2556fe5e51b7Smrg  version_type=sunos
2557fe5e51b7Smrg  need_lib_prefix=no
2558fe5e51b7Smrg  need_version=no
2559fe5e51b7Smrg  case $host_cpu in
2560fe5e51b7Smrg  ia64*)
2561fe5e51b7Smrg    shrext_cmds='.so'
2562fe5e51b7Smrg    hardcode_into_libs=yes
2563fe5e51b7Smrg    dynamic_linker="$host_os dld.so"
2564fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2565fe5e51b7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2566fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2567fe5e51b7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2568fe5e51b7Smrg    if test "X$HPUX_IA64_MODE" = X32; then
2569fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2570fe5e51b7Smrg    else
2571fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2572fe5e51b7Smrg    fi
2573fe5e51b7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2574fe5e51b7Smrg    ;;
2575a31a186aSmrg  hppa*64*)
2576a31a186aSmrg    shrext_cmds='.sl'
2577a31a186aSmrg    hardcode_into_libs=yes
2578a31a186aSmrg    dynamic_linker="$host_os dld.sl"
2579a31a186aSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2580a31a186aSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2581a31a186aSmrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2582a31a186aSmrg    soname_spec='${libname}${release}${shared_ext}$major'
2583a31a186aSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2584a31a186aSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2585a31a186aSmrg    ;;
2586a31a186aSmrg  *)
2587fe5e51b7Smrg    shrext_cmds='.sl'
2588fe5e51b7Smrg    dynamic_linker="$host_os dld.sl"
2589fe5e51b7Smrg    shlibpath_var=SHLIB_PATH
2590fe5e51b7Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2591fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2592fe5e51b7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2593fe5e51b7Smrg    ;;
2594fe5e51b7Smrg  esac
25950bb88ba4Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2596fe5e51b7Smrg  postinstall_cmds='chmod 555 $lib'
25970bb88ba4Smrg  # or fails outright, so override atomically:
25980bb88ba4Smrg  install_override_mode=555
2599fe5e51b7Smrg  ;;
2600fe5e51b7Smrg
2601fe5e51b7Smrginterix[[3-9]]*)
26020bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2603fe5e51b7Smrg  need_lib_prefix=no
2604fe5e51b7Smrg  need_version=no
2605fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2606fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2607fe5e51b7Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2608fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2609fe5e51b7Smrg  shlibpath_overrides_runpath=no
2610fe5e51b7Smrg  hardcode_into_libs=yes
2611fe5e51b7Smrg  ;;
2612fe5e51b7Smrg
2613fe5e51b7Smrgirix5* | irix6* | nonstopux*)
2614fe5e51b7Smrg  case $host_os in
2615fe5e51b7Smrg    nonstopux*) version_type=nonstopux ;;
2616fe5e51b7Smrg    *)
2617fe5e51b7Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
26180bb88ba4Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2619fe5e51b7Smrg	else
2620fe5e51b7Smrg		version_type=irix
2621fe5e51b7Smrg	fi ;;
2622fe5e51b7Smrg  esac
2623fe5e51b7Smrg  need_lib_prefix=no
2624fe5e51b7Smrg  need_version=no
2625fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2626fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
2627fe5e51b7Smrg  case $host_os in
2628fe5e51b7Smrg  irix5* | nonstopux*)
2629fe5e51b7Smrg    libsuff= shlibsuff=
2630fe5e51b7Smrg    ;;
2631fe5e51b7Smrg  *)
2632fe5e51b7Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2633fe5e51b7Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2634fe5e51b7Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2635fe5e51b7Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2636fe5e51b7Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2637fe5e51b7Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2638fe5e51b7Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2639fe5e51b7Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2640fe5e51b7Smrg    esac
2641fe5e51b7Smrg    ;;
2642fe5e51b7Smrg  esac
2643fe5e51b7Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2644fe5e51b7Smrg  shlibpath_overrides_runpath=no
2645fe5e51b7Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
2646fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
2647fe5e51b7Smrg  hardcode_into_libs=yes
2648fe5e51b7Smrg  ;;
2649fe5e51b7Smrg
2650fe5e51b7Smrg# No shared lib support for Linux oldld, aout, or coff.
2651fe5e51b7Smrglinux*oldld* | linux*aout* | linux*coff*)
2652fe5e51b7Smrg  dynamic_linker=no
2653fe5e51b7Smrg  ;;
2654fe5e51b7Smrg
26550bb88ba4Smrg# This must be glibc/ELF.
26560bb88ba4Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
26570bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2658fe5e51b7Smrg  need_lib_prefix=no
2659fe5e51b7Smrg  need_version=no
2660fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2661fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2662fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2663fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2664fe5e51b7Smrg  shlibpath_overrides_runpath=no
26650bb88ba4Smrg
2666a31a186aSmrg  # Some binutils ld are patched to set DT_RUNPATH
26670bb88ba4Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
26680bb88ba4Smrg    [lt_cv_shlibpath_overrides_runpath=no
26690bb88ba4Smrg    save_LDFLAGS=$LDFLAGS
26700bb88ba4Smrg    save_libdir=$libdir
26710bb88ba4Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
26720bb88ba4Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
26730bb88ba4Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
26740bb88ba4Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
26750bb88ba4Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
26760bb88ba4Smrg    LDFLAGS=$save_LDFLAGS
26770bb88ba4Smrg    libdir=$save_libdir
26780bb88ba4Smrg    ])
26790bb88ba4Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2680a31a186aSmrg
2681fe5e51b7Smrg  # This implies no fast_install, which is unacceptable.
2682fe5e51b7Smrg  # Some rework will be needed to allow for fast_install
2683fe5e51b7Smrg  # before this can be enabled.
2684fe5e51b7Smrg  hardcode_into_libs=yes
2685a31a186aSmrg
2686a31a186aSmrg  # Add ABI-specific directories to the system library path.
2687a31a186aSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
2688eda3803bSmrg
2689fe5e51b7Smrg  # Append ld.so.conf contents to the search path
2690fe5e51b7Smrg  if test -f /etc/ld.so.conf; then
26910bb88ba4Smrg    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
2692eda3803bSmrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
26930bb88ba4Smrg
2694fe5e51b7Smrg  fi
2695fe5e51b7Smrg
2696fe5e51b7Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2697fe5e51b7Smrg  # powerpc, because MkLinux only supported shared libraries with the
2698fe5e51b7Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2699fe5e51b7Smrg  # most powerpc-linux boxes support dynamic linking these days and
2700fe5e51b7Smrg  # people can always --disable-shared, the test was removed, and we
2701fe5e51b7Smrg  # assume the GNU/Linux dynamic linker is in use.
2702fe5e51b7Smrg  dynamic_linker='GNU/Linux ld.so'
2703fe5e51b7Smrg  ;;
2704fe5e51b7Smrg
2705fe5e51b7Smrgnetbsd*)
2706fe5e51b7Smrg  version_type=sunos
2707fe5e51b7Smrg  need_lib_prefix=no
2708fe5e51b7Smrg  need_version=no
2709a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2710fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2711fe5e51b7Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2712fe5e51b7Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2713fe5e51b7Smrg  else
2714fe5e51b7Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2715fe5e51b7Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2716fe5e51b7Smrg    dynamic_linker='NetBSD ld.elf_so'
2717fe5e51b7Smrg  fi
2718fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2719fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2720fe5e51b7Smrg  hardcode_into_libs=yes
2721fe5e51b7Smrg  ;;
2722fe5e51b7Smrg
2723fe5e51b7Smrgnewsos6)
27240bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2725fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2726fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2727fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2728fe5e51b7Smrg  ;;
2729fe5e51b7Smrg
2730a31a186aSmrg*nto* | *qnx*)
2731a31a186aSmrg  version_type=qnx
2732fe5e51b7Smrg  need_lib_prefix=no
2733fe5e51b7Smrg  need_version=no
2734fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2735fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2736fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2737a31a186aSmrg  shlibpath_overrides_runpath=no
2738a31a186aSmrg  hardcode_into_libs=yes
2739a31a186aSmrg  dynamic_linker='ldqnx.so'
2740fe5e51b7Smrg  ;;
2741fe5e51b7Smrg
2742fe5e51b7Smrgopenbsd*)
2743fe5e51b7Smrg  version_type=sunos
2744fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
2745fe5e51b7Smrg  need_lib_prefix=no
2746fe5e51b7Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
2747fe5e51b7Smrg  case $host_os in
2748a31a186aSmrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2749a31a186aSmrg    *)				need_version=no  ;;
2750fe5e51b7Smrg  esac
2751fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2752fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2753fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2754a31a186aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
2755fe5e51b7Smrg    case $host_os in
2756fe5e51b7Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
2757fe5e51b7Smrg	shlibpath_overrides_runpath=no
2758fe5e51b7Smrg	;;
2759fe5e51b7Smrg      *)
2760fe5e51b7Smrg	shlibpath_overrides_runpath=yes
2761fe5e51b7Smrg	;;
2762fe5e51b7Smrg      esac
2763fe5e51b7Smrg  else
2764fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2765fe5e51b7Smrg  fi
2766fe5e51b7Smrg  ;;
2767fe5e51b7Smrg
2768fe5e51b7Smrgos2*)
2769fe5e51b7Smrg  libname_spec='$name'
2770fe5e51b7Smrg  shrext_cmds=".dll"
2771fe5e51b7Smrg  need_lib_prefix=no
2772fe5e51b7Smrg  library_names_spec='$libname${shared_ext} $libname.a'
2773fe5e51b7Smrg  dynamic_linker='OS/2 ld.exe'
2774fe5e51b7Smrg  shlibpath_var=LIBPATH
2775fe5e51b7Smrg  ;;
2776fe5e51b7Smrg
2777fe5e51b7Smrgosf3* | osf4* | osf5*)
2778fe5e51b7Smrg  version_type=osf
2779fe5e51b7Smrg  need_lib_prefix=no
2780fe5e51b7Smrg  need_version=no
2781fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2782fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2783fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2784fe5e51b7Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2785fe5e51b7Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
2786fe5e51b7Smrg  ;;
2787fe5e51b7Smrg
2788fe5e51b7Smrgrdos*)
2789fe5e51b7Smrg  dynamic_linker=no
2790fe5e51b7Smrg  ;;
2791fe5e51b7Smrg
2792fe5e51b7Smrgsolaris*)
27930bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2794fe5e51b7Smrg  need_lib_prefix=no
2795fe5e51b7Smrg  need_version=no
2796fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2797fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2798fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2799fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2800fe5e51b7Smrg  hardcode_into_libs=yes
2801fe5e51b7Smrg  # ldd complains unless libraries are executable
2802fe5e51b7Smrg  postinstall_cmds='chmod +x $lib'
2803fe5e51b7Smrg  ;;
2804fe5e51b7Smrg
2805fe5e51b7Smrgsunos4*)
2806fe5e51b7Smrg  version_type=sunos
2807fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
2808fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2809fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2810fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2811fe5e51b7Smrg  if test "$with_gnu_ld" = yes; then
2812fe5e51b7Smrg    need_lib_prefix=no
2813fe5e51b7Smrg  fi
2814fe5e51b7Smrg  need_version=yes
2815fe5e51b7Smrg  ;;
2816fe5e51b7Smrg
2817fe5e51b7Smrgsysv4 | sysv4.3*)
28180bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2819fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2820fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2821fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2822fe5e51b7Smrg  case $host_vendor in
2823fe5e51b7Smrg    sni)
2824fe5e51b7Smrg      shlibpath_overrides_runpath=no
2825fe5e51b7Smrg      need_lib_prefix=no
2826fe5e51b7Smrg      runpath_var=LD_RUN_PATH
2827fe5e51b7Smrg      ;;
2828fe5e51b7Smrg    siemens)
2829fe5e51b7Smrg      need_lib_prefix=no
2830fe5e51b7Smrg      ;;
2831fe5e51b7Smrg    motorola)
2832fe5e51b7Smrg      need_lib_prefix=no
2833fe5e51b7Smrg      need_version=no
2834fe5e51b7Smrg      shlibpath_overrides_runpath=no
2835fe5e51b7Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2836fe5e51b7Smrg      ;;
2837fe5e51b7Smrg  esac
2838fe5e51b7Smrg  ;;
2839fe5e51b7Smrg
2840fe5e51b7Smrgsysv4*MP*)
2841fe5e51b7Smrg  if test -d /usr/nec ;then
28420bb88ba4Smrg    version_type=linux # correct to gnu/linux during the next big refactor
2843fe5e51b7Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
2844fe5e51b7Smrg    soname_spec='$libname${shared_ext}.$major'
2845fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2846fe5e51b7Smrg  fi
2847fe5e51b7Smrg  ;;
2848fe5e51b7Smrg
2849fe5e51b7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2850fe5e51b7Smrg  version_type=freebsd-elf
2851fe5e51b7Smrg  need_lib_prefix=no
2852fe5e51b7Smrg  need_version=no
2853fe5e51b7Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
2854fe5e51b7Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2855fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2856a31a186aSmrg  shlibpath_overrides_runpath=yes
2857fe5e51b7Smrg  hardcode_into_libs=yes
2858fe5e51b7Smrg  if test "$with_gnu_ld" = yes; then
2859fe5e51b7Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2860fe5e51b7Smrg  else
2861fe5e51b7Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
2862fe5e51b7Smrg    case $host_os in
2863fe5e51b7Smrg      sco3.2v5*)
2864fe5e51b7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
2865fe5e51b7Smrg	;;
2866fe5e51b7Smrg    esac
2867fe5e51b7Smrg  fi
2868fe5e51b7Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
2869fe5e51b7Smrg  ;;
2870fe5e51b7Smrg
2871a31a186aSmrgtpf*)
2872a31a186aSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
28730bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2874a31a186aSmrg  need_lib_prefix=no
2875a31a186aSmrg  need_version=no
2876a31a186aSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2877a31a186aSmrg  shlibpath_var=LD_LIBRARY_PATH
2878a31a186aSmrg  shlibpath_overrides_runpath=no
2879a31a186aSmrg  hardcode_into_libs=yes
2880a31a186aSmrg  ;;
2881a31a186aSmrg
2882eda3803bSmrguts4*)
28830bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2884eda3803bSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2885eda3803bSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2886eda3803bSmrg  shlibpath_var=LD_LIBRARY_PATH
2887eda3803bSmrg  ;;
2888fe5e51b7Smrg
2889fe5e51b7Smrg*)
2890fe5e51b7Smrg  dynamic_linker=no
2891fe5e51b7Smrg  ;;
2892fe5e51b7Smrgesac
2893fe5e51b7SmrgAC_MSG_RESULT([$dynamic_linker])
2894fe5e51b7Smrgtest "$dynamic_linker" = no && can_build_shared=no
2895fe5e51b7Smrg
2896fe5e51b7Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
2897fe5e51b7Smrgif test "$GCC" = yes; then
2898fe5e51b7Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
2899fe5e51b7Smrgfi
2900fe5e51b7Smrg
2901a31a186aSmrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2902a31a186aSmrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2903a31a186aSmrgfi
2904a31a186aSmrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2905a31a186aSmrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2906a31a186aSmrgfi
2907fe5e51b7Smrg
2908a31a186aSmrg_LT_DECL([], [variables_saved_for_relink], [1],
2909a31a186aSmrg    [Variables whose values should be saved in libtool wrapper scripts and
2910a31a186aSmrg    restored at link time])
2911a31a186aSmrg_LT_DECL([], [need_lib_prefix], [0],
2912a31a186aSmrg    [Do we need the "lib" prefix for modules?])
2913a31a186aSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2914a31a186aSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
2915a31a186aSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2916a31a186aSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2917a31a186aSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2918a31a186aSmrg    [Is shlibpath searched before the hard-coded library search path?])
2919a31a186aSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2920a31a186aSmrg_LT_DECL([], [library_names_spec], [1],
2921a31a186aSmrg    [[List of archive names.  First name is the real one, the rest are links.
2922a31a186aSmrg    The last name is the one that the linker finds with -lNAME]])
2923a31a186aSmrg_LT_DECL([], [soname_spec], [1],
2924a31a186aSmrg    [[The coded name of the library, if different from the real name]])
29250bb88ba4Smrg_LT_DECL([], [install_override_mode], [1],
29260bb88ba4Smrg    [Permission mode override for installation of shared libraries])
2927a31a186aSmrg_LT_DECL([], [postinstall_cmds], [2],
2928a31a186aSmrg    [Command to use after installation of a shared archive])
2929a31a186aSmrg_LT_DECL([], [postuninstall_cmds], [2],
2930a31a186aSmrg    [Command to use after uninstallation of a shared archive])
2931a31a186aSmrg_LT_DECL([], [finish_cmds], [2],
2932a31a186aSmrg    [Commands used to finish a libtool library installation in a directory])
2933a31a186aSmrg_LT_DECL([], [finish_eval], [1],
2934a31a186aSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
2935a31a186aSmrg    not shown]])
2936a31a186aSmrg_LT_DECL([], [hardcode_into_libs], [0],
2937a31a186aSmrg    [Whether we should hardcode library paths into libraries])
2938a31a186aSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2939a31a186aSmrg    [Compile-time system search path for libraries])
2940a31a186aSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2941a31a186aSmrg    [Run-time system search path for libraries])
2942a31a186aSmrg])# _LT_SYS_DYNAMIC_LINKER
2943a31a186aSmrg
2944a31a186aSmrg
2945a31a186aSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
2946643b027fSmrg# --------------------------
2947643b027fSmrg# find a file program which can recognize shared library
2948a31a186aSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2949a31a186aSmrg[m4_require([_LT_DECL_EGREP])dnl
2950643b027fSmrgAC_MSG_CHECKING([for $1])
2951643b027fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2952643b027fSmrg[case $MAGIC_CMD in
2953fe5e51b7Smrg[[\\/*] |  ?:[\\/]*])
2954fe5e51b7Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2955fe5e51b7Smrg  ;;
2956fe5e51b7Smrg*)
2957fe5e51b7Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2958fe5e51b7Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2959fe5e51b7Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2960fe5e51b7Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2961fe5e51b7Smrgdnl not every word.  This closes a longstanding sh security hole.
2962a31a186aSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2963fe5e51b7Smrg  for ac_dir in $ac_dummy; do
2964fe5e51b7Smrg    IFS="$lt_save_ifs"
2965fe5e51b7Smrg    test -z "$ac_dir" && ac_dir=.
2966fe5e51b7Smrg    if test -f $ac_dir/$1; then
2967fe5e51b7Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
2968fe5e51b7Smrg      if test -n "$file_magic_test_file"; then
2969fe5e51b7Smrg	case $deplibs_check_method in
2970fe5e51b7Smrg	"file_magic "*)
2971fe5e51b7Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
2972fe5e51b7Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
2973fe5e51b7Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
2974fe5e51b7Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
2975fe5e51b7Smrg	    :
2976fe5e51b7Smrg	  else
2977a31a186aSmrg	    cat <<_LT_EOF 1>&2
2978fe5e51b7Smrg
2979fe5e51b7Smrg*** Warning: the command libtool uses to detect shared libraries,
2980fe5e51b7Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
2981fe5e51b7Smrg*** The result is that libtool may fail to recognize shared libraries
2982fe5e51b7Smrg*** as such.  This will affect the creation of libtool libraries that
2983fe5e51b7Smrg*** depend on shared libraries, but programs linked with such libtool
2984fe5e51b7Smrg*** libraries will work regardless of this problem.  Nevertheless, you
2985fe5e51b7Smrg*** may want to report the problem to your system manager and/or to
2986fe5e51b7Smrg*** bug-libtool@gnu.org
2987fe5e51b7Smrg
2988a31a186aSmrg_LT_EOF
2989fe5e51b7Smrg	  fi ;;
2990fe5e51b7Smrg	esac
2991fe5e51b7Smrg      fi
2992fe5e51b7Smrg      break
2993fe5e51b7Smrg    fi
2994fe5e51b7Smrg  done
2995fe5e51b7Smrg  IFS="$lt_save_ifs"
2996fe5e51b7Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
2997fe5e51b7Smrg  ;;
2998fe5e51b7Smrgesac])
2999fe5e51b7SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
3000fe5e51b7Smrgif test -n "$MAGIC_CMD"; then
3001fe5e51b7Smrg  AC_MSG_RESULT($MAGIC_CMD)
3002fe5e51b7Smrgelse
3003fe5e51b7Smrg  AC_MSG_RESULT(no)
3004fe5e51b7Smrgfi
3005a31a186aSmrg_LT_DECL([], [MAGIC_CMD], [0],
3006a31a186aSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3007a31a186aSmrg])# _LT_PATH_TOOL_PREFIX
3008fe5e51b7Smrg
3009a31a186aSmrg# Old name:
3010a31a186aSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3011a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3012a31a186aSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3013eda3803bSmrg
3014a31a186aSmrg
3015a31a186aSmrg# _LT_PATH_MAGIC
3016a31a186aSmrg# --------------
3017fe5e51b7Smrg# find a file program which can recognize a shared library
3018a31a186aSmrgm4_defun([_LT_PATH_MAGIC],
3019a31a186aSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3020fe5e51b7Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3021fe5e51b7Smrg  if test -n "$ac_tool_prefix"; then
3022a31a186aSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3023fe5e51b7Smrg  else
3024fe5e51b7Smrg    MAGIC_CMD=:
3025fe5e51b7Smrg  fi
3026fe5e51b7Smrgfi
3027a31a186aSmrg])# _LT_PATH_MAGIC
3028fe5e51b7Smrg
3029fe5e51b7Smrg
3030a31a186aSmrg# LT_PATH_LD
3031fe5e51b7Smrg# ----------
3032fe5e51b7Smrg# find the pathname to the GNU or non-GNU linker
3033a31a186aSmrgAC_DEFUN([LT_PATH_LD],
3034a31a186aSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3035643b027fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3036643b027fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3037a31a186aSmrgm4_require([_LT_DECL_SED])dnl
3038a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
30390bb88ba4Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3040a31a186aSmrg
3041a31a186aSmrgAC_ARG_WITH([gnu-ld],
3042a31a186aSmrg    [AS_HELP_STRING([--with-gnu-ld],
3043a31a186aSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3044a31a186aSmrg    [test "$withval" = no || with_gnu_ld=yes],
3045a31a186aSmrg    [with_gnu_ld=no])dnl
3046a31a186aSmrg
3047fe5e51b7Smrgac_prog=ld
3048fe5e51b7Smrgif test "$GCC" = yes; then
3049fe5e51b7Smrg  # Check if gcc -print-prog-name=ld gives a path.
3050fe5e51b7Smrg  AC_MSG_CHECKING([for ld used by $CC])
3051fe5e51b7Smrg  case $host in
3052fe5e51b7Smrg  *-*-mingw*)
3053fe5e51b7Smrg    # gcc leaves a trailing carriage return which upsets mingw
3054fe5e51b7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3055fe5e51b7Smrg  *)
3056fe5e51b7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3057fe5e51b7Smrg  esac
3058fe5e51b7Smrg  case $ac_prog in
3059fe5e51b7Smrg    # Accept absolute paths.
3060fe5e51b7Smrg    [[\\/]]* | ?:[[\\/]]*)
3061fe5e51b7Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3062fe5e51b7Smrg      # Canonicalize the pathname of ld
3063a31a186aSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3064a31a186aSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3065a31a186aSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3066fe5e51b7Smrg      done
3067fe5e51b7Smrg      test -z "$LD" && LD="$ac_prog"
3068fe5e51b7Smrg      ;;
3069fe5e51b7Smrg  "")
3070fe5e51b7Smrg    # If it fails, then pretend we aren't using GCC.
3071fe5e51b7Smrg    ac_prog=ld
3072fe5e51b7Smrg    ;;
3073fe5e51b7Smrg  *)
3074fe5e51b7Smrg    # If it is relative, then search for the first ld in PATH.
3075fe5e51b7Smrg    with_gnu_ld=unknown
3076fe5e51b7Smrg    ;;
3077fe5e51b7Smrg  esac
3078fe5e51b7Smrgelif test "$with_gnu_ld" = yes; then
3079fe5e51b7Smrg  AC_MSG_CHECKING([for GNU ld])
3080fe5e51b7Smrgelse
3081fe5e51b7Smrg  AC_MSG_CHECKING([for non-GNU ld])
3082fe5e51b7Smrgfi
3083fe5e51b7SmrgAC_CACHE_VAL(lt_cv_path_LD,
3084fe5e51b7Smrg[if test -z "$LD"; then
3085fe5e51b7Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3086fe5e51b7Smrg  for ac_dir in $PATH; do
3087fe5e51b7Smrg    IFS="$lt_save_ifs"
3088fe5e51b7Smrg    test -z "$ac_dir" && ac_dir=.
3089fe5e51b7Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3090fe5e51b7Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
3091fe5e51b7Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3092fe5e51b7Smrg      # but apparently some variants of GNU ld only accept -v.
3093fe5e51b7Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3094fe5e51b7Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3095fe5e51b7Smrg      *GNU* | *'with BFD'*)
3096fe5e51b7Smrg	test "$with_gnu_ld" != no && break
3097fe5e51b7Smrg	;;
3098fe5e51b7Smrg      *)
3099fe5e51b7Smrg	test "$with_gnu_ld" != yes && break
3100fe5e51b7Smrg	;;
3101fe5e51b7Smrg      esac
3102fe5e51b7Smrg    fi
3103fe5e51b7Smrg  done
3104fe5e51b7Smrg  IFS="$lt_save_ifs"
3105fe5e51b7Smrgelse
3106fe5e51b7Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
3107fe5e51b7Smrgfi])
3108fe5e51b7SmrgLD="$lt_cv_path_LD"
3109fe5e51b7Smrgif test -n "$LD"; then
3110fe5e51b7Smrg  AC_MSG_RESULT($LD)
3111fe5e51b7Smrgelse
3112fe5e51b7Smrg  AC_MSG_RESULT(no)
3113fe5e51b7Smrgfi
3114fe5e51b7Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3115a31a186aSmrg_LT_PATH_LD_GNU
3116a31a186aSmrgAC_SUBST([LD])
3117fe5e51b7Smrg
3118a31a186aSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3119a31a186aSmrg])# LT_PATH_LD
3120fe5e51b7Smrg
3121a31a186aSmrg# Old names:
3122a31a186aSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3123a31a186aSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3124a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3125a31a186aSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3126a31a186aSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3127a31a186aSmrg
3128a31a186aSmrg
3129a31a186aSmrg# _LT_PATH_LD_GNU
3130a31a186aSmrg#- --------------
3131a31a186aSmrgm4_defun([_LT_PATH_LD_GNU],
3132a31a186aSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3133fe5e51b7Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3134fe5e51b7Smrgcase `$LD -v 2>&1 </dev/null` in
3135fe5e51b7Smrg*GNU* | *'with BFD'*)
3136fe5e51b7Smrg  lt_cv_prog_gnu_ld=yes
3137fe5e51b7Smrg  ;;
3138fe5e51b7Smrg*)
3139fe5e51b7Smrg  lt_cv_prog_gnu_ld=no
3140fe5e51b7Smrg  ;;
3141fe5e51b7Smrgesac])
3142fe5e51b7Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3143a31a186aSmrg])# _LT_PATH_LD_GNU
3144fe5e51b7Smrg
3145fe5e51b7Smrg
3146a31a186aSmrg# _LT_CMD_RELOAD
3147a31a186aSmrg# --------------
3148fe5e51b7Smrg# find reload flag for linker
3149fe5e51b7Smrg#   -- PORTME Some linkers may need a different reload flag.
3150a31a186aSmrgm4_defun([_LT_CMD_RELOAD],
3151fe5e51b7Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
3152fe5e51b7Smrg  lt_cv_ld_reload_flag,
3153fe5e51b7Smrg  [lt_cv_ld_reload_flag='-r'])
3154fe5e51b7Smrgreload_flag=$lt_cv_ld_reload_flag
3155fe5e51b7Smrgcase $reload_flag in
3156fe5e51b7Smrg"" | " "*) ;;
3157fe5e51b7Smrg*) reload_flag=" $reload_flag" ;;
3158fe5e51b7Smrgesac
3159fe5e51b7Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3160fe5e51b7Smrgcase $host_os in
31610bb88ba4Smrg  cygwin* | mingw* | pw32* | cegcc*)
31620bb88ba4Smrg    if test "$GCC" != yes; then
31630bb88ba4Smrg      reload_cmds=false
31640bb88ba4Smrg    fi
31650bb88ba4Smrg    ;;
3166fe5e51b7Smrg  darwin*)
3167fe5e51b7Smrg    if test "$GCC" = yes; then
3168fe5e51b7Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
3169fe5e51b7Smrg    else
3170fe5e51b7Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3171fe5e51b7Smrg    fi
3172fe5e51b7Smrg    ;;
3173fe5e51b7Smrgesac
31740bb88ba4Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
31750bb88ba4Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3176a31a186aSmrg])# _LT_CMD_RELOAD
3177fe5e51b7Smrg
3178fe5e51b7Smrg
3179a31a186aSmrg# _LT_CHECK_MAGIC_METHOD
3180a31a186aSmrg# ----------------------
3181fe5e51b7Smrg# how to check for library dependencies
3182fe5e51b7Smrg#  -- PORTME fill in with the dynamic library characteristics
3183a31a186aSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3184a31a186aSmrg[m4_require([_LT_DECL_EGREP])
3185a31a186aSmrgm4_require([_LT_DECL_OBJDUMP])
3186a31a186aSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3187fe5e51b7Smrglt_cv_deplibs_check_method,
3188fe5e51b7Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3189fe5e51b7Smrglt_cv_file_magic_test_file=
3190fe5e51b7Smrglt_cv_deplibs_check_method='unknown'
3191fe5e51b7Smrg# Need to set the preceding variable on all platforms that support
3192fe5e51b7Smrg# interlibrary dependencies.
3193fe5e51b7Smrg# 'none' -- dependencies not supported.
3194fe5e51b7Smrg# `unknown' -- same as none, but documents that we really don't know.
3195fe5e51b7Smrg# 'pass_all' -- all dependencies passed with no checks.
3196fe5e51b7Smrg# 'test_compile' -- check by making test program.
3197fe5e51b7Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3198fe5e51b7Smrg# which responds to the $file_magic_cmd with a given extended regex.
3199fe5e51b7Smrg# If you have `file' or equivalent on your system and you're not sure
3200fe5e51b7Smrg# whether `pass_all' will *always* work, you probably want this one.
3201fe5e51b7Smrg
3202fe5e51b7Smrgcase $host_os in
3203eda3803bSmrgaix[[4-9]]*)
3204fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3205fe5e51b7Smrg  ;;
3206fe5e51b7Smrg
3207fe5e51b7Smrgbeos*)
3208fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3209fe5e51b7Smrg  ;;
3210fe5e51b7Smrg
3211fe5e51b7Smrgbsdi[[45]]*)
3212fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3213fe5e51b7Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3214fe5e51b7Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3215fe5e51b7Smrg  ;;
3216fe5e51b7Smrg
3217fe5e51b7Smrgcygwin*)
3218fe5e51b7Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3219fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3220fe5e51b7Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3221fe5e51b7Smrg  ;;
3222fe5e51b7Smrg
3223fe5e51b7Smrgmingw* | pw32*)
3224fe5e51b7Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3225fe5e51b7Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3226fe5e51b7Smrg  # unless we find 'file', for example because we are cross-compiling.
32270bb88ba4Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
32280bb88ba4Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3229fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3230fe5e51b7Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3231fe5e51b7Smrg  else
32320bb88ba4Smrg    # Keep this pattern in sync with the one in func_win32_libid.
32330bb88ba4Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3234fe5e51b7Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3235fe5e51b7Smrg  fi
3236fe5e51b7Smrg  ;;
3237fe5e51b7Smrg
32380bb88ba4Smrgcegcc*)
3239a31a186aSmrg  # use the weaker test based on 'objdump'. See mingw*.
3240a31a186aSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3241a31a186aSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3242a31a186aSmrg  ;;
3243a31a186aSmrg
3244fe5e51b7Smrgdarwin* | rhapsody*)
3245fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3246fe5e51b7Smrg  ;;
3247fe5e51b7Smrg
3248fe5e51b7Smrgfreebsd* | dragonfly*)
3249a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3250fe5e51b7Smrg    case $host_cpu in
3251fe5e51b7Smrg    i*86 )
3252fe5e51b7Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3253fe5e51b7Smrg      # Let's accept both of them until this is cleared up.
3254fe5e51b7Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3255fe5e51b7Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3256fe5e51b7Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3257fe5e51b7Smrg      ;;
3258fe5e51b7Smrg    esac
3259fe5e51b7Smrg  else
3260fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3261fe5e51b7Smrg  fi
3262fe5e51b7Smrg  ;;
3263fe5e51b7Smrg
3264fe5e51b7Smrggnu*)
3265fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3266fe5e51b7Smrg  ;;
3267fe5e51b7Smrg
32680bb88ba4Smrghaiku*)
32690bb88ba4Smrg  lt_cv_deplibs_check_method=pass_all
32700bb88ba4Smrg  ;;
32710bb88ba4Smrg
3272fe5e51b7Smrghpux10.20* | hpux11*)
3273fe5e51b7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3274fe5e51b7Smrg  case $host_cpu in
3275fe5e51b7Smrg  ia64*)
3276fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3277fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3278fe5e51b7Smrg    ;;
3279fe5e51b7Smrg  hppa*64*)
32800bb88ba4Smrg    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
3281fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3282fe5e51b7Smrg    ;;
3283fe5e51b7Smrg  *)
32840bb88ba4Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3285fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3286fe5e51b7Smrg    ;;
3287fe5e51b7Smrg  esac
3288fe5e51b7Smrg  ;;
3289fe5e51b7Smrg
3290fe5e51b7Smrginterix[[3-9]]*)
3291fe5e51b7Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3292fe5e51b7Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3293fe5e51b7Smrg  ;;
3294fe5e51b7Smrg
3295fe5e51b7Smrgirix5* | irix6* | nonstopux*)
3296fe5e51b7Smrg  case $LD in
3297fe5e51b7Smrg  *-32|*"-32 ") libmagic=32-bit;;
3298fe5e51b7Smrg  *-n32|*"-n32 ") libmagic=N32;;
3299fe5e51b7Smrg  *-64|*"-64 ") libmagic=64-bit;;
3300fe5e51b7Smrg  *) libmagic=never-match;;
3301fe5e51b7Smrg  esac
3302fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3303fe5e51b7Smrg  ;;
3304fe5e51b7Smrg
33050bb88ba4Smrg# This must be glibc/ELF.
33060bb88ba4Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
3307fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3308fe5e51b7Smrg  ;;
3309fe5e51b7Smrg
3310fe5e51b7Smrgnetbsd*)
3311a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3312fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3313fe5e51b7Smrg  else
3314fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3315fe5e51b7Smrg  fi
3316fe5e51b7Smrg  ;;
3317fe5e51b7Smrg
3318fe5e51b7Smrgnewos6*)
3319fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3320fe5e51b7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3321fe5e51b7Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3322fe5e51b7Smrg  ;;
3323fe5e51b7Smrg
3324a31a186aSmrg*nto* | *qnx*)
3325a31a186aSmrg  lt_cv_deplibs_check_method=pass_all
3326fe5e51b7Smrg  ;;
3327fe5e51b7Smrg
3328fe5e51b7Smrgopenbsd*)
3329a31a186aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
3330fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3331fe5e51b7Smrg  else
3332fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3333fe5e51b7Smrg  fi
3334fe5e51b7Smrg  ;;
3335fe5e51b7Smrg
3336fe5e51b7Smrgosf3* | osf4* | osf5*)
3337fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3338fe5e51b7Smrg  ;;
3339fe5e51b7Smrg
3340fe5e51b7Smrgrdos*)
3341fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3342fe5e51b7Smrg  ;;
3343fe5e51b7Smrg
3344fe5e51b7Smrgsolaris*)
3345fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3346fe5e51b7Smrg  ;;
3347fe5e51b7Smrg
3348a31a186aSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3349a31a186aSmrg  lt_cv_deplibs_check_method=pass_all
3350a31a186aSmrg  ;;
3351a31a186aSmrg
3352fe5e51b7Smrgsysv4 | sysv4.3*)
3353fe5e51b7Smrg  case $host_vendor in
3354fe5e51b7Smrg  motorola)
3355fe5e51b7Smrg    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]]'
3356fe5e51b7Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3357fe5e51b7Smrg    ;;
3358fe5e51b7Smrg  ncr)
3359fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3360fe5e51b7Smrg    ;;
3361fe5e51b7Smrg  sequent)
3362fe5e51b7Smrg    lt_cv_file_magic_cmd='/bin/file'
3363fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3364fe5e51b7Smrg    ;;
3365fe5e51b7Smrg  sni)
3366fe5e51b7Smrg    lt_cv_file_magic_cmd='/bin/file'
3367fe5e51b7Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3368fe5e51b7Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3369fe5e51b7Smrg    ;;
3370fe5e51b7Smrg  siemens)
3371fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3372fe5e51b7Smrg    ;;
3373fe5e51b7Smrg  pc)
3374fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3375fe5e51b7Smrg    ;;
3376fe5e51b7Smrg  esac
3377fe5e51b7Smrg  ;;
3378fe5e51b7Smrg
3379a31a186aSmrgtpf*)
3380fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3381fe5e51b7Smrg  ;;
3382fe5e51b7Smrgesac
3383fe5e51b7Smrg])
33840bb88ba4Smrg
33850bb88ba4Smrgfile_magic_glob=
33860bb88ba4Smrgwant_nocaseglob=no
33870bb88ba4Smrgif test "$build" = "$host"; then
33880bb88ba4Smrg  case $host_os in
33890bb88ba4Smrg  mingw* | pw32*)
33900bb88ba4Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
33910bb88ba4Smrg      want_nocaseglob=yes
33920bb88ba4Smrg    else
33930bb88ba4Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
33940bb88ba4Smrg    fi
33950bb88ba4Smrg    ;;
33960bb88ba4Smrg  esac
33970bb88ba4Smrgfi
33980bb88ba4Smrg
3399fe5e51b7Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3400fe5e51b7Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3401fe5e51b7Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3402a31a186aSmrg
3403a31a186aSmrg_LT_DECL([], [deplibs_check_method], [1],
3404a31a186aSmrg    [Method to check whether dependent libraries are shared objects])
3405a31a186aSmrg_LT_DECL([], [file_magic_cmd], [1],
34060bb88ba4Smrg    [Command to use when deplibs_check_method = "file_magic"])
34070bb88ba4Smrg_LT_DECL([], [file_magic_glob], [1],
34080bb88ba4Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
34090bb88ba4Smrg_LT_DECL([], [want_nocaseglob], [1],
34100bb88ba4Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3411a31a186aSmrg])# _LT_CHECK_MAGIC_METHOD
3412eda3803bSmrg
3413fe5e51b7Smrg
3414a31a186aSmrg# LT_PATH_NM
3415fe5e51b7Smrg# ----------
3416a31a186aSmrg# find the pathname to a BSD- or MS-compatible name lister
3417a31a186aSmrgAC_DEFUN([LT_PATH_NM],
3418a31a186aSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3419a31a186aSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3420fe5e51b7Smrg[if test -n "$NM"; then
3421fe5e51b7Smrg  # Let the user override the test.
3422fe5e51b7Smrg  lt_cv_path_NM="$NM"
3423fe5e51b7Smrgelse
3424fe5e51b7Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3425fe5e51b7Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3426fe5e51b7Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3427fe5e51b7Smrg  fi
3428fe5e51b7Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3429fe5e51b7Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
3430fe5e51b7Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3431fe5e51b7Smrg      IFS="$lt_save_ifs"
3432fe5e51b7Smrg      test -z "$ac_dir" && ac_dir=.
3433fe5e51b7Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
3434fe5e51b7Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
3435fe5e51b7Smrg	# Check to see if the nm accepts a BSD-compat flag.
3436fe5e51b7Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
3437fe5e51b7Smrg	#   nm: unknown option "B" ignored
3438fe5e51b7Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3439fe5e51b7Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
3440fe5e51b7Smrg	*/dev/null* | *'Invalid file or object type'*)
3441fe5e51b7Smrg	  lt_cv_path_NM="$tmp_nm -B"
3442fe5e51b7Smrg	  break
3443fe5e51b7Smrg	  ;;
3444fe5e51b7Smrg	*)
3445fe5e51b7Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3446fe5e51b7Smrg	  */dev/null*)
3447fe5e51b7Smrg	    lt_cv_path_NM="$tmp_nm -p"
3448fe5e51b7Smrg	    break
3449fe5e51b7Smrg	    ;;
3450fe5e51b7Smrg	  *)
3451fe5e51b7Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3452fe5e51b7Smrg	    continue # so that we can try to find one that supports BSD flags
3453fe5e51b7Smrg	    ;;
3454fe5e51b7Smrg	  esac
3455fe5e51b7Smrg	  ;;
3456fe5e51b7Smrg	esac
3457fe5e51b7Smrg      fi
3458fe5e51b7Smrg    done
3459fe5e51b7Smrg    IFS="$lt_save_ifs"
3460fe5e51b7Smrg  done
3461a31a186aSmrg  : ${lt_cv_path_NM=no}
3462fe5e51b7Smrgfi])
3463a31a186aSmrgif test "$lt_cv_path_NM" != "no"; then
3464a31a186aSmrg  NM="$lt_cv_path_NM"
3465a31a186aSmrgelse
3466a31a186aSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
34670bb88ba4Smrg  if test -n "$DUMPBIN"; then :
34680bb88ba4Smrg    # Let the user override the test.
34690bb88ba4Smrg  else
34700bb88ba4Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
34710bb88ba4Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
34720bb88ba4Smrg    *COFF*)
34730bb88ba4Smrg      DUMPBIN="$DUMPBIN -symbols"
34740bb88ba4Smrg      ;;
34750bb88ba4Smrg    *)
34760bb88ba4Smrg      DUMPBIN=:
34770bb88ba4Smrg      ;;
34780bb88ba4Smrg    esac
34790bb88ba4Smrg  fi
3480a31a186aSmrg  AC_SUBST([DUMPBIN])
3481a31a186aSmrg  if test "$DUMPBIN" != ":"; then
3482a31a186aSmrg    NM="$DUMPBIN"
3483a31a186aSmrg  fi
3484a31a186aSmrgfi
3485a31a186aSmrgtest -z "$NM" && NM=nm
3486a31a186aSmrgAC_SUBST([NM])
3487a31a186aSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3488a31a186aSmrg
3489a31a186aSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3490a31a186aSmrg  [lt_cv_nm_interface="BSD nm"
3491a31a186aSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
34920bb88ba4Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3493a31a186aSmrg  (eval "$ac_compile" 2>conftest.err)
3494a31a186aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34950bb88ba4Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3496a31a186aSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3497a31a186aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
34980bb88ba4Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3499a31a186aSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3500a31a186aSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3501a31a186aSmrg    lt_cv_nm_interface="MS dumpbin"
3502a31a186aSmrg  fi
3503a31a186aSmrg  rm -f conftest*])
3504a31a186aSmrg])# LT_PATH_NM
3505fe5e51b7Smrg
3506a31a186aSmrg# Old names:
3507a31a186aSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3508a31a186aSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3509a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3510a31a186aSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3511a31a186aSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3512eda3803bSmrg
35130bb88ba4Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35140bb88ba4Smrg# --------------------------------
35150bb88ba4Smrg# how to determine the name of the shared library
35160bb88ba4Smrg# associated with a specific link library.
35170bb88ba4Smrg#  -- PORTME fill in with the dynamic library characteristics
35180bb88ba4Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
35190bb88ba4Smrg[m4_require([_LT_DECL_EGREP])
35200bb88ba4Smrgm4_require([_LT_DECL_OBJDUMP])
35210bb88ba4Smrgm4_require([_LT_DECL_DLLTOOL])
35220bb88ba4SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
35230bb88ba4Smrglt_cv_sharedlib_from_linklib_cmd,
35240bb88ba4Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
35250bb88ba4Smrg
35260bb88ba4Smrgcase $host_os in
35270bb88ba4Smrgcygwin* | mingw* | pw32* | cegcc*)
35280bb88ba4Smrg  # two different shell functions defined in ltmain.sh
35290bb88ba4Smrg  # decide which to use based on capabilities of $DLLTOOL
35300bb88ba4Smrg  case `$DLLTOOL --help 2>&1` in
35310bb88ba4Smrg  *--identify-strict*)
35320bb88ba4Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
35330bb88ba4Smrg    ;;
35340bb88ba4Smrg  *)
35350bb88ba4Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
35360bb88ba4Smrg    ;;
35370bb88ba4Smrg  esac
35380bb88ba4Smrg  ;;
35390bb88ba4Smrg*)
35400bb88ba4Smrg  # fallback: assume linklib IS sharedlib
35410bb88ba4Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
35420bb88ba4Smrg  ;;
35430bb88ba4Smrgesac
35440bb88ba4Smrg])
35450bb88ba4Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
35460bb88ba4Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
35470bb88ba4Smrg
35480bb88ba4Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
35490bb88ba4Smrg    [Command to associate shared and link libraries])
35500bb88ba4Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
35510bb88ba4Smrg
35520bb88ba4Smrg
35530bb88ba4Smrg# _LT_PATH_MANIFEST_TOOL
35540bb88ba4Smrg# ----------------------
35550bb88ba4Smrg# locate the manifest tool
35560bb88ba4Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
35570bb88ba4Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
35580bb88ba4Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
35590bb88ba4SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
35600bb88ba4Smrg  [lt_cv_path_mainfest_tool=no
35610bb88ba4Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
35620bb88ba4Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
35630bb88ba4Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
35640bb88ba4Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
35650bb88ba4Smrg    lt_cv_path_mainfest_tool=yes
35660bb88ba4Smrg  fi
35670bb88ba4Smrg  rm -f conftest*])
35680bb88ba4Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
35690bb88ba4Smrg  MANIFEST_TOOL=:
35700bb88ba4Smrgfi
35710bb88ba4Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
35720bb88ba4Smrg])# _LT_PATH_MANIFEST_TOOL
35730bb88ba4Smrg
3574a31a186aSmrg
3575a31a186aSmrg# LT_LIB_M
3576a31a186aSmrg# --------
3577fe5e51b7Smrg# check for math library
3578a31a186aSmrgAC_DEFUN([LT_LIB_M],
3579fe5e51b7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3580fe5e51b7SmrgLIBM=
3581fe5e51b7Smrgcase $host in
35820bb88ba4Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3583fe5e51b7Smrg  # These system don't have libm, or don't need it
3584fe5e51b7Smrg  ;;
3585fe5e51b7Smrg*-ncr-sysv4.3*)
3586fe5e51b7Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
3587fe5e51b7Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3588fe5e51b7Smrg  ;;
3589fe5e51b7Smrg*)
3590fe5e51b7Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
3591fe5e51b7Smrg  ;;
3592fe5e51b7Smrgesac
3593a31a186aSmrgAC_SUBST([LIBM])
3594a31a186aSmrg])# LT_LIB_M
3595fe5e51b7Smrg
3596a31a186aSmrg# Old name:
3597a31a186aSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3598a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3599a31a186aSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3600fe5e51b7Smrg
3601fe5e51b7Smrg
3602a31a186aSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3603a31a186aSmrg# -------------------------------
3604a31a186aSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3605a31a186aSmrg[m4_require([_LT_TAG_COMPILER])dnl
3606fe5e51b7Smrg
3607a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3608fe5e51b7Smrg
3609a31a186aSmrgif test "$GCC" = yes; then
36100bb88ba4Smrg  case $cc_basename in
36110bb88ba4Smrg  nvcc*)
36120bb88ba4Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
36130bb88ba4Smrg  *)
36140bb88ba4Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
36150bb88ba4Smrg  esac
3616fe5e51b7Smrg
3617a31a186aSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3618a31a186aSmrg    lt_cv_prog_compiler_rtti_exceptions,
3619a31a186aSmrg    [-fno-rtti -fno-exceptions], [],
3620a31a186aSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3621a31a186aSmrgfi
3622a31a186aSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3623a31a186aSmrg	[Compiler flag to turn off builtin functions])
3624a31a186aSmrg])# _LT_COMPILER_NO_RTTI
3625fe5e51b7Smrg
3626fe5e51b7Smrg
3627a31a186aSmrg# _LT_CMD_GLOBAL_SYMBOLS
3628a31a186aSmrg# ----------------------
3629a31a186aSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3630a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3631a31a186aSmrgAC_REQUIRE([AC_PROG_CC])dnl
36320bb88ba4SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3633a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
3634a31a186aSmrgAC_REQUIRE([LT_PATH_LD])dnl
3635a31a186aSmrgm4_require([_LT_DECL_SED])dnl
3636a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
3637a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
3638fe5e51b7Smrg
3639a31a186aSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3640a31a186aSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3641a31a186aSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3642fe5e51b7Smrg[
3643a31a186aSmrg# These are sane defaults that work on at least a few old systems.
3644a31a186aSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3645fe5e51b7Smrg
3646a31a186aSmrg# Character class describing NM global symbol codes.
3647a31a186aSmrgsymcode='[[BCDEGRST]]'
3648fe5e51b7Smrg
3649a31a186aSmrg# Regexp to match symbols that can be accessed directly from C.
3650a31a186aSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3651fe5e51b7Smrg
3652a31a186aSmrg# Define system-specific variables.
3653a31a186aSmrgcase $host_os in
3654a31a186aSmrgaix*)
3655a31a186aSmrg  symcode='[[BCDT]]'
3656a31a186aSmrg  ;;
3657a31a186aSmrgcygwin* | mingw* | pw32* | cegcc*)
3658a31a186aSmrg  symcode='[[ABCDGISTW]]'
3659a31a186aSmrg  ;;
3660a31a186aSmrghpux*)
3661a31a186aSmrg  if test "$host_cpu" = ia64; then
3662a31a186aSmrg    symcode='[[ABCDEGRST]]'
3663a31a186aSmrg  fi
3664a31a186aSmrg  ;;
3665a31a186aSmrgirix* | nonstopux*)
3666a31a186aSmrg  symcode='[[BCDEGRST]]'
3667a31a186aSmrg  ;;
3668a31a186aSmrgosf*)
3669a31a186aSmrg  symcode='[[BCDEGQRST]]'
3670a31a186aSmrg  ;;
3671a31a186aSmrgsolaris*)
3672a31a186aSmrg  symcode='[[BDRT]]'
3673a31a186aSmrg  ;;
3674a31a186aSmrgsco3.2v5*)
3675a31a186aSmrg  symcode='[[DT]]'
3676a31a186aSmrg  ;;
3677a31a186aSmrgsysv4.2uw2*)
3678a31a186aSmrg  symcode='[[DT]]'
3679a31a186aSmrg  ;;
3680a31a186aSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3681a31a186aSmrg  symcode='[[ABDT]]'
3682a31a186aSmrg  ;;
3683a31a186aSmrgsysv4)
3684a31a186aSmrg  symcode='[[DFNSTU]]'
3685a31a186aSmrg  ;;
3686a31a186aSmrgesac
3687fe5e51b7Smrg
3688a31a186aSmrg# If we're using GNU nm, then use its standard symbol codes.
3689a31a186aSmrgcase `$NM -V 2>&1` in
3690a31a186aSmrg*GNU* | *'with BFD'*)
3691a31a186aSmrg  symcode='[[ABCDGIRSTW]]' ;;
3692a31a186aSmrgesac
3693fe5e51b7Smrg
3694a31a186aSmrg# Transform an extracted symbol line into a proper C declaration.
3695a31a186aSmrg# Some systems (esp. on ia64) link data and code symbols differently,
3696a31a186aSmrg# so use this general approach.
3697a31a186aSmrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
3698fe5e51b7Smrg
3699a31a186aSmrg# Transform an extracted symbol line into symbol name and symbol address
37000bb88ba4Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
37010bb88ba4Smrglt_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'"
3702fe5e51b7Smrg
3703a31a186aSmrg# Handle CRLF in mingw tool chain
3704a31a186aSmrgopt_cr=
3705a31a186aSmrgcase $build_os in
3706a31a186aSmrgmingw*)
3707a31a186aSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3708a31a186aSmrg  ;;
3709a31a186aSmrgesac
3710fe5e51b7Smrg
3711a31a186aSmrg# Try without a prefix underscore, then with it.
3712a31a186aSmrgfor ac_symprfx in "" "_"; do
3713fe5e51b7Smrg
3714a31a186aSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3715a31a186aSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3716fe5e51b7Smrg
3717a31a186aSmrg  # Write the raw and C identifiers.
3718a31a186aSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3719a31a186aSmrg    # Fake it for dumpbin and say T for any non-static function
3720a31a186aSmrg    # and D for any global variable.
3721a31a186aSmrg    # Also find C++ and __fastcall symbols from MSVC++,
3722a31a186aSmrg    # which start with @ or ?.
3723a31a186aSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3724a31a186aSmrg"     {last_section=section; section=\$ 3};"\
37250bb88ba4Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3726a31a186aSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3727a31a186aSmrg"     \$ 0!~/External *\|/{next};"\
3728a31a186aSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3729a31a186aSmrg"     {if(hide[section]) next};"\
3730a31a186aSmrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3731a31a186aSmrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3732a31a186aSmrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3733a31a186aSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3734a31a186aSmrg"     ' prfx=^$ac_symprfx]"
3735a31a186aSmrg  else
3736a31a186aSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3737643b027fSmrg  fi
37380bb88ba4Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3739fe5e51b7Smrg
3740a31a186aSmrg  # Check to see that the pipe works correctly.
3741a31a186aSmrg  pipe_works=no
3742fe5e51b7Smrg
3743a31a186aSmrg  rm -f conftest*
3744a31a186aSmrg  cat > conftest.$ac_ext <<_LT_EOF
3745a31a186aSmrg#ifdef __cplusplus
3746a31a186aSmrgextern "C" {
3747a31a186aSmrg#endif
3748a31a186aSmrgchar nm_test_var;
3749a31a186aSmrgvoid nm_test_func(void);
3750a31a186aSmrgvoid nm_test_func(void){}
3751a31a186aSmrg#ifdef __cplusplus
3752a31a186aSmrg}
3753a31a186aSmrg#endif
3754a31a186aSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
3755a31a186aSmrg_LT_EOF
3756643b027fSmrg
3757a31a186aSmrg  if AC_TRY_EVAL(ac_compile); then
3758a31a186aSmrg    # Now try to grab the symbols.
3759a31a186aSmrg    nlist=conftest.nm
37600bb88ba4Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3761a31a186aSmrg      # Try sorting and uniquifying the output.
3762a31a186aSmrg      if sort "$nlist" | uniq > "$nlist"T; then
3763a31a186aSmrg	mv -f "$nlist"T "$nlist"
3764a31a186aSmrg      else
3765a31a186aSmrg	rm -f "$nlist"T
3766a31a186aSmrg      fi
3767643b027fSmrg
3768a31a186aSmrg      # Make sure that we snagged all the symbols we need.
3769a31a186aSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3770a31a186aSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3771a31a186aSmrg	  cat <<_LT_EOF > conftest.$ac_ext
37720bb88ba4Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
37730bb88ba4Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
37740bb88ba4Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
37750bb88ba4Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
37760bb88ba4Smrg# define LT@&t@_DLSYM_CONST
37770bb88ba4Smrg#elif defined(__osf__)
37780bb88ba4Smrg/* This system does not cope well with relocations in const data.  */
37790bb88ba4Smrg# define LT@&t@_DLSYM_CONST
37800bb88ba4Smrg#else
37810bb88ba4Smrg# define LT@&t@_DLSYM_CONST const
37820bb88ba4Smrg#endif
37830bb88ba4Smrg
3784a31a186aSmrg#ifdef __cplusplus
3785a31a186aSmrgextern "C" {
3786a31a186aSmrg#endif
3787643b027fSmrg
3788a31a186aSmrg_LT_EOF
3789a31a186aSmrg	  # Now generate the symbol file.
3790a31a186aSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3791643b027fSmrg
3792a31a186aSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
3793643b027fSmrg
3794a31a186aSmrg/* The mapping between symbol names and symbols.  */
37950bb88ba4SmrgLT@&t@_DLSYM_CONST struct {
3796a31a186aSmrg  const char *name;
3797a31a186aSmrg  void       *address;
3798a31a186aSmrg}
3799a31a186aSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3800a31a186aSmrg{
3801a31a186aSmrg  { "@PROGRAM@", (void *) 0 },
3802a31a186aSmrg_LT_EOF
3803a31a186aSmrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3804a31a186aSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3805a31a186aSmrg  {0, (void *) 0}
3806a31a186aSmrg};
3807643b027fSmrg
3808a31a186aSmrg/* This works around a problem in FreeBSD linker */
3809a31a186aSmrg#ifdef FREEBSD_WORKAROUND
3810a31a186aSmrgstatic const void *lt_preloaded_setup() {
3811a31a186aSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
3812a31a186aSmrg}
3813a31a186aSmrg#endif
3814643b027fSmrg
3815a31a186aSmrg#ifdef __cplusplus
3816a31a186aSmrg}
3817a31a186aSmrg#endif
3818a31a186aSmrg_LT_EOF
3819a31a186aSmrg	  # Now try linking the two files.
3820a31a186aSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
38210bb88ba4Smrg	  lt_globsym_save_LIBS=$LIBS
38220bb88ba4Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
3823a31a186aSmrg	  LIBS="conftstm.$ac_objext"
3824a31a186aSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3825a31a186aSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3826a31a186aSmrg	    pipe_works=yes
3827a31a186aSmrg	  fi
38280bb88ba4Smrg	  LIBS=$lt_globsym_save_LIBS
38290bb88ba4Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
3830a31a186aSmrg	else
3831a31a186aSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3832a31a186aSmrg	fi
3833a31a186aSmrg      else
3834a31a186aSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3835a31a186aSmrg      fi
3836fe5e51b7Smrg    else
3837a31a186aSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
3838fe5e51b7Smrg    fi
3839fe5e51b7Smrg  else
3840a31a186aSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3841a31a186aSmrg    cat conftest.$ac_ext >&5
3842fe5e51b7Smrg  fi
3843a31a186aSmrg  rm -rf conftest* conftst*
3844fe5e51b7Smrg
3845a31a186aSmrg  # Do not use the global_symbol_pipe unless it works.
3846a31a186aSmrg  if test "$pipe_works" = yes; then
3847a31a186aSmrg    break
3848a31a186aSmrg  else
3849a31a186aSmrg    lt_cv_sys_global_symbol_pipe=
3850a31a186aSmrg  fi
3851a31a186aSmrgdone
3852a31a186aSmrg])
3853a31a186aSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3854a31a186aSmrg  lt_cv_sys_global_symbol_to_cdecl=
3855a31a186aSmrgfi
3856a31a186aSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3857a31a186aSmrg  AC_MSG_RESULT(failed)
3858fe5e51b7Smrgelse
3859a31a186aSmrg  AC_MSG_RESULT(ok)
3860fe5e51b7Smrgfi
3861fe5e51b7Smrg
38620bb88ba4Smrg# Response file support.
38630bb88ba4Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
38640bb88ba4Smrg  nm_file_list_spec='@'
38650bb88ba4Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
38660bb88ba4Smrg  nm_file_list_spec='@'
38670bb88ba4Smrgfi
38680bb88ba4Smrg
3869a31a186aSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3870a31a186aSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
3871a31a186aSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3872a31a186aSmrg    [Transform the output of nm in a proper C declaration])
3873a31a186aSmrg_LT_DECL([global_symbol_to_c_name_address],
3874a31a186aSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3875a31a186aSmrg    [Transform the output of nm in a C name address pair])
3876a31a186aSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3877a31a186aSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3878a31a186aSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
38790bb88ba4Smrg_LT_DECL([], [nm_file_list_spec], [1],
38800bb88ba4Smrg    [Specify filename containing input files for $NM])
3881a31a186aSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
3882fe5e51b7Smrg
3883fe5e51b7Smrg
3884a31a186aSmrg# _LT_COMPILER_PIC([TAGNAME])
3885a31a186aSmrg# ---------------------------
3886a31a186aSmrgm4_defun([_LT_COMPILER_PIC],
3887a31a186aSmrg[m4_require([_LT_TAG_COMPILER])dnl
3888a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3889a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3890a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
3891fe5e51b7Smrg
3892a31a186aSmrgm4_if([$1], [CXX], [
3893a31a186aSmrg  # C++ specific cases for pic, static, wl, etc.
3894a31a186aSmrg  if test "$GXX" = yes; then
3895a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3896a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
3897643b027fSmrg
3898a31a186aSmrg    case $host_os in
3899a31a186aSmrg    aix*)
3900a31a186aSmrg      # All AIX code is PIC.
3901643b027fSmrg      if test "$host_cpu" = ia64; then
3902a31a186aSmrg	# AIX 5 now supports IA64 processor
3903a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3904fe5e51b7Smrg      fi
3905fe5e51b7Smrg      ;;
3906fe5e51b7Smrg
3907a31a186aSmrg    amigaos*)
3908fe5e51b7Smrg      case $host_cpu in
3909a31a186aSmrg      powerpc)
3910a31a186aSmrg            # see comment about AmigaOS4 .so support
3911a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3912a31a186aSmrg        ;;
3913a31a186aSmrg      m68k)
3914a31a186aSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
3915a31a186aSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
3916a31a186aSmrg            # like `-m68040'.
3917a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3918fe5e51b7Smrg        ;;
3919fe5e51b7Smrg      esac
3920643b027fSmrg      ;;
3921eda3803bSmrg
3922a31a186aSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3923a31a186aSmrg      # PIC is the default for these OSes.
3924a31a186aSmrg      ;;
3925a31a186aSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3926a31a186aSmrg      # This hack is so that the source file can tell whether it is being
3927a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
3928a31a186aSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3929a31a186aSmrg      # (--disable-auto-import) libraries
3930a31a186aSmrg      m4_if([$1], [GCJ], [],
3931a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3932a31a186aSmrg      ;;
3933a31a186aSmrg    darwin* | rhapsody*)
3934a31a186aSmrg      # PIC is the default on this platform
3935a31a186aSmrg      # Common symbols not allowed in MH_DYLIB files
3936a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3937a31a186aSmrg      ;;
3938a31a186aSmrg    *djgpp*)
3939a31a186aSmrg      # DJGPP does not support shared libraries at all
3940a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3941a31a186aSmrg      ;;
39420bb88ba4Smrg    haiku*)
39430bb88ba4Smrg      # PIC is the default for Haiku.
39440bb88ba4Smrg      # The "-static" flag exists, but is broken.
39450bb88ba4Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
39460bb88ba4Smrg      ;;
3947a31a186aSmrg    interix[[3-9]]*)
3948a31a186aSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3949a31a186aSmrg      # Instead, we relocate shared libraries at runtime.
3950a31a186aSmrg      ;;
3951a31a186aSmrg    sysv4*MP*)
3952a31a186aSmrg      if test -d /usr/nec; then
3953a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3954a31a186aSmrg      fi
3955a31a186aSmrg      ;;
3956a31a186aSmrg    hpux*)
3957a31a186aSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3958a31a186aSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3959a31a186aSmrg      # sets the default TLS model and affects inlining.
3960a31a186aSmrg      case $host_cpu in
3961a31a186aSmrg      hppa*64*)
3962fe5e51b7Smrg	;;
3963643b027fSmrg      *)
3964a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3965fe5e51b7Smrg	;;
3966a31a186aSmrg      esac
3967a31a186aSmrg      ;;
3968a31a186aSmrg    *qnx* | *nto*)
3969a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3970a31a186aSmrg      # it will coredump.
3971a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3972a31a186aSmrg      ;;
3973a31a186aSmrg    *)
3974a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3975a31a186aSmrg      ;;
3976643b027fSmrg    esac
3977a31a186aSmrg  else
3978a31a186aSmrg    case $host_os in
3979a31a186aSmrg      aix[[4-9]]*)
3980a31a186aSmrg	# All AIX code is PIC.
3981a31a186aSmrg	if test "$host_cpu" = ia64; then
3982a31a186aSmrg	  # AIX 5 now supports IA64 processor
3983a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3984a31a186aSmrg	else
3985a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3986643b027fSmrg	fi
3987643b027fSmrg	;;
3988a31a186aSmrg      chorus*)
3989a31a186aSmrg	case $cc_basename in
3990a31a186aSmrg	cxch68*)
3991a31a186aSmrg	  # Green Hills C++ Compiler
3992a31a186aSmrg	  # _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"
3993643b027fSmrg	  ;;
3994fe5e51b7Smrg	esac
3995fe5e51b7Smrg	;;
39960bb88ba4Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
39970bb88ba4Smrg	# This hack is so that the source file can tell whether it is being
39980bb88ba4Smrg	# built for inclusion in a dll (and should export symbols for example).
39990bb88ba4Smrg	m4_if([$1], [GCJ], [],
40000bb88ba4Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
40010bb88ba4Smrg	;;
4002a31a186aSmrg      dgux*)
4003a31a186aSmrg	case $cc_basename in
4004a31a186aSmrg	  ec++*)
4005a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4006a31a186aSmrg	    ;;
4007a31a186aSmrg	  ghcx*)
4008a31a186aSmrg	    # Green Hills C++ Compiler
4009a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4010a31a186aSmrg	    ;;
4011a31a186aSmrg	  *)
4012a31a186aSmrg	    ;;
4013eda3803bSmrg	esac
4014fe5e51b7Smrg	;;
4015a31a186aSmrg      freebsd* | dragonfly*)
4016a31a186aSmrg	# FreeBSD uses GNU C++
4017fe5e51b7Smrg	;;
4018a31a186aSmrg      hpux9* | hpux10* | hpux11*)
4019a31a186aSmrg	case $cc_basename in
4020a31a186aSmrg	  CC*)
4021a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4022a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4023a31a186aSmrg	    if test "$host_cpu" != ia64; then
4024a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4025a31a186aSmrg	    fi
4026a31a186aSmrg	    ;;
4027a31a186aSmrg	  aCC*)
4028a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4029a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4030a31a186aSmrg	    case $host_cpu in
4031a31a186aSmrg	    hppa*64*|ia64*)
4032a31a186aSmrg	      # +Z the default
4033a31a186aSmrg	      ;;
4034a31a186aSmrg	    *)
4035a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4036a31a186aSmrg	      ;;
4037a31a186aSmrg	    esac
4038a31a186aSmrg	    ;;
4039a31a186aSmrg	  *)
4040a31a186aSmrg	    ;;
4041a31a186aSmrg	esac
4042fe5e51b7Smrg	;;
4043a31a186aSmrg      interix*)
4044a31a186aSmrg	# This is c89, which is MS Visual C++ (no shared libs)
4045a31a186aSmrg	# Anyone wants to do a port?
4046fe5e51b7Smrg	;;
4047a31a186aSmrg      irix5* | irix6* | nonstopux*)
4048a31a186aSmrg	case $cc_basename in
4049a31a186aSmrg	  CC*)
4050a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4051a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4052a31a186aSmrg	    # CC pic flag -KPIC is the default.
4053a31a186aSmrg	    ;;
4054a31a186aSmrg	  *)
4055a31a186aSmrg	    ;;
4056a31a186aSmrg	esac
4057fe5e51b7Smrg	;;
40580bb88ba4Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
4059a31a186aSmrg	case $cc_basename in
4060a31a186aSmrg	  KCC*)
4061a31a186aSmrg	    # KAI C++ Compiler
4062a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4063a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4064a31a186aSmrg	    ;;
4065a31a186aSmrg	  ecpc* )
4066a31a186aSmrg	    # old Intel C++ for x86_64 which still supported -KPIC.
4067a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4068a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4069a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4070a31a186aSmrg	    ;;
4071a31a186aSmrg	  icpc* )
4072a31a186aSmrg	    # Intel C++, used to be incompatible with GCC.
4073a31a186aSmrg	    # ICC 10 doesn't accept -KPIC any more.
4074a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4075a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4076a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4077a31a186aSmrg	    ;;
4078a31a186aSmrg	  pgCC* | pgcpp*)
4079a31a186aSmrg	    # Portland Group C++ compiler
4080a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4081a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4082a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4083a31a186aSmrg	    ;;
4084a31a186aSmrg	  cxx*)
4085a31a186aSmrg	    # Compaq C++
4086a31a186aSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4087a31a186aSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4088a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4089a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4090a31a186aSmrg	    ;;
40910bb88ba4Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
40920bb88ba4Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4093a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4094a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4095a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4096a31a186aSmrg	    ;;
4097a31a186aSmrg	  *)
4098a31a186aSmrg	    case `$CC -V 2>&1 | sed 5q` in
4099a31a186aSmrg	    *Sun\ C*)
4100a31a186aSmrg	      # Sun C++ 5.9
4101a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4102a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4103a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4104a31a186aSmrg	      ;;
4105a31a186aSmrg	    esac
4106a31a186aSmrg	    ;;
4107a31a186aSmrg	esac
4108fe5e51b7Smrg	;;
4109a31a186aSmrg      lynxos*)
4110fe5e51b7Smrg	;;
4111a31a186aSmrg      m88k*)
4112fe5e51b7Smrg	;;
4113a31a186aSmrg      mvs*)
4114a31a186aSmrg	case $cc_basename in
4115a31a186aSmrg	  cxx*)
4116a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4117a31a186aSmrg	    ;;
4118a31a186aSmrg	  *)
4119a31a186aSmrg	    ;;
4120a31a186aSmrg	esac
4121fe5e51b7Smrg	;;
4122a31a186aSmrg      netbsd*)
4123643b027fSmrg	;;
4124a31a186aSmrg      *qnx* | *nto*)
4125a31a186aSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4126a31a186aSmrg        # it will coredump.
4127a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4128a31a186aSmrg        ;;
4129a31a186aSmrg      osf3* | osf4* | osf5*)
4130a31a186aSmrg	case $cc_basename in
4131a31a186aSmrg	  KCC*)
4132a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4133a31a186aSmrg	    ;;
4134a31a186aSmrg	  RCC*)
4135a31a186aSmrg	    # Rational C++ 2.4.1
4136a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4137a31a186aSmrg	    ;;
4138a31a186aSmrg	  cxx*)
4139a31a186aSmrg	    # Digital/Compaq C++
4140a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4141a31a186aSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4142a31a186aSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4143a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4144a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4145a31a186aSmrg	    ;;
4146a31a186aSmrg	  *)
4147a31a186aSmrg	    ;;
4148a31a186aSmrg	esac
4149643b027fSmrg	;;
4150a31a186aSmrg      psos*)
4151643b027fSmrg	;;
4152a31a186aSmrg      solaris*)
4153a31a186aSmrg	case $cc_basename in
41540bb88ba4Smrg	  CC* | sunCC*)
4155a31a186aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
4156a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4157a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4158a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4159a31a186aSmrg	    ;;
4160a31a186aSmrg	  gcx*)
4161a31a186aSmrg	    # Green Hills C++ Compiler
4162a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4163a31a186aSmrg	    ;;
4164a31a186aSmrg	  *)
4165a31a186aSmrg	    ;;
4166a31a186aSmrg	esac
4167643b027fSmrg	;;
4168a31a186aSmrg      sunos4*)
4169a31a186aSmrg	case $cc_basename in
4170a31a186aSmrg	  CC*)
4171a31a186aSmrg	    # Sun C++ 4.x
4172a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4173a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4174a31a186aSmrg	    ;;
4175a31a186aSmrg	  lcc*)
4176a31a186aSmrg	    # Lucid
4177a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4178a31a186aSmrg	    ;;
4179fe5e51b7Smrg	  *)
4180fe5e51b7Smrg	    ;;
4181fe5e51b7Smrg	esac
4182fe5e51b7Smrg	;;
4183a31a186aSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4184a31a186aSmrg	case $cc_basename in
4185a31a186aSmrg	  CC*)
4186a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4187a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4188a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4189a31a186aSmrg	    ;;
4190a31a186aSmrg	esac
4191fe5e51b7Smrg	;;
4192a31a186aSmrg      tandem*)
4193a31a186aSmrg	case $cc_basename in
4194a31a186aSmrg	  NCC*)
4195a31a186aSmrg	    # NonStop-UX NCC 3.20
4196a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4197a31a186aSmrg	    ;;
4198643b027fSmrg	  *)
4199643b027fSmrg	    ;;
4200a31a186aSmrg	esac
4201643b027fSmrg	;;
4202a31a186aSmrg      vxworks*)
4203fe5e51b7Smrg	;;
4204fe5e51b7Smrg      *)
4205a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4206fe5e51b7Smrg	;;
4207fe5e51b7Smrg    esac
4208a31a186aSmrg  fi
4209a31a186aSmrg],
4210a31a186aSmrg[
4211a31a186aSmrg  if test "$GCC" = yes; then
4212a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4213a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4214a31a186aSmrg
4215a31a186aSmrg    case $host_os in
4216a31a186aSmrg      aix*)
4217a31a186aSmrg      # All AIX code is PIC.
4218a31a186aSmrg      if test "$host_cpu" = ia64; then
4219a31a186aSmrg	# AIX 5 now supports IA64 processor
4220a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4221a31a186aSmrg      fi
4222a31a186aSmrg      ;;
4223a31a186aSmrg
4224a31a186aSmrg    amigaos*)
4225a31a186aSmrg      case $host_cpu in
4226a31a186aSmrg      powerpc)
4227a31a186aSmrg            # see comment about AmigaOS4 .so support
4228a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4229a31a186aSmrg        ;;
4230a31a186aSmrg      m68k)
4231a31a186aSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4232a31a186aSmrg            # adding the `-m68020' flag to GCC prevents building anything better,
4233a31a186aSmrg            # like `-m68040'.
4234a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4235a31a186aSmrg        ;;
4236a31a186aSmrg      esac
4237a31a186aSmrg      ;;
4238a31a186aSmrg
4239a31a186aSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4240a31a186aSmrg      # PIC is the default for these OSes.
4241a31a186aSmrg      ;;
4242a31a186aSmrg
4243a31a186aSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4244a31a186aSmrg      # This hack is so that the source file can tell whether it is being
4245a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
4246a31a186aSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4247a31a186aSmrg      # (--disable-auto-import) libraries
4248a31a186aSmrg      m4_if([$1], [GCJ], [],
4249a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4250a31a186aSmrg      ;;
4251a31a186aSmrg
4252a31a186aSmrg    darwin* | rhapsody*)
4253a31a186aSmrg      # PIC is the default on this platform
4254a31a186aSmrg      # Common symbols not allowed in MH_DYLIB files
4255a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4256a31a186aSmrg      ;;
4257a31a186aSmrg
42580bb88ba4Smrg    haiku*)
42590bb88ba4Smrg      # PIC is the default for Haiku.
42600bb88ba4Smrg      # The "-static" flag exists, but is broken.
42610bb88ba4Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
42620bb88ba4Smrg      ;;
42630bb88ba4Smrg
4264a31a186aSmrg    hpux*)
4265a31a186aSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4266a31a186aSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4267a31a186aSmrg      # sets the default TLS model and affects inlining.
4268a31a186aSmrg      case $host_cpu in
4269a31a186aSmrg      hppa*64*)
4270a31a186aSmrg	# +Z the default
4271fe5e51b7Smrg	;;
4272fe5e51b7Smrg      *)
4273a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4274eda3803bSmrg	;;
4275a31a186aSmrg      esac
4276a31a186aSmrg      ;;
4277a31a186aSmrg
4278a31a186aSmrg    interix[[3-9]]*)
4279a31a186aSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4280a31a186aSmrg      # Instead, we relocate shared libraries at runtime.
4281a31a186aSmrg      ;;
4282a31a186aSmrg
4283a31a186aSmrg    msdosdjgpp*)
4284a31a186aSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4285a31a186aSmrg      # on systems that don't support them.
4286a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4287a31a186aSmrg      enable_shared=no
4288a31a186aSmrg      ;;
4289a31a186aSmrg
4290a31a186aSmrg    *nto* | *qnx*)
4291a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4292a31a186aSmrg      # it will coredump.
4293a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4294a31a186aSmrg      ;;
4295a31a186aSmrg
4296a31a186aSmrg    sysv4*MP*)
4297a31a186aSmrg      if test -d /usr/nec; then
4298a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4299a31a186aSmrg      fi
4300a31a186aSmrg      ;;
4301a31a186aSmrg
4302a31a186aSmrg    *)
4303a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4304a31a186aSmrg      ;;
4305643b027fSmrg    esac
43060bb88ba4Smrg
43070bb88ba4Smrg    case $cc_basename in
43080bb88ba4Smrg    nvcc*) # Cuda Compiler Driver 2.2
43090bb88ba4Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
43100bb88ba4Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
43110bb88ba4Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
43120bb88ba4Smrg      fi
43130bb88ba4Smrg      ;;
43140bb88ba4Smrg    esac
4315a31a186aSmrg  else
4316a31a186aSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
4317a31a186aSmrg    case $host_os in
4318a31a186aSmrg    aix*)
4319a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4320a31a186aSmrg      if test "$host_cpu" = ia64; then
4321a31a186aSmrg	# AIX 5 now supports IA64 processor
4322a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4323a31a186aSmrg      else
4324a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4325a31a186aSmrg      fi
4326a31a186aSmrg      ;;
4327a31a186aSmrg
4328a31a186aSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4329a31a186aSmrg      # This hack is so that the source file can tell whether it is being
4330a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
4331a31a186aSmrg      m4_if([$1], [GCJ], [],
4332a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4333a31a186aSmrg      ;;
4334a31a186aSmrg
4335a31a186aSmrg    hpux9* | hpux10* | hpux11*)
4336a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4337a31a186aSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4338a31a186aSmrg      # not for PA HP-UX.
4339a31a186aSmrg      case $host_cpu in
4340a31a186aSmrg      hppa*64*|ia64*)
4341a31a186aSmrg	# +Z the default
4342fe5e51b7Smrg	;;
4343fe5e51b7Smrg      *)
4344a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4345fe5e51b7Smrg	;;
4346a31a186aSmrg      esac
4347a31a186aSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4348a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4349a31a186aSmrg      ;;
4350fe5e51b7Smrg
4351a31a186aSmrg    irix5* | irix6* | nonstopux*)
4352a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4353a31a186aSmrg      # PIC (with -KPIC) is the default.
4354a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4355a31a186aSmrg      ;;
4356fe5e51b7Smrg
43570bb88ba4Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4358a31a186aSmrg      case $cc_basename in
4359a31a186aSmrg      # old Intel for x86_64 which still supported -KPIC.
4360a31a186aSmrg      ecc*)
4361a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4362a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4363a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4364a31a186aSmrg        ;;
4365a31a186aSmrg      # icc used to be incompatible with GCC.
4366a31a186aSmrg      # ICC 10 doesn't accept -KPIC any more.
4367a31a186aSmrg      icc* | ifort*)
4368a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4369a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4370a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4371a31a186aSmrg        ;;
4372a31a186aSmrg      # Lahey Fortran 8.1.
4373a31a186aSmrg      lf95*)
4374a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4375a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4376a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4377a31a186aSmrg	;;
43780bb88ba4Smrg      nagfor*)
43790bb88ba4Smrg	# NAG Fortran compiler
43800bb88ba4Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
43810bb88ba4Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
43820bb88ba4Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
43830bb88ba4Smrg	;;
43840bb88ba4Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4385a31a186aSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4386a31a186aSmrg	# which looks to be a dead project)
4387a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4388a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4389a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4390a31a186aSmrg        ;;
4391a31a186aSmrg      ccc*)
4392a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4393a31a186aSmrg        # All Alpha code is PIC.
4394a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4395a31a186aSmrg        ;;
43960bb88ba4Smrg      xl* | bgxl* | bgf* | mpixl*)
43970bb88ba4Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4398a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4399a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4400a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4401a31a186aSmrg	;;
4402a31a186aSmrg      *)
4403a31a186aSmrg	case `$CC -V 2>&1 | sed 5q` in
44040bb88ba4Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
44050bb88ba4Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
44060bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44070bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44080bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
44090bb88ba4Smrg	  ;;
44100bb88ba4Smrg	*Sun\ F* | *Sun*Fortran*)
44110bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
44120bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
44130bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
44140bb88ba4Smrg	  ;;
4415a31a186aSmrg	*Sun\ C*)
4416a31a186aSmrg	  # Sun C 5.9
4417a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4418a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4419a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4420a31a186aSmrg	  ;;
44210bb88ba4Smrg        *Intel*\ [[CF]]*Compiler*)
44220bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44230bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
44240bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
44250bb88ba4Smrg	  ;;
44260bb88ba4Smrg	*Portland\ Group*)
44270bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
44280bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4429a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4430a31a186aSmrg	  ;;
4431a31a186aSmrg	esac
4432a31a186aSmrg	;;
4433a31a186aSmrg      esac
4434a31a186aSmrg      ;;
4435fe5e51b7Smrg
4436a31a186aSmrg    newsos6)
4437a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4438a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4439a31a186aSmrg      ;;
4440fe5e51b7Smrg
4441a31a186aSmrg    *nto* | *qnx*)
4442a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4443a31a186aSmrg      # it will coredump.
4444a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4445a31a186aSmrg      ;;
4446fe5e51b7Smrg
4447a31a186aSmrg    osf3* | osf4* | osf5*)
4448a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4449a31a186aSmrg      # All OSF/1 code is PIC.
4450a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4451a31a186aSmrg      ;;
4452fe5e51b7Smrg
4453a31a186aSmrg    rdos*)
4454a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4455a31a186aSmrg      ;;
4456fe5e51b7Smrg
4457a31a186aSmrg    solaris*)
4458a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4459a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4460a31a186aSmrg      case $cc_basename in
44610bb88ba4Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4462a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4463a31a186aSmrg      *)
4464a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4465a31a186aSmrg      esac
4466a31a186aSmrg      ;;
4467fe5e51b7Smrg
4468a31a186aSmrg    sunos4*)
4469a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4470a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4471a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4472a31a186aSmrg      ;;
4473fe5e51b7Smrg
4474a31a186aSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4475a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4476a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4477a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4478a31a186aSmrg      ;;
4479fe5e51b7Smrg
4480a31a186aSmrg    sysv4*MP*)
4481a31a186aSmrg      if test -d /usr/nec ;then
4482a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4483a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4484a31a186aSmrg      fi
4485a31a186aSmrg      ;;
4486fe5e51b7Smrg
4487a31a186aSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4488a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4489a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4490a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4491a31a186aSmrg      ;;
4492643b027fSmrg
4493a31a186aSmrg    unicos*)
4494a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4495a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4496a31a186aSmrg      ;;
4497fe5e51b7Smrg
4498a31a186aSmrg    uts4*)
4499a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4500a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4501a31a186aSmrg      ;;
4502a31a186aSmrg
4503a31a186aSmrg    *)
4504a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4505a31a186aSmrg      ;;
4506fe5e51b7Smrg    esac
4507a31a186aSmrg  fi
4508a31a186aSmrg])
4509a31a186aSmrgcase $host_os in
4510a31a186aSmrg  # For platforms which do not support PIC, -DPIC is meaningless:
4511a31a186aSmrg  *djgpp*)
4512a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4513a31a186aSmrg    ;;
4514a31a186aSmrg  *)
4515a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4516a31a186aSmrg    ;;
4517a31a186aSmrgesac
45180bb88ba4Smrg
45190bb88ba4SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
45200bb88ba4Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
45210bb88ba4Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
45220bb88ba4Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4523fe5e51b7Smrg
4524a31a186aSmrg#
4525a31a186aSmrg# Check to make sure the PIC flag actually works.
4526a31a186aSmrg#
4527a31a186aSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4528a31a186aSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4529a31a186aSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4530a31a186aSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4531a31a186aSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4532a31a186aSmrg     "" | " "*) ;;
4533a31a186aSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4534a31a186aSmrg     esac],
4535a31a186aSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4536a31a186aSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4537fe5e51b7Smrgfi
4538a31a186aSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4539a31a186aSmrg	[Additional compiler flags for building library objects])
4540fe5e51b7Smrg
45410bb88ba4Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
45420bb88ba4Smrg	[How to pass a linker flag through the compiler])
4543a31a186aSmrg#
4544a31a186aSmrg# Check to make sure the static flag actually works.
4545a31a186aSmrg#
4546a31a186aSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4547a31a186aSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4548a31a186aSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4549a31a186aSmrg  $lt_tmp_static_flag,
4550a31a186aSmrg  [],
4551a31a186aSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4552a31a186aSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4553a31a186aSmrg	[Compiler flag to prevent dynamic linking])
4554a31a186aSmrg])# _LT_COMPILER_PIC
4555fe5e51b7Smrg
4556643b027fSmrg
4557a31a186aSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4558a31a186aSmrg# ----------------------------
4559a31a186aSmrg# See if the linker supports building shared libraries.
4560a31a186aSmrgm4_defun([_LT_LINKER_SHLIBS],
4561a31a186aSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4562a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
45630bb88ba4Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4564a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4565a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
4566a31a186aSmrgm4_require([_LT_DECL_SED])dnl
4567a31a186aSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4568a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
4569a31a186aSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4570a31a186aSmrgm4_if([$1], [CXX], [
4571a31a186aSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
45720bb88ba4Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4573a31a186aSmrg  case $host_os in
4574a31a186aSmrg  aix[[4-9]]*)
4575a31a186aSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4576a31a186aSmrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
45770bb88ba4Smrg    # Also, AIX nm treats weak defined symbols like other global defined
45780bb88ba4Smrg    # symbols, whereas GNU nm marks them as "W".
4579a31a186aSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
45800bb88ba4Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4581a31a186aSmrg    else
4582a31a186aSmrg      _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'
4583fe5e51b7Smrg    fi
4584fe5e51b7Smrg    ;;
4585a31a186aSmrg  pw32*)
4586a31a186aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
45870bb88ba4Smrg    ;;
4588a31a186aSmrg  cygwin* | mingw* | cegcc*)
45890bb88ba4Smrg    case $cc_basename in
45900bb88ba4Smrg    cl*)
45910bb88ba4Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
45920bb88ba4Smrg      ;;
45930bb88ba4Smrg    *)
45940bb88ba4Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
45950bb88ba4Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
45960bb88ba4Smrg      ;;
45970bb88ba4Smrg    esac
45980bb88ba4Smrg    ;;
4599a31a186aSmrg  *)
4600a31a186aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
46010bb88ba4Smrg    ;;
4602a31a186aSmrg  esac
4603a31a186aSmrg], [
4604a31a186aSmrg  runpath_var=
4605a31a186aSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4606a31a186aSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4607a31a186aSmrg  _LT_TAGVAR(archive_cmds, $1)=
4608a31a186aSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4609a31a186aSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4610a31a186aSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4611a31a186aSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4612a31a186aSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4613a31a186aSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4614a31a186aSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4615a31a186aSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4616a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4617a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4618a31a186aSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4619a31a186aSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4620a31a186aSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4621a31a186aSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4622a31a186aSmrg  _LT_TAGVAR(module_cmds, $1)=
4623a31a186aSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4624a31a186aSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4625a31a186aSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4626a31a186aSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4627a31a186aSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4628a31a186aSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4629a31a186aSmrg  # included in the symbol list
4630a31a186aSmrg  _LT_TAGVAR(include_expsyms, $1)=
4631a31a186aSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4632a31a186aSmrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4633a31a186aSmrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4634a31a186aSmrg  # as well as any symbol that contains `d'.
4635a31a186aSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4636a31a186aSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4637a31a186aSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4638a31a186aSmrg  # the symbol is explicitly referenced.  Since portable code cannot
4639a31a186aSmrg  # rely on this symbol name, it's probably fine to never include it in
4640a31a186aSmrg  # preloaded symbol tables.
4641a31a186aSmrg  # Exclude shared library initialization/finalization symbols.
4642a31a186aSmrgdnl Note also adjust exclude_expsyms for C++ above.
4643a31a186aSmrg  extract_expsyms_cmds=
4644fe5e51b7Smrg
4645a31a186aSmrg  case $host_os in
4646a31a186aSmrg  cygwin* | mingw* | pw32* | cegcc*)
4647a31a186aSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4648a31a186aSmrg    # When not using gcc, we currently assume that we are using
4649a31a186aSmrg    # Microsoft Visual C++.
4650a31a186aSmrg    if test "$GCC" != yes; then
4651a31a186aSmrg      with_gnu_ld=no
4652fe5e51b7Smrg    fi
4653fe5e51b7Smrg    ;;
4654a31a186aSmrg  interix*)
4655a31a186aSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4656a31a186aSmrg    with_gnu_ld=yes
4657a31a186aSmrg    ;;
4658a31a186aSmrg  openbsd*)
4659a31a186aSmrg    with_gnu_ld=no
4660a31a186aSmrg    ;;
4661fe5e51b7Smrg  esac
4662fe5e51b7Smrg
4663a31a186aSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
46640bb88ba4Smrg
46650bb88ba4Smrg  # On some targets, GNU ld is compatible enough with the native linker
46660bb88ba4Smrg  # that we're better off using the native interface for both.
46670bb88ba4Smrg  lt_use_gnu_ld_interface=no
4668a31a186aSmrg  if test "$with_gnu_ld" = yes; then
46690bb88ba4Smrg    case $host_os in
46700bb88ba4Smrg      aix*)
46710bb88ba4Smrg	# The AIX port of GNU ld has always aspired to compatibility
46720bb88ba4Smrg	# with the native linker.  However, as the warning in the GNU ld
46730bb88ba4Smrg	# block says, versions before 2.19.5* couldn't really create working
46740bb88ba4Smrg	# shared libraries, regardless of the interface used.
46750bb88ba4Smrg	case `$LD -v 2>&1` in
46760bb88ba4Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
46770bb88ba4Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
46780bb88ba4Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
46790bb88ba4Smrg	  *)
46800bb88ba4Smrg	    lt_use_gnu_ld_interface=yes
46810bb88ba4Smrg	    ;;
46820bb88ba4Smrg	esac
46830bb88ba4Smrg	;;
46840bb88ba4Smrg      *)
46850bb88ba4Smrg	lt_use_gnu_ld_interface=yes
46860bb88ba4Smrg	;;
46870bb88ba4Smrg    esac
46880bb88ba4Smrg  fi
46890bb88ba4Smrg
46900bb88ba4Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
4691a31a186aSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4692a31a186aSmrg    wlarc='${wl}'
4693fe5e51b7Smrg
4694a31a186aSmrg    # Set some defaults for GNU ld with shared library support. These
4695a31a186aSmrg    # are reset later if shared libraries are not supported. Putting them
4696a31a186aSmrg    # here allows them to be overridden if necessary.
4697a31a186aSmrg    runpath_var=LD_RUN_PATH
4698a31a186aSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4699a31a186aSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4700a31a186aSmrg    # ancient GNU ld didn't support --whole-archive et. al.
4701a31a186aSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4702a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4703a31a186aSmrg    else
4704a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4705a31a186aSmrg    fi
4706a31a186aSmrg    supports_anon_versioning=no
4707a31a186aSmrg    case `$LD -v 2>&1` in
47080bb88ba4Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4709a31a186aSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4710a31a186aSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4711a31a186aSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4712a31a186aSmrg      *\ 2.11.*) ;; # other 2.11 versions
4713a31a186aSmrg      *) supports_anon_versioning=yes ;;
4714a31a186aSmrg    esac
4715fe5e51b7Smrg
4716a31a186aSmrg    # See if GNU ld supports shared libraries.
4717a31a186aSmrg    case $host_os in
4718a31a186aSmrg    aix[[3-9]]*)
4719a31a186aSmrg      # On AIX/PPC, the GNU linker is very broken
4720a31a186aSmrg      if test "$host_cpu" != ia64; then
4721a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4722a31a186aSmrg	cat <<_LT_EOF 1>&2
4723fe5e51b7Smrg
47240bb88ba4Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
4725a31a186aSmrg*** to be unable to reliably create shared libraries on AIX.
4726a31a186aSmrg*** Therefore, libtool is disabling shared libraries support.  If you
47270bb88ba4Smrg*** really care for shared libraries, you may want to install binutils
47280bb88ba4Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
47290bb88ba4Smrg*** You will then need to restart the configuration process.
4730fe5e51b7Smrg
4731a31a186aSmrg_LT_EOF
4732a31a186aSmrg      fi
4733a31a186aSmrg      ;;
4734fe5e51b7Smrg
4735a31a186aSmrg    amigaos*)
4736a31a186aSmrg      case $host_cpu in
4737a31a186aSmrg      powerpc)
4738a31a186aSmrg            # see comment about AmigaOS4 .so support
4739a31a186aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4740a31a186aSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4741a31a186aSmrg        ;;
4742a31a186aSmrg      m68k)
4743a31a186aSmrg            _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)'
4744a31a186aSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4745a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4746a31a186aSmrg        ;;
4747a31a186aSmrg      esac
4748a31a186aSmrg      ;;
4749fe5e51b7Smrg
4750a31a186aSmrg    beos*)
4751a31a186aSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4752a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4753a31a186aSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4754a31a186aSmrg	# support --undefined.  This deserves some investigation.  FIXME
4755a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4756a31a186aSmrg      else
4757a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4758a31a186aSmrg      fi
4759a31a186aSmrg      ;;
4760fe5e51b7Smrg
4761a31a186aSmrg    cygwin* | mingw* | pw32* | cegcc*)
4762a31a186aSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4763a31a186aSmrg      # as there is no search path for DLLs.
4764a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
47650bb88ba4Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4766a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4767a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
4768a31a186aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
47690bb88ba4Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
47700bb88ba4Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4771a31a186aSmrg
4772a31a186aSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4773a31a186aSmrg        _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'
4774a31a186aSmrg	# If the export-symbols file already is a .def file (1st line
4775a31a186aSmrg	# is EXPORTS), use it as is; otherwise, prepend...
4776a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4777a31a186aSmrg	  cp $export_symbols $output_objdir/$soname.def;
4778a31a186aSmrg	else
4779a31a186aSmrg	  echo EXPORTS > $output_objdir/$soname.def;
4780a31a186aSmrg	  cat $export_symbols >> $output_objdir/$soname.def;
4781a31a186aSmrg	fi~
4782a31a186aSmrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4783a31a186aSmrg      else
4784a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4785a31a186aSmrg      fi
4786a31a186aSmrg      ;;
4787fe5e51b7Smrg
47880bb88ba4Smrg    haiku*)
47890bb88ba4Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
47900bb88ba4Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
47910bb88ba4Smrg      ;;
47920bb88ba4Smrg
4793a31a186aSmrg    interix[[3-9]]*)
4794a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
4795a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4796a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4797a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4798a31a186aSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4799a31a186aSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4800a31a186aSmrg      # default) and relocated if they conflict, which is a slow very memory
4801a31a186aSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4802a31a186aSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4803a31a186aSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4804a31a186aSmrg      _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'
4805a31a186aSmrg      _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'
4806a31a186aSmrg      ;;
4807fe5e51b7Smrg
48080bb88ba4Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4809a31a186aSmrg      tmp_diet=no
4810a31a186aSmrg      if test "$host_os" = linux-dietlibc; then
4811a31a186aSmrg	case $cc_basename in
4812a31a186aSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4813a31a186aSmrg	esac
4814a31a186aSmrg      fi
4815a31a186aSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4816a31a186aSmrg	 && test "$tmp_diet" = no
4817a31a186aSmrg      then
48180bb88ba4Smrg	tmp_addflag=' $pic_flag'
4819a31a186aSmrg	tmp_sharedflag='-shared'
4820a31a186aSmrg	case $cc_basename,$host_cpu in
4821a31a186aSmrg        pgcc*)				# Portland Group C compiler
48220bb88ba4Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4823a31a186aSmrg	  tmp_addflag=' $pic_flag'
4824a31a186aSmrg	  ;;
48250bb88ba4Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
48260bb88ba4Smrg					# Portland Group f77 and f90 compilers
48270bb88ba4Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4828a31a186aSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4829a31a186aSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4830a31a186aSmrg	  tmp_addflag=' -i_dynamic' ;;
4831a31a186aSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4832a31a186aSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4833a31a186aSmrg	ifc* | ifort*)			# Intel Fortran compiler
4834a31a186aSmrg	  tmp_addflag=' -nofor_main' ;;
4835a31a186aSmrg	lf95*)				# Lahey Fortran 8.1
4836a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4837a31a186aSmrg	  tmp_sharedflag='--shared' ;;
48380bb88ba4Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4839a31a186aSmrg	  tmp_sharedflag='-qmkshrobj'
4840a31a186aSmrg	  tmp_addflag= ;;
48410bb88ba4Smrg	nvcc*)	# Cuda Compiler Driver 2.2
48420bb88ba4Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
48430bb88ba4Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
48440bb88ba4Smrg	  ;;
4845a31a186aSmrg	esac
4846a31a186aSmrg	case `$CC -V 2>&1 | sed 5q` in
4847a31a186aSmrg	*Sun\ C*)			# Sun C 5.9
48480bb88ba4Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
4849a31a186aSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4850a31a186aSmrg	  tmp_sharedflag='-G' ;;
4851a31a186aSmrg	*Sun\ F*)			# Sun Fortran 8.3
4852a31a186aSmrg	  tmp_sharedflag='-G' ;;
4853a31a186aSmrg	esac
4854a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4855fe5e51b7Smrg
4856a31a186aSmrg        if test "x$supports_anon_versioning" = xyes; then
4857a31a186aSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4858a31a186aSmrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4859a31a186aSmrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4860a31a186aSmrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4861a31a186aSmrg        fi
4862fe5e51b7Smrg
4863a31a186aSmrg	case $cc_basename in
48640bb88ba4Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
4865a31a186aSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4866a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
48670bb88ba4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
48680bb88ba4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4869a31a186aSmrg	  if test "x$supports_anon_versioning" = xyes; then
4870a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4871a31a186aSmrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4872a31a186aSmrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
48730bb88ba4Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4874a31a186aSmrg	  fi
4875a31a186aSmrg	  ;;
4876a31a186aSmrg	esac
4877a31a186aSmrg      else
4878a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
4879a31a186aSmrg      fi
4880a31a186aSmrg      ;;
4881fe5e51b7Smrg
4882a31a186aSmrg    netbsd*)
4883a31a186aSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4884a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4885a31a186aSmrg	wlarc=
4886a31a186aSmrg      else
48870bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
48880bb88ba4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4889a31a186aSmrg      fi
4890a31a186aSmrg      ;;
4891fe5e51b7Smrg
4892a31a186aSmrg    solaris*)
4893a31a186aSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4894a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4895a31a186aSmrg	cat <<_LT_EOF 1>&2
4896fe5e51b7Smrg
4897a31a186aSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4898a31a186aSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
4899a31a186aSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4900a31a186aSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4901a31a186aSmrg*** your PATH or compiler configuration so that the native linker is
4902a31a186aSmrg*** used, and then restart.
4903fe5e51b7Smrg
4904a31a186aSmrg_LT_EOF
4905a31a186aSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49060bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49070bb88ba4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4908a31a186aSmrg      else
4909a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4910a31a186aSmrg      fi
4911a31a186aSmrg      ;;
4912fe5e51b7Smrg
4913a31a186aSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4914a31a186aSmrg      case `$LD -v 2>&1` in
4915a31a186aSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4916a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4917a31a186aSmrg	cat <<_LT_EOF 1>&2
4918fe5e51b7Smrg
4919a31a186aSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4920a31a186aSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4921a31a186aSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4922a31a186aSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4923a31a186aSmrg*** your PATH or compiler configuration so that the native linker is
4924a31a186aSmrg*** used, and then restart.
4925fe5e51b7Smrg
4926a31a186aSmrg_LT_EOF
4927a31a186aSmrg	;;
4928a31a186aSmrg	*)
4929a31a186aSmrg	  # For security reasons, it is highly recommended that you always
4930a31a186aSmrg	  # use absolute paths for naming shared libraries, and exclude the
4931a31a186aSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4932a31a186aSmrg	  # requires that you compile everything twice, which is a pain.
4933a31a186aSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4934a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4935a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4936a31a186aSmrg	    _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'
4937a31a186aSmrg	  else
4938a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4939a31a186aSmrg	  fi
4940a31a186aSmrg	;;
4941a31a186aSmrg      esac
4942a31a186aSmrg      ;;
4943fe5e51b7Smrg
4944a31a186aSmrg    sunos4*)
4945a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4946a31a186aSmrg      wlarc=
4947a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4948a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4949a31a186aSmrg      ;;
4950fe5e51b7Smrg
4951a31a186aSmrg    *)
4952a31a186aSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
49530bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
49540bb88ba4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
4955a31a186aSmrg      else
4956a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4957a31a186aSmrg      fi
4958a31a186aSmrg      ;;
4959a31a186aSmrg    esac
4960fe5e51b7Smrg
4961a31a186aSmrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4962a31a186aSmrg      runpath_var=
4963a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4964a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4965a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4966a31a186aSmrg    fi
4967a31a186aSmrg  else
4968a31a186aSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
4969a31a186aSmrg    case $host_os in
4970a31a186aSmrg    aix3*)
4971a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4972a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4973a31a186aSmrg      _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'
4974a31a186aSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
4975a31a186aSmrg      # are no directories specified by -L.
4976a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4977a31a186aSmrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4978a31a186aSmrg	# Neither direct hardcoding nor static linking is supported with a
4979a31a186aSmrg	# broken collect2.
4980a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4981a31a186aSmrg      fi
4982a31a186aSmrg      ;;
4983fe5e51b7Smrg
4984a31a186aSmrg    aix[[4-9]]*)
4985a31a186aSmrg      if test "$host_cpu" = ia64; then
4986a31a186aSmrg	# On IA64, the linker does run time linking by default, so we don't
4987a31a186aSmrg	# have to do anything special.
4988a31a186aSmrg	aix_use_runtimelinking=no
4989a31a186aSmrg	exp_sym_flag='-Bexport'
4990a31a186aSmrg	no_entry_flag=""
4991a31a186aSmrg      else
4992a31a186aSmrg	# If we're using GNU nm, then we don't want the "-C" option.
4993a31a186aSmrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
49940bb88ba4Smrg	# Also, AIX nm treats weak defined symbols like other global
49950bb88ba4Smrg	# defined symbols, whereas GNU nm marks them as "W".
4996a31a186aSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
49970bb88ba4Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4998a31a186aSmrg	else
4999a31a186aSmrg	  _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'
5000a31a186aSmrg	fi
5001a31a186aSmrg	aix_use_runtimelinking=no
5002fe5e51b7Smrg
5003a31a186aSmrg	# Test if we are trying to use run time linking or normal
5004a31a186aSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5005a31a186aSmrg	# need to do runtime linking.
5006a31a186aSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5007a31a186aSmrg	  for ld_flag in $LDFLAGS; do
5008a31a186aSmrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5009a31a186aSmrg	    aix_use_runtimelinking=yes
5010a31a186aSmrg	    break
5011a31a186aSmrg	  fi
5012a31a186aSmrg	  done
5013a31a186aSmrg	  ;;
5014a31a186aSmrg	esac
5015fe5e51b7Smrg
5016a31a186aSmrg	exp_sym_flag='-bexport'
5017a31a186aSmrg	no_entry_flag='-bnoentry'
5018a31a186aSmrg      fi
5019fe5e51b7Smrg
5020a31a186aSmrg      # When large executables or shared objects are built, AIX ld can
5021a31a186aSmrg      # have problems creating the table of contents.  If linking a library
5022a31a186aSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
5023a31a186aSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5024a31a186aSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5025a31a186aSmrg
5026a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)=''
5027a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5028a31a186aSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5029a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5030a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5031a31a186aSmrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
5032fe5e51b7Smrg
5033a31a186aSmrg      if test "$GCC" = yes; then
5034a31a186aSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5035a31a186aSmrg	# We only want to do this on AIX 4.2 and lower, the check
5036a31a186aSmrg	# below for broken collect2 doesn't work under 4.3+
5037a31a186aSmrg	  collect2name=`${CC} -print-prog-name=collect2`
5038a31a186aSmrg	  if test -f "$collect2name" &&
5039a31a186aSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5040a31a186aSmrg	  then
5041a31a186aSmrg	  # We have reworked collect2
5042a31a186aSmrg	  :
5043a31a186aSmrg	  else
5044a31a186aSmrg	  # We have old collect2
5045a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5046a31a186aSmrg	  # It fails to find uninstalled libraries when the uninstalled
5047a31a186aSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5048a31a186aSmrg	  # to unsupported forces relinking
5049a31a186aSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5050a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5051a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5052a31a186aSmrg	  fi
5053a31a186aSmrg	  ;;
5054a31a186aSmrg	esac
5055a31a186aSmrg	shared_flag='-shared'
5056a31a186aSmrg	if test "$aix_use_runtimelinking" = yes; then
5057a31a186aSmrg	  shared_flag="$shared_flag "'${wl}-G'
5058a31a186aSmrg	fi
5059a31a186aSmrg      else
5060a31a186aSmrg	# not using gcc
5061a31a186aSmrg	if test "$host_cpu" = ia64; then
5062a31a186aSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5063a31a186aSmrg	# chokes on -Wl,-G. The following line is correct:
5064a31a186aSmrg	  shared_flag='-G'
5065a31a186aSmrg	else
5066a31a186aSmrg	  if test "$aix_use_runtimelinking" = yes; then
5067a31a186aSmrg	    shared_flag='${wl}-G'
5068a31a186aSmrg	  else
5069a31a186aSmrg	    shared_flag='${wl}-bM:SRE'
5070a31a186aSmrg	  fi
5071a31a186aSmrg	fi
5072a31a186aSmrg      fi
5073fe5e51b7Smrg
5074a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5075a31a186aSmrg      # It seems that -bexpall does not export symbols beginning with
5076a31a186aSmrg      # underscore (_), so it is better to generate a list of symbols to export.
5077a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5078a31a186aSmrg      if test "$aix_use_runtimelinking" = yes; then
5079a31a186aSmrg	# Warning - without using the other runtime loading flags (-brtl),
5080a31a186aSmrg	# -berok will link without error, but may produce a broken library.
5081a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5082a31a186aSmrg        # Determine the default libpath from the value encoded in an
5083a31a186aSmrg        # empty executable.
50840bb88ba4Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5085a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
50860bb88ba4Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5087a31a186aSmrg      else
5088a31a186aSmrg	if test "$host_cpu" = ia64; then
5089a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5090a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5091a31a186aSmrg	  _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"
5092a31a186aSmrg	else
5093a31a186aSmrg	 # Determine the default libpath from the value encoded in an
5094a31a186aSmrg	 # empty executable.
50950bb88ba4Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5096a31a186aSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5097a31a186aSmrg	  # Warning - without using the other run time loading flags,
5098a31a186aSmrg	  # -berok will link without error, but may produce a broken library.
5099a31a186aSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5100a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
51010bb88ba4Smrg	  if test "$with_gnu_ld" = yes; then
51020bb88ba4Smrg	    # We only use this code for GNU lds that support --whole-archive.
51030bb88ba4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
51040bb88ba4Smrg	  else
51050bb88ba4Smrg	    # Exported symbols can be pulled into shared objects from archives
51060bb88ba4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
51070bb88ba4Smrg	  fi
5108a31a186aSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5109a31a186aSmrg	  # This is similar to how AIX traditionally builds its shared libraries.
5110a31a186aSmrg	  _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'
5111a31a186aSmrg	fi
5112a31a186aSmrg      fi
5113a31a186aSmrg      ;;
5114fe5e51b7Smrg
5115a31a186aSmrg    amigaos*)
5116a31a186aSmrg      case $host_cpu in
5117a31a186aSmrg      powerpc)
5118a31a186aSmrg            # see comment about AmigaOS4 .so support
5119a31a186aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5120a31a186aSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5121a31a186aSmrg        ;;
5122a31a186aSmrg      m68k)
5123a31a186aSmrg            _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)'
5124a31a186aSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5125a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5126a31a186aSmrg        ;;
5127a31a186aSmrg      esac
5128a31a186aSmrg      ;;
5129fe5e51b7Smrg
5130a31a186aSmrg    bsdi[[45]]*)
5131a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5132a31a186aSmrg      ;;
5133fe5e51b7Smrg
5134a31a186aSmrg    cygwin* | mingw* | pw32* | cegcc*)
5135a31a186aSmrg      # When not using gcc, we currently assume that we are using
5136a31a186aSmrg      # Microsoft Visual C++.
5137a31a186aSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5138a31a186aSmrg      # no search path for DLLs.
51390bb88ba4Smrg      case $cc_basename in
51400bb88ba4Smrg      cl*)
51410bb88ba4Smrg	# Native MSVC
51420bb88ba4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51430bb88ba4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51440bb88ba4Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
51450bb88ba4Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
51460bb88ba4Smrg	# Tell ltmain to make .lib files, not .a files.
51470bb88ba4Smrg	libext=lib
51480bb88ba4Smrg	# Tell ltmain to make .dll files, not .so files.
51490bb88ba4Smrg	shrext_cmds=".dll"
51500bb88ba4Smrg	# FIXME: Setting linknames here is a bad hack.
51510bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
51520bb88ba4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
51530bb88ba4Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
51540bb88ba4Smrg	  else
51550bb88ba4Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
51560bb88ba4Smrg	  fi~
51570bb88ba4Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
51580bb88ba4Smrg	  linknames='
51590bb88ba4Smrg	# The linker will not automatically build a static lib if we build a DLL.
51600bb88ba4Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51610bb88ba4Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51620bb88ba4Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
51630bb88ba4Smrg	_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'
51640bb88ba4Smrg	# Don't use ranlib
51650bb88ba4Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
51660bb88ba4Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
51670bb88ba4Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
51680bb88ba4Smrg	  case $lt_outputfile in
51690bb88ba4Smrg	    *.exe|*.EXE) ;;
51700bb88ba4Smrg	    *)
51710bb88ba4Smrg	      lt_outputfile="$lt_outputfile.exe"
51720bb88ba4Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
51730bb88ba4Smrg	      ;;
51740bb88ba4Smrg	  esac~
51750bb88ba4Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
51760bb88ba4Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
51770bb88ba4Smrg	    $RM "$lt_outputfile.manifest";
51780bb88ba4Smrg	  fi'
51790bb88ba4Smrg	;;
51800bb88ba4Smrg      *)
51810bb88ba4Smrg	# Assume MSVC wrapper
51820bb88ba4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
51830bb88ba4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
51840bb88ba4Smrg	# Tell ltmain to make .lib files, not .a files.
51850bb88ba4Smrg	libext=lib
51860bb88ba4Smrg	# Tell ltmain to make .dll files, not .so files.
51870bb88ba4Smrg	shrext_cmds=".dll"
51880bb88ba4Smrg	# FIXME: Setting linknames here is a bad hack.
51890bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
51900bb88ba4Smrg	# The linker will automatically build a .lib file if we build a DLL.
51910bb88ba4Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
51920bb88ba4Smrg	# FIXME: Should let the user specify the lib program.
51930bb88ba4Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
51940bb88ba4Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51950bb88ba4Smrg	;;
51960bb88ba4Smrg      esac
5197a31a186aSmrg      ;;
5198fe5e51b7Smrg
5199a31a186aSmrg    darwin* | rhapsody*)
5200a31a186aSmrg      _LT_DARWIN_LINKER_FEATURES($1)
5201a31a186aSmrg      ;;
5202fe5e51b7Smrg
5203a31a186aSmrg    dgux*)
5204a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5205a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5206a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5207a31a186aSmrg      ;;
5208fe5e51b7Smrg
5209a31a186aSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5210a31a186aSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5211a31a186aSmrg    # does not break anything, and helps significantly (at the cost of a little
5212a31a186aSmrg    # extra space).
5213a31a186aSmrg    freebsd2.2*)
5214a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5215a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5216a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5217a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5218a31a186aSmrg      ;;
5219fe5e51b7Smrg
5220a31a186aSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
52210bb88ba4Smrg    freebsd2.*)
5222a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5223a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5224a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5225a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5226a31a186aSmrg      ;;
5227fe5e51b7Smrg
5228a31a186aSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5229a31a186aSmrg    freebsd* | dragonfly*)
52300bb88ba4Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5231a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5232a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5233a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5234a31a186aSmrg      ;;
5235fe5e51b7Smrg
5236a31a186aSmrg    hpux9*)
5237a31a186aSmrg      if test "$GCC" = yes; then
52380bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5239a31a186aSmrg      else
5240a31a186aSmrg	_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'
5241a31a186aSmrg      fi
5242a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5243a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5244a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5245fe5e51b7Smrg
5246a31a186aSmrg      # hardcode_minus_L: Not really in the search PATH,
5247a31a186aSmrg      # but as the default location of the library.
5248a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5249a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5250a31a186aSmrg      ;;
5251fe5e51b7Smrg
5252a31a186aSmrg    hpux10*)
52530bb88ba4Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
52540bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5255a31a186aSmrg      else
5256a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5257a31a186aSmrg      fi
5258a31a186aSmrg      if test "$with_gnu_ld" = no; then
5259a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5260a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5261a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5262a31a186aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5263a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5264a31a186aSmrg	# hardcode_minus_L: Not really in the search PATH,
5265a31a186aSmrg	# but as the default location of the library.
5266a31a186aSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5267a31a186aSmrg      fi
5268a31a186aSmrg      ;;
5269fe5e51b7Smrg
5270a31a186aSmrg    hpux11*)
52710bb88ba4Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5272a31a186aSmrg	case $host_cpu in
5273a31a186aSmrg	hppa*64*)
5274a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5275a31a186aSmrg	  ;;
5276a31a186aSmrg	ia64*)
52770bb88ba4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5278a31a186aSmrg	  ;;
5279a31a186aSmrg	*)
52800bb88ba4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5281a31a186aSmrg	  ;;
5282a31a186aSmrg	esac
5283a31a186aSmrg      else
5284a31a186aSmrg	case $host_cpu in
5285a31a186aSmrg	hppa*64*)
5286a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5287a31a186aSmrg	  ;;
5288a31a186aSmrg	ia64*)
5289a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5290a31a186aSmrg	  ;;
5291a31a186aSmrg	*)
52920bb88ba4Smrg	m4_if($1, [], [
52930bb88ba4Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
52940bb88ba4Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
52950bb88ba4Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
52960bb88ba4Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
52970bb88ba4Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
52980bb88ba4Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
52990bb88ba4Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5300a31a186aSmrg	  ;;
5301a31a186aSmrg	esac
5302a31a186aSmrg      fi
5303a31a186aSmrg      if test "$with_gnu_ld" = no; then
5304a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5305a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5306fe5e51b7Smrg
5307a31a186aSmrg	case $host_cpu in
5308a31a186aSmrg	hppa*64*|ia64*)
5309a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5310a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5311a31a186aSmrg	  ;;
5312a31a186aSmrg	*)
5313a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5314a31a186aSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5315a31a186aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5316fe5e51b7Smrg
5317a31a186aSmrg	  # hardcode_minus_L: Not really in the search PATH,
5318a31a186aSmrg	  # but as the default location of the library.
5319a31a186aSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5320a31a186aSmrg	  ;;
5321a31a186aSmrg	esac
5322a31a186aSmrg      fi
5323eda3803bSmrg      ;;
5324a31a186aSmrg
5325a31a186aSmrg    irix5* | irix6* | nonstopux*)
5326a31a186aSmrg      if test "$GCC" = yes; then
53270bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5328a31a186aSmrg	# Try to use the -exported_symbol ld option, if it does not
5329a31a186aSmrg	# work, assume that -exports_file does not work either and
5330a31a186aSmrg	# implicitly export all symbols.
53310bb88ba4Smrg	# This should be the same for all languages, so no per-tag cache variable.
53320bb88ba4Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
53330bb88ba4Smrg	  [lt_cv_irix_exported_symbol],
53340bb88ba4Smrg	  [save_LDFLAGS="$LDFLAGS"
53350bb88ba4Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
53360bb88ba4Smrg	   AC_LINK_IFELSE(
53370bb88ba4Smrg	     [AC_LANG_SOURCE(
53380bb88ba4Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
53390bb88ba4Smrg			      [C++], [[int foo (void) { return 0; }]],
53400bb88ba4Smrg			      [Fortran 77], [[
53410bb88ba4Smrg      subroutine foo
53420bb88ba4Smrg      end]],
53430bb88ba4Smrg			      [Fortran], [[
53440bb88ba4Smrg      subroutine foo
53450bb88ba4Smrg      end]])])],
53460bb88ba4Smrg	      [lt_cv_irix_exported_symbol=yes],
53470bb88ba4Smrg	      [lt_cv_irix_exported_symbol=no])
53480bb88ba4Smrg           LDFLAGS="$save_LDFLAGS"])
53490bb88ba4Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
53500bb88ba4Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
53510bb88ba4Smrg	fi
5352a31a186aSmrg      else
53530bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
53540bb88ba4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
5355a31a186aSmrg      fi
5356a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5357a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5358a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5359a31a186aSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5360a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5361fe5e51b7Smrg      ;;
5362eda3803bSmrg
5363a31a186aSmrg    netbsd*)
5364a31a186aSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5365a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5366a31a186aSmrg      else
5367a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5368a31a186aSmrg      fi
5369a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5370a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5371a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5372a31a186aSmrg      ;;
5373fe5e51b7Smrg
5374a31a186aSmrg    newsos6)
5375a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5376a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5377a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5378a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5379a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5380a31a186aSmrg      ;;
5381fe5e51b7Smrg
5382a31a186aSmrg    *nto* | *qnx*)
5383a31a186aSmrg      ;;
5384fe5e51b7Smrg
5385a31a186aSmrg    openbsd*)
5386a31a186aSmrg      if test -f /usr/libexec/ld.so; then
5387a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5388a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5389a31a186aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5390a31a186aSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5391a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5392a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5393a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5394a31a186aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5395a31a186aSmrg	else
5396a31a186aSmrg	  case $host_os in
5397a31a186aSmrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5398a31a186aSmrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5399a31a186aSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5400a31a186aSmrg	     ;;
5401a31a186aSmrg	   *)
5402a31a186aSmrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5403a31a186aSmrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5404a31a186aSmrg	     ;;
5405a31a186aSmrg	  esac
5406a31a186aSmrg	fi
5407a31a186aSmrg      else
5408a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5409a31a186aSmrg      fi
5410a31a186aSmrg      ;;
5411fe5e51b7Smrg
5412a31a186aSmrg    os2*)
5413a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5414a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5415a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54160bb88ba4Smrg      _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'
5417a31a186aSmrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5418a31a186aSmrg      ;;
5419fe5e51b7Smrg
5420a31a186aSmrg    osf3*)
5421a31a186aSmrg      if test "$GCC" = yes; then
5422a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54230bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5424a31a186aSmrg      else
5425a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54260bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5427a31a186aSmrg      fi
5428a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5429a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5430a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5431a31a186aSmrg      ;;
5432fe5e51b7Smrg
5433a31a186aSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5434a31a186aSmrg      if test "$GCC" = yes; then
5435a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
54360bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
5437a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5438a31a186aSmrg      else
5439a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
54400bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
5441a31a186aSmrg	_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~
54420bb88ba4Smrg	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
5443fe5e51b7Smrg
5444a31a186aSmrg	# Both c and cxx compiler support -rpath directly
5445a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5446a31a186aSmrg      fi
5447a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5448a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5449a31a186aSmrg      ;;
5450fe5e51b7Smrg
5451a31a186aSmrg    solaris*)
5452a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5453a31a186aSmrg      if test "$GCC" = yes; then
5454a31a186aSmrg	wlarc='${wl}'
54550bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5456a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
54570bb88ba4Smrg	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5458a31a186aSmrg      else
5459a31a186aSmrg	case `$CC -V 2>&1` in
5460a31a186aSmrg	*"Compilers 5.0"*)
5461a31a186aSmrg	  wlarc=''
5462a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5463a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5464a31a186aSmrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5465a31a186aSmrg	  ;;
5466a31a186aSmrg	*)
5467a31a186aSmrg	  wlarc='${wl}'
5468a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5469a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5470a31a186aSmrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5471a31a186aSmrg	  ;;
5472a31a186aSmrg	esac
5473a31a186aSmrg      fi
5474a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5475a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5476a31a186aSmrg      case $host_os in
5477a31a186aSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5478a31a186aSmrg      *)
5479a31a186aSmrg	# The compiler driver will combine and reorder linker options,
5480a31a186aSmrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5481a31a186aSmrg	# but is careful enough not to reorder.
5482a31a186aSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5483a31a186aSmrg	if test "$GCC" = yes; then
5484a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5485a31a186aSmrg	else
5486a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5487a31a186aSmrg	fi
5488a31a186aSmrg	;;
5489a31a186aSmrg      esac
5490a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5491a31a186aSmrg      ;;
5492fe5e51b7Smrg
5493a31a186aSmrg    sunos4*)
5494a31a186aSmrg      if test "x$host_vendor" = xsequent; then
5495a31a186aSmrg	# Use $CC to link under sequent, because it throws in some extra .o
5496a31a186aSmrg	# files that make .init and .fini sections work.
5497a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5498a31a186aSmrg      else
5499a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5500a31a186aSmrg      fi
5501a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5502a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5503a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5504a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5505a31a186aSmrg      ;;
5506fe5e51b7Smrg
5507a31a186aSmrg    sysv4)
5508a31a186aSmrg      case $host_vendor in
5509a31a186aSmrg	sni)
5510a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5511a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5512a31a186aSmrg	;;
5513a31a186aSmrg	siemens)
5514a31a186aSmrg	  ## LD is ld it makes a PLAMLIB
5515a31a186aSmrg	  ## CC just makes a GrossModule.
5516a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5517a31a186aSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5518a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5519a31a186aSmrg        ;;
5520a31a186aSmrg	motorola)
5521a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5522a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5523a31a186aSmrg	;;
5524a31a186aSmrg      esac
5525a31a186aSmrg      runpath_var='LD_RUN_PATH'
5526a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5527a31a186aSmrg      ;;
5528fe5e51b7Smrg
5529a31a186aSmrg    sysv4.3*)
5530a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5531a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5532a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5533a31a186aSmrg      ;;
5534fe5e51b7Smrg
5535a31a186aSmrg    sysv4*MP*)
5536a31a186aSmrg      if test -d /usr/nec; then
5537a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5538a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5539a31a186aSmrg	runpath_var=LD_RUN_PATH
5540a31a186aSmrg	hardcode_runpath_var=yes
5541a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5542a31a186aSmrg      fi
5543a31a186aSmrg      ;;
5544fe5e51b7Smrg
5545a31a186aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5546a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5547a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5548a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5549a31a186aSmrg      runpath_var='LD_RUN_PATH'
5550fe5e51b7Smrg
5551a31a186aSmrg      if test "$GCC" = yes; then
5552a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5553a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5554a31a186aSmrg      else
5555a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5556a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5557a31a186aSmrg      fi
5558a31a186aSmrg      ;;
5559fe5e51b7Smrg
5560a31a186aSmrg    sysv5* | sco3.2v5* | sco5v6*)
5561a31a186aSmrg      # Note: We can NOT use -z defs as we might desire, because we do not
5562a31a186aSmrg      # link with -lc, and that would cause any symbols used from libc to
5563a31a186aSmrg      # always be unresolved, which means just about no library would
5564a31a186aSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
5565a31a186aSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
5566a31a186aSmrg      # as -z defs.
5567a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5568a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5569a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5570a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5571a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5572a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5573a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5574a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5575a31a186aSmrg      runpath_var='LD_RUN_PATH'
5576fe5e51b7Smrg
5577a31a186aSmrg      if test "$GCC" = yes; then
5578a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5579a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5580a31a186aSmrg      else
5581a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5582a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5583a31a186aSmrg      fi
5584a31a186aSmrg      ;;
5585fe5e51b7Smrg
5586a31a186aSmrg    uts4*)
5587a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5588a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5589a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5590a31a186aSmrg      ;;
5591fe5e51b7Smrg
5592a31a186aSmrg    *)
5593a31a186aSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
5594a31a186aSmrg      ;;
5595a31a186aSmrg    esac
5596fe5e51b7Smrg
5597a31a186aSmrg    if test x$host_vendor = xsni; then
5598a31a186aSmrg      case $host in
5599a31a186aSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5600a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5601a31a186aSmrg	;;
5602a31a186aSmrg      esac
5603a31a186aSmrg    fi
5604a31a186aSmrg  fi
5605a31a186aSmrg])
5606a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5607a31a186aSmrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
5608fe5e51b7Smrg
5609a31a186aSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5610fe5e51b7Smrg
5611a31a186aSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5612a31a186aSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5613a31a186aSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
5614a31a186aSmrg    [The commands to extract the exported symbol list from a shared archive])
5615fe5e51b7Smrg
5616a31a186aSmrg#
5617a31a186aSmrg# Do we need to explicitly link libc?
5618a31a186aSmrg#
5619a31a186aSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5620a31a186aSmrgx|xyes)
5621a31a186aSmrg  # Assume -lc should be added
5622a31a186aSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5623fe5e51b7Smrg
5624a31a186aSmrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5625a31a186aSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
5626a31a186aSmrg    *'~'*)
5627a31a186aSmrg      # FIXME: we may have to deal with multi-command sequences.
5628a31a186aSmrg      ;;
5629a31a186aSmrg    '$CC '*)
5630a31a186aSmrg      # Test whether the compiler implicitly links with -lc since on some
5631a31a186aSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5632a31a186aSmrg      # to ld, don't add -lc before -lgcc.
56330bb88ba4Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
56340bb88ba4Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
56350bb88ba4Smrg	[$RM conftest*
56360bb88ba4Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
56370bb88ba4Smrg
56380bb88ba4Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
56390bb88ba4Smrg	  soname=conftest
56400bb88ba4Smrg	  lib=conftest
56410bb88ba4Smrg	  libobjs=conftest.$ac_objext
56420bb88ba4Smrg	  deplibs=
56430bb88ba4Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
56440bb88ba4Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
56450bb88ba4Smrg	  compiler_flags=-v
56460bb88ba4Smrg	  linker_flags=-v
56470bb88ba4Smrg	  verstring=
56480bb88ba4Smrg	  output_objdir=.
56490bb88ba4Smrg	  libname=conftest
56500bb88ba4Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
56510bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
56520bb88ba4Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
56530bb88ba4Smrg	  then
56540bb88ba4Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
56550bb88ba4Smrg	  else
56560bb88ba4Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
56570bb88ba4Smrg	  fi
56580bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
56590bb88ba4Smrg	else
56600bb88ba4Smrg	  cat conftest.err 1>&5
56610bb88ba4Smrg	fi
56620bb88ba4Smrg	$RM conftest*
56630bb88ba4Smrg	])
56640bb88ba4Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5665a31a186aSmrg      ;;
5666a31a186aSmrg    esac
5667a31a186aSmrg  fi
5668a31a186aSmrg  ;;
5669a31a186aSmrgesac
5670fe5e51b7Smrg
5671a31a186aSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5672a31a186aSmrg    [Whether or not to add -lc for building shared libraries])
5673a31a186aSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5674a31a186aSmrg    [enable_shared_with_static_runtimes], [0],
5675a31a186aSmrg    [Whether or not to disallow shared libs when runtime libs are static])
5676a31a186aSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5677a31a186aSmrg    [Compiler flag to allow reflexive dlopens])
5678a31a186aSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5679a31a186aSmrg    [Compiler flag to generate shared objects directly from archives])
5680a31a186aSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
5681a31a186aSmrg    [Whether the compiler copes with passing no objects directly])
5682a31a186aSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5683a31a186aSmrg    [Create an old-style archive from a shared archive])
5684a31a186aSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5685a31a186aSmrg    [Create a temporary old-style archive to link instead of a shared archive])
5686a31a186aSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5687a31a186aSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5688a31a186aSmrg_LT_TAGDECL([], [module_cmds], [2],
5689a31a186aSmrg    [Commands used to build a loadable module if different from building
5690a31a186aSmrg    a shared archive.])
5691a31a186aSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5692a31a186aSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
5693a31a186aSmrg    [Whether we are building with GNU ld or not])
5694a31a186aSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5695a31a186aSmrg    [Flag that allows shared libraries with undefined symbols to be built])
5696a31a186aSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
5697a31a186aSmrg    [Flag that enforces no undefined symbols])
5698a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5699a31a186aSmrg    [Flag to hardcode $libdir into a binary during linking.
5700a31a186aSmrg    This must work even if $libdir does not exist])
5701a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5702a31a186aSmrg    [Whether we need a single "-rpath" flag with a separated argument])
5703a31a186aSmrg_LT_TAGDECL([], [hardcode_direct], [0],
5704a31a186aSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5705a31a186aSmrg    DIR into the resulting binary])
5706a31a186aSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5707a31a186aSmrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5708a31a186aSmrg    DIR into the resulting binary and the resulting library dependency is
5709a31a186aSmrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5710a31a186aSmrg    library is relocated])
5711a31a186aSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5712a31a186aSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5713a31a186aSmrg    into the resulting binary])
5714a31a186aSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5715a31a186aSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5716a31a186aSmrg    into the resulting binary])
5717a31a186aSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
5718a31a186aSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5719a31a186aSmrg    into the library and all subsequent libraries and executables linked
5720a31a186aSmrg    against it])
5721a31a186aSmrg_LT_TAGDECL([], [inherit_rpath], [0],
5722a31a186aSmrg    [Set to yes if linker adds runtime paths of dependent libraries
5723a31a186aSmrg    to runtime path list])
5724a31a186aSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
5725a31a186aSmrg    [Whether libtool must link a program against all its dependency libraries])
5726a31a186aSmrg_LT_TAGDECL([], [always_export_symbols], [0],
5727a31a186aSmrg    [Set to "yes" if exported symbols are required])
5728a31a186aSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5729a31a186aSmrg    [The commands to list exported symbols])
5730a31a186aSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
5731a31a186aSmrg    [Symbols that should not be listed in the preloaded symbols])
5732a31a186aSmrg_LT_TAGDECL([], [include_expsyms], [1],
5733a31a186aSmrg    [Symbols that must always be exported])
5734a31a186aSmrg_LT_TAGDECL([], [prelink_cmds], [2],
5735a31a186aSmrg    [Commands necessary for linking programs (against libraries) with templates])
57360bb88ba4Smrg_LT_TAGDECL([], [postlink_cmds], [2],
57370bb88ba4Smrg    [Commands necessary for finishing linking programs])
5738a31a186aSmrg_LT_TAGDECL([], [file_list_spec], [1],
5739a31a186aSmrg    [Specify filename containing input files])
5740a31a186aSmrgdnl FIXME: Not yet implemented
5741a31a186aSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5742a31a186aSmrgdnl    [Compiler flag to generate thread safe objects])
5743a31a186aSmrg])# _LT_LINKER_SHLIBS
5744a31a186aSmrg
5745a31a186aSmrg
5746a31a186aSmrg# _LT_LANG_C_CONFIG([TAG])
5747a31a186aSmrg# ------------------------
5748a31a186aSmrg# Ensure that the configuration variables for a C compiler are suitably
5749a31a186aSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5750a31a186aSmrg# the compiler configuration to `libtool'.
5751a31a186aSmrgm4_defun([_LT_LANG_C_CONFIG],
5752a31a186aSmrg[m4_require([_LT_DECL_EGREP])dnl
5753a31a186aSmrglt_save_CC="$CC"
5754a31a186aSmrgAC_LANG_PUSH(C)
5755fe5e51b7Smrg
5756a31a186aSmrg# Source file extension for C test sources.
5757a31a186aSmrgac_ext=c
5758fe5e51b7Smrg
5759a31a186aSmrg# Object file extension for compiled C test sources.
5760a31a186aSmrgobjext=o
5761a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
5762fe5e51b7Smrg
5763a31a186aSmrg# Code to be used in simple compile tests
5764a31a186aSmrglt_simple_compile_test_code="int some_variable = 0;"
5765fe5e51b7Smrg
5766a31a186aSmrg# Code to be used in simple link tests
5767a31a186aSmrglt_simple_link_test_code='int main(){return(0);}'
5768fe5e51b7Smrg
5769a31a186aSmrg_LT_TAG_COMPILER
5770a31a186aSmrg# Save the default compiler, since it gets overwritten when the other
5771a31a186aSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5772a31a186aSmrgcompiler_DEFAULT=$CC
5773fe5e51b7Smrg
5774a31a186aSmrg# save warnings/boilerplate of simple test code
5775a31a186aSmrg_LT_COMPILER_BOILERPLATE
5776a31a186aSmrg_LT_LINKER_BOILERPLATE
5777fe5e51b7Smrg
5778a31a186aSmrgif test -n "$compiler"; then
5779a31a186aSmrg  _LT_COMPILER_NO_RTTI($1)
5780a31a186aSmrg  _LT_COMPILER_PIC($1)
5781a31a186aSmrg  _LT_COMPILER_C_O($1)
5782a31a186aSmrg  _LT_COMPILER_FILE_LOCKS($1)
5783a31a186aSmrg  _LT_LINKER_SHLIBS($1)
5784a31a186aSmrg  _LT_SYS_DYNAMIC_LINKER($1)
5785a31a186aSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5786a31a186aSmrg  LT_SYS_DLOPEN_SELF
5787a31a186aSmrg  _LT_CMD_STRIPLIB
5788a31a186aSmrg
5789a31a186aSmrg  # Report which library types will actually be built
5790a31a186aSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5791a31a186aSmrg  AC_MSG_RESULT([$can_build_shared])
5792a31a186aSmrg
5793a31a186aSmrg  AC_MSG_CHECKING([whether to build shared libraries])
5794a31a186aSmrg  test "$can_build_shared" = "no" && enable_shared=no
5795a31a186aSmrg
5796a31a186aSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
5797a31a186aSmrg  # are all built from PIC.
5798a31a186aSmrg  case $host_os in
5799a31a186aSmrg  aix3*)
5800a31a186aSmrg    test "$enable_shared" = yes && enable_static=no
5801a31a186aSmrg    if test -n "$RANLIB"; then
5802a31a186aSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5803a31a186aSmrg      postinstall_cmds='$RANLIB $lib'
5804a31a186aSmrg    fi
5805a31a186aSmrg    ;;
5806fe5e51b7Smrg
5807a31a186aSmrg  aix[[4-9]]*)
5808a31a186aSmrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5809a31a186aSmrg      test "$enable_shared" = yes && enable_static=no
5810a31a186aSmrg    fi
5811a31a186aSmrg    ;;
5812a31a186aSmrg  esac
5813a31a186aSmrg  AC_MSG_RESULT([$enable_shared])
5814fe5e51b7Smrg
5815a31a186aSmrg  AC_MSG_CHECKING([whether to build static libraries])
5816a31a186aSmrg  # Make sure either enable_shared or enable_static is yes.
5817a31a186aSmrg  test "$enable_shared" = yes || enable_static=yes
5818a31a186aSmrg  AC_MSG_RESULT([$enable_static])
5819fe5e51b7Smrg
5820a31a186aSmrg  _LT_CONFIG($1)
5821a31a186aSmrgfi
5822a31a186aSmrgAC_LANG_POP
5823a31a186aSmrgCC="$lt_save_CC"
5824a31a186aSmrg])# _LT_LANG_C_CONFIG
5825fe5e51b7Smrg
5826fe5e51b7Smrg
5827a31a186aSmrg# _LT_LANG_CXX_CONFIG([TAG])
5828a31a186aSmrg# --------------------------
5829a31a186aSmrg# Ensure that the configuration variables for a C++ compiler are suitably
5830a31a186aSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5831a31a186aSmrg# the compiler configuration to `libtool'.
5832a31a186aSmrgm4_defun([_LT_LANG_CXX_CONFIG],
58330bb88ba4Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5834a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
58350bb88ba4Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
58360bb88ba4Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
58370bb88ba4Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
58380bb88ba4Smrg    (test "X$CXX" != "Xg++"))) ; then
58390bb88ba4Smrg  AC_PROG_CXXCPP
58400bb88ba4Smrgelse
58410bb88ba4Smrg  _lt_caught_CXX_error=yes
58420bb88ba4Smrgfi
5843a31a186aSmrg
5844a31a186aSmrgAC_LANG_PUSH(C++)
5845a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5846a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
5847a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
5848a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5849a31a186aSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
5850a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5851a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
5852a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5853a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5854a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5855a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5856a31a186aSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5857a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
5858a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
5859a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
5860a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
5861a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5862a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
58630bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
58640bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5865a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
5866a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5867a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
5868fe5e51b7Smrg
5869a31a186aSmrg# Source file extension for C++ test sources.
5870a31a186aSmrgac_ext=cpp
5871fe5e51b7Smrg
5872a31a186aSmrg# Object file extension for compiled C++ test sources.
5873a31a186aSmrgobjext=o
5874a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
5875a31a186aSmrg
5876a31a186aSmrg# No sense in running all these tests if we already determined that
5877a31a186aSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5878a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
5879a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
5880a31a186aSmrgif test "$_lt_caught_CXX_error" != yes; then
5881a31a186aSmrg  # Code to be used in simple compile tests
5882a31a186aSmrg  lt_simple_compile_test_code="int some_variable = 0;"
5883a31a186aSmrg
5884a31a186aSmrg  # Code to be used in simple link tests
5885a31a186aSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5886a31a186aSmrg
5887a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5888a31a186aSmrg  _LT_TAG_COMPILER
5889a31a186aSmrg
5890a31a186aSmrg  # save warnings/boilerplate of simple test code
5891a31a186aSmrg  _LT_COMPILER_BOILERPLATE
5892a31a186aSmrg  _LT_LINKER_BOILERPLATE
5893a31a186aSmrg
5894a31a186aSmrg  # Allow CC to be a program name with arguments.
5895a31a186aSmrg  lt_save_CC=$CC
58960bb88ba4Smrg  lt_save_CFLAGS=$CFLAGS
5897a31a186aSmrg  lt_save_LD=$LD
5898a31a186aSmrg  lt_save_GCC=$GCC
5899a31a186aSmrg  GCC=$GXX
5900a31a186aSmrg  lt_save_with_gnu_ld=$with_gnu_ld
5901a31a186aSmrg  lt_save_path_LD=$lt_cv_path_LD
5902a31a186aSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5903a31a186aSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5904a31a186aSmrg  else
5905a31a186aSmrg    $as_unset lt_cv_prog_gnu_ld
5906a31a186aSmrg  fi
5907a31a186aSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5908a31a186aSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5909a31a186aSmrg  else
5910a31a186aSmrg    $as_unset lt_cv_path_LD
5911a31a186aSmrg  fi
5912a31a186aSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
5913a31a186aSmrg  CC=${CXX-"c++"}
59140bb88ba4Smrg  CFLAGS=$CXXFLAGS
5915a31a186aSmrg  compiler=$CC
5916a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
5917a31a186aSmrg  _LT_CC_BASENAME([$compiler])
5918fe5e51b7Smrg
5919a31a186aSmrg  if test -n "$compiler"; then
5920a31a186aSmrg    # We don't want -fno-exception when compiling C++ code, so set the
5921a31a186aSmrg    # no_builtin_flag separately
5922a31a186aSmrg    if test "$GXX" = yes; then
5923a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5924a31a186aSmrg    else
5925a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5926a31a186aSmrg    fi
5927fe5e51b7Smrg
5928a31a186aSmrg    if test "$GXX" = yes; then
5929a31a186aSmrg      # Set up default GNU C++ configuration
5930fe5e51b7Smrg
5931a31a186aSmrg      LT_PATH_LD
5932fe5e51b7Smrg
5933a31a186aSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5934a31a186aSmrg      # archiving commands below assume that GNU ld is being used.
5935a31a186aSmrg      if test "$with_gnu_ld" = yes; then
59360bb88ba4Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
59370bb88ba4Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
5938fe5e51b7Smrg
5939a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5940a31a186aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
5941fe5e51b7Smrg
5942a31a186aSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5943a31a186aSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5944a31a186aSmrg        #     investigate it a little bit more. (MM)
5945a31a186aSmrg        wlarc='${wl}'
5946fe5e51b7Smrg
5947a31a186aSmrg        # ancient GNU ld didn't support --whole-archive et. al.
5948a31a186aSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5949a31a186aSmrg	  $GREP 'no-whole-archive' > /dev/null; then
5950a31a186aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5951a31a186aSmrg        else
5952a31a186aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5953a31a186aSmrg        fi
5954a31a186aSmrg      else
5955a31a186aSmrg        with_gnu_ld=no
5956a31a186aSmrg        wlarc=
5957a31a186aSmrg
5958a31a186aSmrg        # A generic and very simple default shared library creation
5959a31a186aSmrg        # command for GNU C++ for the case where it uses the native
5960a31a186aSmrg        # linker, instead of GNU ld.  If possible, this setting should
5961a31a186aSmrg        # overridden to take advantage of the native linker features on
5962a31a186aSmrg        # the platform it is being used on.
5963a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5964a31a186aSmrg      fi
5965fe5e51b7Smrg
5966a31a186aSmrg      # Commands to make compiler produce verbose output that lists
5967a31a186aSmrg      # what "hidden" libraries, object files and flags are used when
5968a31a186aSmrg      # linking a shared library.
59690bb88ba4Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
5970fe5e51b7Smrg
5971a31a186aSmrg    else
5972a31a186aSmrg      GXX=no
5973a31a186aSmrg      with_gnu_ld=no
5974a31a186aSmrg      wlarc=
5975a31a186aSmrg    fi
5976fe5e51b7Smrg
5977a31a186aSmrg    # PORTME: fill in a description of your system's C++ link characteristics
5978a31a186aSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5979a31a186aSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5980a31a186aSmrg    case $host_os in
5981a31a186aSmrg      aix3*)
5982a31a186aSmrg        # FIXME: insert proper C++ library support
5983a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5984a31a186aSmrg        ;;
5985a31a186aSmrg      aix[[4-9]]*)
5986a31a186aSmrg        if test "$host_cpu" = ia64; then
5987a31a186aSmrg          # On IA64, the linker does run time linking by default, so we don't
5988a31a186aSmrg          # have to do anything special.
5989a31a186aSmrg          aix_use_runtimelinking=no
5990a31a186aSmrg          exp_sym_flag='-Bexport'
5991a31a186aSmrg          no_entry_flag=""
5992a31a186aSmrg        else
5993a31a186aSmrg          aix_use_runtimelinking=no
5994a31a186aSmrg
5995a31a186aSmrg          # Test if we are trying to use run time linking or normal
5996a31a186aSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5997a31a186aSmrg          # need to do runtime linking.
5998a31a186aSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5999a31a186aSmrg	    for ld_flag in $LDFLAGS; do
6000a31a186aSmrg	      case $ld_flag in
6001a31a186aSmrg	      *-brtl*)
6002a31a186aSmrg	        aix_use_runtimelinking=yes
6003a31a186aSmrg	        break
6004a31a186aSmrg	        ;;
6005a31a186aSmrg	      esac
6006a31a186aSmrg	    done
6007a31a186aSmrg	    ;;
6008a31a186aSmrg          esac
6009fe5e51b7Smrg
6010a31a186aSmrg          exp_sym_flag='-bexport'
6011a31a186aSmrg          no_entry_flag='-bnoentry'
6012a31a186aSmrg        fi
6013fe5e51b7Smrg
6014a31a186aSmrg        # When large executables or shared objects are built, AIX ld can
6015a31a186aSmrg        # have problems creating the table of contents.  If linking a library
6016a31a186aSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
6017a31a186aSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6018a31a186aSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6019a31a186aSmrg
6020a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)=''
6021a31a186aSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6022a31a186aSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6023a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6024a31a186aSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6025a31a186aSmrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6026a31a186aSmrg
6027a31a186aSmrg        if test "$GXX" = yes; then
6028a31a186aSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6029a31a186aSmrg          # We only want to do this on AIX 4.2 and lower, the check
6030a31a186aSmrg          # below for broken collect2 doesn't work under 4.3+
6031a31a186aSmrg	  collect2name=`${CC} -print-prog-name=collect2`
6032a31a186aSmrg	  if test -f "$collect2name" &&
6033a31a186aSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6034a31a186aSmrg	  then
6035a31a186aSmrg	    # We have reworked collect2
6036a31a186aSmrg	    :
6037a31a186aSmrg	  else
6038a31a186aSmrg	    # We have old collect2
6039a31a186aSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6040a31a186aSmrg	    # It fails to find uninstalled libraries when the uninstalled
6041a31a186aSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6042a31a186aSmrg	    # to unsupported forces relinking
6043a31a186aSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6044a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6045a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6046a31a186aSmrg	  fi
6047a31a186aSmrg          esac
6048a31a186aSmrg          shared_flag='-shared'
6049a31a186aSmrg	  if test "$aix_use_runtimelinking" = yes; then
6050a31a186aSmrg	    shared_flag="$shared_flag "'${wl}-G'
6051a31a186aSmrg	  fi
6052a31a186aSmrg        else
6053a31a186aSmrg          # not using gcc
6054a31a186aSmrg          if test "$host_cpu" = ia64; then
6055a31a186aSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6056a31a186aSmrg	  # chokes on -Wl,-G. The following line is correct:
6057a31a186aSmrg	  shared_flag='-G'
6058a31a186aSmrg          else
6059a31a186aSmrg	    if test "$aix_use_runtimelinking" = yes; then
6060a31a186aSmrg	      shared_flag='${wl}-G'
6061a31a186aSmrg	    else
6062a31a186aSmrg	      shared_flag='${wl}-bM:SRE'
6063a31a186aSmrg	    fi
6064a31a186aSmrg          fi
6065a31a186aSmrg        fi
6066fe5e51b7Smrg
6067a31a186aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6068a31a186aSmrg        # It seems that -bexpall does not export symbols beginning with
6069a31a186aSmrg        # underscore (_), so it is better to generate a list of symbols to
6070a31a186aSmrg	# export.
6071a31a186aSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6072a31a186aSmrg        if test "$aix_use_runtimelinking" = yes; then
6073a31a186aSmrg          # Warning - without using the other runtime loading flags (-brtl),
6074a31a186aSmrg          # -berok will link without error, but may produce a broken library.
6075a31a186aSmrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6076a31a186aSmrg          # Determine the default libpath from the value encoded in an empty
6077a31a186aSmrg          # executable.
60780bb88ba4Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6079a31a186aSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6080a31a186aSmrg
60810bb88ba4Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6082a31a186aSmrg        else
6083a31a186aSmrg          if test "$host_cpu" = ia64; then
6084a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6085a31a186aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6086a31a186aSmrg	    _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"
6087a31a186aSmrg          else
6088a31a186aSmrg	    # Determine the default libpath from the value encoded in an
6089a31a186aSmrg	    # empty executable.
60900bb88ba4Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6091a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6092a31a186aSmrg	    # Warning - without using the other run time loading flags,
6093a31a186aSmrg	    # -berok will link without error, but may produce a broken library.
6094a31a186aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6095a31a186aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
60960bb88ba4Smrg	    if test "$with_gnu_ld" = yes; then
60970bb88ba4Smrg	      # We only use this code for GNU lds that support --whole-archive.
60980bb88ba4Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
60990bb88ba4Smrg	    else
61000bb88ba4Smrg	      # Exported symbols can be pulled into shared objects from archives
61010bb88ba4Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
61020bb88ba4Smrg	    fi
6103a31a186aSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6104a31a186aSmrg	    # This is similar to how AIX traditionally builds its shared
6105a31a186aSmrg	    # libraries.
6106a31a186aSmrg	    _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'
6107a31a186aSmrg          fi
6108a31a186aSmrg        fi
6109a31a186aSmrg        ;;
6110fe5e51b7Smrg
6111a31a186aSmrg      beos*)
6112a31a186aSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6113a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6114a31a186aSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6115a31a186aSmrg	  # support --undefined.  This deserves some investigation.  FIXME
6116a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6117a31a186aSmrg	else
6118a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6119a31a186aSmrg	fi
6120a31a186aSmrg	;;
6121fe5e51b7Smrg
6122a31a186aSmrg      chorus*)
6123a31a186aSmrg        case $cc_basename in
6124a31a186aSmrg          *)
6125a31a186aSmrg	  # FIXME: insert proper C++ library support
6126a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6127a31a186aSmrg	  ;;
6128a31a186aSmrg        esac
6129a31a186aSmrg        ;;
6130fe5e51b7Smrg
6131a31a186aSmrg      cygwin* | mingw* | pw32* | cegcc*)
61320bb88ba4Smrg	case $GXX,$cc_basename in
61330bb88ba4Smrg	,cl* | no,cl*)
61340bb88ba4Smrg	  # Native MSVC
61350bb88ba4Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
61360bb88ba4Smrg	  # no search path for DLLs.
61370bb88ba4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
61380bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61390bb88ba4Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
61400bb88ba4Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
61410bb88ba4Smrg	  # Tell ltmain to make .lib files, not .a files.
61420bb88ba4Smrg	  libext=lib
61430bb88ba4Smrg	  # Tell ltmain to make .dll files, not .so files.
61440bb88ba4Smrg	  shrext_cmds=".dll"
61450bb88ba4Smrg	  # FIXME: Setting linknames here is a bad hack.
61460bb88ba4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
61470bb88ba4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61480bb88ba4Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
61490bb88ba4Smrg	    else
61500bb88ba4Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
61510bb88ba4Smrg	    fi~
61520bb88ba4Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
61530bb88ba4Smrg	    linknames='
61540bb88ba4Smrg	  # The linker will not automatically build a static lib if we build a DLL.
61550bb88ba4Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
61560bb88ba4Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61570bb88ba4Smrg	  # Don't use ranlib
61580bb88ba4Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
61590bb88ba4Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
61600bb88ba4Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
61610bb88ba4Smrg	    case $lt_outputfile in
61620bb88ba4Smrg	      *.exe|*.EXE) ;;
61630bb88ba4Smrg	      *)
61640bb88ba4Smrg		lt_outputfile="$lt_outputfile.exe"
61650bb88ba4Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
61660bb88ba4Smrg		;;
61670bb88ba4Smrg	    esac~
61680bb88ba4Smrg	    func_to_tool_file "$lt_outputfile"~
61690bb88ba4Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
61700bb88ba4Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
61710bb88ba4Smrg	      $RM "$lt_outputfile.manifest";
61720bb88ba4Smrg	    fi'
61730bb88ba4Smrg	  ;;
61740bb88ba4Smrg	*)
61750bb88ba4Smrg	  # g++
61760bb88ba4Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
61770bb88ba4Smrg	  # as there is no search path for DLLs.
61780bb88ba4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
61790bb88ba4Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
61800bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
61810bb88ba4Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
61820bb88ba4Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
61830bb88ba4Smrg
61840bb88ba4Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
61850bb88ba4Smrg	    _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'
61860bb88ba4Smrg	    # If the export-symbols file already is a .def file (1st line
61870bb88ba4Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
61880bb88ba4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
61890bb88ba4Smrg	      cp $export_symbols $output_objdir/$soname.def;
61900bb88ba4Smrg	    else
61910bb88ba4Smrg	      echo EXPORTS > $output_objdir/$soname.def;
61920bb88ba4Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
61930bb88ba4Smrg	    fi~
61940bb88ba4Smrg	    $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'
61950bb88ba4Smrg	  else
61960bb88ba4Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
61970bb88ba4Smrg	  fi
61980bb88ba4Smrg	  ;;
61990bb88ba4Smrg	esac
62000bb88ba4Smrg	;;
6201a31a186aSmrg      darwin* | rhapsody*)
6202a31a186aSmrg        _LT_DARWIN_LINKER_FEATURES($1)
6203a31a186aSmrg	;;
6204fe5e51b7Smrg
6205a31a186aSmrg      dgux*)
6206a31a186aSmrg        case $cc_basename in
6207a31a186aSmrg          ec++*)
6208a31a186aSmrg	    # FIXME: insert proper C++ library support
6209a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6210a31a186aSmrg	    ;;
6211a31a186aSmrg          ghcx*)
6212a31a186aSmrg	    # Green Hills C++ Compiler
6213a31a186aSmrg	    # FIXME: insert proper C++ library support
6214a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6215a31a186aSmrg	    ;;
6216a31a186aSmrg          *)
6217a31a186aSmrg	    # FIXME: insert proper C++ library support
6218a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6219a31a186aSmrg	    ;;
6220a31a186aSmrg        esac
6221a31a186aSmrg        ;;
6222fe5e51b7Smrg
62230bb88ba4Smrg      freebsd2.*)
6224a31a186aSmrg        # C++ shared libraries reported to be fairly broken before
6225a31a186aSmrg	# switch to ELF
6226a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6227a31a186aSmrg        ;;
6228fe5e51b7Smrg
6229a31a186aSmrg      freebsd-elf*)
6230a31a186aSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6231a31a186aSmrg        ;;
6232a31a186aSmrg
6233a31a186aSmrg      freebsd* | dragonfly*)
6234a31a186aSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6235a31a186aSmrg        # conventions
6236a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6237a31a186aSmrg        ;;
6238fe5e51b7Smrg
6239a31a186aSmrg      gnu*)
6240a31a186aSmrg        ;;
6241fe5e51b7Smrg
62420bb88ba4Smrg      haiku*)
62430bb88ba4Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
62440bb88ba4Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
62450bb88ba4Smrg        ;;
62460bb88ba4Smrg
6247a31a186aSmrg      hpux9*)
6248a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6249a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6250a31a186aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6251a31a186aSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6252a31a186aSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6253a31a186aSmrg				             # but as the default
6254a31a186aSmrg				             # location of the library.
6255a31a186aSmrg
6256a31a186aSmrg        case $cc_basename in
6257a31a186aSmrg          CC*)
6258a31a186aSmrg            # FIXME: insert proper C++ library support
6259a31a186aSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
6260a31a186aSmrg            ;;
6261a31a186aSmrg          aCC*)
6262a31a186aSmrg            _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'
6263a31a186aSmrg            # Commands to make compiler produce verbose output that lists
6264a31a186aSmrg            # what "hidden" libraries, object files and flags are used when
6265a31a186aSmrg            # linking a shared library.
6266a31a186aSmrg            #
6267a31a186aSmrg            # There doesn't appear to be a way to prevent this compiler from
6268a31a186aSmrg            # explicitly linking system object files so we need to strip them
6269a31a186aSmrg            # from the output so that they don't get included in the library
6270a31a186aSmrg            # dependencies.
62710bb88ba4Smrg            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6272a31a186aSmrg            ;;
6273a31a186aSmrg          *)
6274a31a186aSmrg            if test "$GXX" = yes; then
62750bb88ba4Smrg              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6276a31a186aSmrg            else
6277a31a186aSmrg              # FIXME: insert proper C++ library support
6278a31a186aSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
6279a31a186aSmrg            fi
6280a31a186aSmrg            ;;
6281a31a186aSmrg        esac
6282a31a186aSmrg        ;;
6283fe5e51b7Smrg
6284a31a186aSmrg      hpux10*|hpux11*)
6285a31a186aSmrg        if test $with_gnu_ld = no; then
6286a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6287a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6288a31a186aSmrg
6289a31a186aSmrg          case $host_cpu in
6290a31a186aSmrg            hppa*64*|ia64*)
6291a31a186aSmrg              ;;
6292a31a186aSmrg            *)
6293a31a186aSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6294a31a186aSmrg              ;;
6295a31a186aSmrg          esac
6296a31a186aSmrg        fi
6297a31a186aSmrg        case $host_cpu in
6298a31a186aSmrg          hppa*64*|ia64*)
6299a31a186aSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
6300a31a186aSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6301a31a186aSmrg            ;;
6302a31a186aSmrg          *)
6303a31a186aSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6304a31a186aSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6305a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6306a31a186aSmrg					         # but as the default
6307a31a186aSmrg					         # location of the library.
6308a31a186aSmrg            ;;
6309a31a186aSmrg        esac
6310a31a186aSmrg
6311a31a186aSmrg        case $cc_basename in
6312a31a186aSmrg          CC*)
6313a31a186aSmrg	    # FIXME: insert proper C++ library support
6314a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6315a31a186aSmrg	    ;;
6316a31a186aSmrg          aCC*)
6317a31a186aSmrg	    case $host_cpu in
6318a31a186aSmrg	      hppa*64*)
6319a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6320a31a186aSmrg	        ;;
6321a31a186aSmrg	      ia64*)
6322a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6323a31a186aSmrg	        ;;
6324a31a186aSmrg	      *)
6325a31a186aSmrg	        _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'
6326a31a186aSmrg	        ;;
6327a31a186aSmrg	    esac
6328a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6329a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6330a31a186aSmrg	    # linking a shared library.
6331a31a186aSmrg	    #
6332a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6333a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6334a31a186aSmrg	    # from the output so that they don't get included in the library
6335a31a186aSmrg	    # dependencies.
63360bb88ba4Smrg	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6337a31a186aSmrg	    ;;
6338a31a186aSmrg          *)
6339a31a186aSmrg	    if test "$GXX" = yes; then
6340a31a186aSmrg	      if test $with_gnu_ld = no; then
6341a31a186aSmrg	        case $host_cpu in
6342a31a186aSmrg	          hppa*64*)
6343a31a186aSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6344a31a186aSmrg	            ;;
6345a31a186aSmrg	          ia64*)
63460bb88ba4Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6347a31a186aSmrg	            ;;
6348a31a186aSmrg	          *)
63490bb88ba4Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6350a31a186aSmrg	            ;;
6351a31a186aSmrg	        esac
6352a31a186aSmrg	      fi
6353a31a186aSmrg	    else
6354a31a186aSmrg	      # FIXME: insert proper C++ library support
6355a31a186aSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6356a31a186aSmrg	    fi
6357a31a186aSmrg	    ;;
6358a31a186aSmrg        esac
6359a31a186aSmrg        ;;
6360fe5e51b7Smrg
6361a31a186aSmrg      interix[[3-9]]*)
6362a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
6363a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6364a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6365a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6366a31a186aSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6367a31a186aSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6368a31a186aSmrg	# default) and relocated if they conflict, which is a slow very memory
6369a31a186aSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6370a31a186aSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6371a31a186aSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6372a31a186aSmrg	_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'
6373a31a186aSmrg	_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'
6374a31a186aSmrg	;;
6375a31a186aSmrg      irix5* | irix6*)
6376a31a186aSmrg        case $cc_basename in
6377a31a186aSmrg          CC*)
6378a31a186aSmrg	    # SGI C++
63790bb88ba4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6380a31a186aSmrg
6381a31a186aSmrg	    # Archives containing C++ object files must be created using
6382a31a186aSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6383a31a186aSmrg	    # necessary to make sure instantiated templates are included
6384a31a186aSmrg	    # in the archive.
6385a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6386a31a186aSmrg	    ;;
6387a31a186aSmrg          *)
6388a31a186aSmrg	    if test "$GXX" = yes; then
6389a31a186aSmrg	      if test "$with_gnu_ld" = no; then
63900bb88ba4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6391a31a186aSmrg	      else
63920bb88ba4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
6393a31a186aSmrg	      fi
6394a31a186aSmrg	    fi
6395a31a186aSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6396a31a186aSmrg	    ;;
6397a31a186aSmrg        esac
6398a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6399a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6400a31a186aSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6401a31a186aSmrg        ;;
6402fe5e51b7Smrg
64030bb88ba4Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6404a31a186aSmrg        case $cc_basename in
6405a31a186aSmrg          KCC*)
6406a31a186aSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6407a31a186aSmrg
6408a31a186aSmrg	    # KCC will only create a shared library if the output file
6409a31a186aSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6410a31a186aSmrg	    # to its proper name (with version) after linking.
6411a31a186aSmrg	    _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'
6412a31a186aSmrg	    _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'
6413a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6414a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6415a31a186aSmrg	    # linking a shared library.
6416a31a186aSmrg	    #
6417a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6418a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6419a31a186aSmrg	    # from the output so that they don't get included in the library
6420a31a186aSmrg	    # dependencies.
64210bb88ba4Smrg	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6422a31a186aSmrg
6423a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6424a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6425a31a186aSmrg
6426a31a186aSmrg	    # Archives containing C++ object files must be created using
6427a31a186aSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6428a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6429a31a186aSmrg	    ;;
6430a31a186aSmrg	  icpc* | ecpc* )
6431a31a186aSmrg	    # Intel C++
6432a31a186aSmrg	    with_gnu_ld=yes
6433a31a186aSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6434a31a186aSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6435a31a186aSmrg	    # earlier do not add the objects themselves.
6436a31a186aSmrg	    case `$CC -V 2>&1` in
6437a31a186aSmrg	      *"Version 7."*)
6438a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6439a31a186aSmrg		_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'
6440a31a186aSmrg		;;
6441a31a186aSmrg	      *)  # Version 8.0 or newer
6442a31a186aSmrg	        tmp_idyn=
6443a31a186aSmrg	        case $host_cpu in
6444a31a186aSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
6445a31a186aSmrg		esac
6446a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6447a31a186aSmrg		_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'
6448a31a186aSmrg		;;
6449a31a186aSmrg	    esac
6450a31a186aSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6451a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6452a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6453a31a186aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6454a31a186aSmrg	    ;;
6455a31a186aSmrg          pgCC* | pgcpp*)
6456a31a186aSmrg            # Portland Group C++ compiler
6457a31a186aSmrg	    case `$CC -V` in
64580bb88ba4Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6459a31a186aSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6460a31a186aSmrg		rm -rf $tpldir~
6461a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
64620bb88ba4Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6463a31a186aSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6464a31a186aSmrg		rm -rf $tpldir~
6465a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
64660bb88ba4Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6467a31a186aSmrg		$RANLIB $oldlib'
6468a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6469a31a186aSmrg		rm -rf $tpldir~
6470a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64710bb88ba4Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6472a31a186aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6473a31a186aSmrg		rm -rf $tpldir~
6474a31a186aSmrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
64750bb88ba4Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
6476a31a186aSmrg	      ;;
64770bb88ba4Smrg	    *) # Version 6 and above use weak symbols
6478a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6479a31a186aSmrg	      _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'
6480a31a186aSmrg	      ;;
6481a31a186aSmrg	    esac
6482fe5e51b7Smrg
6483a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6484a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
64850bb88ba4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
6486a31a186aSmrg            ;;
6487a31a186aSmrg	  cxx*)
6488a31a186aSmrg	    # Compaq C++
6489a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6490a31a186aSmrg	    _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'
6491fe5e51b7Smrg
6492a31a186aSmrg	    runpath_var=LD_RUN_PATH
6493a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6494a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6495fe5e51b7Smrg
6496a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6497a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6498a31a186aSmrg	    # linking a shared library.
6499a31a186aSmrg	    #
6500a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6501a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6502a31a186aSmrg	    # from the output so that they don't get included in the library
6503a31a186aSmrg	    # dependencies.
65040bb88ba4Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
6505a31a186aSmrg	    ;;
65060bb88ba4Smrg	  xl* | mpixl* | bgxl*)
6507a31a186aSmrg	    # IBM XL 8.0 on PPC, with GNU ld
6508a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6509a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6510a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6511a31a186aSmrg	    if test "x$supports_anon_versioning" = xyes; then
6512a31a186aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6513a31a186aSmrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6514a31a186aSmrg		echo "local: *; };" >> $output_objdir/$libname.ver~
6515a31a186aSmrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6516a31a186aSmrg	    fi
6517a31a186aSmrg	    ;;
6518a31a186aSmrg	  *)
6519a31a186aSmrg	    case `$CC -V 2>&1 | sed 5q` in
6520a31a186aSmrg	    *Sun\ C*)
6521a31a186aSmrg	      # Sun C++ 5.9
6522a31a186aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6523a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6524a31a186aSmrg	      _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'
6525a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
65260bb88ba4Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
6527a31a186aSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6528a31a186aSmrg
6529a31a186aSmrg	      # Not sure whether something based on
6530a31a186aSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6531a31a186aSmrg	      # would be better.
65320bb88ba4Smrg	      output_verbose_link_cmd='func_echo_all'
6533a31a186aSmrg
6534a31a186aSmrg	      # Archives containing C++ object files must be created using
6535a31a186aSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6536a31a186aSmrg	      # necessary to make sure instantiated templates are included
6537a31a186aSmrg	      # in the archive.
6538a31a186aSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6539a31a186aSmrg	      ;;
6540a31a186aSmrg	    esac
6541a31a186aSmrg	    ;;
6542a31a186aSmrg	esac
6543a31a186aSmrg	;;
6544fe5e51b7Smrg
6545a31a186aSmrg      lynxos*)
6546a31a186aSmrg        # FIXME: insert proper C++ library support
6547a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6548a31a186aSmrg	;;
6549fe5e51b7Smrg
6550a31a186aSmrg      m88k*)
6551a31a186aSmrg        # FIXME: insert proper C++ library support
6552a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6553a31a186aSmrg	;;
6554fe5e51b7Smrg
6555a31a186aSmrg      mvs*)
6556a31a186aSmrg        case $cc_basename in
6557a31a186aSmrg          cxx*)
6558a31a186aSmrg	    # FIXME: insert proper C++ library support
6559a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6560a31a186aSmrg	    ;;
6561a31a186aSmrg	  *)
6562a31a186aSmrg	    # FIXME: insert proper C++ library support
6563a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6564a31a186aSmrg	    ;;
6565a31a186aSmrg	esac
6566a31a186aSmrg	;;
6567fe5e51b7Smrg
6568a31a186aSmrg      netbsd*)
6569a31a186aSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6570a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6571a31a186aSmrg	  wlarc=
6572a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6573a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6574a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6575a31a186aSmrg	fi
6576a31a186aSmrg	# Workaround some broken pre-1.5 toolchains
6577a31a186aSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6578a31a186aSmrg	;;
6579fe5e51b7Smrg
6580a31a186aSmrg      *nto* | *qnx*)
6581a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6582a31a186aSmrg	;;
6583fe5e51b7Smrg
6584a31a186aSmrg      openbsd2*)
6585a31a186aSmrg        # C++ shared libraries are fairly broken
6586a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
6587a31a186aSmrg	;;
6588fe5e51b7Smrg
6589a31a186aSmrg      openbsd*)
6590a31a186aSmrg	if test -f /usr/libexec/ld.so; then
6591a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6592a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6593a31a186aSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6594a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6595a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6596a31a186aSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6597a31a186aSmrg	    _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'
6598a31a186aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6599a31a186aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6600a31a186aSmrg	  fi
66010bb88ba4Smrg	  output_verbose_link_cmd=func_echo_all
6602a31a186aSmrg	else
6603a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6604a31a186aSmrg	fi
6605a31a186aSmrg	;;
6606fe5e51b7Smrg
6607a31a186aSmrg      osf3* | osf4* | osf5*)
6608a31a186aSmrg        case $cc_basename in
6609a31a186aSmrg          KCC*)
6610a31a186aSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6611a31a186aSmrg
6612a31a186aSmrg	    # KCC will only create a shared library if the output file
6613a31a186aSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6614a31a186aSmrg	    # to its proper name (with version) after linking.
6615a31a186aSmrg	    _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'
6616a31a186aSmrg
6617a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6618a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6619a31a186aSmrg
6620a31a186aSmrg	    # Archives containing C++ object files must be created using
6621a31a186aSmrg	    # the KAI C++ compiler.
6622a31a186aSmrg	    case $host in
6623a31a186aSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6624a31a186aSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6625a31a186aSmrg	    esac
6626a31a186aSmrg	    ;;
6627a31a186aSmrg          RCC*)
6628a31a186aSmrg	    # Rational C++ 2.4.1
6629a31a186aSmrg	    # FIXME: insert proper C++ library support
6630a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6631a31a186aSmrg	    ;;
6632a31a186aSmrg          cxx*)
6633a31a186aSmrg	    case $host in
6634a31a186aSmrg	      osf3*)
6635a31a186aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
66360bb88ba4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6637a31a186aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6638a31a186aSmrg		;;
6639a31a186aSmrg	      *)
6640a31a186aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
66410bb88ba4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
6642a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6643a31a186aSmrg	          echo "-hidden">> $lib.exp~
66440bb88ba4Smrg	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
6645a31a186aSmrg	          $RM $lib.exp'
6646a31a186aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6647a31a186aSmrg		;;
6648a31a186aSmrg	    esac
6649fe5e51b7Smrg
6650a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6651fe5e51b7Smrg
6652a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6653a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6654a31a186aSmrg	    # linking a shared library.
6655a31a186aSmrg	    #
6656a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6657a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6658a31a186aSmrg	    # from the output so that they don't get included in the library
6659a31a186aSmrg	    # dependencies.
66600bb88ba4Smrg	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
6661a31a186aSmrg	    ;;
6662a31a186aSmrg	  *)
6663a31a186aSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6664a31a186aSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6665a31a186aSmrg	      case $host in
6666a31a186aSmrg	        osf3*)
66670bb88ba4Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6668a31a186aSmrg		  ;;
6669a31a186aSmrg	        *)
66700bb88ba4Smrg	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
6671a31a186aSmrg		  ;;
6672a31a186aSmrg	      esac
6673a31a186aSmrg
6674a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6675a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6676a31a186aSmrg
6677a31a186aSmrg	      # Commands to make compiler produce verbose output that lists
6678a31a186aSmrg	      # what "hidden" libraries, object files and flags are used when
6679a31a186aSmrg	      # linking a shared library.
66800bb88ba4Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6681a31a186aSmrg
6682a31a186aSmrg	    else
6683a31a186aSmrg	      # FIXME: insert proper C++ library support
6684a31a186aSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6685a31a186aSmrg	    fi
6686a31a186aSmrg	    ;;
6687a31a186aSmrg        esac
6688a31a186aSmrg        ;;
6689fe5e51b7Smrg
6690a31a186aSmrg      psos*)
6691a31a186aSmrg        # FIXME: insert proper C++ library support
6692a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6693a31a186aSmrg        ;;
6694fe5e51b7Smrg
6695a31a186aSmrg      sunos4*)
6696a31a186aSmrg        case $cc_basename in
6697a31a186aSmrg          CC*)
6698a31a186aSmrg	    # Sun C++ 4.x
6699a31a186aSmrg	    # FIXME: insert proper C++ library support
6700a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6701a31a186aSmrg	    ;;
6702a31a186aSmrg          lcc*)
6703a31a186aSmrg	    # Lucid
6704a31a186aSmrg	    # FIXME: insert proper C++ library support
6705a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6706a31a186aSmrg	    ;;
6707a31a186aSmrg          *)
6708a31a186aSmrg	    # FIXME: insert proper C++ library support
6709a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6710a31a186aSmrg	    ;;
6711a31a186aSmrg        esac
6712a31a186aSmrg        ;;
6713fe5e51b7Smrg
6714a31a186aSmrg      solaris*)
6715a31a186aSmrg        case $cc_basename in
67160bb88ba4Smrg          CC* | sunCC*)
6717a31a186aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
6718a31a186aSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6719a31a186aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6720a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6721a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6722a31a186aSmrg	      $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'
6723a31a186aSmrg
6724a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6725a31a186aSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6726a31a186aSmrg	    case $host_os in
6727a31a186aSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6728a31a186aSmrg	      *)
6729a31a186aSmrg		# The compiler driver will combine and reorder linker options,
6730a31a186aSmrg		# but understands `-z linker_flag'.
6731a31a186aSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6732a31a186aSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6733a31a186aSmrg	        ;;
6734a31a186aSmrg	    esac
6735a31a186aSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6736fe5e51b7Smrg
67370bb88ba4Smrg	    output_verbose_link_cmd='func_echo_all'
6738fe5e51b7Smrg
6739a31a186aSmrg	    # Archives containing C++ object files must be created using
6740a31a186aSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6741a31a186aSmrg	    # necessary to make sure instantiated templates are included
6742a31a186aSmrg	    # in the archive.
6743a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6744a31a186aSmrg	    ;;
6745a31a186aSmrg          gcx*)
6746a31a186aSmrg	    # Green Hills C++ Compiler
6747a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6748fe5e51b7Smrg
6749a31a186aSmrg	    # The C++ compiler must be used to create the archive.
6750a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6751a31a186aSmrg	    ;;
6752a31a186aSmrg          *)
6753a31a186aSmrg	    # GNU C++ compiler with Solaris linker
6754a31a186aSmrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6755a31a186aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6756a31a186aSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
67570bb88ba4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6758a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
67590bb88ba4Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6760a31a186aSmrg
6761a31a186aSmrg	        # Commands to make compiler produce verbose output that lists
6762a31a186aSmrg	        # what "hidden" libraries, object files and flags are used when
6763a31a186aSmrg	        # linking a shared library.
67640bb88ba4Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6765a31a186aSmrg	      else
6766a31a186aSmrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6767a31a186aSmrg	        # platform.
6768a31a186aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6769a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6770a31a186aSmrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6771a31a186aSmrg
6772a31a186aSmrg	        # Commands to make compiler produce verbose output that lists
6773a31a186aSmrg	        # what "hidden" libraries, object files and flags are used when
6774a31a186aSmrg	        # linking a shared library.
67750bb88ba4Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6776a31a186aSmrg	      fi
6777a31a186aSmrg
6778a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6779a31a186aSmrg	      case $host_os in
6780a31a186aSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6781a31a186aSmrg		*)
6782a31a186aSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6783a31a186aSmrg		  ;;
6784a31a186aSmrg	      esac
6785a31a186aSmrg	    fi
6786a31a186aSmrg	    ;;
6787a31a186aSmrg        esac
6788a31a186aSmrg        ;;
6789fe5e51b7Smrg
6790a31a186aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6791a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6792a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6793a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6794a31a186aSmrg      runpath_var='LD_RUN_PATH'
6795fe5e51b7Smrg
6796a31a186aSmrg      case $cc_basename in
6797a31a186aSmrg        CC*)
6798a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6799a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6800a31a186aSmrg	  ;;
6801a31a186aSmrg	*)
6802a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6803a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6804a31a186aSmrg	  ;;
6805a31a186aSmrg      esac
6806a31a186aSmrg      ;;
6807fe5e51b7Smrg
6808a31a186aSmrg      sysv5* | sco3.2v5* | sco5v6*)
6809a31a186aSmrg	# Note: We can NOT use -z defs as we might desire, because we do not
6810a31a186aSmrg	# link with -lc, and that would cause any symbols used from libc to
6811a31a186aSmrg	# always be unresolved, which means just about no library would
6812a31a186aSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
6813a31a186aSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
6814a31a186aSmrg	# as -z defs.
6815a31a186aSmrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6816a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6817a31a186aSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6818a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6819a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6820a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6821a31a186aSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6822a31a186aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6823a31a186aSmrg	runpath_var='LD_RUN_PATH'
6824fe5e51b7Smrg
6825a31a186aSmrg	case $cc_basename in
6826a31a186aSmrg          CC*)
6827a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6828a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
68290bb88ba4Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
68300bb88ba4Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
68310bb88ba4Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
68320bb88ba4Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
6833a31a186aSmrg	    ;;
6834a31a186aSmrg	  *)
6835a31a186aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6836a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6837a31a186aSmrg	    ;;
6838a31a186aSmrg	esac
6839a31a186aSmrg      ;;
6840fe5e51b7Smrg
6841a31a186aSmrg      tandem*)
6842a31a186aSmrg        case $cc_basename in
6843a31a186aSmrg          NCC*)
6844a31a186aSmrg	    # NonStop-UX NCC 3.20
6845a31a186aSmrg	    # FIXME: insert proper C++ library support
6846a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6847a31a186aSmrg	    ;;
6848a31a186aSmrg          *)
6849a31a186aSmrg	    # FIXME: insert proper C++ library support
6850a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6851a31a186aSmrg	    ;;
6852a31a186aSmrg        esac
6853a31a186aSmrg        ;;
6854fe5e51b7Smrg
6855a31a186aSmrg      vxworks*)
6856a31a186aSmrg        # FIXME: insert proper C++ library support
6857a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6858a31a186aSmrg        ;;
6859fe5e51b7Smrg
6860a31a186aSmrg      *)
6861a31a186aSmrg        # FIXME: insert proper C++ library support
6862a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6863a31a186aSmrg        ;;
6864a31a186aSmrg    esac
6865fe5e51b7Smrg
6866a31a186aSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6867a31a186aSmrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6868a31a186aSmrg
6869a31a186aSmrg    _LT_TAGVAR(GCC, $1)="$GXX"
6870a31a186aSmrg    _LT_TAGVAR(LD, $1)="$LD"
6871a31a186aSmrg
6872a31a186aSmrg    ## CAVEAT EMPTOR:
6873a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
6874a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
6875a31a186aSmrg    ## what you are doing...
6876a31a186aSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6877a31a186aSmrg    _LT_COMPILER_PIC($1)
6878a31a186aSmrg    _LT_COMPILER_C_O($1)
6879a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
6880a31a186aSmrg    _LT_LINKER_SHLIBS($1)
6881a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
6882a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6883a31a186aSmrg
6884a31a186aSmrg    _LT_CONFIG($1)
6885a31a186aSmrg  fi # test -n "$compiler"
6886a31a186aSmrg
6887a31a186aSmrg  CC=$lt_save_CC
68880bb88ba4Smrg  CFLAGS=$lt_save_CFLAGS
6889a31a186aSmrg  LDCXX=$LD
6890a31a186aSmrg  LD=$lt_save_LD
6891a31a186aSmrg  GCC=$lt_save_GCC
6892a31a186aSmrg  with_gnu_ld=$lt_save_with_gnu_ld
6893a31a186aSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6894a31a186aSmrg  lt_cv_path_LD=$lt_save_path_LD
6895a31a186aSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6896a31a186aSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6897a31a186aSmrgfi # test "$_lt_caught_CXX_error" != yes
6898fe5e51b7Smrg
6899a31a186aSmrgAC_LANG_POP
6900a31a186aSmrg])# _LT_LANG_CXX_CONFIG
6901fe5e51b7Smrg
6902fe5e51b7Smrg
69030bb88ba4Smrg# _LT_FUNC_STRIPNAME_CNF
69040bb88ba4Smrg# ----------------------
69050bb88ba4Smrg# func_stripname_cnf prefix suffix name
69060bb88ba4Smrg# strip PREFIX and SUFFIX off of NAME.
69070bb88ba4Smrg# PREFIX and SUFFIX must not contain globbing or regex special
69080bb88ba4Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
69090bb88ba4Smrg# dot (in which case that matches only a dot).
69100bb88ba4Smrg#
69110bb88ba4Smrg# This function is identical to the (non-XSI) version of func_stripname,
69120bb88ba4Smrg# except this one can be used by m4 code that may be executed by configure,
69130bb88ba4Smrg# rather than the libtool script.
69140bb88ba4Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
69150bb88ba4SmrgAC_REQUIRE([_LT_DECL_SED])
69160bb88ba4SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
69170bb88ba4Smrgfunc_stripname_cnf ()
69180bb88ba4Smrg{
69190bb88ba4Smrg  case ${2} in
69200bb88ba4Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
69210bb88ba4Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
69220bb88ba4Smrg  esac
69230bb88ba4Smrg} # func_stripname_cnf
69240bb88ba4Smrg])# _LT_FUNC_STRIPNAME_CNF
69250bb88ba4Smrg
6926a31a186aSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6927a31a186aSmrg# ---------------------------------
6928a31a186aSmrg# Figure out "hidden" library dependencies from verbose
6929a31a186aSmrg# compiler output when linking a shared library.
6930a31a186aSmrg# Parse the compiler output and extract the necessary
6931a31a186aSmrg# objects, libraries and library flags.
6932a31a186aSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6933a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
69340bb88ba4SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6935a31a186aSmrg# Dependencies to place before and after the object being linked:
6936a31a186aSmrg_LT_TAGVAR(predep_objects, $1)=
6937a31a186aSmrg_LT_TAGVAR(postdep_objects, $1)=
6938a31a186aSmrg_LT_TAGVAR(predeps, $1)=
6939a31a186aSmrg_LT_TAGVAR(postdeps, $1)=
6940a31a186aSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
6941fe5e51b7Smrg
6942a31a186aSmrgdnl we can't use the lt_simple_compile_test_code here,
6943a31a186aSmrgdnl because it contains code intended for an executable,
6944a31a186aSmrgdnl not a library.  It's possible we should let each
6945a31a186aSmrgdnl tag define a new lt_????_link_test_code variable,
6946a31a186aSmrgdnl but it's only used here...
6947a31a186aSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6948a31a186aSmrgint a;
6949a31a186aSmrgvoid foo (void) { a = 0; }
6950a31a186aSmrg_LT_EOF
6951a31a186aSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6952a31a186aSmrgclass Foo
6953a31a186aSmrg{
6954a31a186aSmrgpublic:
6955a31a186aSmrg  Foo (void) { a = 0; }
6956a31a186aSmrgprivate:
6957a31a186aSmrg  int a;
6958a31a186aSmrg};
6959a31a186aSmrg_LT_EOF
6960a31a186aSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6961a31a186aSmrg      subroutine foo
6962a31a186aSmrg      implicit none
6963a31a186aSmrg      integer*4 a
6964a31a186aSmrg      a=0
6965a31a186aSmrg      return
6966a31a186aSmrg      end
6967a31a186aSmrg_LT_EOF
6968a31a186aSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6969a31a186aSmrg      subroutine foo
6970a31a186aSmrg      implicit none
6971a31a186aSmrg      integer a
6972a31a186aSmrg      a=0
6973a31a186aSmrg      return
6974a31a186aSmrg      end
6975a31a186aSmrg_LT_EOF
6976a31a186aSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6977a31a186aSmrgpublic class foo {
6978a31a186aSmrg  private int a;
6979a31a186aSmrg  public void bar (void) {
6980a31a186aSmrg    a = 0;
6981a31a186aSmrg  }
6982a31a186aSmrg};
6983a31a186aSmrg_LT_EOF
69840bb88ba4Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
69850bb88ba4Smrgpackage foo
69860bb88ba4Smrgfunc foo() {
69870bb88ba4Smrg}
69880bb88ba4Smrg_LT_EOF
6989a31a186aSmrg])
69900bb88ba4Smrg
69910bb88ba4Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
69920bb88ba4Smrgcase "$CC $CFLAGS " in #(
69930bb88ba4Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
69940bb88ba4Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
69950bb88ba4Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
69960bb88ba4Smrgesac
69970bb88ba4Smrg
6998a31a186aSmrgdnl Parse the compiler output and extract the necessary
6999a31a186aSmrgdnl objects, libraries and library flags.
7000a31a186aSmrgif AC_TRY_EVAL(ac_compile); then
7001a31a186aSmrg  # Parse the compiler output and extract the necessary
7002a31a186aSmrg  # objects, libraries and library flags.
7003fe5e51b7Smrg
7004a31a186aSmrg  # Sentinel used to keep track of whether or not we are before
7005a31a186aSmrg  # the conftest object file.
7006a31a186aSmrg  pre_test_object_deps_done=no
7007fe5e51b7Smrg
7008a31a186aSmrg  for p in `eval "$output_verbose_link_cmd"`; do
70090bb88ba4Smrg    case ${prev}${p} in
7010fe5e51b7Smrg
7011a31a186aSmrg    -L* | -R* | -l*)
7012a31a186aSmrg       # Some compilers place space between "-{L,R}" and the path.
7013a31a186aSmrg       # Remove the space.
7014a31a186aSmrg       if test $p = "-L" ||
7015a31a186aSmrg          test $p = "-R"; then
7016a31a186aSmrg	 prev=$p
7017a31a186aSmrg	 continue
7018a31a186aSmrg       fi
7019fe5e51b7Smrg
70200bb88ba4Smrg       # Expand the sysroot to ease extracting the directories later.
70210bb88ba4Smrg       if test -z "$prev"; then
70220bb88ba4Smrg         case $p in
70230bb88ba4Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
70240bb88ba4Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
70250bb88ba4Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
70260bb88ba4Smrg         esac
70270bb88ba4Smrg       fi
70280bb88ba4Smrg       case $p in
70290bb88ba4Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
70300bb88ba4Smrg       esac
7031a31a186aSmrg       if test "$pre_test_object_deps_done" = no; then
70320bb88ba4Smrg	 case ${prev} in
70330bb88ba4Smrg	 -L | -R)
7034a31a186aSmrg	   # Internal compiler library paths should come after those
7035a31a186aSmrg	   # provided the user.  The postdeps already come after the
7036a31a186aSmrg	   # user supplied libs so there is no need to process them.
7037a31a186aSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7038a31a186aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7039a31a186aSmrg	   else
7040a31a186aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7041a31a186aSmrg	   fi
7042a31a186aSmrg	   ;;
7043a31a186aSmrg	 # The "-l" case would never come before the object being
7044a31a186aSmrg	 # linked, so don't bother handling this case.
7045a31a186aSmrg	 esac
7046a31a186aSmrg       else
7047a31a186aSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7048a31a186aSmrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7049a31a186aSmrg	 else
7050a31a186aSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7051a31a186aSmrg	 fi
7052a31a186aSmrg       fi
70530bb88ba4Smrg       prev=
7054a31a186aSmrg       ;;
7055fe5e51b7Smrg
70560bb88ba4Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7057a31a186aSmrg    *.$objext)
7058a31a186aSmrg       # This assumes that the test object file only shows up
7059a31a186aSmrg       # once in the compiler output.
7060a31a186aSmrg       if test "$p" = "conftest.$objext"; then
7061a31a186aSmrg	 pre_test_object_deps_done=yes
7062a31a186aSmrg	 continue
7063a31a186aSmrg       fi
7064fe5e51b7Smrg
7065a31a186aSmrg       if test "$pre_test_object_deps_done" = no; then
7066a31a186aSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7067a31a186aSmrg	   _LT_TAGVAR(predep_objects, $1)="$p"
7068a31a186aSmrg	 else
7069a31a186aSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7070a31a186aSmrg	 fi
7071a31a186aSmrg       else
7072a31a186aSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7073a31a186aSmrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
7074a31a186aSmrg	 else
7075a31a186aSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7076a31a186aSmrg	 fi
7077a31a186aSmrg       fi
7078a31a186aSmrg       ;;
7079fe5e51b7Smrg
7080a31a186aSmrg    *) ;; # Ignore the rest.
7081fe5e51b7Smrg
7082a31a186aSmrg    esac
7083a31a186aSmrg  done
7084fe5e51b7Smrg
7085a31a186aSmrg  # Clean up.
7086a31a186aSmrg  rm -f a.out a.exe
7087eda3803bSmrgelse
7088a31a186aSmrg  echo "libtool.m4: error: problem compiling $1 test program"
7089fe5e51b7Smrgfi
7090fe5e51b7Smrg
7091a31a186aSmrg$RM -f confest.$objext
70920bb88ba4SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7093fe5e51b7Smrg
7094a31a186aSmrg# PORTME: override above test on systems where it is broken
7095a31a186aSmrgm4_if([$1], [CXX],
7096a31a186aSmrg[case $host_os in
7097a31a186aSmrginterix[[3-9]]*)
7098a31a186aSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7099a31a186aSmrg  # hack all around it, let's just trust "g++" to DTRT.
7100a31a186aSmrg  _LT_TAGVAR(predep_objects,$1)=
7101a31a186aSmrg  _LT_TAGVAR(postdep_objects,$1)=
7102a31a186aSmrg  _LT_TAGVAR(postdeps,$1)=
7103a31a186aSmrg  ;;
7104eda3803bSmrg
7105a31a186aSmrglinux*)
7106a31a186aSmrg  case `$CC -V 2>&1 | sed 5q` in
7107a31a186aSmrg  *Sun\ C*)
7108a31a186aSmrg    # Sun C++ 5.9
7109fe5e51b7Smrg
7110a31a186aSmrg    # The more standards-conforming stlport4 library is
7111a31a186aSmrg    # incompatible with the Cstd library. Avoid specifying
7112a31a186aSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
7113a31a186aSmrg    # -library=stlport4 depends on it.
7114a31a186aSmrg    case " $CXX $CXXFLAGS " in
7115a31a186aSmrg    *" -library=stlport4 "*)
7116a31a186aSmrg      solaris_use_stlport4=yes
7117a31a186aSmrg      ;;
7118a31a186aSmrg    esac
7119fe5e51b7Smrg
7120a31a186aSmrg    if test "$solaris_use_stlport4" != yes; then
7121a31a186aSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7122a31a186aSmrg    fi
7123a31a186aSmrg    ;;
7124a31a186aSmrg  esac
7125a31a186aSmrg  ;;
7126a31a186aSmrg
7127a31a186aSmrgsolaris*)
7128a31a186aSmrg  case $cc_basename in
71290bb88ba4Smrg  CC* | sunCC*)
7130a31a186aSmrg    # The more standards-conforming stlport4 library is
7131a31a186aSmrg    # incompatible with the Cstd library. Avoid specifying
7132a31a186aSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
7133a31a186aSmrg    # -library=stlport4 depends on it.
7134a31a186aSmrg    case " $CXX $CXXFLAGS " in
7135a31a186aSmrg    *" -library=stlport4 "*)
7136a31a186aSmrg      solaris_use_stlport4=yes
7137a31a186aSmrg      ;;
7138a31a186aSmrg    esac
7139fe5e51b7Smrg
7140a31a186aSmrg    # Adding this requires a known-good setup of shared libraries for
7141a31a186aSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
7142a31a186aSmrg    # archive will be linked into the output, leading to subtle bugs.
7143a31a186aSmrg    if test "$solaris_use_stlport4" != yes; then
7144a31a186aSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7145a31a186aSmrg    fi
7146a31a186aSmrg    ;;
7147a31a186aSmrg  esac
7148a31a186aSmrg  ;;
7149a31a186aSmrgesac
7150a31a186aSmrg])
7151fe5e51b7Smrg
7152a31a186aSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
7153a31a186aSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7154a31a186aSmrgesac
7155a31a186aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7156a31a186aSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7157a31a186aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7158a31a186aSmrgfi
7159a31a186aSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7160a31a186aSmrg    [The directories searched by this compiler when creating a shared library])
7161a31a186aSmrg_LT_TAGDECL([], [predep_objects], [1],
7162a31a186aSmrg    [Dependencies to place before and after the objects being linked to
7163a31a186aSmrg    create a shared library])
7164a31a186aSmrg_LT_TAGDECL([], [postdep_objects], [1])
7165a31a186aSmrg_LT_TAGDECL([], [predeps], [1])
7166a31a186aSmrg_LT_TAGDECL([], [postdeps], [1])
7167a31a186aSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7168a31a186aSmrg    [The library search path used internally by the compiler when linking
7169a31a186aSmrg    a shared library])
7170a31a186aSmrg])# _LT_SYS_HIDDEN_LIBDEPS
7171a31a186aSmrg
7172a31a186aSmrg
7173a31a186aSmrg# _LT_LANG_F77_CONFIG([TAG])
7174a31a186aSmrg# --------------------------
7175a31a186aSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
7176a31a186aSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7177a31a186aSmrg# to write the compiler configuration to `libtool'.
7178a31a186aSmrgm4_defun([_LT_LANG_F77_CONFIG],
71790bb88ba4Smrg[AC_LANG_PUSH(Fortran 77)
71800bb88ba4Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
71810bb88ba4Smrg  _lt_disable_F77=yes
71820bb88ba4Smrgfi
7183eda3803bSmrg
7184a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7185a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7186a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7187a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7188a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7189a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7190a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7191a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7192a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7193a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7194a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7195a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7196a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
7197a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7198a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7199a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
72000bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
72010bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7202a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7203a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7204a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7205fe5e51b7Smrg
7206a31a186aSmrg# Source file extension for f77 test sources.
7207a31a186aSmrgac_ext=f
7208eda3803bSmrg
7209a31a186aSmrg# Object file extension for compiled f77 test sources.
7210a31a186aSmrgobjext=o
7211a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7212a31a186aSmrg
7213a31a186aSmrg# No sense in running all these tests if we already determined that
7214a31a186aSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7215a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
7216a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
7217a31a186aSmrgif test "$_lt_disable_F77" != yes; then
7218a31a186aSmrg  # Code to be used in simple compile tests
7219a31a186aSmrg  lt_simple_compile_test_code="\
7220a31a186aSmrg      subroutine t
7221a31a186aSmrg      return
7222a31a186aSmrg      end
7223a31a186aSmrg"
7224eda3803bSmrg
7225a31a186aSmrg  # Code to be used in simple link tests
7226a31a186aSmrg  lt_simple_link_test_code="\
7227a31a186aSmrg      program t
7228a31a186aSmrg      end
7229a31a186aSmrg"
7230fe5e51b7Smrg
7231a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7232a31a186aSmrg  _LT_TAG_COMPILER
7233fe5e51b7Smrg
7234a31a186aSmrg  # save warnings/boilerplate of simple test code
7235a31a186aSmrg  _LT_COMPILER_BOILERPLATE
7236a31a186aSmrg  _LT_LINKER_BOILERPLATE
7237fe5e51b7Smrg
7238a31a186aSmrg  # Allow CC to be a program name with arguments.
7239a31a186aSmrg  lt_save_CC="$CC"
7240a31a186aSmrg  lt_save_GCC=$GCC
72410bb88ba4Smrg  lt_save_CFLAGS=$CFLAGS
7242a31a186aSmrg  CC=${F77-"f77"}
72430bb88ba4Smrg  CFLAGS=$FFLAGS
7244a31a186aSmrg  compiler=$CC
7245a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
7246a31a186aSmrg  _LT_CC_BASENAME([$compiler])
7247a31a186aSmrg  GCC=$G77
7248a31a186aSmrg  if test -n "$compiler"; then
7249a31a186aSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7250a31a186aSmrg    AC_MSG_RESULT([$can_build_shared])
7251eda3803bSmrg
7252a31a186aSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7253a31a186aSmrg    test "$can_build_shared" = "no" && enable_shared=no
7254eda3803bSmrg
7255a31a186aSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7256a31a186aSmrg    # are all built from PIC.
7257a31a186aSmrg    case $host_os in
7258a31a186aSmrg      aix3*)
7259a31a186aSmrg        test "$enable_shared" = yes && enable_static=no
7260a31a186aSmrg        if test -n "$RANLIB"; then
7261a31a186aSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7262a31a186aSmrg          postinstall_cmds='$RANLIB $lib'
7263a31a186aSmrg        fi
7264a31a186aSmrg        ;;
7265a31a186aSmrg      aix[[4-9]]*)
7266a31a186aSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7267a31a186aSmrg	  test "$enable_shared" = yes && enable_static=no
7268a31a186aSmrg	fi
7269a31a186aSmrg        ;;
7270a31a186aSmrg    esac
7271a31a186aSmrg    AC_MSG_RESULT([$enable_shared])
7272a31a186aSmrg
7273a31a186aSmrg    AC_MSG_CHECKING([whether to build static libraries])
7274a31a186aSmrg    # Make sure either enable_shared or enable_static is yes.
7275a31a186aSmrg    test "$enable_shared" = yes || enable_static=yes
7276a31a186aSmrg    AC_MSG_RESULT([$enable_static])
7277a31a186aSmrg
7278a31a186aSmrg    _LT_TAGVAR(GCC, $1)="$G77"
7279a31a186aSmrg    _LT_TAGVAR(LD, $1)="$LD"
7280a31a186aSmrg
7281a31a186aSmrg    ## CAVEAT EMPTOR:
7282a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
7283a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
7284a31a186aSmrg    ## what you are doing...
7285a31a186aSmrg    _LT_COMPILER_PIC($1)
7286a31a186aSmrg    _LT_COMPILER_C_O($1)
7287a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
7288a31a186aSmrg    _LT_LINKER_SHLIBS($1)
7289a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7290a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7291a31a186aSmrg
7292a31a186aSmrg    _LT_CONFIG($1)
7293a31a186aSmrg  fi # test -n "$compiler"
7294a31a186aSmrg
7295a31a186aSmrg  GCC=$lt_save_GCC
7296a31a186aSmrg  CC="$lt_save_CC"
72970bb88ba4Smrg  CFLAGS="$lt_save_CFLAGS"
7298a31a186aSmrgfi # test "$_lt_disable_F77" != yes
7299eda3803bSmrg
7300a31a186aSmrgAC_LANG_POP
7301a31a186aSmrg])# _LT_LANG_F77_CONFIG
7302eda3803bSmrg
7303fe5e51b7Smrg
7304a31a186aSmrg# _LT_LANG_FC_CONFIG([TAG])
7305a31a186aSmrg# -------------------------
7306a31a186aSmrg# Ensure that the configuration variables for a Fortran compiler are
7307a31a186aSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7308a31a186aSmrg# to write the compiler configuration to `libtool'.
7309a31a186aSmrgm4_defun([_LT_LANG_FC_CONFIG],
73100bb88ba4Smrg[AC_LANG_PUSH(Fortran)
73110bb88ba4Smrg
73120bb88ba4Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
73130bb88ba4Smrg  _lt_disable_FC=yes
73140bb88ba4Smrgfi
7315a31a186aSmrg
7316a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7317a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7318a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7319a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7320a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7321a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7322a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7323a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7324a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7325a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7326a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7327a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7328a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
7329a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7330a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7331a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
73320bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
73330bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7334a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7335a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7336a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7337a31a186aSmrg
7338a31a186aSmrg# Source file extension for fc test sources.
7339a31a186aSmrgac_ext=${ac_fc_srcext-f}
7340a31a186aSmrg
7341a31a186aSmrg# Object file extension for compiled fc test sources.
7342a31a186aSmrgobjext=o
7343a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7344a31a186aSmrg
7345a31a186aSmrg# No sense in running all these tests if we already determined that
7346a31a186aSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
7347a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
7348a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
7349a31a186aSmrgif test "$_lt_disable_FC" != yes; then
7350a31a186aSmrg  # Code to be used in simple compile tests
7351a31a186aSmrg  lt_simple_compile_test_code="\
7352a31a186aSmrg      subroutine t
7353a31a186aSmrg      return
7354a31a186aSmrg      end
7355a31a186aSmrg"
7356fe5e51b7Smrg
7357a31a186aSmrg  # Code to be used in simple link tests
7358a31a186aSmrg  lt_simple_link_test_code="\
7359a31a186aSmrg      program t
7360a31a186aSmrg      end
7361a31a186aSmrg"
7362fe5e51b7Smrg
7363a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7364a31a186aSmrg  _LT_TAG_COMPILER
7365fe5e51b7Smrg
7366a31a186aSmrg  # save warnings/boilerplate of simple test code
7367a31a186aSmrg  _LT_COMPILER_BOILERPLATE
7368a31a186aSmrg  _LT_LINKER_BOILERPLATE
7369fe5e51b7Smrg
7370a31a186aSmrg  # Allow CC to be a program name with arguments.
7371a31a186aSmrg  lt_save_CC="$CC"
7372a31a186aSmrg  lt_save_GCC=$GCC
73730bb88ba4Smrg  lt_save_CFLAGS=$CFLAGS
7374a31a186aSmrg  CC=${FC-"f95"}
73750bb88ba4Smrg  CFLAGS=$FCFLAGS
7376a31a186aSmrg  compiler=$CC
7377a31a186aSmrg  GCC=$ac_cv_fc_compiler_gnu
7378a31a186aSmrg
7379a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
7380a31a186aSmrg  _LT_CC_BASENAME([$compiler])
7381fe5e51b7Smrg
7382a31a186aSmrg  if test -n "$compiler"; then
7383a31a186aSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7384a31a186aSmrg    AC_MSG_RESULT([$can_build_shared])
7385a31a186aSmrg
7386a31a186aSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7387a31a186aSmrg    test "$can_build_shared" = "no" && enable_shared=no
7388a31a186aSmrg
7389a31a186aSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7390a31a186aSmrg    # are all built from PIC.
7391643b027fSmrg    case $host_os in
7392a31a186aSmrg      aix3*)
7393a31a186aSmrg        test "$enable_shared" = yes && enable_static=no
7394a31a186aSmrg        if test -n "$RANLIB"; then
7395a31a186aSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7396a31a186aSmrg          postinstall_cmds='$RANLIB $lib'
7397a31a186aSmrg        fi
7398a31a186aSmrg        ;;
7399643b027fSmrg      aix[[4-9]]*)
7400a31a186aSmrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7401a31a186aSmrg	  test "$enable_shared" = yes && enable_static=no
7402643b027fSmrg	fi
7403a31a186aSmrg        ;;
7404643b027fSmrg    esac
7405a31a186aSmrg    AC_MSG_RESULT([$enable_shared])
7406a31a186aSmrg
7407a31a186aSmrg    AC_MSG_CHECKING([whether to build static libraries])
7408a31a186aSmrg    # Make sure either enable_shared or enable_static is yes.
7409a31a186aSmrg    test "$enable_shared" = yes || enable_static=yes
7410a31a186aSmrg    AC_MSG_RESULT([$enable_static])
7411a31a186aSmrg
7412a31a186aSmrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7413a31a186aSmrg    _LT_TAGVAR(LD, $1)="$LD"
7414a31a186aSmrg
7415a31a186aSmrg    ## CAVEAT EMPTOR:
7416a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
7417a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
7418a31a186aSmrg    ## what you are doing...
7419a31a186aSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7420a31a186aSmrg    _LT_COMPILER_PIC($1)
7421a31a186aSmrg    _LT_COMPILER_C_O($1)
7422a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
7423a31a186aSmrg    _LT_LINKER_SHLIBS($1)
7424a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7425a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7426a31a186aSmrg
7427a31a186aSmrg    _LT_CONFIG($1)
7428a31a186aSmrg  fi # test -n "$compiler"
7429a31a186aSmrg
7430a31a186aSmrg  GCC=$lt_save_GCC
74310bb88ba4Smrg  CC=$lt_save_CC
74320bb88ba4Smrg  CFLAGS=$lt_save_CFLAGS
7433a31a186aSmrgfi # test "$_lt_disable_FC" != yes
7434eda3803bSmrg
7435a31a186aSmrgAC_LANG_POP
7436a31a186aSmrg])# _LT_LANG_FC_CONFIG
7437eda3803bSmrg
7438eda3803bSmrg
7439a31a186aSmrg# _LT_LANG_GCJ_CONFIG([TAG])
7440a31a186aSmrg# --------------------------
7441a31a186aSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7442a31a186aSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7443a31a186aSmrg# to write the compiler configuration to `libtool'.
7444a31a186aSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
7445a31a186aSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7446a31a186aSmrgAC_LANG_SAVE
7447eda3803bSmrg
7448a31a186aSmrg# Source file extension for Java test sources.
7449a31a186aSmrgac_ext=java
7450eda3803bSmrg
7451a31a186aSmrg# Object file extension for compiled Java test sources.
7452a31a186aSmrgobjext=o
7453a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7454eda3803bSmrg
7455a31a186aSmrg# Code to be used in simple compile tests
7456a31a186aSmrglt_simple_compile_test_code="class foo {}"
7457eda3803bSmrg
7458a31a186aSmrg# Code to be used in simple link tests
7459a31a186aSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7460fe5e51b7Smrg
7461a31a186aSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7462a31a186aSmrg_LT_TAG_COMPILER
7463fe5e51b7Smrg
7464a31a186aSmrg# save warnings/boilerplate of simple test code
7465a31a186aSmrg_LT_COMPILER_BOILERPLATE
7466a31a186aSmrg_LT_LINKER_BOILERPLATE
7467fe5e51b7Smrg
7468a31a186aSmrg# Allow CC to be a program name with arguments.
74690bb88ba4Smrglt_save_CC=$CC
74700bb88ba4Smrglt_save_CFLAGS=$CFLAGS
7471a31a186aSmrglt_save_GCC=$GCC
7472a31a186aSmrgGCC=yes
7473a31a186aSmrgCC=${GCJ-"gcj"}
74740bb88ba4SmrgCFLAGS=$GCJFLAGS
7475a31a186aSmrgcompiler=$CC
7476a31a186aSmrg_LT_TAGVAR(compiler, $1)=$CC
7477a31a186aSmrg_LT_TAGVAR(LD, $1)="$LD"
7478a31a186aSmrg_LT_CC_BASENAME([$compiler])
7479a31a186aSmrg
7480a31a186aSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7481a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7482a31a186aSmrg
7483a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
74840bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
74850bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7486a31a186aSmrg
7487a31a186aSmrgif test -n "$compiler"; then
7488a31a186aSmrg  _LT_COMPILER_NO_RTTI($1)
7489a31a186aSmrg  _LT_COMPILER_PIC($1)
7490a31a186aSmrg  _LT_COMPILER_C_O($1)
7491a31a186aSmrg  _LT_COMPILER_FILE_LOCKS($1)
7492a31a186aSmrg  _LT_LINKER_SHLIBS($1)
7493a31a186aSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7494a31a186aSmrg
7495a31a186aSmrg  _LT_CONFIG($1)
7496a31a186aSmrgfi
7497a31a186aSmrg
7498a31a186aSmrgAC_LANG_RESTORE
7499a31a186aSmrg
7500a31a186aSmrgGCC=$lt_save_GCC
75010bb88ba4SmrgCC=$lt_save_CC
75020bb88ba4SmrgCFLAGS=$lt_save_CFLAGS
7503a31a186aSmrg])# _LT_LANG_GCJ_CONFIG
7504a31a186aSmrg
7505a31a186aSmrg
75060bb88ba4Smrg# _LT_LANG_GO_CONFIG([TAG])
75070bb88ba4Smrg# --------------------------
75080bb88ba4Smrg# Ensure that the configuration variables for the GNU Go compiler
7509a31a186aSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7510a31a186aSmrg# to write the compiler configuration to `libtool'.
75110bb88ba4Smrgm4_defun([_LT_LANG_GO_CONFIG],
75120bb88ba4Smrg[AC_REQUIRE([LT_PROG_GO])dnl
7513a31a186aSmrgAC_LANG_SAVE
7514a31a186aSmrg
75150bb88ba4Smrg# Source file extension for Go test sources.
75160bb88ba4Smrgac_ext=go
7517a31a186aSmrg
75180bb88ba4Smrg# Object file extension for compiled Go test sources.
7519a31a186aSmrgobjext=o
7520a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7521a31a186aSmrg
7522a31a186aSmrg# Code to be used in simple compile tests
75230bb88ba4Smrglt_simple_compile_test_code="package main; func main() { }"
7524a31a186aSmrg
7525a31a186aSmrg# Code to be used in simple link tests
75260bb88ba4Smrglt_simple_link_test_code='package main; func main() { }'
7527a31a186aSmrg
7528a31a186aSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7529a31a186aSmrg_LT_TAG_COMPILER
7530a31a186aSmrg
7531a31a186aSmrg# save warnings/boilerplate of simple test code
7532a31a186aSmrg_LT_COMPILER_BOILERPLATE
7533a31a186aSmrg_LT_LINKER_BOILERPLATE
7534fe5e51b7Smrg
7535a31a186aSmrg# Allow CC to be a program name with arguments.
75360bb88ba4Smrglt_save_CC=$CC
75370bb88ba4Smrglt_save_CFLAGS=$CFLAGS
7538a31a186aSmrglt_save_GCC=$GCC
75390bb88ba4SmrgGCC=yes
75400bb88ba4SmrgCC=${GOC-"gccgo"}
75410bb88ba4SmrgCFLAGS=$GOFLAGS
7542a31a186aSmrgcompiler=$CC
7543a31a186aSmrg_LT_TAGVAR(compiler, $1)=$CC
75440bb88ba4Smrg_LT_TAGVAR(LD, $1)="$LD"
7545a31a186aSmrg_LT_CC_BASENAME([$compiler])
75460bb88ba4Smrg
75470bb88ba4Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
75480bb88ba4Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
75490bb88ba4Smrg
75500bb88ba4Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
75510bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
75520bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7553fe5e51b7Smrg
7554a31a186aSmrgif test -n "$compiler"; then
75550bb88ba4Smrg  _LT_COMPILER_NO_RTTI($1)
75560bb88ba4Smrg  _LT_COMPILER_PIC($1)
75570bb88ba4Smrg  _LT_COMPILER_C_O($1)
75580bb88ba4Smrg  _LT_COMPILER_FILE_LOCKS($1)
75590bb88ba4Smrg  _LT_LINKER_SHLIBS($1)
75600bb88ba4Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
75610bb88ba4Smrg
7562a31a186aSmrg  _LT_CONFIG($1)
7563a31a186aSmrgfi
7564fe5e51b7Smrg
7565a31a186aSmrgAC_LANG_RESTORE
7566fe5e51b7Smrg
75670bb88ba4SmrgGCC=$lt_save_GCC
75680bb88ba4SmrgCC=$lt_save_CC
75690bb88ba4SmrgCFLAGS=$lt_save_CFLAGS
75700bb88ba4Smrg])# _LT_LANG_GO_CONFIG
7571fe5e51b7Smrg
75720bb88ba4Smrg
75730bb88ba4Smrg# _LT_LANG_RC_CONFIG([TAG])
75740bb88ba4Smrg# -------------------------
75750bb88ba4Smrg# Ensure that the configuration variables for the Windows resource compiler
75760bb88ba4Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
75770bb88ba4Smrg# to write the compiler configuration to `libtool'.
75780bb88ba4Smrgm4_defun([_LT_LANG_RC_CONFIG],
75790bb88ba4Smrg[AC_REQUIRE([LT_PROG_RC])dnl
75800bb88ba4SmrgAC_LANG_SAVE
75810bb88ba4Smrg
75820bb88ba4Smrg# Source file extension for RC test sources.
75830bb88ba4Smrgac_ext=rc
75840bb88ba4Smrg
75850bb88ba4Smrg# Object file extension for compiled RC test sources.
75860bb88ba4Smrgobjext=o
75870bb88ba4Smrg_LT_TAGVAR(objext, $1)=$objext
75880bb88ba4Smrg
75890bb88ba4Smrg# Code to be used in simple compile tests
75900bb88ba4Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
75910bb88ba4Smrg
75920bb88ba4Smrg# Code to be used in simple link tests
75930bb88ba4Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
75940bb88ba4Smrg
75950bb88ba4Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
75960bb88ba4Smrg_LT_TAG_COMPILER
75970bb88ba4Smrg
75980bb88ba4Smrg# save warnings/boilerplate of simple test code
75990bb88ba4Smrg_LT_COMPILER_BOILERPLATE
76000bb88ba4Smrg_LT_LINKER_BOILERPLATE
76010bb88ba4Smrg
76020bb88ba4Smrg# Allow CC to be a program name with arguments.
76030bb88ba4Smrglt_save_CC="$CC"
76040bb88ba4Smrglt_save_CFLAGS=$CFLAGS
76050bb88ba4Smrglt_save_GCC=$GCC
76060bb88ba4SmrgGCC=
76070bb88ba4SmrgCC=${RC-"windres"}
76080bb88ba4SmrgCFLAGS=
76090bb88ba4Smrgcompiler=$CC
76100bb88ba4Smrg_LT_TAGVAR(compiler, $1)=$CC
76110bb88ba4Smrg_LT_CC_BASENAME([$compiler])
76120bb88ba4Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
76130bb88ba4Smrg
76140bb88ba4Smrgif test -n "$compiler"; then
76150bb88ba4Smrg  :
76160bb88ba4Smrg  _LT_CONFIG($1)
76170bb88ba4Smrgfi
76180bb88ba4Smrg
76190bb88ba4SmrgGCC=$lt_save_GCC
76200bb88ba4SmrgAC_LANG_RESTORE
76210bb88ba4SmrgCC=$lt_save_CC
76220bb88ba4SmrgCFLAGS=$lt_save_CFLAGS
76230bb88ba4Smrg])# _LT_LANG_RC_CONFIG
76240bb88ba4Smrg
76250bb88ba4Smrg
76260bb88ba4Smrg# LT_PROG_GCJ
76270bb88ba4Smrg# -----------
76280bb88ba4SmrgAC_DEFUN([LT_PROG_GCJ],
76290bb88ba4Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7630a31a186aSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7631a31a186aSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
7632a31a186aSmrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7633a31a186aSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
7634a31a186aSmrg])
7635fe5e51b7Smrg
7636a31a186aSmrg# Old name:
7637a31a186aSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7638a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7639a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7640fe5e51b7Smrg
7641fe5e51b7Smrg
76420bb88ba4Smrg# LT_PROG_GO
76430bb88ba4Smrg# ----------
76440bb88ba4SmrgAC_DEFUN([LT_PROG_GO],
76450bb88ba4Smrg[AC_CHECK_TOOL(GOC, gccgo,)
76460bb88ba4Smrg])
76470bb88ba4Smrg
76480bb88ba4Smrg
7649a31a186aSmrg# LT_PROG_RC
7650a31a186aSmrg# ----------
7651a31a186aSmrgAC_DEFUN([LT_PROG_RC],
7652a31a186aSmrg[AC_CHECK_TOOL(RC, windres,)
7653a31a186aSmrg])
7654fe5e51b7Smrg
7655a31a186aSmrg# Old name:
7656a31a186aSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7657a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7658a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7659fe5e51b7Smrg
7660fe5e51b7Smrg
7661a31a186aSmrg# _LT_DECL_EGREP
7662a31a186aSmrg# --------------
7663a31a186aSmrg# If we don't have a new enough Autoconf to choose the best grep
7664a31a186aSmrg# available, choose the one first in the user's PATH.
7665a31a186aSmrgm4_defun([_LT_DECL_EGREP],
7666a31a186aSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7667a31a186aSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7668a31a186aSmrgtest -z "$GREP" && GREP=grep
7669a31a186aSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7670a31a186aSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7671a31a186aSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7672a31a186aSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7673a31a186aSmrgAC_SUBST([GREP])
7674a31a186aSmrg])
7675fe5e51b7Smrg
7676eda3803bSmrg
7677a31a186aSmrg# _LT_DECL_OBJDUMP
7678a31a186aSmrg# --------------
7679a31a186aSmrg# If we don't have a new enough Autoconf to choose the best objdump
7680a31a186aSmrg# available, choose the one first in the user's PATH.
7681a31a186aSmrgm4_defun([_LT_DECL_OBJDUMP],
7682a31a186aSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7683a31a186aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7684a31a186aSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7685a31a186aSmrgAC_SUBST([OBJDUMP])
7686a31a186aSmrg])
7687eda3803bSmrg
76880bb88ba4Smrg# _LT_DECL_DLLTOOL
76890bb88ba4Smrg# ----------------
76900bb88ba4Smrg# Ensure DLLTOOL variable is set.
76910bb88ba4Smrgm4_defun([_LT_DECL_DLLTOOL],
76920bb88ba4Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
76930bb88ba4Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
76940bb88ba4Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
76950bb88ba4SmrgAC_SUBST([DLLTOOL])
76960bb88ba4Smrg])
7697eda3803bSmrg
7698a31a186aSmrg# _LT_DECL_SED
7699a31a186aSmrg# ------------
7700a31a186aSmrg# Check for a fully-functional sed program, that truncates
7701a31a186aSmrg# as few characters as possible.  Prefer GNU sed if found.
7702a31a186aSmrgm4_defun([_LT_DECL_SED],
7703a31a186aSmrg[AC_PROG_SED
7704a31a186aSmrgtest -z "$SED" && SED=sed
7705a31a186aSmrgXsed="$SED -e 1s/^X//"
7706a31a186aSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7707a31a186aSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7708a31a186aSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7709a31a186aSmrg])# _LT_DECL_SED
7710a31a186aSmrg
7711a31a186aSmrgm4_ifndef([AC_PROG_SED], [
7712a31a186aSmrg# NOTE: This macro has been submitted for inclusion into   #
7713a31a186aSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7714a31a186aSmrg#  a released version of Autoconf we should remove this    #
7715a31a186aSmrg#  macro and use it instead.                               #
7716a31a186aSmrg
7717a31a186aSmrgm4_defun([AC_PROG_SED],
7718a31a186aSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7719a31a186aSmrgAC_CACHE_VAL(lt_cv_path_SED,
7720a31a186aSmrg[# Loop through the user's path and test for sed and gsed.
7721a31a186aSmrg# Then use that list of sed's as ones to test for truncation.
7722a31a186aSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7723a31a186aSmrgfor as_dir in $PATH
7724a31a186aSmrgdo
7725a31a186aSmrg  IFS=$as_save_IFS
7726a31a186aSmrg  test -z "$as_dir" && as_dir=.
7727a31a186aSmrg  for lt_ac_prog in sed gsed; do
7728a31a186aSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
7729a31a186aSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7730a31a186aSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7731a31a186aSmrg      fi
7732a31a186aSmrg    done
7733a31a186aSmrg  done
7734a31a186aSmrgdone
7735a31a186aSmrgIFS=$as_save_IFS
7736a31a186aSmrglt_ac_max=0
7737a31a186aSmrglt_ac_count=0
7738a31a186aSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7739a31a186aSmrg# along with /bin/sed that truncates output.
7740a31a186aSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7741a31a186aSmrg  test ! -f $lt_ac_sed && continue
7742a31a186aSmrg  cat /dev/null > conftest.in
7743a31a186aSmrg  lt_ac_count=0
7744a31a186aSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7745a31a186aSmrg  # Check for GNU sed and select it if it is found.
7746a31a186aSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7747a31a186aSmrg    lt_cv_path_SED=$lt_ac_sed
7748a31a186aSmrg    break
7749fe5e51b7Smrg  fi
7750a31a186aSmrg  while true; do
7751a31a186aSmrg    cat conftest.in conftest.in >conftest.tmp
7752a31a186aSmrg    mv conftest.tmp conftest.in
7753a31a186aSmrg    cp conftest.in conftest.nl
7754a31a186aSmrg    echo >>conftest.nl
7755a31a186aSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7756a31a186aSmrg    cmp -s conftest.out conftest.nl || break
7757a31a186aSmrg    # 10000 chars as input seems more than enough
7758a31a186aSmrg    test $lt_ac_count -gt 10 && break
7759a31a186aSmrg    lt_ac_count=`expr $lt_ac_count + 1`
7760a31a186aSmrg    if test $lt_ac_count -gt $lt_ac_max; then
7761a31a186aSmrg      lt_ac_max=$lt_ac_count
7762a31a186aSmrg      lt_cv_path_SED=$lt_ac_sed
7763a31a186aSmrg    fi
7764a31a186aSmrg  done
7765a31a186aSmrgdone
7766fe5e51b7Smrg])
7767a31a186aSmrgSED=$lt_cv_path_SED
7768a31a186aSmrgAC_SUBST([SED])
7769a31a186aSmrgAC_MSG_RESULT([$SED])
7770a31a186aSmrg])#AC_PROG_SED
7771a31a186aSmrg])#m4_ifndef
7772fe5e51b7Smrg
7773a31a186aSmrg# Old name:
7774a31a186aSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7775a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
7776a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7777a31a186aSmrg
7778a31a186aSmrg
7779a31a186aSmrg# _LT_CHECK_SHELL_FEATURES
7780a31a186aSmrg# ------------------------
7781a31a186aSmrg# Find out whether the shell is Bourne or XSI compatible,
7782a31a186aSmrg# or has some other useful features.
7783a31a186aSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7784a31a186aSmrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7785a31a186aSmrg# Try some XSI features
7786a31a186aSmrgxsi_shell=no
7787a31a186aSmrg( _lt_dummy="a/b/c"
77880bb88ba4Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
77890bb88ba4Smrg      = c,a/b,b/c, \
7790a31a186aSmrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7791a31a186aSmrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7792a31a186aSmrg  && xsi_shell=yes
7793a31a186aSmrgAC_MSG_RESULT([$xsi_shell])
7794a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7795a31a186aSmrg
7796a31a186aSmrgAC_MSG_CHECKING([whether the shell understands "+="])
7797a31a186aSmrglt_shell_append=no
7798a31a186aSmrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7799a31a186aSmrg    >/dev/null 2>&1 \
7800a31a186aSmrg  && lt_shell_append=yes
7801a31a186aSmrgAC_MSG_RESULT([$lt_shell_append])
7802a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7803a31a186aSmrg
7804a31a186aSmrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7805a31a186aSmrg  lt_unset=unset
7806a31a186aSmrgelse
7807a31a186aSmrg  lt_unset=false
7808fe5e51b7Smrgfi
7809a31a186aSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7810a31a186aSmrg
7811a31a186aSmrg# test EBCDIC or ASCII
7812a31a186aSmrgcase `echo X|tr X '\101'` in
7813a31a186aSmrg A) # ASCII based system
7814a31a186aSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7815a31a186aSmrg  lt_SP2NL='tr \040 \012'
7816a31a186aSmrg  lt_NL2SP='tr \015\012 \040\040'
7817a31a186aSmrg  ;;
7818a31a186aSmrg *) # EBCDIC based system
7819a31a186aSmrg  lt_SP2NL='tr \100 \n'
7820a31a186aSmrg  lt_NL2SP='tr \r\n \100\100'
7821a31a186aSmrg  ;;
7822fe5e51b7Smrgesac
7823a31a186aSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7824a31a186aSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7825a31a186aSmrg])# _LT_CHECK_SHELL_FEATURES
7826eda3803bSmrg
7827eda3803bSmrg
78280bb88ba4Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
78290bb88ba4Smrg# ------------------------------------------------------
78300bb88ba4Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
78310bb88ba4Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
78320bb88ba4Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
78330bb88ba4Smrg[dnl {
78340bb88ba4Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
78350bb88ba4Smrg$1 ()\
78360bb88ba4Smrg{\
78370bb88ba4Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
78380bb88ba4Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
78390bb88ba4Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
78400bb88ba4Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
78410bb88ba4Smrgtest 0 -eq $? || _lt_function_replace_fail=:
78420bb88ba4Smrg])
7843a31a186aSmrg
7844a31a186aSmrg
78450bb88ba4Smrg# _LT_PROG_REPLACE_SHELLFNS
78460bb88ba4Smrg# -------------------------
78470bb88ba4Smrg# Replace existing portable implementations of several shell functions with
78480bb88ba4Smrg# equivalent extended shell implementations where those features are available..
78490bb88ba4Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
78500bb88ba4Smrg[if test x"$xsi_shell" = xyes; then
78510bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
78520bb88ba4Smrg    case ${1} in
78530bb88ba4Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
78540bb88ba4Smrg      *  ) func_dirname_result="${3}" ;;
78550bb88ba4Smrg    esac])
78560bb88ba4Smrg
78570bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
78580bb88ba4Smrg    func_basename_result="${1##*/}"])
78590bb88ba4Smrg
78600bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
78610bb88ba4Smrg    case ${1} in
78620bb88ba4Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
78630bb88ba4Smrg      *  ) func_dirname_result="${3}" ;;
78640bb88ba4Smrg    esac
78650bb88ba4Smrg    func_basename_result="${1##*/}"])
7866a31a186aSmrg
78670bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
78680bb88ba4Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
78690bb88ba4Smrg    # positional parameters, so assign one to ordinary parameter first.
78700bb88ba4Smrg    func_stripname_result=${3}
78710bb88ba4Smrg    func_stripname_result=${func_stripname_result#"${1}"}
78720bb88ba4Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
7873a31a186aSmrg
78740bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
78750bb88ba4Smrg    func_split_long_opt_name=${1%%=*}
78760bb88ba4Smrg    func_split_long_opt_arg=${1#*=}])
7877a31a186aSmrg
78780bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
78790bb88ba4Smrg    func_split_short_opt_arg=${1#??}
78800bb88ba4Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
7881a31a186aSmrg
78820bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
78830bb88ba4Smrg    case ${1} in
78840bb88ba4Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
78850bb88ba4Smrg      *)    func_lo2o_result=${1} ;;
78860bb88ba4Smrg    esac])
7887fe5e51b7Smrg
78880bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
7889fe5e51b7Smrg
78900bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
7891fe5e51b7Smrg
78920bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
78930bb88ba4Smrgfi
7894fe5e51b7Smrg
78950bb88ba4Smrgif test x"$lt_shell_append" = xyes; then
78960bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
7897fe5e51b7Smrg
78980bb88ba4Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
78990bb88ba4Smrg    func_quote_for_eval "${2}"
79000bb88ba4Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
79010bb88ba4Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
7902fe5e51b7Smrg
79030bb88ba4Smrg  # Save a `func_append' function call where possible by direct use of '+='
79040bb88ba4Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
79050bb88ba4Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79060bb88ba4Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79070bb88ba4Smrg  test 0 -eq $? || _lt_function_replace_fail=:
79080bb88ba4Smrgelse
79090bb88ba4Smrg  # Save a `func_append' function call even when '+=' is not available
79100bb88ba4Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
79110bb88ba4Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
79120bb88ba4Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
79130bb88ba4Smrg  test 0 -eq $? || _lt_function_replace_fail=:
79140bb88ba4Smrgfi
7915fe5e51b7Smrg
79160bb88ba4Smrgif test x"$_lt_function_replace_fail" = x":"; then
79170bb88ba4Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
79180bb88ba4Smrgfi
79190bb88ba4Smrg])
7920fe5e51b7Smrg
79210bb88ba4Smrg# _LT_PATH_CONVERSION_FUNCTIONS
79220bb88ba4Smrg# -----------------------------
79230bb88ba4Smrg# Determine which file name conversion functions should be used by
79240bb88ba4Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
79250bb88ba4Smrg# for certain cross-compile configurations and native mingw.
79260bb88ba4Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
79270bb88ba4Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
79280bb88ba4SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
79290bb88ba4SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
79300bb88ba4SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
79310bb88ba4Smrg[case $host in
79320bb88ba4Smrg  *-*-mingw* )
79330bb88ba4Smrg    case $build in
79340bb88ba4Smrg      *-*-mingw* ) # actually msys
79350bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
79360bb88ba4Smrg        ;;
79370bb88ba4Smrg      *-*-cygwin* )
79380bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
79390bb88ba4Smrg        ;;
79400bb88ba4Smrg      * ) # otherwise, assume *nix
79410bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
79420bb88ba4Smrg        ;;
79430bb88ba4Smrg    esac
7944a31a186aSmrg    ;;
79450bb88ba4Smrg  *-*-cygwin* )
79460bb88ba4Smrg    case $build in
79470bb88ba4Smrg      *-*-mingw* ) # actually msys
79480bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
79490bb88ba4Smrg        ;;
79500bb88ba4Smrg      *-*-cygwin* )
79510bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
79520bb88ba4Smrg        ;;
79530bb88ba4Smrg      * ) # otherwise, assume *nix
79540bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
79550bb88ba4Smrg        ;;
79560bb88ba4Smrg    esac
7957a31a186aSmrg    ;;
79580bb88ba4Smrg  * ) # unhandled hosts (and "normal" native builds)
79590bb88ba4Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
79600bb88ba4Smrg    ;;
79610bb88ba4Smrgesac
79620bb88ba4Smrg])
79630bb88ba4Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
79640bb88ba4SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
79650bb88ba4Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
79660bb88ba4Smrg         [0], [convert $build file names to $host format])dnl
79670bb88ba4Smrg
79680bb88ba4SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
79690bb88ba4SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
79700bb88ba4Smrg[#assume ordinary cross tools, or native build.
79710bb88ba4Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
79720bb88ba4Smrgcase $host in
79730bb88ba4Smrg  *-*-mingw* )
79740bb88ba4Smrg    case $build in
79750bb88ba4Smrg      *-*-mingw* ) # actually msys
79760bb88ba4Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
79770bb88ba4Smrg        ;;
79780bb88ba4Smrg    esac
79790bb88ba4Smrg    ;;
79800bb88ba4Smrgesac
7981a31a186aSmrg])
79820bb88ba4Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
79830bb88ba4SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
79840bb88ba4Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
79850bb88ba4Smrg         [0], [convert $build files to toolchain format])dnl
79860bb88ba4Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7987fe5e51b7Smrg
7988a31a186aSmrg# Helper functions for option handling.                    -*- Autoconf -*-
7989a31a186aSmrg#
79900bb88ba4Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
79910bb88ba4Smrg#   Inc.
7992a31a186aSmrg#   Written by Gary V. Vaughan, 2004
7993a31a186aSmrg#
7994a31a186aSmrg# This file is free software; the Free Software Foundation gives
7995a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
7996a31a186aSmrg# modifications, as long as this notice is preserved.
7997fe5e51b7Smrg
79980bb88ba4Smrg# serial 7 ltoptions.m4
7999fe5e51b7Smrg
8000a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8001a31a186aSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8002fe5e51b7Smrg
8003fe5e51b7Smrg
8004a31a186aSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8005a31a186aSmrg# ------------------------------------------
8006a31a186aSmrgm4_define([_LT_MANGLE_OPTION],
8007a31a186aSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8008fe5e51b7Smrg
8009fe5e51b7Smrg
8010a31a186aSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8011a31a186aSmrg# ---------------------------------------
8012a31a186aSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8013a31a186aSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8014a31a186aSmrg# saved as a flag.
8015a31a186aSmrgm4_define([_LT_SET_OPTION],
8016a31a186aSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8017a31a186aSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8018a31a186aSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
8019a31a186aSmrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
8020a31a186aSmrg])
8021fe5e51b7Smrg
8022fe5e51b7Smrg
8023a31a186aSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8024a31a186aSmrg# ------------------------------------------------------------
8025a31a186aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8026a31a186aSmrgm4_define([_LT_IF_OPTION],
8027a31a186aSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8028a31a186aSmrg
8029a31a186aSmrg
8030a31a186aSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8031a31a186aSmrg# -------------------------------------------------------
8032a31a186aSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8033a31a186aSmrg# are set.
8034a31a186aSmrgm4_define([_LT_UNLESS_OPTIONS],
8035a31a186aSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8036a31a186aSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8037a31a186aSmrg		      [m4_define([$0_found])])])[]dnl
8038a31a186aSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8039a31a186aSmrg])[]dnl
8040a31a186aSmrg])
8041fe5e51b7Smrg
8042fe5e51b7Smrg
8043a31a186aSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8044a31a186aSmrg# ----------------------------------------
8045a31a186aSmrg# OPTION-LIST is a space-separated list of Libtool options associated
8046a31a186aSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8047a31a186aSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8048a31a186aSmrg# the unknown option and exit.
8049a31a186aSmrgm4_defun([_LT_SET_OPTIONS],
8050a31a186aSmrg[# Set options
8051a31a186aSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8052a31a186aSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
8053a31a186aSmrg
8054a31a186aSmrgm4_if([$1],[LT_INIT],[
8055a31a186aSmrg  dnl
8056a31a186aSmrg  dnl Simply set some default values (i.e off) if boolean options were not
8057a31a186aSmrg  dnl specified:
8058a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8059a31a186aSmrg  ])
8060a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8061a31a186aSmrg  ])
8062a31a186aSmrg  dnl
8063a31a186aSmrg  dnl If no reference was made to various pairs of opposing options, then
8064a31a186aSmrg  dnl we run the default mode handler for the pair.  For example, if neither
8065a31a186aSmrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
8066a31a186aSmrg  dnl archives by default:
8067a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8068a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8069a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8070a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8071a31a186aSmrg  		   [_LT_ENABLE_FAST_INSTALL])
8072a31a186aSmrg  ])
8073a31a186aSmrg])# _LT_SET_OPTIONS
8074fe5e51b7Smrg
8075fe5e51b7Smrg
8076fe5e51b7Smrg
8077a31a186aSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8078a31a186aSmrg# -----------------------------------------
8079a31a186aSmrgm4_define([_LT_MANGLE_DEFUN],
8080a31a186aSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8081eda3803bSmrg
8082eda3803bSmrg
8083a31a186aSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8084a31a186aSmrg# -----------------------------------------------
8085a31a186aSmrgm4_define([LT_OPTION_DEFINE],
8086a31a186aSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8087a31a186aSmrg])# LT_OPTION_DEFINE
8088eda3803bSmrg
8089eda3803bSmrg
8090a31a186aSmrg# dlopen
8091a31a186aSmrg# ------
8092a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8093a31a186aSmrg])
8094a31a186aSmrg
8095a31a186aSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8096a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8097a31a186aSmrgAC_DIAGNOSE([obsolete],
8098a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8099a31a186aSmrgput the `dlopen' option into LT_INIT's first parameter.])
8100a31a186aSmrg])
8101a31a186aSmrg
8102a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8103a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8104a31a186aSmrg
8105a31a186aSmrg
8106a31a186aSmrg# win32-dll
8107a31a186aSmrg# ---------
8108a31a186aSmrg# Declare package support for building win32 dll's.
8109a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8110a31a186aSmrg[enable_win32_dll=yes
8111a31a186aSmrg
8112a31a186aSmrgcase $host in
81130bb88ba4Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8114a31a186aSmrg  AC_CHECK_TOOL(AS, as, false)
8115a31a186aSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8116a31a186aSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8117a31a186aSmrg  ;;
8118a31a186aSmrgesac
8119fe5e51b7Smrg
8120a31a186aSmrgtest -z "$AS" && AS=as
81210bb88ba4Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8122fe5e51b7Smrg
8123a31a186aSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81240bb88ba4Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8125fe5e51b7Smrg
8126a31a186aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81270bb88ba4Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8128a31a186aSmrg])# win32-dll
8129fe5e51b7Smrg
8130a31a186aSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8131a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8132a31a186aSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8133a31a186aSmrgAC_DIAGNOSE([obsolete],
8134a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8135a31a186aSmrgput the `win32-dll' option into LT_INIT's first parameter.])
8136a31a186aSmrg])
8137fe5e51b7Smrg
8138a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8139a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8140fe5e51b7Smrg
8141fe5e51b7Smrg
8142a31a186aSmrg# _LT_ENABLE_SHARED([DEFAULT])
8143a31a186aSmrg# ----------------------------
8144a31a186aSmrg# implement the --enable-shared flag, and supports the `shared' and
8145a31a186aSmrg# `disable-shared' LT_INIT options.
8146a31a186aSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8147a31a186aSmrgm4_define([_LT_ENABLE_SHARED],
8148a31a186aSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8149a31a186aSmrgAC_ARG_ENABLE([shared],
8150a31a186aSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8151a31a186aSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8152a31a186aSmrg    [p=${PACKAGE-default}
8153a31a186aSmrg    case $enableval in
8154a31a186aSmrg    yes) enable_shared=yes ;;
8155a31a186aSmrg    no) enable_shared=no ;;
8156a31a186aSmrg    *)
8157a31a186aSmrg      enable_shared=no
8158a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
8159a31a186aSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8160a31a186aSmrg      for pkg in $enableval; do
8161a31a186aSmrg	IFS="$lt_save_ifs"
8162a31a186aSmrg	if test "X$pkg" = "X$p"; then
8163a31a186aSmrg	  enable_shared=yes
8164a31a186aSmrg	fi
8165a31a186aSmrg      done
8166a31a186aSmrg      IFS="$lt_save_ifs"
8167fe5e51b7Smrg      ;;
8168a31a186aSmrg    esac],
8169a31a186aSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8170fe5e51b7Smrg
8171a31a186aSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8172a31a186aSmrg	[Whether or not to build shared libraries])
8173a31a186aSmrg])# _LT_ENABLE_SHARED
8174fe5e51b7Smrg
8175a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8176a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8177fe5e51b7Smrg
8178a31a186aSmrg# Old names:
8179a31a186aSmrgAC_DEFUN([AC_ENABLE_SHARED],
8180a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8181a31a186aSmrg])
8182fe5e51b7Smrg
8183a31a186aSmrgAC_DEFUN([AC_DISABLE_SHARED],
8184a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8185a31a186aSmrg])
8186fe5e51b7Smrg
8187a31a186aSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8188a31a186aSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8189fe5e51b7Smrg
8190a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8191a31a186aSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8192a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8193fe5e51b7Smrg
8194fe5e51b7Smrg
8195fe5e51b7Smrg
8196a31a186aSmrg# _LT_ENABLE_STATIC([DEFAULT])
8197a31a186aSmrg# ----------------------------
8198a31a186aSmrg# implement the --enable-static flag, and support the `static' and
8199a31a186aSmrg# `disable-static' LT_INIT options.
8200a31a186aSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8201a31a186aSmrgm4_define([_LT_ENABLE_STATIC],
8202a31a186aSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8203a31a186aSmrgAC_ARG_ENABLE([static],
8204a31a186aSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8205a31a186aSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8206a31a186aSmrg    [p=${PACKAGE-default}
8207a31a186aSmrg    case $enableval in
8208a31a186aSmrg    yes) enable_static=yes ;;
8209a31a186aSmrg    no) enable_static=no ;;
8210a31a186aSmrg    *)
8211a31a186aSmrg     enable_static=no
8212a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
8213a31a186aSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8214a31a186aSmrg      for pkg in $enableval; do
8215a31a186aSmrg	IFS="$lt_save_ifs"
8216a31a186aSmrg	if test "X$pkg" = "X$p"; then
8217a31a186aSmrg	  enable_static=yes
8218a31a186aSmrg	fi
8219a31a186aSmrg      done
8220a31a186aSmrg      IFS="$lt_save_ifs"
8221fe5e51b7Smrg      ;;
8222a31a186aSmrg    esac],
8223a31a186aSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8224fe5e51b7Smrg
8225a31a186aSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
8226a31a186aSmrg	[Whether or not to build static libraries])
8227a31a186aSmrg])# _LT_ENABLE_STATIC
8228fe5e51b7Smrg
8229a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8230a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8231fe5e51b7Smrg
8232a31a186aSmrg# Old names:
8233a31a186aSmrgAC_DEFUN([AC_ENABLE_STATIC],
8234a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8235a31a186aSmrg])
8236fe5e51b7Smrg
8237a31a186aSmrgAC_DEFUN([AC_DISABLE_STATIC],
8238a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8239a31a186aSmrg])
8240fe5e51b7Smrg
8241a31a186aSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8242a31a186aSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8243fe5e51b7Smrg
8244a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8245a31a186aSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8246a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8247fe5e51b7Smrg
8248fe5e51b7Smrg
8249fe5e51b7Smrg
8250a31a186aSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8251a31a186aSmrg# ----------------------------------
8252a31a186aSmrg# implement the --enable-fast-install flag, and support the `fast-install'
8253a31a186aSmrg# and `disable-fast-install' LT_INIT options.
8254a31a186aSmrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8255a31a186aSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
8256a31a186aSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8257a31a186aSmrgAC_ARG_ENABLE([fast-install],
8258a31a186aSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8259a31a186aSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8260a31a186aSmrg    [p=${PACKAGE-default}
8261a31a186aSmrg    case $enableval in
8262a31a186aSmrg    yes) enable_fast_install=yes ;;
8263a31a186aSmrg    no) enable_fast_install=no ;;
8264a31a186aSmrg    *)
8265a31a186aSmrg      enable_fast_install=no
8266a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
8267a31a186aSmrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8268a31a186aSmrg      for pkg in $enableval; do
8269a31a186aSmrg	IFS="$lt_save_ifs"
8270a31a186aSmrg	if test "X$pkg" = "X$p"; then
8271a31a186aSmrg	  enable_fast_install=yes
8272eda3803bSmrg	fi
8273a31a186aSmrg      done
8274a31a186aSmrg      IFS="$lt_save_ifs"
8275fe5e51b7Smrg      ;;
8276a31a186aSmrg    esac],
8277a31a186aSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8278fe5e51b7Smrg
8279a31a186aSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
8280a31a186aSmrg	 [Whether or not to optimize for fast installation])dnl
8281a31a186aSmrg])# _LT_ENABLE_FAST_INSTALL
8282fe5e51b7Smrg
8283a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8284a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8285fe5e51b7Smrg
8286a31a186aSmrg# Old names:
8287a31a186aSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8288a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8289a31a186aSmrgAC_DIAGNOSE([obsolete],
8290a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8291a31a186aSmrgthe `fast-install' option into LT_INIT's first parameter.])
8292a31a186aSmrg])
8293fe5e51b7Smrg
8294a31a186aSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8295a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8296a31a186aSmrgAC_DIAGNOSE([obsolete],
8297a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8298a31a186aSmrgthe `disable-fast-install' option into LT_INIT's first parameter.])
8299a31a186aSmrg])
8300fe5e51b7Smrg
8301a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8302a31a186aSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8303a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8304fe5e51b7Smrg
8305fe5e51b7Smrg
8306a31a186aSmrg# _LT_WITH_PIC([MODE])
8307a31a186aSmrg# --------------------
8308a31a186aSmrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8309a31a186aSmrg# LT_INIT options.
8310a31a186aSmrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
8311a31a186aSmrgm4_define([_LT_WITH_PIC],
8312a31a186aSmrg[AC_ARG_WITH([pic],
83130bb88ba4Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8314a31a186aSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
83150bb88ba4Smrg    [lt_p=${PACKAGE-default}
83160bb88ba4Smrg    case $withval in
83170bb88ba4Smrg    yes|no) pic_mode=$withval ;;
83180bb88ba4Smrg    *)
83190bb88ba4Smrg      pic_mode=default
83200bb88ba4Smrg      # Look at the argument we got.  We use all the common list separators.
83210bb88ba4Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
83220bb88ba4Smrg      for lt_pkg in $withval; do
83230bb88ba4Smrg	IFS="$lt_save_ifs"
83240bb88ba4Smrg	if test "X$lt_pkg" = "X$lt_p"; then
83250bb88ba4Smrg	  pic_mode=yes
83260bb88ba4Smrg	fi
83270bb88ba4Smrg      done
83280bb88ba4Smrg      IFS="$lt_save_ifs"
83290bb88ba4Smrg      ;;
83300bb88ba4Smrg    esac],
8331a31a186aSmrg    [pic_mode=default])
8332a31a186aSmrg
8333a31a186aSmrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8334fe5e51b7Smrg
8335a31a186aSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8336a31a186aSmrg])# _LT_WITH_PIC
8337eda3803bSmrg
8338a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8339a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8340eda3803bSmrg
8341a31a186aSmrg# Old name:
8342a31a186aSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8343a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8344a31a186aSmrgAC_DIAGNOSE([obsolete],
8345a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8346a31a186aSmrgput the `pic-only' option into LT_INIT's first parameter.])
8347fe5e51b7Smrg])
8348fe5e51b7Smrg
8349a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8350a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8351fe5e51b7Smrg
8352fe5e51b7Smrg
8353a31a186aSmrgm4_define([_LTDL_MODE], [])
8354a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8355a31a186aSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8356a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8357a31a186aSmrg		 [m4_define([_LTDL_MODE], [recursive])])
8358a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8359a31a186aSmrg		 [m4_define([_LTDL_MODE], [subproject])])
8360fe5e51b7Smrg
8361a31a186aSmrgm4_define([_LTDL_TYPE], [])
8362a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8363a31a186aSmrg		 [m4_define([_LTDL_TYPE], [installable])])
8364a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8365a31a186aSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
8366fe5e51b7Smrg
8367a31a186aSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8368fe5e51b7Smrg#
8369a31a186aSmrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8370a31a186aSmrg# Written by Gary V. Vaughan, 2004
8371fe5e51b7Smrg#
8372a31a186aSmrg# This file is free software; the Free Software Foundation gives
8373a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8374a31a186aSmrg# modifications, as long as this notice is preserved.
8375a31a186aSmrg
8376a31a186aSmrg# serial 6 ltsugar.m4
8377a31a186aSmrg
8378a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8379a31a186aSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8380a31a186aSmrg
8381a31a186aSmrg
8382a31a186aSmrg# lt_join(SEP, ARG1, [ARG2...])
8383a31a186aSmrg# -----------------------------
8384a31a186aSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8385a31a186aSmrg# associated separator.
8386a31a186aSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8387a31a186aSmrg# versions in m4sugar had bugs.
8388a31a186aSmrgm4_define([lt_join],
8389a31a186aSmrg[m4_if([$#], [1], [],
8390a31a186aSmrg       [$#], [2], [[$2]],
8391a31a186aSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8392a31a186aSmrgm4_define([_lt_join],
8393a31a186aSmrg[m4_if([$#$2], [2], [],
8394a31a186aSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8395a31a186aSmrg
8396a31a186aSmrg
8397a31a186aSmrg# lt_car(LIST)
8398a31a186aSmrg# lt_cdr(LIST)
8399a31a186aSmrg# ------------
8400a31a186aSmrg# Manipulate m4 lists.
8401a31a186aSmrg# These macros are necessary as long as will still need to support
8402a31a186aSmrg# Autoconf-2.59 which quotes differently.
8403a31a186aSmrgm4_define([lt_car], [[$1]])
8404a31a186aSmrgm4_define([lt_cdr],
8405a31a186aSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8406a31a186aSmrg       [$#], 1, [],
8407a31a186aSmrg       [m4_dquote(m4_shift($@))])])
8408a31a186aSmrgm4_define([lt_unquote], $1)
8409a31a186aSmrg
8410a31a186aSmrg
8411a31a186aSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8412a31a186aSmrg# ------------------------------------------
8413a31a186aSmrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8414a31a186aSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8415a31a186aSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8416a31a186aSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8417a31a186aSmrg# than defined and empty).
8418643b027fSmrg#
8419a31a186aSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8420a31a186aSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8421a31a186aSmrgm4_define([lt_append],
8422a31a186aSmrg[m4_define([$1],
8423a31a186aSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8424a31a186aSmrg
8425a31a186aSmrg
8426a31a186aSmrg
8427a31a186aSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8428a31a186aSmrg# ----------------------------------------------------------
8429a31a186aSmrg# Produce a SEP delimited list of all paired combinations of elements of
8430a31a186aSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8431a31a186aSmrg# has the form PREFIXmINFIXSUFFIXn.
8432a31a186aSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8433a31a186aSmrgm4_define([lt_combine],
8434a31a186aSmrg[m4_if(m4_eval([$# > 3]), [1],
8435a31a186aSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8436a31a186aSmrg[[m4_foreach([_Lt_prefix], [$2],
8437a31a186aSmrg	     [m4_foreach([_Lt_suffix],
8438a31a186aSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8439a31a186aSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8440a31a186aSmrg
8441a31a186aSmrg
8442a31a186aSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8443a31a186aSmrg# -----------------------------------------------------------------------
8444a31a186aSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8445a31a186aSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8446a31a186aSmrgm4_define([lt_if_append_uniq],
8447a31a186aSmrg[m4_ifdef([$1],
8448a31a186aSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8449a31a186aSmrg		 [lt_append([$1], [$2], [$3])$4],
8450a31a186aSmrg		 [$5])],
8451a31a186aSmrg	  [lt_append([$1], [$2], [$3])$4])])
8452a31a186aSmrg
8453a31a186aSmrg
8454a31a186aSmrg# lt_dict_add(DICT, KEY, VALUE)
8455a31a186aSmrg# -----------------------------
8456a31a186aSmrgm4_define([lt_dict_add],
8457a31a186aSmrg[m4_define([$1($2)], [$3])])
8458fe5e51b7Smrg
8459eda3803bSmrg
8460a31a186aSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8461a31a186aSmrg# --------------------------------------------
8462a31a186aSmrgm4_define([lt_dict_add_subkey],
8463a31a186aSmrg[m4_define([$1($2:$3)], [$4])])
8464fe5e51b7Smrg
8465fe5e51b7Smrg
8466a31a186aSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8467a31a186aSmrg# ----------------------------------
8468a31a186aSmrgm4_define([lt_dict_fetch],
8469a31a186aSmrg[m4_ifval([$3],
8470a31a186aSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8471a31a186aSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8472fe5e51b7Smrg
8473fe5e51b7Smrg
8474a31a186aSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8475a31a186aSmrg# -----------------------------------------------------------------
8476a31a186aSmrgm4_define([lt_if_dict_fetch],
8477a31a186aSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8478a31a186aSmrg	[$5],
8479a31a186aSmrg    [$6])])
8480fe5e51b7Smrg
8481a31a186aSmrg
8482a31a186aSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8483a31a186aSmrg# --------------------------------------------------------------
8484a31a186aSmrgm4_define([lt_dict_filter],
8485a31a186aSmrg[m4_if([$5], [], [],
8486a31a186aSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8487a31a186aSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8488a31a186aSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8489fe5e51b7Smrg])
8490fe5e51b7Smrg
8491a31a186aSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8492a31a186aSmrg#
8493a31a186aSmrg#   Copyright (C) 2004 Free Software Foundation, Inc.
8494a31a186aSmrg#   Written by Scott James Remnant, 2004
8495a31a186aSmrg#
8496a31a186aSmrg# This file is free software; the Free Software Foundation gives
8497a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8498a31a186aSmrg# modifications, as long as this notice is preserved.
8499fe5e51b7Smrg
85000bb88ba4Smrg# @configure_input@
8501fe5e51b7Smrg
85020bb88ba4Smrg# serial 3337 ltversion.m4
8503a31a186aSmrg# This file is part of GNU Libtool
8504fe5e51b7Smrg
85050bb88ba4Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
85060bb88ba4Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
8507fe5e51b7Smrg
8508a31a186aSmrgAC_DEFUN([LTVERSION_VERSION],
85090bb88ba4Smrg[macro_version='2.4.2'
85100bb88ba4Smrgmacro_revision='1.3337'
8511a31a186aSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8512a31a186aSmrg_LT_DECL(, macro_revision, 0)
8513fe5e51b7Smrg])
8514eda3803bSmrg
8515a31a186aSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8516a31a186aSmrg#
85170bb88ba4Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8518a31a186aSmrg#   Written by Scott James Remnant, 2004.
8519a31a186aSmrg#
8520a31a186aSmrg# This file is free software; the Free Software Foundation gives
8521a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8522a31a186aSmrg# modifications, as long as this notice is preserved.
8523a31a186aSmrg
85240bb88ba4Smrg# serial 5 lt~obsolete.m4
8525a31a186aSmrg
8526a31a186aSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
8527a31a186aSmrg#
8528a31a186aSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8529a31a186aSmrg# which have later been changed to m4_define as they aren't part of the
8530a31a186aSmrg# exported API, or moved to Autoconf or Automake where they belong.
8531a31a186aSmrg#
8532a31a186aSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8533a31a186aSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8534a31a186aSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
8535a31a186aSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8536a31a186aSmrg# and doesn't know about Autoconf macros at all.)
8537a31a186aSmrg#
8538a31a186aSmrg# So we provide this file, which has a silly filename so it's always
8539a31a186aSmrg# included after everything else.  This provides aclocal with the
8540a31a186aSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8541a31a186aSmrg# because those macros already exist, or will be overwritten later.
8542a31a186aSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
8543a31a186aSmrg#
8544a31a186aSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8545a31a186aSmrg# Yes, that means every name once taken will need to remain here until
8546a31a186aSmrg# we give up compatibility with versions before 1.7, at which point
8547a31a186aSmrg# we need to keep only those names which we still refer to.
8548a31a186aSmrg
8549a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8550a31a186aSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8551a31a186aSmrg
8552a31a186aSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8553a31a186aSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8554a31a186aSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8555a31a186aSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8556a31a186aSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8557a31a186aSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8558a31a186aSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8559a31a186aSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8560a31a186aSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8561a31a186aSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8562a31a186aSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8563a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8564a31a186aSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8565a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8566a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8567a31a186aSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8568a31a186aSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8569a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8570a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8571a31a186aSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8572a31a186aSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8573a31a186aSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8574a31a186aSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8575a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8576a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8577a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8578a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8579a31a186aSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8580a31a186aSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8581a31a186aSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8582a31a186aSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8583a31a186aSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8584a31a186aSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8585a31a186aSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8586a31a186aSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8587a31a186aSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8588a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8589a31a186aSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8590a31a186aSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8591a31a186aSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8592a31a186aSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8593a31a186aSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8594a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8595a31a186aSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8596a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8597a31a186aSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8598a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8599a31a186aSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8600a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8601a31a186aSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8602a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8603a31a186aSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8604a31a186aSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
8605a31a186aSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
86060bb88ba4Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
86070bb88ba4Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
86080bb88ba4Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
86090bb88ba4Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
86100bb88ba4Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
86110bb88ba4Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
86120bb88ba4Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8613a31a186aSmrg
8614fe5e51b7Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
86150bb88ba4Smrg# serial 1 (pkg-config-0.24)
8616fe5e51b7Smrg# 
8617fe5e51b7Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8618fe5e51b7Smrg#
8619fe5e51b7Smrg# This program is free software; you can redistribute it and/or modify
8620fe5e51b7Smrg# it under the terms of the GNU General Public License as published by
8621fe5e51b7Smrg# the Free Software Foundation; either version 2 of the License, or
8622fe5e51b7Smrg# (at your option) any later version.
8623fe5e51b7Smrg#
8624fe5e51b7Smrg# This program is distributed in the hope that it will be useful, but
8625fe5e51b7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8626fe5e51b7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8627fe5e51b7Smrg# General Public License for more details.
8628fe5e51b7Smrg#
8629fe5e51b7Smrg# You should have received a copy of the GNU General Public License
8630fe5e51b7Smrg# along with this program; if not, write to the Free Software
8631fe5e51b7Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8632fe5e51b7Smrg#
8633fe5e51b7Smrg# As a special exception to the GNU General Public License, if you
8634fe5e51b7Smrg# distribute this file as part of a program that contains a
8635fe5e51b7Smrg# configuration script generated by Autoconf, you may include it under
8636fe5e51b7Smrg# the same distribution terms that you use for the rest of that program.
8637fe5e51b7Smrg
8638fe5e51b7Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8639fe5e51b7Smrg# ----------------------------------
8640fe5e51b7SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8641fe5e51b7Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8642fe5e51b7Smrgm4_pattern_allow([^PKG_CONFIG(_PATH)?$])
86430bb88ba4SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
86440bb88ba4SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
86450bb88ba4SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
86460bb88ba4Smrg
8647fe5e51b7Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8648fe5e51b7Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8649fe5e51b7Smrgfi
8650fe5e51b7Smrgif test -n "$PKG_CONFIG"; then
8651fe5e51b7Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
8652fe5e51b7Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8653fe5e51b7Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8654fe5e51b7Smrg		AC_MSG_RESULT([yes])
8655fe5e51b7Smrg	else
8656fe5e51b7Smrg		AC_MSG_RESULT([no])
8657fe5e51b7Smrg		PKG_CONFIG=""
8658fe5e51b7Smrg	fi
8659fe5e51b7Smrgfi[]dnl
8660fe5e51b7Smrg])# PKG_PROG_PKG_CONFIG
8661fe5e51b7Smrg
8662fe5e51b7Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8663fe5e51b7Smrg#
8664fe5e51b7Smrg# Check to see whether a particular set of modules exists.  Similar
8665fe5e51b7Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8666fe5e51b7Smrg#
86670bb88ba4Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
86680bb88ba4Smrg# only at the first occurence in configure.ac, so if the first place
86690bb88ba4Smrg# it's called might be skipped (such as if it is within an "if", you
86700bb88ba4Smrg# have to call PKG_CHECK_EXISTS manually
8671fe5e51b7Smrg# --------------------------------------------------------------
8672fe5e51b7SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8673fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8674fe5e51b7Smrgif test -n "$PKG_CONFIG" && \
8675fe5e51b7Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
86760bb88ba4Smrg  m4_default([$2], [:])
8677fe5e51b7Smrgm4_ifvaln([$3], [else
8678fe5e51b7Smrg  $3])dnl
8679fe5e51b7Smrgfi])
8680fe5e51b7Smrg
8681fe5e51b7Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8682fe5e51b7Smrg# ---------------------------------------------
8683fe5e51b7Smrgm4_define([_PKG_CONFIG],
8684eda3803bSmrg[if test -n "$$1"; then
8685eda3803bSmrg    pkg_cv_[]$1="$$1"
8686eda3803bSmrg elif test -n "$PKG_CONFIG"; then
8687eda3803bSmrg    PKG_CHECK_EXISTS([$3],
8688eda3803bSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
8689eda3803bSmrg		     [pkg_failed=yes])
8690eda3803bSmrg else
8691eda3803bSmrg    pkg_failed=untried
8692fe5e51b7Smrgfi[]dnl
8693fe5e51b7Smrg])# _PKG_CONFIG
8694fe5e51b7Smrg
8695fe5e51b7Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8696fe5e51b7Smrg# -----------------------------
8697fe5e51b7SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8698fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8699fe5e51b7Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8700fe5e51b7Smrg        _pkg_short_errors_supported=yes
8701fe5e51b7Smrgelse
8702fe5e51b7Smrg        _pkg_short_errors_supported=no
8703fe5e51b7Smrgfi[]dnl
8704fe5e51b7Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
8705fe5e51b7Smrg
8706fe5e51b7Smrg
8707fe5e51b7Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8708fe5e51b7Smrg# [ACTION-IF-NOT-FOUND])
8709fe5e51b7Smrg#
8710fe5e51b7Smrg#
8711fe5e51b7Smrg# Note that if there is a possibility the first call to
8712fe5e51b7Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8713fe5e51b7Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8714fe5e51b7Smrg#
8715fe5e51b7Smrg#
8716fe5e51b7Smrg# --------------------------------------------------------------
8717fe5e51b7SmrgAC_DEFUN([PKG_CHECK_MODULES],
8718fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8719fe5e51b7SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8720fe5e51b7SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
8721fe5e51b7Smrg
8722fe5e51b7Smrgpkg_failed=no
8723fe5e51b7SmrgAC_MSG_CHECKING([for $1])
8724fe5e51b7Smrg
8725fe5e51b7Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8726fe5e51b7Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
8727fe5e51b7Smrg
8728fe5e51b7Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8729fe5e51b7Smrgand $1[]_LIBS to avoid the need to call pkg-config.
8730fe5e51b7SmrgSee the pkg-config man page for more details.])
8731fe5e51b7Smrg
8732fe5e51b7Smrgif test $pkg_failed = yes; then
87330bb88ba4Smrg   	AC_MSG_RESULT([no])
8734fe5e51b7Smrg        _PKG_SHORT_ERRORS_SUPPORTED
8735fe5e51b7Smrg        if test $_pkg_short_errors_supported = yes; then
8736eda3803bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
8737fe5e51b7Smrg        else 
8738eda3803bSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
8739fe5e51b7Smrg        fi
8740fe5e51b7Smrg	# Put the nasty error message in config.log where it belongs
8741fe5e51b7Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8742fe5e51b7Smrg
87430bb88ba4Smrg	m4_default([$4], [AC_MSG_ERROR(
8744fe5e51b7Smrg[Package requirements ($2) were not met:
8745fe5e51b7Smrg
8746fe5e51b7Smrg$$1_PKG_ERRORS
8747fe5e51b7Smrg
8748fe5e51b7SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8749fe5e51b7Smrginstalled software in a non-standard prefix.
8750fe5e51b7Smrg
87510bb88ba4Smrg_PKG_TEXT])
87520bb88ba4Smrg        ])
8753fe5e51b7Smrgelif test $pkg_failed = untried; then
87540bb88ba4Smrg     	AC_MSG_RESULT([no])
87550bb88ba4Smrg	m4_default([$4], [AC_MSG_FAILURE(
8756fe5e51b7Smrg[The pkg-config script could not be found or is too old.  Make sure it
8757fe5e51b7Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8758fe5e51b7Smrgpath to pkg-config.
8759fe5e51b7Smrg
8760fe5e51b7Smrg_PKG_TEXT
8761fe5e51b7Smrg
87620bb88ba4SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])
87630bb88ba4Smrg        ])
8764fe5e51b7Smrgelse
8765fe5e51b7Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8766fe5e51b7Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8767fe5e51b7Smrg        AC_MSG_RESULT([yes])
87680bb88ba4Smrg	$3
8769fe5e51b7Smrgfi[]dnl
8770fe5e51b7Smrg])# PKG_CHECK_MODULES
8771fe5e51b7Smrg
8772eda3803bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
8773fe5e51b7Smrgdnl
87740bb88ba4Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
8775fe5e51b7Smrgdnl 
8776fe5e51b7Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
8777d7be9c72Smrgdnl copy of this software and associated documentation files (the "Software"),
8778d7be9c72Smrgdnl to deal in the Software without restriction, including without limitation
8779d7be9c72Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
8780d7be9c72Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
8781d7be9c72Smrgdnl Software is furnished to do so, subject to the following conditions:
8782fe5e51b7Smrgdnl
8783d7be9c72Smrgdnl The above copyright notice and this permission notice (including the next
8784d7be9c72Smrgdnl paragraph) shall be included in all copies or substantial portions of the
8785d7be9c72Smrgdnl Software.
8786fe5e51b7Smrgdnl
8787d7be9c72Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8788d7be9c72Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8789d7be9c72Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
8790d7be9c72Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
8791d7be9c72Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
8792d7be9c72Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
8793d7be9c72Smrgdnl DEALINGS IN THE SOFTWARE.
8794fe5e51b7Smrg
8795fe5e51b7Smrg# XORG_MACROS_VERSION(required-version)
8796fe5e51b7Smrg# -------------------------------------
8797fe5e51b7Smrg# Minimum version: 1.1.0
8798fe5e51b7Smrg#
8799fe5e51b7Smrg# If you're using a macro added in Version 1.1 or newer, include this in
8800fe5e51b7Smrg# your configure.ac with the minimum required version, such as:
8801fe5e51b7Smrg# XORG_MACROS_VERSION(1.1)
8802fe5e51b7Smrg#
8803a31a186aSmrg# To ensure that this macro is defined, also add:
8804a31a186aSmrg# m4_ifndef([XORG_MACROS_VERSION],
8805a31a186aSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
8806fe5e51b7Smrg#
8807fe5e51b7Smrg#
8808fe5e51b7Smrg# See the "minimum version" comment for each macro you use to see what 
8809fe5e51b7Smrg# version you require.
8810a31a186aSmrgm4_defun([XORG_MACROS_VERSION],[
88110bb88ba4Smrgm4_define([vers_have], [1.17])
8812a31a186aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
8813a31a186aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
8814a31a186aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
8815a31a186aSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
8816a31a186aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
8817a31a186aSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
8818a31a186aSmrgm4_undefine([vers_have])
8819a31a186aSmrgm4_undefine([maj_have])
8820a31a186aSmrgm4_undefine([maj_needed])
8821fe5e51b7Smrg]) # XORG_MACROS_VERSION
8822fe5e51b7Smrg
8823fe5e51b7Smrg# XORG_PROG_RAWCPP()
8824fe5e51b7Smrg# ------------------
8825fe5e51b7Smrg# Minimum version: 1.0.0
8826fe5e51b7Smrg#
8827fe5e51b7Smrg# Find cpp program and necessary flags for use in pre-processing text files
8828fe5e51b7Smrg# such as man pages and config files
8829fe5e51b7SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
8830fe5e51b7SmrgAC_REQUIRE([AC_PROG_CPP])
8831fe5e51b7SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], 
8832fe5e51b7Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
8833fe5e51b7Smrg
8834fe5e51b7Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
8835fe5e51b7Smrg# which is not the best choice for supporting other OS'es, but covers most
8836fe5e51b7Smrg# of the ones we need for now.
8837fe5e51b7SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
88380bb88ba4SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
8839fe5e51b7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8840fe5e51b7Smrg	AC_MSG_RESULT([no])
8841fe5e51b7Smrgelse
8842fe5e51b7Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8843fe5e51b7Smrg		RAWCPPFLAGS=-undef
8844fe5e51b7Smrg		AC_MSG_RESULT([yes])
8845eda3803bSmrg	# under Cygwin unix is still defined even with -undef
8846eda3803bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
8847eda3803bSmrg		RAWCPPFLAGS="-undef -ansi"
8848eda3803bSmrg		AC_MSG_RESULT([yes, with -ansi])
8849fe5e51b7Smrg	else
8850fe5e51b7Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
8851fe5e51b7Smrg	fi
8852fe5e51b7Smrgfi
8853fe5e51b7Smrgrm -f conftest.$ac_ext
8854fe5e51b7Smrg
8855fe5e51b7SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
88560bb88ba4SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
8857fe5e51b7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8858fe5e51b7Smrg	AC_MSG_RESULT([no])
8859fe5e51b7Smrgelse
8860fe5e51b7Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
8861fe5e51b7Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
8862fe5e51b7Smrg		AC_MSG_RESULT([yes])
8863fe5e51b7Smrg	else
8864fe5e51b7Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
8865fe5e51b7Smrg	fi
8866fe5e51b7Smrgfi
8867fe5e51b7Smrgrm -f conftest.$ac_ext
8868fe5e51b7SmrgAC_SUBST(RAWCPPFLAGS)
8869fe5e51b7Smrg]) # XORG_PROG_RAWCPP
8870fe5e51b7Smrg
8871fe5e51b7Smrg# XORG_MANPAGE_SECTIONS()
8872fe5e51b7Smrg# -----------------------
8873fe5e51b7Smrg# Minimum version: 1.0.0
8874fe5e51b7Smrg#
8875fe5e51b7Smrg# Determine which sections man pages go in for the different man page types
8876fe5e51b7Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
8877fe5e51b7Smrg# Not sure if there's any better way than just hardcoding by OS name.
8878fe5e51b7Smrg# Override default settings by setting environment variables
8879d7be9c72Smrg# Added MAN_SUBSTS in version 1.8
8880d7be9c72Smrg# Added AC_PROG_SED in version 1.8
8881fe5e51b7Smrg
8882fe5e51b7SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
8883fe5e51b7SmrgAC_REQUIRE([AC_CANONICAL_HOST])
8884d7be9c72SmrgAC_REQUIRE([AC_PROG_SED])
8885fe5e51b7Smrg
8886fe5e51b7Smrgif test x$APP_MAN_SUFFIX = x    ; then
8887fe5e51b7Smrg    APP_MAN_SUFFIX=1
8888fe5e51b7Smrgfi
8889fe5e51b7Smrgif test x$APP_MAN_DIR = x    ; then
8890fe5e51b7Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
8891fe5e51b7Smrgfi
8892fe5e51b7Smrg
8893fe5e51b7Smrgif test x$LIB_MAN_SUFFIX = x    ; then
8894fe5e51b7Smrg    LIB_MAN_SUFFIX=3
8895fe5e51b7Smrgfi
8896fe5e51b7Smrgif test x$LIB_MAN_DIR = x    ; then
8897fe5e51b7Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
8898fe5e51b7Smrgfi
8899fe5e51b7Smrg
8900fe5e51b7Smrgif test x$FILE_MAN_SUFFIX = x    ; then
8901fe5e51b7Smrg    case $host_os in
8902fe5e51b7Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
8903fe5e51b7Smrg	*)		FILE_MAN_SUFFIX=5  ;;
8904fe5e51b7Smrg    esac
8905fe5e51b7Smrgfi
8906fe5e51b7Smrgif test x$FILE_MAN_DIR = x    ; then
8907fe5e51b7Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
8908fe5e51b7Smrgfi
8909fe5e51b7Smrg
8910fe5e51b7Smrgif test x$MISC_MAN_SUFFIX = x    ; then
8911fe5e51b7Smrg    case $host_os in
8912fe5e51b7Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
8913fe5e51b7Smrg	*)		MISC_MAN_SUFFIX=7  ;;
8914fe5e51b7Smrg    esac
8915fe5e51b7Smrgfi
8916fe5e51b7Smrgif test x$MISC_MAN_DIR = x    ; then
8917fe5e51b7Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
8918fe5e51b7Smrgfi
8919fe5e51b7Smrg
8920fe5e51b7Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
8921fe5e51b7Smrg    case $host_os in
8922fe5e51b7Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
8923fe5e51b7Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
8924fe5e51b7Smrg    esac
8925fe5e51b7Smrgfi
8926fe5e51b7Smrgif test x$DRIVER_MAN_DIR = x    ; then
8927fe5e51b7Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
8928fe5e51b7Smrgfi
8929fe5e51b7Smrg
8930fe5e51b7Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
8931fe5e51b7Smrg    case $host_os in
8932fe5e51b7Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
8933fe5e51b7Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
8934fe5e51b7Smrg    esac
8935fe5e51b7Smrgfi
8936fe5e51b7Smrgif test x$ADMIN_MAN_DIR = x    ; then
8937fe5e51b7Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
8938fe5e51b7Smrgfi
8939fe5e51b7Smrg
8940fe5e51b7Smrg
8941fe5e51b7SmrgAC_SUBST([APP_MAN_SUFFIX])
8942fe5e51b7SmrgAC_SUBST([LIB_MAN_SUFFIX])
8943fe5e51b7SmrgAC_SUBST([FILE_MAN_SUFFIX])
8944fe5e51b7SmrgAC_SUBST([MISC_MAN_SUFFIX])
8945fe5e51b7SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
8946fe5e51b7SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
8947fe5e51b7SmrgAC_SUBST([APP_MAN_DIR])
8948fe5e51b7SmrgAC_SUBST([LIB_MAN_DIR])
8949fe5e51b7SmrgAC_SUBST([FILE_MAN_DIR])
8950fe5e51b7SmrgAC_SUBST([MISC_MAN_DIR])
8951fe5e51b7SmrgAC_SUBST([DRIVER_MAN_DIR])
8952fe5e51b7SmrgAC_SUBST([ADMIN_MAN_DIR])
8953d7be9c72Smrg
8954d7be9c72SmrgXORG_MAN_PAGE="X Version 11"
8955d7be9c72SmrgAC_SUBST([XORG_MAN_PAGE])
8956d7be9c72SmrgMAN_SUBSTS="\
8957d7be9c72Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8958d7be9c72Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
8959d7be9c72Smrg	-e 's|__xservername__|Xorg|g' \
8960d7be9c72Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
8961d7be9c72Smrg	-e 's|__projectroot__|\$(prefix)|g' \
89620bb88ba4Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
8963d7be9c72Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
8964d7be9c72Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
8965d7be9c72Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
8966d7be9c72Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
8967d7be9c72Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
8968d7be9c72Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
8969d7be9c72SmrgAC_SUBST([MAN_SUBSTS])
8970d7be9c72Smrg
8971fe5e51b7Smrg]) # XORG_MANPAGE_SECTIONS
8972fe5e51b7Smrg
8973d7be9c72Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
8974d7be9c72Smrg# ------------------------
8975d7be9c72Smrg# Minimum version: 1.7.0
8976d7be9c72Smrg#
8977d7be9c72Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
8978d7be9c72Smrg# provided by xorg-sgml-doctools, if installed.
8979d7be9c72SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
8980d7be9c72SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
8981d7be9c72SmrgXORG_SGML_PATH=
8982d7be9c72SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
8983d7be9c72Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
8984d7be9c72Smrg    [m4_ifval([$1],[:],
8985d7be9c72Smrg        [if test x"$cross_compiling" != x"yes" ; then
8986d7be9c72Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
8987d7be9c72Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
8988d7be9c72Smrg         fi])
8989d7be9c72Smrg    ])
8990d7be9c72Smrg
8991d7be9c72Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
8992d7be9c72Smrg# the path and the name of the doc stylesheet
8993d7be9c72Smrgif test "x$XORG_SGML_PATH" != "x" ; then
8994d7be9c72Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
8995d7be9c72Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
8996d7be9c72Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
8997d7be9c72Smrgelse
8998d7be9c72Smrg   AC_MSG_RESULT([no])
8999d7be9c72Smrgfi
9000d7be9c72Smrg
9001d7be9c72SmrgAC_SUBST(XORG_SGML_PATH)
9002d7be9c72SmrgAC_SUBST(STYLESHEET_SRCDIR)
9003d7be9c72SmrgAC_SUBST(XSL_STYLESHEET)
9004d7be9c72SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9005d7be9c72Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9006d7be9c72Smrg
9007fe5e51b7Smrg# XORG_CHECK_LINUXDOC
9008fe5e51b7Smrg# -------------------
9009fe5e51b7Smrg# Minimum version: 1.0.0
9010fe5e51b7Smrg#
9011fe5e51b7Smrg# Defines the variable MAKE_TEXT if the necessary tools and
9012fe5e51b7Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9013fe5e51b7Smrg# Whether or not the necessary tools and files are found can be checked
9014fe5e51b7Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9015fe5e51b7SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9016d7be9c72SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9017d7be9c72SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9018fe5e51b7Smrg
9019fe5e51b7SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9020fe5e51b7Smrg
9021d7be9c72SmrgAC_MSG_CHECKING([whether to build documentation])
9022fe5e51b7Smrg
9023d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9024fe5e51b7Smrg   BUILDDOC=yes
9025fe5e51b7Smrgelse
9026fe5e51b7Smrg   BUILDDOC=no
9027fe5e51b7Smrgfi
9028fe5e51b7Smrg
9029fe5e51b7SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9030fe5e51b7Smrg
9031fe5e51b7SmrgAC_MSG_RESULT([$BUILDDOC])
9032fe5e51b7Smrg
9033d7be9c72SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9034fe5e51b7Smrg
9035d7be9c72Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9036fe5e51b7Smrg   BUILDPDFDOC=yes
9037fe5e51b7Smrgelse
9038fe5e51b7Smrg   BUILDPDFDOC=no
9039fe5e51b7Smrgfi
9040fe5e51b7Smrg
9041fe5e51b7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9042fe5e51b7Smrg
9043fe5e51b7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9044fe5e51b7Smrg
9045d7be9c72SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9046fe5e51b7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9047fe5e51b7SmrgMAKE_PDF="$PS2PDF"
9048fe5e51b7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9049fe5e51b7Smrg
9050fe5e51b7SmrgAC_SUBST(MAKE_TEXT)
9051fe5e51b7SmrgAC_SUBST(MAKE_PS)
9052fe5e51b7SmrgAC_SUBST(MAKE_PDF)
9053fe5e51b7SmrgAC_SUBST(MAKE_HTML)
9054fe5e51b7Smrg]) # XORG_CHECK_LINUXDOC
9055fe5e51b7Smrg
9056fe5e51b7Smrg# XORG_CHECK_DOCBOOK
9057fe5e51b7Smrg# -------------------
9058fe5e51b7Smrg# Minimum version: 1.0.0
9059fe5e51b7Smrg#
9060fe5e51b7Smrg# Checks for the ability to build output formats from SGML DocBook source.
9061fe5e51b7Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9062fe5e51b7Smrg# indicates whether the necessary tools and files are found and, if set,
9063fe5e51b7Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9064fe5e51b7SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9065d7be9c72SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9066d7be9c72Smrg
9067fe5e51b7SmrgBUILDTXTDOC=no
9068fe5e51b7SmrgBUILDPDFDOC=no
9069fe5e51b7SmrgBUILDPSDOC=no
9070fe5e51b7SmrgBUILDHTMLDOC=no
9071fe5e51b7Smrg
9072fe5e51b7SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9073fe5e51b7SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9074fe5e51b7SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9075fe5e51b7SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9076fe5e51b7Smrg
9077d7be9c72SmrgAC_MSG_CHECKING([whether to build text documentation])
9078d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9079fe5e51b7Smrg   test x$BUILD_TXTDOC != xno; then
9080fe5e51b7Smrg	BUILDTXTDOC=yes
9081fe5e51b7Smrgfi
9082fe5e51b7SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9083fe5e51b7SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9084fe5e51b7Smrg
9085d7be9c72SmrgAC_MSG_CHECKING([whether to build PDF documentation])
9086d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9087fe5e51b7Smrg   test x$BUILD_PDFDOC != xno; then
9088fe5e51b7Smrg	BUILDPDFDOC=yes
9089fe5e51b7Smrgfi
9090fe5e51b7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9091fe5e51b7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9092fe5e51b7Smrg
9093d7be9c72SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9094d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9095fe5e51b7Smrg   test x$BUILD_PSDOC != xno; then
9096fe5e51b7Smrg	BUILDPSDOC=yes
9097fe5e51b7Smrgfi
9098fe5e51b7SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9099fe5e51b7SmrgAC_MSG_RESULT([$BUILDPSDOC])
9100fe5e51b7Smrg
9101d7be9c72SmrgAC_MSG_CHECKING([whether to build HTML documentation])
9102d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9103fe5e51b7Smrg   test x$BUILD_HTMLDOC != xno; then
9104fe5e51b7Smrg	BUILDHTMLDOC=yes
9105fe5e51b7Smrgfi
9106fe5e51b7SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9107fe5e51b7SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9108fe5e51b7Smrg
9109fe5e51b7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9110fe5e51b7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9111fe5e51b7SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9112fe5e51b7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9113fe5e51b7Smrg
9114fe5e51b7SmrgAC_SUBST(MAKE_TEXT)
9115fe5e51b7SmrgAC_SUBST(MAKE_PS)
9116fe5e51b7SmrgAC_SUBST(MAKE_PDF)
9117fe5e51b7SmrgAC_SUBST(MAKE_HTML)
9118fe5e51b7Smrg]) # XORG_CHECK_DOCBOOK
9119fe5e51b7Smrg
91200bb88ba4Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9121d7be9c72Smrg# ----------------
9122d7be9c72Smrg# Minimum version: 1.5.0
91230bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9124d7be9c72Smrg#
9125d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9126d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9127d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9128d7be9c72Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
91290bb88ba4Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
91300bb88ba4Smrg# --with-xmlto assumes 'auto'.
9131d7be9c72Smrg#
9132d7be9c72Smrg# Interface to module:
9133d7be9c72Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9134d7be9c72Smrg# XMLTO:	returns the path of the xmlto program found
9135d7be9c72Smrg#		returns the path set by the user in the environment
9136d7be9c72Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9137d7be9c72Smrg#		'no' user instructs the module not to use xmlto
9138d7be9c72Smrg#
9139d7be9c72Smrg# Added in version 1.10.0
9140d7be9c72Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9141d7be9c72Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9142d7be9c72Smrg#
9143d7be9c72Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9144d7be9c72Smrg#
9145d7be9c72SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9146d7be9c72SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
91470bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9148d7be9c72SmrgAC_ARG_WITH(xmlto,
9149d7be9c72Smrg	AS_HELP_STRING([--with-xmlto],
91500bb88ba4Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
91510bb88ba4Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
91520bb88ba4Smrgm4_undefine([_defopt])
9153d7be9c72Smrg
9154d7be9c72Smrgif test "x$use_xmlto" = x"auto"; then
9155d7be9c72Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9156d7be9c72Smrg   if test "x$XMLTO" = "x"; then
9157d7be9c72Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9158d7be9c72Smrg	have_xmlto=no
9159d7be9c72Smrg   else
9160d7be9c72Smrg        have_xmlto=yes
9161d7be9c72Smrg   fi
9162d7be9c72Smrgelif test "x$use_xmlto" = x"yes" ; then
9163d7be9c72Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9164d7be9c72Smrg   if test "x$XMLTO" = "x"; then
9165d7be9c72Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9166d7be9c72Smrg   fi
9167d7be9c72Smrg   have_xmlto=yes
9168d7be9c72Smrgelif test "x$use_xmlto" = x"no" ; then
9169d7be9c72Smrg   if test "x$XMLTO" != "x"; then
9170d7be9c72Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9171d7be9c72Smrg   fi
9172d7be9c72Smrg   have_xmlto=no
9173d7be9c72Smrgelse
9174d7be9c72Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9175d7be9c72Smrgfi
9176d7be9c72Smrg
9177d7be9c72Smrg# Test for a minimum version of xmlto, if provided.
9178d7be9c72Smrgm4_ifval([$1],
9179d7be9c72Smrg[if test "$have_xmlto" = yes; then
9180d7be9c72Smrg    # scrape the xmlto version
9181d7be9c72Smrg    AC_MSG_CHECKING([the xmlto version])
9182d7be9c72Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9183d7be9c72Smrg    AC_MSG_RESULT([$xmlto_version])
9184d7be9c72Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9185d7be9c72Smrg        [if test "x$use_xmlto" = xauto; then
9186d7be9c72Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9187d7be9c72Smrg            have_xmlto=no
9188d7be9c72Smrg        else
9189d7be9c72Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9190d7be9c72Smrg        fi])
9191d7be9c72Smrgfi])
9192d7be9c72Smrg
9193d7be9c72Smrg# Test for the ability of xmlto to generate a text target
9194d7be9c72Smrghave_xmlto_text=no
9195d7be9c72Smrgcat > conftest.xml << "EOF"
9196d7be9c72SmrgEOF
9197d7be9c72SmrgAS_IF([test "$have_xmlto" = yes],
9198d7be9c72Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9199d7be9c72Smrg             [have_xmlto_text=yes],
9200d7be9c72Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9201d7be9c72Smrgrm -f conftest.xml
9202d7be9c72SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9203d7be9c72SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9204d7be9c72Smrg]) # XORG_WITH_XMLTO
9205d7be9c72Smrg
92060bb88ba4Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
92070bb88ba4Smrg# --------------------------------------------
92080bb88ba4Smrg# Minimum version: 1.12.0
92090bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.12.0
92100bb88ba4Smrg#
92110bb88ba4Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
92120bb88ba4Smrg# XML-based language used for the transformation of XML documents.
92130bb88ba4Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
92140bb88ba4Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
92150bb88ba4Smrg# The XSLT processor is often used as a standalone tool for transformations.
92160bb88ba4Smrg# It should not be assumed that this tool is used only to work with documnetation.
92170bb88ba4Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
92180bb88ba4Smrg#
92190bb88ba4Smrg# Interface to module:
92200bb88ba4Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
92210bb88ba4Smrg# XSLTPROC:	 returns the path of the xsltproc program found
92220bb88ba4Smrg#		 returns the path set by the user in the environment
92230bb88ba4Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
92240bb88ba4Smrg#		  'no' user instructs the module not to use xsltproc
92250bb88ba4Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
92260bb88ba4Smrg#
92270bb88ba4Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
92280bb88ba4Smrg#
92290bb88ba4SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
92300bb88ba4SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
92310bb88ba4Smrg# Preserves the interface, should it be implemented later
92320bb88ba4Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
92330bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
92340bb88ba4SmrgAC_ARG_WITH(xsltproc,
92350bb88ba4Smrg	AS_HELP_STRING([--with-xsltproc],
92360bb88ba4Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
92370bb88ba4Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
92380bb88ba4Smrgm4_undefine([_defopt])
92390bb88ba4Smrg
92400bb88ba4Smrgif test "x$use_xsltproc" = x"auto"; then
92410bb88ba4Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
92420bb88ba4Smrg   if test "x$XSLTPROC" = "x"; then
92430bb88ba4Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
92440bb88ba4Smrg	have_xsltproc=no
92450bb88ba4Smrg   else
92460bb88ba4Smrg        have_xsltproc=yes
92470bb88ba4Smrg   fi
92480bb88ba4Smrgelif test "x$use_xsltproc" = x"yes" ; then
92490bb88ba4Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
92500bb88ba4Smrg   if test "x$XSLTPROC" = "x"; then
92510bb88ba4Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
92520bb88ba4Smrg   fi
92530bb88ba4Smrg   have_xsltproc=yes
92540bb88ba4Smrgelif test "x$use_xsltproc" = x"no" ; then
92550bb88ba4Smrg   if test "x$XSLTPROC" != "x"; then
92560bb88ba4Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
92570bb88ba4Smrg   fi
92580bb88ba4Smrg   have_xsltproc=no
92590bb88ba4Smrgelse
92600bb88ba4Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
92610bb88ba4Smrgfi
92620bb88ba4Smrg
92630bb88ba4SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
92640bb88ba4Smrg]) # XORG_WITH_XSLTPROC
92650bb88ba4Smrg
92660bb88ba4Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
92670bb88ba4Smrg# ----------------------------------------
92680bb88ba4Smrg# Minimum version: 1.15.0
92690bb88ba4Smrg#
92700bb88ba4Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
92710bb88ba4Smrg# scanning arbitrary text files, extracting information from those text files,
92720bb88ba4Smrg# and printing reports based on that information.
92730bb88ba4Smrg#
92740bb88ba4Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
92750bb88ba4Smrg#
92760bb88ba4Smrg# Interface to module:
92770bb88ba4Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
92780bb88ba4Smrg# PERL:	     returns the path of the perl program found
92790bb88ba4Smrg#	     returns the path set by the user in the environment
92800bb88ba4Smrg# --with-perl: 'yes' user instructs the module to use perl
92810bb88ba4Smrg#	       'no' user instructs the module not to use perl
92820bb88ba4Smrg# have_perl: returns yes if perl found in PATH or no
92830bb88ba4Smrg#
92840bb88ba4Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
92850bb88ba4Smrg#
92860bb88ba4SmrgAC_DEFUN([XORG_WITH_PERL],[
92870bb88ba4SmrgAC_ARG_VAR([PERL], [Path to perl command])
92880bb88ba4Smrg# Preserves the interface, should it be implemented later
92890bb88ba4Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
92900bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
92910bb88ba4SmrgAC_ARG_WITH(perl,
92920bb88ba4Smrg	AS_HELP_STRING([--with-perl],
92930bb88ba4Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
92940bb88ba4Smrg	   [use_perl=$withval], [use_perl=]_defopt)
92950bb88ba4Smrgm4_undefine([_defopt])
92960bb88ba4Smrg
92970bb88ba4Smrgif test "x$use_perl" = x"auto"; then
92980bb88ba4Smrg   AC_PATH_PROG([PERL], [perl])
92990bb88ba4Smrg   if test "x$PERL" = "x"; then
93000bb88ba4Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
93010bb88ba4Smrg	have_perl=no
93020bb88ba4Smrg   else
93030bb88ba4Smrg        have_perl=yes
93040bb88ba4Smrg   fi
93050bb88ba4Smrgelif test "x$use_perl" = x"yes" ; then
93060bb88ba4Smrg   AC_PATH_PROG([PERL], [perl])
93070bb88ba4Smrg   if test "x$PERL" = "x"; then
93080bb88ba4Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
93090bb88ba4Smrg   fi
93100bb88ba4Smrg   have_perl=yes
93110bb88ba4Smrgelif test "x$use_perl" = x"no" ; then
93120bb88ba4Smrg   if test "x$PERL" != "x"; then
93130bb88ba4Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
93140bb88ba4Smrg   fi
93150bb88ba4Smrg   have_perl=no
93160bb88ba4Smrgelse
93170bb88ba4Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
93180bb88ba4Smrgfi
93190bb88ba4Smrg
93200bb88ba4SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
93210bb88ba4Smrg]) # XORG_WITH_PERL
93220bb88ba4Smrg
93230bb88ba4Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9324d7be9c72Smrg# ----------------
9325d7be9c72Smrg# Minimum version: 1.5.0
93260bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9327d7be9c72Smrg#
9328d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9329d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9330d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9331d7be9c72Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
93320bb88ba4Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
93330bb88ba4Smrg# --with-asciidoc assumes 'auto'.
9334d7be9c72Smrg#
9335d7be9c72Smrg# Interface to module:
9336d7be9c72Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9337d7be9c72Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
9338d7be9c72Smrg#		 returns the path set by the user in the environment
9339d7be9c72Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9340d7be9c72Smrg#		  'no' user instructs the module not to use asciidoc
9341d7be9c72Smrg#
9342d7be9c72Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9343d7be9c72Smrg#
9344d7be9c72SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9345d7be9c72SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
93460bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9347d7be9c72SmrgAC_ARG_WITH(asciidoc,
9348d7be9c72Smrg	AS_HELP_STRING([--with-asciidoc],
93490bb88ba4Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
93500bb88ba4Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
93510bb88ba4Smrgm4_undefine([_defopt])
9352d7be9c72Smrg
9353d7be9c72Smrgif test "x$use_asciidoc" = x"auto"; then
9354d7be9c72Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9355d7be9c72Smrg   if test "x$ASCIIDOC" = "x"; then
9356d7be9c72Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9357d7be9c72Smrg	have_asciidoc=no
9358d7be9c72Smrg   else
9359d7be9c72Smrg        have_asciidoc=yes
9360d7be9c72Smrg   fi
9361d7be9c72Smrgelif test "x$use_asciidoc" = x"yes" ; then
9362d7be9c72Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9363d7be9c72Smrg   if test "x$ASCIIDOC" = "x"; then
9364d7be9c72Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9365d7be9c72Smrg   fi
9366d7be9c72Smrg   have_asciidoc=yes
9367d7be9c72Smrgelif test "x$use_asciidoc" = x"no" ; then
9368d7be9c72Smrg   if test "x$ASCIIDOC" != "x"; then
9369d7be9c72Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9370d7be9c72Smrg   fi
9371d7be9c72Smrg   have_asciidoc=no
9372d7be9c72Smrgelse
9373d7be9c72Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9374d7be9c72Smrgfi
9375d7be9c72Smrgm4_ifval([$1],
9376d7be9c72Smrg[if test "$have_asciidoc" = yes; then
9377d7be9c72Smrg    # scrape the asciidoc version
9378d7be9c72Smrg    AC_MSG_CHECKING([the asciidoc version])
9379d7be9c72Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9380d7be9c72Smrg    AC_MSG_RESULT([$asciidoc_version])
9381d7be9c72Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9382d7be9c72Smrg        [if test "x$use_asciidoc" = xauto; then
9383d7be9c72Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9384d7be9c72Smrg            have_asciidoc=no
9385d7be9c72Smrg        else
9386d7be9c72Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9387d7be9c72Smrg        fi])
9388d7be9c72Smrgfi])
9389d7be9c72SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9390d7be9c72Smrg]) # XORG_WITH_ASCIIDOC
9391d7be9c72Smrg
93920bb88ba4Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9393d7be9c72Smrg# --------------------------------
9394d7be9c72Smrg# Minimum version: 1.5.0
93950bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9396d7be9c72Smrg#
9397d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9398d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9399d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9400d7be9c72Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
94010bb88ba4Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
94020bb88ba4Smrg# --with-doxygen assumes 'auto'.
9403d7be9c72Smrg#
9404d7be9c72Smrg# Interface to module:
9405d7be9c72Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9406d7be9c72Smrg# DOXYGEN:	 returns the path of the doxygen program found
9407d7be9c72Smrg#		 returns the path set by the user in the environment
9408d7be9c72Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9409d7be9c72Smrg#		  'no' user instructs the module not to use doxygen
9410d7be9c72Smrg#
9411d7be9c72Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9412d7be9c72Smrg#
9413d7be9c72SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9414d7be9c72SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
94150bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9416d7be9c72SmrgAC_ARG_WITH(doxygen,
9417d7be9c72Smrg	AS_HELP_STRING([--with-doxygen],
94180bb88ba4Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
94190bb88ba4Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
94200bb88ba4Smrgm4_undefine([_defopt])
9421d7be9c72Smrg
9422d7be9c72Smrgif test "x$use_doxygen" = x"auto"; then
9423d7be9c72Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9424d7be9c72Smrg   if test "x$DOXYGEN" = "x"; then
9425d7be9c72Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9426d7be9c72Smrg	have_doxygen=no
9427d7be9c72Smrg   else
9428d7be9c72Smrg        have_doxygen=yes
9429d7be9c72Smrg   fi
9430d7be9c72Smrgelif test "x$use_doxygen" = x"yes" ; then
9431d7be9c72Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9432d7be9c72Smrg   if test "x$DOXYGEN" = "x"; then
9433d7be9c72Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9434d7be9c72Smrg   fi
9435d7be9c72Smrg   have_doxygen=yes
9436d7be9c72Smrgelif test "x$use_doxygen" = x"no" ; then
9437d7be9c72Smrg   if test "x$DOXYGEN" != "x"; then
9438d7be9c72Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9439d7be9c72Smrg   fi
9440d7be9c72Smrg   have_doxygen=no
9441d7be9c72Smrgelse
9442d7be9c72Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
9443d7be9c72Smrgfi
9444d7be9c72Smrgm4_ifval([$1],
9445d7be9c72Smrg[if test "$have_doxygen" = yes; then
9446d7be9c72Smrg    # scrape the doxygen version
9447d7be9c72Smrg    AC_MSG_CHECKING([the doxygen version])
9448d7be9c72Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9449d7be9c72Smrg    AC_MSG_RESULT([$doxygen_version])
9450d7be9c72Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9451d7be9c72Smrg        [if test "x$use_doxygen" = xauto; then
9452d7be9c72Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9453d7be9c72Smrg            have_doxygen=no
9454d7be9c72Smrg        else
9455d7be9c72Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9456d7be9c72Smrg        fi])
9457d7be9c72Smrgfi])
9458d7be9c72SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9459d7be9c72Smrg]) # XORG_WITH_DOXYGEN
9460d7be9c72Smrg
94610bb88ba4Smrg# XORG_WITH_GROFF([DEFAULT])
9462d7be9c72Smrg# ----------------
9463d7be9c72Smrg# Minimum version: 1.6.0
94640bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9465d7be9c72Smrg#
9466d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9467d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9468d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9469d7be9c72Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
94700bb88ba4Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
94710bb88ba4Smrg# --with-groff assumes 'auto'.
9472d7be9c72Smrg#
9473d7be9c72Smrg# Interface to module:
9474d7be9c72Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9475d7be9c72Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
9476d7be9c72Smrg# HAVE_GROFF_MS: the -ms macros package
9477d7be9c72Smrg# GROFF:	 returns the path of the groff program found
9478d7be9c72Smrg#		 returns the path set by the user in the environment
9479d7be9c72Smrg# --with-groff:	 'yes' user instructs the module to use groff
9480d7be9c72Smrg#		 'no' user instructs the module not to use groff
9481d7be9c72Smrg#
9482d7be9c72Smrg# Added in version 1.9.0:
9483d7be9c72Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
9484d7be9c72Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
9485d7be9c72Smrg#		   psselect from the psutils package.
9486d7be9c72Smrg#		   the ghostcript package. Refer to the grohtml man pages
9487d7be9c72Smrg#
9488d7be9c72Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9489d7be9c72Smrg#
9490d7be9c72Smrg# OS and distros often splits groff in a basic and full package, the former
9491d7be9c72Smrg# having the groff program and the later having devices, fonts and macros
9492d7be9c72Smrg# Checking for the groff executable is not enough.
9493d7be9c72Smrg#
9494d7be9c72Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
9495d7be9c72Smrg# unset HAVE_GROFF or GROFF env variables.
9496d7be9c72Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9497d7be9c72Smrg#
9498d7be9c72SmrgAC_DEFUN([XORG_WITH_GROFF],[
9499d7be9c72SmrgAC_ARG_VAR([GROFF], [Path to groff command])
95000bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
9501d7be9c72SmrgAC_ARG_WITH(groff,
9502d7be9c72Smrg	AS_HELP_STRING([--with-groff],
95030bb88ba4Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
95040bb88ba4Smrg	   [use_groff=$withval], [use_groff=]_defopt)
95050bb88ba4Smrgm4_undefine([_defopt])
9506d7be9c72Smrg
9507d7be9c72Smrgif test "x$use_groff" = x"auto"; then
9508d7be9c72Smrg   AC_PATH_PROG([GROFF], [groff])
9509d7be9c72Smrg   if test "x$GROFF" = "x"; then
9510d7be9c72Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9511d7be9c72Smrg	have_groff=no
9512d7be9c72Smrg   else
9513d7be9c72Smrg        have_groff=yes
9514d7be9c72Smrg   fi
9515d7be9c72Smrgelif test "x$use_groff" = x"yes" ; then
9516d7be9c72Smrg   AC_PATH_PROG([GROFF], [groff])
9517d7be9c72Smrg   if test "x$GROFF" = "x"; then
9518d7be9c72Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
9519d7be9c72Smrg   fi
9520d7be9c72Smrg   have_groff=yes
9521d7be9c72Smrgelif test "x$use_groff" = x"no" ; then
9522d7be9c72Smrg   if test "x$GROFF" != "x"; then
9523d7be9c72Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
9524d7be9c72Smrg   fi
9525d7be9c72Smrg   have_groff=no
9526d7be9c72Smrgelse
9527d7be9c72Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
9528d7be9c72Smrgfi
9529d7be9c72Smrg
9530d7be9c72Smrg# We have groff, test for the presence of the macro packages
9531d7be9c72Smrgif test "x$have_groff" = x"yes"; then
9532d7be9c72Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
9533d7be9c72Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
9534d7be9c72Smrg        groff_ms_works=yes
9535d7be9c72Smrg    else
9536d7be9c72Smrg        groff_ms_works=no
9537d7be9c72Smrg    fi
9538d7be9c72Smrg    AC_MSG_RESULT([$groff_ms_works])
9539d7be9c72Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
9540d7be9c72Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
9541d7be9c72Smrg        groff_mm_works=yes
9542d7be9c72Smrg    else
9543d7be9c72Smrg        groff_mm_works=no
9544d7be9c72Smrg    fi
9545d7be9c72Smrg    AC_MSG_RESULT([$groff_mm_works])
9546d7be9c72Smrgfi
9547d7be9c72Smrg
9548d7be9c72Smrg# We have groff, test for HTML dependencies, one command per package
9549d7be9c72Smrgif test "x$have_groff" = x"yes"; then
9550d7be9c72Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
9551d7be9c72Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
9552d7be9c72Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
9553d7be9c72Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
9554d7be9c72Smrg      have_groff_html=yes
9555d7be9c72Smrg   else
9556d7be9c72Smrg      have_groff_html=no
9557d7be9c72Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
9558d7be9c72Smrg   fi
9559d7be9c72Smrgfi
9560d7be9c72Smrg
9561d7be9c72Smrg# Set Automake conditionals for Makefiles
9562d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
9563d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
9564d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
9565d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
9566d7be9c72Smrg]) # XORG_WITH_GROFF
9567d7be9c72Smrg
95680bb88ba4Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
95690bb88ba4Smrg# ---------------------------------------
9570d7be9c72Smrg# Minimum version: 1.6.0
95710bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
95720bb88ba4Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
9573d7be9c72Smrg#
9574d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9575d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9576d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9577d7be9c72Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
95780bb88ba4Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
95790bb88ba4Smrg# --with-fop assumes 'auto'.
9580d7be9c72Smrg#
9581d7be9c72Smrg# Interface to module:
9582d7be9c72Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
9583d7be9c72Smrg# FOP:	 	returns the path of the fop program found
9584d7be9c72Smrg#		returns the path set by the user in the environment
9585d7be9c72Smrg# --with-fop: 	'yes' user instructs the module to use fop
9586d7be9c72Smrg#		'no' user instructs the module not to use fop
9587d7be9c72Smrg#
9588d7be9c72Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
9589d7be9c72Smrg#
9590d7be9c72SmrgAC_DEFUN([XORG_WITH_FOP],[
9591d7be9c72SmrgAC_ARG_VAR([FOP], [Path to fop command])
95920bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9593d7be9c72SmrgAC_ARG_WITH(fop,
9594d7be9c72Smrg	AS_HELP_STRING([--with-fop],
95950bb88ba4Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
95960bb88ba4Smrg	   [use_fop=$withval], [use_fop=]_defopt)
95970bb88ba4Smrgm4_undefine([_defopt])
9598d7be9c72Smrg
9599d7be9c72Smrgif test "x$use_fop" = x"auto"; then
9600d7be9c72Smrg   AC_PATH_PROG([FOP], [fop])
9601d7be9c72Smrg   if test "x$FOP" = "x"; then
9602d7be9c72Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
9603d7be9c72Smrg	have_fop=no
9604d7be9c72Smrg   else
9605d7be9c72Smrg        have_fop=yes
9606d7be9c72Smrg   fi
9607d7be9c72Smrgelif test "x$use_fop" = x"yes" ; then
9608d7be9c72Smrg   AC_PATH_PROG([FOP], [fop])
9609d7be9c72Smrg   if test "x$FOP" = "x"; then
9610d7be9c72Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
9611d7be9c72Smrg   fi
9612d7be9c72Smrg   have_fop=yes
9613d7be9c72Smrgelif test "x$use_fop" = x"no" ; then
9614d7be9c72Smrg   if test "x$FOP" != "x"; then
9615d7be9c72Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
9616d7be9c72Smrg   fi
9617d7be9c72Smrg   have_fop=no
9618d7be9c72Smrgelse
9619d7be9c72Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
9620d7be9c72Smrgfi
96210bb88ba4Smrg
96220bb88ba4Smrg# Test for a minimum version of fop, if provided.
96230bb88ba4Smrgm4_ifval([$1],
96240bb88ba4Smrg[if test "$have_fop" = yes; then
96250bb88ba4Smrg    # scrape the fop version
96260bb88ba4Smrg    AC_MSG_CHECKING([for fop minimum version])
96270bb88ba4Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
96280bb88ba4Smrg    AC_MSG_RESULT([$fop_version])
96290bb88ba4Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
96300bb88ba4Smrg        [if test "x$use_fop" = xauto; then
96310bb88ba4Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
96320bb88ba4Smrg            have_fop=no
96330bb88ba4Smrg        else
96340bb88ba4Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
96350bb88ba4Smrg        fi])
96360bb88ba4Smrgfi])
9637d7be9c72SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
9638d7be9c72Smrg]) # XORG_WITH_FOP
9639d7be9c72Smrg
96400bb88ba4Smrg# XORG_WITH_PS2PDF([DEFAULT])
9641d7be9c72Smrg# ----------------
9642d7be9c72Smrg# Minimum version: 1.6.0
96430bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9644d7be9c72Smrg#
9645d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9646d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9647d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9648d7be9c72Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
96490bb88ba4Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
96500bb88ba4Smrg# --with-ps2pdf assumes 'auto'.
9651d7be9c72Smrg#
9652d7be9c72Smrg# Interface to module:
9653d7be9c72Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
9654d7be9c72Smrg# PS2PDF:	returns the path of the ps2pdf program found
9655d7be9c72Smrg#		returns the path set by the user in the environment
9656d7be9c72Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
9657d7be9c72Smrg#		 'no' user instructs the module not to use ps2pdf
9658d7be9c72Smrg#
9659d7be9c72Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
9660d7be9c72Smrg#
9661d7be9c72SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
9662d7be9c72SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
96630bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
9664d7be9c72SmrgAC_ARG_WITH(ps2pdf,
9665d7be9c72Smrg	AS_HELP_STRING([--with-ps2pdf],
96660bb88ba4Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
96670bb88ba4Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
96680bb88ba4Smrgm4_undefine([_defopt])
9669d7be9c72Smrg
9670d7be9c72Smrgif test "x$use_ps2pdf" = x"auto"; then
9671d7be9c72Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
9672d7be9c72Smrg   if test "x$PS2PDF" = "x"; then
9673d7be9c72Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
9674d7be9c72Smrg	have_ps2pdf=no
9675d7be9c72Smrg   else
9676d7be9c72Smrg        have_ps2pdf=yes
9677d7be9c72Smrg   fi
9678d7be9c72Smrgelif test "x$use_ps2pdf" = x"yes" ; then
9679d7be9c72Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
9680d7be9c72Smrg   if test "x$PS2PDF" = "x"; then
9681d7be9c72Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
9682d7be9c72Smrg   fi
9683d7be9c72Smrg   have_ps2pdf=yes
9684d7be9c72Smrgelif test "x$use_ps2pdf" = x"no" ; then
9685d7be9c72Smrg   if test "x$PS2PDF" != "x"; then
9686d7be9c72Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
9687d7be9c72Smrg   fi
9688d7be9c72Smrg   have_ps2pdf=no
9689d7be9c72Smrgelse
9690d7be9c72Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
9691d7be9c72Smrgfi
9692d7be9c72SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
9693d7be9c72Smrg]) # XORG_WITH_PS2PDF
9694d7be9c72Smrg
9695d7be9c72Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
9696d7be9c72Smrg# ----------------
9697d7be9c72Smrg# Minimum version: 1.6.0
9698d7be9c72Smrg#
9699d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9700d7be9c72Smrg# not at the appropriate level. This macro enables a builder to skip all
9701d7be9c72Smrg# documentation targets except traditional man pages.
9702d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9703d7be9c72Smrg# maximum flexibilty in controlling documentation building.
9704d7be9c72Smrg# Refer to:
9705d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
9706d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9707d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9708d7be9c72Smrg# XORG_WITH_FOP           --with-fop
9709d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
9710d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9711d7be9c72Smrg#
9712d7be9c72Smrg# Interface to module:
9713d7be9c72Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
9714d7be9c72Smrg# --enable-docs: 'yes' user instructs the module to generate docs
9715d7be9c72Smrg#		 'no' user instructs the module not to generate docs
9716d7be9c72Smrg# parm1:	specify the default value, yes or no.
9717d7be9c72Smrg#
9718d7be9c72SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
97190bb88ba4Smrgm4_define([docs_default], m4_default([$1], [yes]))
9720d7be9c72SmrgAC_ARG_ENABLE(docs,
9721d7be9c72Smrg	AS_HELP_STRING([--enable-docs],
97220bb88ba4Smrg	   [Enable building the documentation (default: ]docs_default[)]),
97230bb88ba4Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
97240bb88ba4Smrgm4_undefine([docs_default])
9725d7be9c72SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
9726d7be9c72SmrgAC_MSG_CHECKING([whether to build documentation])
9727d7be9c72SmrgAC_MSG_RESULT([$build_docs])
9728d7be9c72Smrg]) # XORG_ENABLE_DOCS
9729d7be9c72Smrg
9730d7be9c72Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
9731d7be9c72Smrg# ----------------
9732d7be9c72Smrg# Minimum version: 1.6.0
9733d7be9c72Smrg#
9734d7be9c72Smrg# This macro enables a builder to skip all developer documentation.
9735d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9736d7be9c72Smrg# maximum flexibilty in controlling documentation building.
9737d7be9c72Smrg# Refer to:
9738d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
9739d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9740d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9741d7be9c72Smrg# XORG_WITH_FOP           --with-fop
9742d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
9743d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9744d7be9c72Smrg#
9745d7be9c72Smrg# Interface to module:
9746d7be9c72Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
9747d7be9c72Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
9748d7be9c72Smrg#			'no' user instructs the module not to generate developer docs
9749d7be9c72Smrg# parm1:		specify the default value, yes or no.
9750d7be9c72Smrg#
9751d7be9c72SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
97520bb88ba4Smrgm4_define([devel_default], m4_default([$1], [yes]))
9753d7be9c72SmrgAC_ARG_ENABLE(devel-docs,
9754d7be9c72Smrg	AS_HELP_STRING([--enable-devel-docs],
97550bb88ba4Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
97560bb88ba4Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
97570bb88ba4Smrgm4_undefine([devel_default])
9758d7be9c72SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
9759d7be9c72SmrgAC_MSG_CHECKING([whether to build developer documentation])
9760d7be9c72SmrgAC_MSG_RESULT([$build_devel_docs])
9761d7be9c72Smrg]) # XORG_ENABLE_DEVEL_DOCS
9762d7be9c72Smrg
9763d7be9c72Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
9764d7be9c72Smrg# ----------------
9765d7be9c72Smrg# Minimum version: 1.6.0
9766d7be9c72Smrg#
9767d7be9c72Smrg# This macro enables a builder to skip all functional specification targets.
9768d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
9769d7be9c72Smrg# maximum flexibilty in controlling documentation building.
9770d7be9c72Smrg# Refer to:
9771d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
9772d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
9773d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
9774d7be9c72Smrg# XORG_WITH_FOP           --with-fop
9775d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
9776d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
9777d7be9c72Smrg#
9778d7be9c72Smrg# Interface to module:
9779d7be9c72Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
9780d7be9c72Smrg# --enable-specs:	'yes' user instructs the module to generate specs
9781d7be9c72Smrg#			'no' user instructs the module not to generate specs
9782d7be9c72Smrg# parm1:		specify the default value, yes or no.
9783d7be9c72Smrg#
9784d7be9c72SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
97850bb88ba4Smrgm4_define([spec_default], m4_default([$1], [yes]))
9786d7be9c72SmrgAC_ARG_ENABLE(specs,
9787d7be9c72Smrg	AS_HELP_STRING([--enable-specs],
97880bb88ba4Smrg	   [Enable building the specs (default: ]spec_default[)]),
97890bb88ba4Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
97900bb88ba4Smrgm4_undefine([spec_default])
9791d7be9c72SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
9792d7be9c72SmrgAC_MSG_CHECKING([whether to build functional specifications])
9793d7be9c72SmrgAC_MSG_RESULT([$build_specs])
9794d7be9c72Smrg]) # XORG_ENABLE_SPECS
9795d7be9c72Smrg
97960bb88ba4Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
97970bb88ba4Smrg# ----------------------------------------------
97980bb88ba4Smrg# Minimum version: 1.13.0
97990bb88ba4Smrg#
98000bb88ba4Smrg# This macro enables a builder to enable/disable unit testing
98010bb88ba4Smrg# It makes no assumption about the test cases implementation
98020bb88ba4Smrg# Test cases may or may not use Automake "Support for test suites"
98030bb88ba4Smrg# They may or may not use the software utility library GLib
98040bb88ba4Smrg#
98050bb88ba4Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
98060bb88ba4Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
98070bb88ba4Smrg# The variable enable_unit_tests is used by other macros in this file.
98080bb88ba4Smrg#
98090bb88ba4Smrg# Interface to module:
98100bb88ba4Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
98110bb88ba4Smrg# enable_unit_tests:    used in configure.ac for additional configuration
98120bb88ba4Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
98130bb88ba4Smrg#			'no' user instructs the module not to build tests
98140bb88ba4Smrg# parm1:		specify the default value, yes or no.
98150bb88ba4Smrg#
98160bb88ba4SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
98170bb88ba4SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
98180bb88ba4SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
98190bb88ba4SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
98200bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
98210bb88ba4SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
98220bb88ba4Smrg	[Enable building unit test cases (default: ]_defopt[)]),
98230bb88ba4Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
98240bb88ba4Smrgm4_undefine([_defopt])
98250bb88ba4SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
98260bb88ba4SmrgAC_MSG_CHECKING([whether to build unit test cases])
98270bb88ba4SmrgAC_MSG_RESULT([$enable_unit_tests])
98280bb88ba4Smrg]) # XORG_ENABLE_UNIT_TESTS
98290bb88ba4Smrg
98300bb88ba4Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
98310bb88ba4Smrg# ------------------------------------------------------
98320bb88ba4Smrg# Minimum version: 1.17.0
98330bb88ba4Smrg#
98340bb88ba4Smrg# This macro enables a builder to enable/disable integration testing
98350bb88ba4Smrg# It makes no assumption about the test cases' implementation
98360bb88ba4Smrg# Test cases may or may not use Automake "Support for test suites"
98370bb88ba4Smrg#
98380bb88ba4Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
98390bb88ba4Smrg# usually requires less dependencies and may be built and run under less
98400bb88ba4Smrg# stringent environments than integration tests.
98410bb88ba4Smrg#
98420bb88ba4Smrg# Interface to module:
98430bb88ba4Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
98440bb88ba4Smrg# enable_integration_tests:   used in configure.ac for additional configuration
98450bb88ba4Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
98460bb88ba4Smrg#                             'no' user instructs the module not to build tests
98470bb88ba4Smrg# parm1:                      specify the default value, yes or no.
98480bb88ba4Smrg#
98490bb88ba4SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
98500bb88ba4SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
98510bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
98520bb88ba4SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
98530bb88ba4Smrg	[Enable building integration test cases (default: ]_defopt[)]),
98540bb88ba4Smrg	[enable_integration_tests=$enableval],
98550bb88ba4Smrg	[enable_integration_tests=]_defopt)
98560bb88ba4Smrgm4_undefine([_defopt])
98570bb88ba4SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
98580bb88ba4Smrg	[test "x$enable_integration_tests" != xno])
98590bb88ba4SmrgAC_MSG_CHECKING([whether to build unit test cases])
98600bb88ba4SmrgAC_MSG_RESULT([$enable_integration_tests])
98610bb88ba4Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
98620bb88ba4Smrg
98630bb88ba4Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
98640bb88ba4Smrg# ----------------------------------------
98650bb88ba4Smrg# Minimum version: 1.13.0
98660bb88ba4Smrg#
98670bb88ba4Smrg# GLib is a library which provides advanced data structures and functions.
98680bb88ba4Smrg# This macro enables a module to test for the presence of Glib.
98690bb88ba4Smrg#
98700bb88ba4Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
98710bb88ba4Smrg# Otherwise the value of $enable_unit_tests is blank.
98720bb88ba4Smrg#
98730bb88ba4Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
98740bb88ba4Smrg# test support usually requires less dependencies and may be built and run under
98750bb88ba4Smrg# less stringent environments than integration tests.
98760bb88ba4Smrg#
98770bb88ba4Smrg# Interface to module:
98780bb88ba4Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
98790bb88ba4Smrg# with_glib: used in configure.ac to know if GLib has been found
98800bb88ba4Smrg# --with-glib:	'yes' user instructs the module to use glib
98810bb88ba4Smrg#		'no' user instructs the module not to use glib
98820bb88ba4Smrg#
98830bb88ba4SmrgAC_DEFUN([XORG_WITH_GLIB],[
98840bb88ba4SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
98850bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
98860bb88ba4SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
98870bb88ba4Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
98880bb88ba4Smrg	[with_glib=$withval], [with_glib=]_defopt)
98890bb88ba4Smrgm4_undefine([_defopt])
98900bb88ba4Smrg
98910bb88ba4Smrghave_glib=no
98920bb88ba4Smrg# Do not probe GLib if user explicitly disabled unit testing
98930bb88ba4Smrgif test "x$enable_unit_tests" != x"no"; then
98940bb88ba4Smrg  # Do not probe GLib if user explicitly disabled it
98950bb88ba4Smrg  if test "x$with_glib" != x"no"; then
98960bb88ba4Smrg    m4_ifval(
98970bb88ba4Smrg      [$1],
98980bb88ba4Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
98990bb88ba4Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
99000bb88ba4Smrg    )
99010bb88ba4Smrg  fi
99020bb88ba4Smrgfi
99030bb88ba4Smrg
99040bb88ba4Smrg# Not having GLib when unit testing has been explicitly requested is an error
99050bb88ba4Smrgif test "x$enable_unit_tests" = x"yes"; then
99060bb88ba4Smrg  if test "x$have_glib" = x"no"; then
99070bb88ba4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
99080bb88ba4Smrg  fi
99090bb88ba4Smrgfi
99100bb88ba4Smrg
99110bb88ba4Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
99120bb88ba4Smrgif test "x$enable_unit_tests" = x"no"; then
99130bb88ba4Smrg  if test "x$with_glib" = x"yes"; then
99140bb88ba4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
99150bb88ba4Smrg  fi
99160bb88ba4Smrgfi
99170bb88ba4Smrg
99180bb88ba4Smrg# Not having GLib when it has been explicitly requested is an error
99190bb88ba4Smrgif test "x$with_glib" = x"yes"; then
99200bb88ba4Smrg  if test "x$have_glib" = x"no"; then
99210bb88ba4Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
99220bb88ba4Smrg  fi
99230bb88ba4Smrgfi
99240bb88ba4Smrg
99250bb88ba4SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
99260bb88ba4Smrg]) # XORG_WITH_GLIB
99270bb88ba4Smrg
99280bb88ba4Smrg# XORG_LD_WRAP([required|optional])
99290bb88ba4Smrg# ---------------------------------
99300bb88ba4Smrg# Minimum version: 1.13.0
99310bb88ba4Smrg#
99320bb88ba4Smrg# Check if linker supports -wrap, passed via compiler flags
99330bb88ba4Smrg#
99340bb88ba4Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
99350bb88ba4Smrg# Otherwise the value of $enable_unit_tests is blank.
99360bb88ba4Smrg#
99370bb88ba4Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
99380bb88ba4Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
99390bb88ba4Smrg# available, an argument of "optional" allows use when some unit tests require
99400bb88ba4Smrg# ld -wrap and others do not.
99410bb88ba4Smrg#
99420bb88ba4SmrgAC_DEFUN([XORG_LD_WRAP],[
99430bb88ba4SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
99440bb88ba4Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
99450bb88ba4Smrg                      void __wrap_exit(int status) { return; }],
99460bb88ba4Smrg                     [exit(0);])])
99470bb88ba4Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
99480bb88ba4Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
99490bb88ba4Smrg  if test "x$have_ld_wrap" = x"no"; then
99500bb88ba4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
99510bb88ba4Smrg  fi
99520bb88ba4Smrgfi
99530bb88ba4SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
99540bb88ba4Smrg#
99550bb88ba4Smrg]) # XORG_LD_WRAP
99560bb88ba4Smrg
99570bb88ba4Smrg# XORG_CHECK_LINKER_FLAGS
99580bb88ba4Smrg# -----------------------
99590bb88ba4Smrg# SYNOPSIS
99600bb88ba4Smrg#
99610bb88ba4Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
99620bb88ba4Smrg#
99630bb88ba4Smrg# DESCRIPTION
99640bb88ba4Smrg#
99650bb88ba4Smrg#   Check whether the given linker FLAGS work with the current language's
99660bb88ba4Smrg#   linker, or whether they give an error.
99670bb88ba4Smrg#
99680bb88ba4Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
99690bb88ba4Smrg#   success/failure.
99700bb88ba4Smrg#
99710bb88ba4Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
99720bb88ba4Smrg#
99730bb88ba4Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
99740bb88ba4Smrg#
99750bb88ba4Smrg# LICENSE
99760bb88ba4Smrg#
99770bb88ba4Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
99780bb88ba4Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
99790bb88ba4Smrg#   Copyright (c) 2009 Matteo Frigo
99800bb88ba4Smrg#
99810bb88ba4Smrg#   This program is free software: you can redistribute it and/or modify it
99820bb88ba4Smrg#   under the terms of the GNU General Public License as published by the
99830bb88ba4Smrg#   Free Software Foundation, either version 3 of the License, or (at your
99840bb88ba4Smrg#   option) any later version.
99850bb88ba4Smrg#
99860bb88ba4Smrg#   This program is distributed in the hope that it will be useful, but
99870bb88ba4Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
99880bb88ba4Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
99890bb88ba4Smrg#   Public License for more details.
99900bb88ba4Smrg#
99910bb88ba4Smrg#   You should have received a copy of the GNU General Public License along
99920bb88ba4Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
99930bb88ba4Smrg#
99940bb88ba4Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
99950bb88ba4Smrg#   gives unlimited permission to copy, distribute and modify the configure
99960bb88ba4Smrg#   scripts that are the output of Autoconf when processing the Macro. You
99970bb88ba4Smrg#   need not follow the terms of the GNU General Public License when using
99980bb88ba4Smrg#   or distributing such scripts, even though portions of the text of the
99990bb88ba4Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
100000bb88ba4Smrg#   all other use of the material that constitutes the Autoconf Macro.
100010bb88ba4Smrg#
100020bb88ba4Smrg#   This special exception to the GPL applies to versions of the Autoconf
100030bb88ba4Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
100040bb88ba4Smrg#   modified version of the Autoconf Macro, you may extend this special
100050bb88ba4Smrg#   exception to the GPL to apply to your modified version as well.#
100060bb88ba4SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
100070bb88ba4Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
100080bb88ba4Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
100090bb88ba4SmrgAS_LITERAL_IF([$1],
100100bb88ba4Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
100110bb88ba4Smrg      ax_save_FLAGS=$LDFLAGS
100120bb88ba4Smrg      LDFLAGS="$1"
100130bb88ba4Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
100140bb88ba4Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
100150bb88ba4Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
100160bb88ba4Smrg      LDFLAGS=$ax_save_FLAGS])],
100170bb88ba4Smrg  [ax_save_FLAGS=$LDFLAGS
100180bb88ba4Smrg   LDFLAGS="$1"
100190bb88ba4Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
100200bb88ba4Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
100210bb88ba4Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
100220bb88ba4Smrg   LDFLAGS=$ax_save_FLAGS])
100230bb88ba4Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
100240bb88ba4SmrgAC_MSG_RESULT($xorg_check_linker_flags)
100250bb88ba4Smrgif test "x$xorg_check_linker_flags" = xyes; then
100260bb88ba4Smrg	m4_default([$2], :)
100270bb88ba4Smrgelse
100280bb88ba4Smrg	m4_default([$3], :)
100290bb88ba4Smrgfi
100300bb88ba4Smrg]) # XORG_CHECK_LINKER_FLAGS
100310bb88ba4Smrg
100320bb88ba4Smrg# XORG_MEMORY_CHECK_FLAGS
100330bb88ba4Smrg# -----------------------
100340bb88ba4Smrg# Minimum version: 1.16.0
100350bb88ba4Smrg#
100360bb88ba4Smrg# This macro attempts to find appropriate memory checking functionality
100370bb88ba4Smrg# for various platforms which unit testing code may use to catch various
100380bb88ba4Smrg# forms of memory allocation and access errors in testing.
100390bb88ba4Smrg#
100400bb88ba4Smrg# Interface to module:
100410bb88ba4Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
100420bb88ba4Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
100430bb88ba4Smrg#
100440bb88ba4Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
100450bb88ba4Smrg#
100460bb88ba4SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
100470bb88ba4Smrg
100480bb88ba4SmrgAC_REQUIRE([AC_CANONICAL_HOST])
100490bb88ba4SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
100500bb88ba4Smrg           [Environment variables to enable memory checking in tests])
100510bb88ba4Smrg
100520bb88ba4Smrg# Check for different types of support on different platforms
100530bb88ba4Smrgcase $host_os in
100540bb88ba4Smrg    solaris*)
100550bb88ba4Smrg        AC_CHECK_LIB([umem], [umem_alloc],
100560bb88ba4Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
100570bb88ba4Smrg        ;;
100580bb88ba4Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
100590bb88ba4Smrg        # both directly and inverted, so should not be 0 or 255.
100600bb88ba4Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
100610bb88ba4Smrg        ;;
100620bb88ba4Smrg    darwin*)
100630bb88ba4Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
100640bb88ba4Smrg        ;;
100650bb88ba4Smrg    *bsd*)
100660bb88ba4Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
100670bb88ba4Smrg        ;;
100680bb88ba4Smrgesac
100690bb88ba4Smrg
100700bb88ba4Smrg# User supplied flags override default flags
100710bb88ba4Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
100720bb88ba4Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
100730bb88ba4Smrgfi
100740bb88ba4Smrg
100750bb88ba4SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
100760bb88ba4Smrg]) # XORG_WITH_LINT
100770bb88ba4Smrg
10078fe5e51b7Smrg# XORG_CHECK_MALLOC_ZERO
10079fe5e51b7Smrg# ----------------------
10080fe5e51b7Smrg# Minimum version: 1.0.0
10081fe5e51b7Smrg#
10082fe5e51b7Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10083fe5e51b7Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10084fe5e51b7Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10085fe5e51b7SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10086fe5e51b7SmrgAC_ARG_ENABLE(malloc0returnsnull,
10087a31a186aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10088fe5e51b7Smrg		       [malloc(0) returns NULL (default: auto)]),
10089fe5e51b7Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10090fe5e51b7Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10091fe5e51b7Smrg
10092fe5e51b7SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10093fe5e51b7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
100940bb88ba4Smrg	AC_RUN_IFELSE([AC_LANG_PROGRAM([
100950bb88ba4Smrg#include <stdlib.h>
100960bb88ba4Smrg],[
10097fe5e51b7Smrg    char *m0, *r0, *c0, *p;
10098fe5e51b7Smrg    m0 = malloc(0);
10099fe5e51b7Smrg    p = malloc(10);
10100fe5e51b7Smrg    r0 = realloc(p,0);
101010bb88ba4Smrg    c0 = calloc(0,10);
101020bb88ba4Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
101030bb88ba4Smrg])],
10104fe5e51b7Smrg		[MALLOC_ZERO_RETURNS_NULL=yes],
10105d7be9c72Smrg		[MALLOC_ZERO_RETURNS_NULL=no],
10106d7be9c72Smrg		[MALLOC_ZERO_RETURNS_NULL=yes])
10107fe5e51b7Smrgfi
10108fe5e51b7SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10109fe5e51b7Smrg
10110fe5e51b7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10111fe5e51b7Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10112fe5e51b7Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10113fe5e51b7Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10114fe5e51b7Smrgelse
10115fe5e51b7Smrg	MALLOC_ZERO_CFLAGS=""
10116fe5e51b7Smrg	XMALLOC_ZERO_CFLAGS=""
10117fe5e51b7Smrg	XTMALLOC_ZERO_CFLAGS=""
10118fe5e51b7Smrgfi
10119fe5e51b7Smrg
10120fe5e51b7SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10121fe5e51b7SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10122fe5e51b7SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10123fe5e51b7Smrg]) # XORG_CHECK_MALLOC_ZERO
10124fe5e51b7Smrg
10125fe5e51b7Smrg# XORG_WITH_LINT()
10126fe5e51b7Smrg# ----------------
10127fe5e51b7Smrg# Minimum version: 1.1.0
10128fe5e51b7Smrg#
10129d7be9c72Smrg# This macro enables the use of a tool that flags some suspicious and
10130d7be9c72Smrg# non-portable constructs (likely to be bugs) in C language source code.
10131d7be9c72Smrg# It will attempt to locate the tool and use appropriate options.
10132d7be9c72Smrg# There are various lint type tools on different platforms.
10133d7be9c72Smrg#
10134d7be9c72Smrg# Interface to module:
10135d7be9c72Smrg# LINT:		returns the path to the tool found on the platform
10136d7be9c72Smrg#		or the value set to LINT on the configure cmd line
10137d7be9c72Smrg#		also an Automake conditional
10138d7be9c72Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
10139d7be9c72Smrg#
10140d7be9c72Smrg# --with-lint:	'yes' user instructs the module to use lint
10141d7be9c72Smrg#		'no' user instructs the module not to use lint (default)
10142d7be9c72Smrg#
10143d7be9c72Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10144d7be9c72Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10145fe5e51b7Smrg#
10146fe5e51b7SmrgAC_DEFUN([XORG_WITH_LINT],[
10147fe5e51b7Smrg
10148d7be9c72SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10149d7be9c72SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10150a31a186aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10151fe5e51b7Smrg		[Use a lint-style source code checker (default: disabled)])],
10152fe5e51b7Smrg		[use_lint=$withval], [use_lint=no])
10153d7be9c72Smrg
10154d7be9c72Smrg# Obtain platform specific info like program name and options
10155d7be9c72Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10156d7be9c72Smrgcase $host_os in
10157d7be9c72Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10158d7be9c72Smrg	lint_name=splint
10159d7be9c72Smrg	lint_options="-badflag"
10160d7be9c72Smrg	;;
10161d7be9c72Smrg  *freebsd* | *netbsd*)
10162d7be9c72Smrg	lint_name=lint
10163d7be9c72Smrg	lint_options="-u -b"
10164d7be9c72Smrg	;;
10165d7be9c72Smrg  *solaris*)
10166d7be9c72Smrg	lint_name=lint
10167d7be9c72Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10168d7be9c72Smrg	;;
10169d7be9c72Smrgesac
10170d7be9c72Smrg
10171d7be9c72Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10172d7be9c72Smrgif test "x$use_lint" = x"yes" ; then
10173d7be9c72Smrg   AC_PATH_PROG([LINT], [$lint_name])
10174d7be9c72Smrg   if test "x$LINT" = "x"; then
10175d7be9c72Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10176d7be9c72Smrg   fi
10177d7be9c72Smrgelif test "x$use_lint" = x"no" ; then
10178d7be9c72Smrg   if test "x$LINT" != "x"; then
10179d7be9c72Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10180d7be9c72Smrg   fi
10181fe5e51b7Smrgelse
10182d7be9c72Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10183fe5e51b7Smrgfi
10184d7be9c72Smrg
10185d7be9c72Smrg# User supplied flags override default flags
10186d7be9c72Smrgif test "x$LINT_FLAGS" != "x"; then
10187d7be9c72Smrg   lint_options=$LINT_FLAGS
10188fe5e51b7Smrgfi
10189fe5e51b7Smrg
10190d7be9c72SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10191d7be9c72SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10192fe5e51b7Smrg
10193fe5e51b7Smrg]) # XORG_WITH_LINT
10194fe5e51b7Smrg
10195fe5e51b7Smrg# XORG_LINT_LIBRARY(LIBNAME)
10196fe5e51b7Smrg# --------------------------
10197fe5e51b7Smrg# Minimum version: 1.1.0
10198fe5e51b7Smrg#
10199fe5e51b7Smrg# Sets up flags for building lint libraries for checking programs that call
10200fe5e51b7Smrg# functions in the library.
10201fe5e51b7Smrg#
10202d7be9c72Smrg# Interface to module:
10203d7be9c72Smrg# LINTLIB		- Automake variable with the name of lint library file to make
10204d7be9c72Smrg# MAKE_LINT_LIB		- Automake conditional
10205d7be9c72Smrg#
10206d7be9c72Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10207d7be9c72Smrg#			  - 'no' user instructs the module not to create a lint library (default)
10208fe5e51b7Smrg
10209fe5e51b7SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10210fe5e51b7SmrgAC_REQUIRE([XORG_WITH_LINT])
10211a31a186aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10212fe5e51b7Smrg	[Create lint library (default: disabled)])],
10213fe5e51b7Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10214d7be9c72Smrg
10215d7be9c72Smrgif test "x$make_lint_lib" = x"yes" ; then
10216d7be9c72Smrg   LINTLIB=llib-l$1.ln
10217d7be9c72Smrg   if test "x$LINT" = "x"; then
10218d7be9c72Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10219d7be9c72Smrg   fi
10220d7be9c72Smrgelif test "x$make_lint_lib" != x"no" ; then
10221d7be9c72Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10222fe5e51b7Smrgfi
10223d7be9c72Smrg
10224fe5e51b7SmrgAC_SUBST(LINTLIB)
10225fe5e51b7SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10226fe5e51b7Smrg
10227fe5e51b7Smrg]) # XORG_LINT_LIBRARY
10228fe5e51b7Smrg
102290bb88ba4Smrg# XORG_COMPILER_BRAND
102300bb88ba4Smrg# -------------------
102310bb88ba4Smrg# Minimum version: 1.14.0
102320bb88ba4Smrg#
102330bb88ba4Smrg# Checks for various brands of compilers and sets flags as appropriate:
102340bb88ba4Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
102350bb88ba4Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
102360bb88ba4Smrg#   clang compiler - sets CLANGCC to "yes"
102370bb88ba4Smrg#   Intel compiler - sets INTELCC to "yes"
102380bb88ba4Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
102390bb88ba4Smrg#
102400bb88ba4SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
102410bb88ba4SmrgAC_LANG_CASE(
102420bb88ba4Smrg	[C], [
102430bb88ba4Smrg		AC_REQUIRE([AC_PROG_CC_C99])
102440bb88ba4Smrg	],
102450bb88ba4Smrg	[C++], [
102460bb88ba4Smrg		AC_REQUIRE([AC_PROG_CXX])
102470bb88ba4Smrg	]
102480bb88ba4Smrg)
102490bb88ba4SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
102500bb88ba4SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
102510bb88ba4SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
102520bb88ba4Smrg]) # XORG_COMPILER_BRAND
102530bb88ba4Smrg
102540bb88ba4Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
102550bb88ba4Smrg# ---------------
102560bb88ba4Smrg# Minimum version: 1.16.0
102570bb88ba4Smrg#
102580bb88ba4Smrg# Test if the compiler works when passed the given flag as a command line argument.
102590bb88ba4Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
102600bb88ba4Smrg# next flag in the list until there are no more options.
102610bb88ba4Smrg#
102620bb88ba4Smrg# Note that this does not guarantee that the compiler supports the flag as some
102630bb88ba4Smrg# compilers will simply ignore arguments that they do not understand, but we do
102640bb88ba4Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
102650bb88ba4Smrg# -Werror=unused-command-line-argument
102660bb88ba4Smrg#
102670bb88ba4SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
102680bb88ba4Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
102690bb88ba4Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
102700bb88ba4Smrg
102710bb88ba4SmrgAC_LANG_COMPILER_REQUIRE
102720bb88ba4Smrg
102730bb88ba4SmrgAC_LANG_CASE(
102740bb88ba4Smrg	[C], [
102750bb88ba4Smrg		AC_REQUIRE([AC_PROG_CC_C99])
102760bb88ba4Smrg		define([PREFIX], [C])
102770bb88ba4Smrg		define([CACHE_PREFIX], [cc])
102780bb88ba4Smrg		define([COMPILER], [$CC])
102790bb88ba4Smrg	],
102800bb88ba4Smrg	[C++], [
102810bb88ba4Smrg		define([PREFIX], [CXX])
102820bb88ba4Smrg		define([CACHE_PREFIX], [cxx])
102830bb88ba4Smrg		define([COMPILER], [$CXX])
102840bb88ba4Smrg	]
102850bb88ba4Smrg)
102860bb88ba4Smrg
102870bb88ba4Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
102880bb88ba4Smrg
102890bb88ba4Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
102900bb88ba4Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
102910bb88ba4Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
102920bb88ba4Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
102930bb88ba4Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
102940bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
102950bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
102960bb88ba4Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
102970bb88ba4Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
102980bb88ba4Smrgfi
102990bb88ba4Smrg
103000bb88ba4Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
103010bb88ba4Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
103020bb88ba4Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
103030bb88ba4Smrg	fi
103040bb88ba4Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
103050bb88ba4Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
103060bb88ba4Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
103070bb88ba4Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
103080bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
103090bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
103100bb88ba4Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
103110bb88ba4Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
103120bb88ba4Smrgfi
103130bb88ba4Smrg
103140bb88ba4Smrgfound="no"
103150bb88ba4Smrgm4_foreach([flag], m4_cdr($@), [
103160bb88ba4Smrg	if test $found = "no" ; then
103170bb88ba4Smrg		if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then
103180bb88ba4Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
103190bb88ba4Smrg		fi
103200bb88ba4Smrg
103210bb88ba4Smrg		if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then
103220bb88ba4Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
103230bb88ba4Smrg		fi
103240bb88ba4Smrg
103250bb88ba4Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
103260bb88ba4Smrg
103270bb88ba4Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
103280bb88ba4Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
103290bb88ba4Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
103300bb88ba4Smrg		AC_CACHE_VAL($cacheid,
103310bb88ba4Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
103320bb88ba4Smrg					     [eval $cacheid=yes],
103330bb88ba4Smrg					     [eval $cacheid=no])])
103340bb88ba4Smrg
103350bb88ba4Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
103360bb88ba4Smrg
103370bb88ba4Smrg		eval supported=\$$cacheid
103380bb88ba4Smrg		AC_MSG_RESULT([$supported])
103390bb88ba4Smrg		if test "$supported" = "yes" ; then
103400bb88ba4Smrg			$1="$$1 ]flag["
103410bb88ba4Smrg			found="yes"
103420bb88ba4Smrg		fi
103430bb88ba4Smrg	fi
103440bb88ba4Smrg])
103450bb88ba4Smrg]) # XORG_TESTSET_CFLAG
103460bb88ba4Smrg
103470bb88ba4Smrg# XORG_COMPILER_FLAGS
103480bb88ba4Smrg# ---------------
103490bb88ba4Smrg# Minimum version: 1.16.0
103500bb88ba4Smrg#
103510bb88ba4Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
103520bb88ba4Smrg# arguments supported by the selected compiler which do NOT alter the generated
103530bb88ba4Smrg# code.  These arguments will cause the compiler to print various warnings
103540bb88ba4Smrg# during compilation AND turn a conservative set of warnings into errors.
103550bb88ba4Smrg#
103560bb88ba4Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
103570bb88ba4Smrg# future versions of util-macros as options are added to new compilers.
103580bb88ba4Smrg#
103590bb88ba4SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
103600bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
103610bb88ba4Smrg
103620bb88ba4SmrgAC_ARG_ENABLE(selective-werror,
103630bb88ba4Smrg              AS_HELP_STRING([--disable-selective-werror],
103640bb88ba4Smrg                             [Turn off selective compiler errors. (default: enabled)]),
103650bb88ba4Smrg              [SELECTIVE_WERROR=$enableval],
103660bb88ba4Smrg              [SELECTIVE_WERROR=yes])
103670bb88ba4Smrg
103680bb88ba4SmrgAC_LANG_CASE(
103690bb88ba4Smrg        [C], [
103700bb88ba4Smrg                define([PREFIX], [C])
103710bb88ba4Smrg        ],
103720bb88ba4Smrg        [C++], [
103730bb88ba4Smrg                define([PREFIX], [CXX])
103740bb88ba4Smrg        ]
103750bb88ba4Smrg)
103760bb88ba4Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
103770bb88ba4Smrgif test "x$SUNCC" = "xyes"; then
103780bb88ba4Smrg    [BASE_]PREFIX[FLAGS]="-v"
103790bb88ba4Smrgelse
103800bb88ba4Smrg    [BASE_]PREFIX[FLAGS]=""
103810bb88ba4Smrgfi
103820bb88ba4Smrg
103830bb88ba4Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
103840bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
103850bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
103860bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
103870bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
103880bb88ba4Smrg
103890bb88ba4SmrgAC_LANG_CASE(
103900bb88ba4Smrg	[C], [
103910bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
103920bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
103930bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
103940bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
103950bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition])
103960bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
103970bb88ba4Smrg	]
103980bb88ba4Smrg)
103990bb88ba4Smrg
104000bb88ba4Smrg# This chunk adds additional warnings that could catch undesired effects.
104010bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
104020bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
104030bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
104040bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
104050bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
104060bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
104070bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
104080bb88ba4Smrg
104090bb88ba4Smrg# These are currently disabled because they are noisy.  They will be enabled
104100bb88ba4Smrg# in the future once the codebase is sufficiently modernized to silence
104110bb88ba4Smrg# them.  For now, I don't want them to drown out the other warnings.
104120bb88ba4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
104130bb88ba4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
104140bb88ba4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
104150bb88ba4Smrg
104160bb88ba4Smrg# Turn some warnings into errors, so we don't accidently get successful builds
104170bb88ba4Smrg# when there are problems that should be fixed.
104180bb88ba4Smrg
104190bb88ba4Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
104200bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
104210bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
104220bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
104230bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
104240bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
104250bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
104260bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
104270bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
104280bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
104290bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
104300bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
104310bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
104320bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
104330bb88ba4Smrgelse
104340bb88ba4SmrgAC_MSG_WARN([You have chosen not to turn some select compiler warnings into errors.  This should not be necessary.  Please report why you needed to do so in a bug report at $PACKAGE_BUGREPORT])
104350bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
104360bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
104370bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
104380bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
104390bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
104400bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
104410bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
104420bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
104430bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
104440bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
104450bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
104460bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
104470bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
104480bb88ba4Smrgfi
104490bb88ba4Smrg
104500bb88ba4SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
104510bb88ba4Smrg]) # XORG_COMPILER_FLAGS
104520bb88ba4Smrg
10453eda3803bSmrg# XORG_CWARNFLAGS
10454eda3803bSmrg# ---------------
10455eda3803bSmrg# Minimum version: 1.2.0
104560bb88ba4Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
10457eda3803bSmrg#
10458eda3803bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
10459eda3803bSmrg#
104600bb88ba4Smrg# This function is deprecated because it defines -fno-strict-aliasing
104610bb88ba4Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
104620bb88ba4Smrg# is needed, then it should be added explicitly in the module when
104630bb88ba4Smrg# it is updated to use BASE_CFLAGS.
104640bb88ba4Smrg#
10465eda3803bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
104660bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
104670bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
104680bb88ba4SmrgAC_LANG_CASE(
104690bb88ba4Smrg	[C], [
104700bb88ba4Smrg		CWARNFLAGS="$BASE_CFLAGS"
104710bb88ba4Smrg		if  test "x$GCC" = xyes ; then
104720bb88ba4Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
104730bb88ba4Smrg		fi
104740bb88ba4Smrg		AC_SUBST(CWARNFLAGS)
104750bb88ba4Smrg	]
104760bb88ba4Smrg)
10477eda3803bSmrg]) # XORG_CWARNFLAGS
10478a31a186aSmrg
10479a31a186aSmrg# XORG_STRICT_OPTION
10480a31a186aSmrg# -----------------------
10481a31a186aSmrg# Minimum version: 1.3.0
10482a31a186aSmrg#
104830bb88ba4Smrg# Add configure option to enable strict compilation flags, such as treating
104840bb88ba4Smrg# warnings as fatal errors.
104850bb88ba4Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
104860bb88ba4Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
104870bb88ba4Smrg#
104880bb88ba4Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
104890bb88ba4Smrg# when strict compilation is unconditionally desired.
10490a31a186aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
10491a31a186aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
104920bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
10493a31a186aSmrg
10494a31a186aSmrgAC_ARG_ENABLE(strict-compilation,
10495a31a186aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
10496a31a186aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
10497a31a186aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
104980bb88ba4Smrg
104990bb88ba4SmrgAC_LANG_CASE(
105000bb88ba4Smrg        [C], [
105010bb88ba4Smrg                define([PREFIX], [C])
105020bb88ba4Smrg        ],
105030bb88ba4Smrg        [C++], [
105040bb88ba4Smrg                define([PREFIX], [CXX])
105050bb88ba4Smrg        ]
105060bb88ba4Smrg)
105070bb88ba4Smrg
105080bb88ba4Smrg[STRICT_]PREFIX[FLAGS]=""
105090bb88ba4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
105100bb88ba4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
105110bb88ba4Smrg
105120bb88ba4Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
105130bb88ba4Smrg# activate it with -Werror, so we add it here explicitly.
105140bb88ba4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
105150bb88ba4Smrg
10516a31a186aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
105170bb88ba4Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
105180bb88ba4Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
10519a31a186aSmrgfi
105200bb88ba4SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
105210bb88ba4SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
105220bb88ba4SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
10523a31a186aSmrg]) # XORG_STRICT_OPTION
10524a31a186aSmrg
10525a31a186aSmrg# XORG_DEFAULT_OPTIONS
10526a31a186aSmrg# --------------------
10527a31a186aSmrg# Minimum version: 1.3.0
10528a31a186aSmrg#
10529a31a186aSmrg# Defines default options for X.Org modules.
10530a31a186aSmrg#
10531a31a186aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
10532d7be9c72SmrgAC_REQUIRE([AC_PROG_INSTALL])
105330bb88ba4SmrgXORG_COMPILER_FLAGS
10534a31a186aSmrgXORG_CWARNFLAGS
10535a31a186aSmrgXORG_STRICT_OPTION
10536a31a186aSmrgXORG_RELEASE_VERSION
10537a31a186aSmrgXORG_CHANGELOG
10538a31a186aSmrgXORG_INSTALL
10539a31a186aSmrgXORG_MANPAGE_SECTIONS
10540d7be9c72Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
10541d7be9c72Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
10542a31a186aSmrg]) # XORG_DEFAULT_OPTIONS
10543a31a186aSmrg
10544a31a186aSmrg# XORG_INSTALL()
10545a31a186aSmrg# ----------------
10546a31a186aSmrg# Minimum version: 1.4.0
10547a31a186aSmrg#
10548a31a186aSmrg# Defines the variable INSTALL_CMD as the command to copy
10549d7be9c72Smrg# INSTALL from $prefix/share/util-macros.
10550a31a186aSmrg#
10551a31a186aSmrgAC_DEFUN([XORG_INSTALL], [
10552a31a186aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10553d7be9c72Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
10554d7be9c72SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
10555a31a186aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
10556a31a186aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
10557d7be9c72Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
10558a31a186aSmrgAC_SUBST([INSTALL_CMD])
10559a31a186aSmrg]) # XORG_INSTALL
10560fe5e51b7Smrgdnl Copyright 2005 Red Hat, Inc
10561fe5e51b7Smrgdnl
10562fe5e51b7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
10563fe5e51b7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
10564fe5e51b7Smrgdnl the above copyright notice appear in all copies and that both that
10565fe5e51b7Smrgdnl copyright notice and this permission notice appear in supporting
10566fe5e51b7Smrgdnl documentation.
10567fe5e51b7Smrgdnl
10568fe5e51b7Smrgdnl The above copyright notice and this permission notice shall be included
10569fe5e51b7Smrgdnl in all copies or substantial portions of the Software.
10570fe5e51b7Smrgdnl
10571fe5e51b7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10572fe5e51b7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10573fe5e51b7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10574fe5e51b7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10575fe5e51b7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10576fe5e51b7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10577fe5e51b7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
10578fe5e51b7Smrgdnl
10579fe5e51b7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
10580fe5e51b7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
10581fe5e51b7Smrgdnl other dealings in this Software without prior written authorization
10582fe5e51b7Smrgdnl from the copyright holders.
10583fe5e51b7Smrgdnl
10584fe5e51b7Smrg
10585fe5e51b7Smrg# XORG_RELEASE_VERSION
10586fe5e51b7Smrg# --------------------
10587d7be9c72Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
10588fe5e51b7Smrg 
10589fe5e51b7SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
10590fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
10591fe5e51b7Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
10592fe5e51b7Smrg		[Major version of this package])
10593eda3803bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
10594fe5e51b7Smrg	if test "x$PVM" = "x"; then
10595fe5e51b7Smrg		PVM="0"
10596fe5e51b7Smrg	fi
10597fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
10598fe5e51b7Smrg		[$PVM],
10599fe5e51b7Smrg		[Minor version of this package])
10600eda3803bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
10601fe5e51b7Smrg	if test "x$PVP" = "x"; then
10602fe5e51b7Smrg		PVP="0"
10603fe5e51b7Smrg	fi
10604fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
10605fe5e51b7Smrg		[$PVP],
10606fe5e51b7Smrg		[Patch version of this package])
10607fe5e51b7Smrg])
10608fe5e51b7Smrg
10609eda3803bSmrg# XORG_CHANGELOG()
10610eda3803bSmrg# ----------------
10611eda3803bSmrg# Minimum version: 1.2.0
10612eda3803bSmrg#
10613eda3803bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
10614eda3803bSmrg# ChangeLog from git.
10615eda3803bSmrg#
10616eda3803bSmrg#
10617eda3803bSmrgAC_DEFUN([XORG_CHANGELOG], [
10618a31a186aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
10619a31a186aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
10620a31a186aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
10621eda3803bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
10622eda3803bSmrgAC_SUBST([CHANGELOG_CMD])
10623eda3803bSmrg]) # XORG_CHANGELOG
10624eda3803bSmrg
10625a31a186aSmrgdnl Copyright 2005 Red Hat, Inc
10626a31a186aSmrgdnl 
10627a31a186aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
10628a31a186aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
10629a31a186aSmrgdnl the above copyright notice appear in all copies and that both that
10630a31a186aSmrgdnl copyright notice and this permission notice appear in supporting
10631a31a186aSmrgdnl documentation.
10632a31a186aSmrgdnl 
10633a31a186aSmrgdnl The above copyright notice and this permission notice shall be included
10634a31a186aSmrgdnl in all copies or substantial portions of the Software.
10635a31a186aSmrgdnl 
10636a31a186aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10637a31a186aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
10638a31a186aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
10639a31a186aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
10640a31a186aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
10641a31a186aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
10642a31a186aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
10643a31a186aSmrgdnl 
10644a31a186aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
10645a31a186aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
10646a31a186aSmrgdnl other dealings in this Software without prior written authorization
10647a31a186aSmrgdnl from the copyright holders.
10648a31a186aSmrgdnl 
10649a31a186aSmrg
10650a31a186aSmrg# XORG_DRIVER_CHECK_EXT()
10651a31a186aSmrg# --------------------------
10652a31a186aSmrg# Checks for the $1 define in xorg-server.h (from the sdk).  If it
10653a31a186aSmrg# is defined, then add $1 to $REQUIRED_MODULES.
10654a31a186aSmrg
10655a31a186aSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
10656d7be9c72Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
10657a31a186aSmrg	SAVE_CFLAGS="$CFLAGS"
10658d7be9c72Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
10659a31a186aSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
10660a31a186aSmrg#include "xorg-server.h"
10661a31a186aSmrg#if !defined $1
10662a31a186aSmrg#error $1 not defined
10663a31a186aSmrg#endif
10664a31a186aSmrg		]])],
10665a31a186aSmrg		[_EXT_CHECK=yes],
10666a31a186aSmrg		[_EXT_CHECK=no])
10667a31a186aSmrg	CFLAGS="$SAVE_CFLAGS"
10668a31a186aSmrg	AC_MSG_CHECKING([if $1 is defined])
10669a31a186aSmrg	AC_MSG_RESULT([$_EXT_CHECK])
10670a31a186aSmrg	if test "$_EXT_CHECK" != no; then
10671a31a186aSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
10672a31a186aSmrg	fi
10673a31a186aSmrg])
10674a31a186aSmrg
106750bb88ba4Smrg# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
106760bb88ba4Smrg# Foundation, Inc.
10677fe5e51b7Smrg#
10678fe5e51b7Smrg# This file is free software; the Free Software Foundation
10679fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10680fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10681fe5e51b7Smrg
106820bb88ba4Smrg# serial 1
106830bb88ba4Smrg
10684fe5e51b7Smrg# AM_AUTOMAKE_VERSION(VERSION)
10685fe5e51b7Smrg# ----------------------------
10686fe5e51b7Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
10687fe5e51b7Smrg# generated from the m4 files accompanying Automake X.Y.
10688fe5e51b7Smrg# (This private macro should not be called outside this file.)
10689fe5e51b7SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
10690643b027fSmrg[am__api_version='1.11'
10691fe5e51b7Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
10692fe5e51b7Smrgdnl require some minimum version.  Point them to the right macro.
106930bb88ba4Smrgm4_if([$1], [1.11.3], [],
10694fe5e51b7Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
10695fe5e51b7Smrg])
10696fe5e51b7Smrg
10697fe5e51b7Smrg# _AM_AUTOCONF_VERSION(VERSION)
10698fe5e51b7Smrg# -----------------------------
10699fe5e51b7Smrg# aclocal traces this macro to find the Autoconf version.
10700fe5e51b7Smrg# This is a private macro too.  Using m4_define simplifies
10701fe5e51b7Smrg# the logic in aclocal, which can simply ignore this definition.
10702fe5e51b7Smrgm4_define([_AM_AUTOCONF_VERSION], [])
10703fe5e51b7Smrg
10704fe5e51b7Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
10705fe5e51b7Smrg# -------------------------------
10706fe5e51b7Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
10707eda3803bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
10708fe5e51b7SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
107090bb88ba4Smrg[AM_AUTOMAKE_VERSION([1.11.3])dnl
10710eda3803bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
10711eda3803bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
10712eda3803bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
10713fe5e51b7Smrg
10714fe5e51b7Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
10715fe5e51b7Smrg
107160bb88ba4Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
10717fe5e51b7Smrg#
10718fe5e51b7Smrg# This file is free software; the Free Software Foundation
10719fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10720fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10721fe5e51b7Smrg
107220bb88ba4Smrg# serial 1
107230bb88ba4Smrg
10724fe5e51b7Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
10725fe5e51b7Smrg# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
10726fe5e51b7Smrg# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
10727fe5e51b7Smrg#
10728fe5e51b7Smrg# Of course, Automake must honor this variable whenever it calls a
10729fe5e51b7Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
10730fe5e51b7Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
10731fe5e51b7Smrg# depending on how configure is run.  This is pretty annoying, since
10732fe5e51b7Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
10733fe5e51b7Smrg# source directory, any form will work fine, but in subdirectories a
10734fe5e51b7Smrg# relative path needs to be adjusted first.
10735fe5e51b7Smrg#
10736fe5e51b7Smrg# $ac_aux_dir/missing
10737fe5e51b7Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
10738fe5e51b7Smrg# $top_srcdir/$ac_aux_dir/missing
10739fe5e51b7Smrg#    fails if $ac_aux_dir is absolute,
10740fe5e51b7Smrg#    fails when called from a subdirectory in a VPATH build with
10741fe5e51b7Smrg#          a relative $ac_aux_dir
10742fe5e51b7Smrg#
10743fe5e51b7Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
10744fe5e51b7Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
10745fe5e51b7Smrg# harmless because $srcdir is `.', but things will broke when you
10746fe5e51b7Smrg# start a VPATH build or use an absolute $srcdir.
10747fe5e51b7Smrg#
10748fe5e51b7Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
10749fe5e51b7Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
10750fe5e51b7Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
10751fe5e51b7Smrg# and then we would define $MISSING as
10752fe5e51b7Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
10753fe5e51b7Smrg# This will work as long as MISSING is not called from configure, because
10754fe5e51b7Smrg# unfortunately $(top_srcdir) has no meaning in configure.
10755fe5e51b7Smrg# However there are other variables, like CC, which are often used in
10756fe5e51b7Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
10757fe5e51b7Smrg#
10758fe5e51b7Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
10759fe5e51b7Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
10760fe5e51b7Smrg# configured tree to be moved without reconfiguration.
10761fe5e51b7Smrg
10762fe5e51b7SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
10763fe5e51b7Smrg[dnl Rely on autoconf to set up CDPATH properly.
10764fe5e51b7SmrgAC_PREREQ([2.50])dnl
10765fe5e51b7Smrg# expand $ac_aux_dir to an absolute path
10766fe5e51b7Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
10767fe5e51b7Smrg])
10768fe5e51b7Smrg
10769fe5e51b7Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
10770fe5e51b7Smrg
10771643b027fSmrg# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
10772fe5e51b7Smrg# Free Software Foundation, Inc.
10773fe5e51b7Smrg#
10774fe5e51b7Smrg# This file is free software; the Free Software Foundation
10775fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10776fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10777fe5e51b7Smrg
10778643b027fSmrg# serial 9
10779fe5e51b7Smrg
10780fe5e51b7Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
10781fe5e51b7Smrg# -------------------------------------
10782fe5e51b7Smrg# Define a conditional.
10783fe5e51b7SmrgAC_DEFUN([AM_CONDITIONAL],
10784fe5e51b7Smrg[AC_PREREQ(2.52)dnl
10785fe5e51b7Smrg ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
10786fe5e51b7Smrg	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
10787fe5e51b7SmrgAC_SUBST([$1_TRUE])dnl
10788fe5e51b7SmrgAC_SUBST([$1_FALSE])dnl
10789fe5e51b7Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
10790fe5e51b7Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
10791643b027fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
10792fe5e51b7Smrgif $2; then
10793fe5e51b7Smrg  $1_TRUE=
10794fe5e51b7Smrg  $1_FALSE='#'
10795fe5e51b7Smrgelse
10796fe5e51b7Smrg  $1_TRUE='#'
10797fe5e51b7Smrg  $1_FALSE=
10798fe5e51b7Smrgfi
10799fe5e51b7SmrgAC_CONFIG_COMMANDS_PRE(
10800fe5e51b7Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
10801fe5e51b7Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
10802fe5e51b7SmrgUsually this means the macro was only invoked conditionally.]])
10803fe5e51b7Smrgfi])])
10804fe5e51b7Smrg
108050bb88ba4Smrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
108060bb88ba4Smrg# 2010, 2011 Free Software Foundation, Inc.
10807fe5e51b7Smrg#
10808fe5e51b7Smrg# This file is free software; the Free Software Foundation
10809fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10810fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10811fe5e51b7Smrg
108120bb88ba4Smrg# serial 12
10813fe5e51b7Smrg
10814fe5e51b7Smrg# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
10815fe5e51b7Smrg# written in clear, in which case automake, when reading aclocal.m4,
10816fe5e51b7Smrg# will think it sees a *use*, and therefore will trigger all it's
10817fe5e51b7Smrg# C support machinery.  Also note that it means that autoscan, seeing
10818fe5e51b7Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
10819fe5e51b7Smrg
10820fe5e51b7Smrg
10821fe5e51b7Smrg# _AM_DEPENDENCIES(NAME)
10822fe5e51b7Smrg# ----------------------
10823fe5e51b7Smrg# See how the compiler implements dependency checking.
10824fe5e51b7Smrg# NAME is "CC", "CXX", "GCJ", or "OBJC".
10825fe5e51b7Smrg# We try a few techniques and use that to set a single cache variable.
10826fe5e51b7Smrg#
10827fe5e51b7Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
10828fe5e51b7Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
10829fe5e51b7Smrg# dependency, and given that the user is not expected to run this macro,
10830fe5e51b7Smrg# just rely on AC_PROG_CC.
10831fe5e51b7SmrgAC_DEFUN([_AM_DEPENDENCIES],
10832fe5e51b7Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
10833fe5e51b7SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
10834fe5e51b7SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
10835fe5e51b7SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
10836fe5e51b7Smrg
10837fe5e51b7Smrgifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
10838fe5e51b7Smrg       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
10839fe5e51b7Smrg       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
10840fe5e51b7Smrg       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
10841fe5e51b7Smrg       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
10842fe5e51b7Smrg                   [depcc="$$1"   am_compiler_list=])
10843fe5e51b7Smrg
10844fe5e51b7SmrgAC_CACHE_CHECK([dependency style of $depcc],
10845fe5e51b7Smrg               [am_cv_$1_dependencies_compiler_type],
10846fe5e51b7Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
10847fe5e51b7Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
10848fe5e51b7Smrg  # making bogus files that we don't know about and never remove.  For
10849fe5e51b7Smrg  # instance it was reported that on HP-UX the gcc test will end up
10850fe5e51b7Smrg  # making a dummy file named `D' -- because `-MD' means `put the output
10851fe5e51b7Smrg  # in D'.
108520bb88ba4Smrg  rm -rf conftest.dir
10853fe5e51b7Smrg  mkdir conftest.dir
10854fe5e51b7Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
10855fe5e51b7Smrg  # using a relative directory.
10856fe5e51b7Smrg  cp "$am_depcomp" conftest.dir
10857fe5e51b7Smrg  cd conftest.dir
10858fe5e51b7Smrg  # We will build objects and dependencies in a subdirectory because
10859fe5e51b7Smrg  # it helps to detect inapplicable dependency modes.  For instance
10860fe5e51b7Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
10861fe5e51b7Smrg  # side effect of compilation, but ICC will put the dependencies in
10862fe5e51b7Smrg  # the current directory while Tru64 will put them in the object
10863fe5e51b7Smrg  # directory.
10864fe5e51b7Smrg  mkdir sub
10865fe5e51b7Smrg
10866fe5e51b7Smrg  am_cv_$1_dependencies_compiler_type=none
10867fe5e51b7Smrg  if test "$am_compiler_list" = ""; then
10868fe5e51b7Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
10869fe5e51b7Smrg  fi
10870643b027fSmrg  am__universal=false
10871643b027fSmrg  m4_case([$1], [CC],
10872643b027fSmrg    [case " $depcc " in #(
10873643b027fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10874643b027fSmrg     esac],
10875643b027fSmrg    [CXX],
10876643b027fSmrg    [case " $depcc " in #(
10877643b027fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
10878643b027fSmrg     esac])
10879643b027fSmrg
10880fe5e51b7Smrg  for depmode in $am_compiler_list; do
10881fe5e51b7Smrg    # Setup a source with many dependencies, because some compilers
10882fe5e51b7Smrg    # like to wrap large dependency lists on column 80 (with \), and
10883fe5e51b7Smrg    # we should not choose a depcomp mode which is confused by this.
10884fe5e51b7Smrg    #
10885fe5e51b7Smrg    # We need to recreate these files for each test, as the compiler may
10886fe5e51b7Smrg    # overwrite some of them when testing with obscure command lines.
10887fe5e51b7Smrg    # This happens at least with the AIX C compiler.
10888fe5e51b7Smrg    : > sub/conftest.c
10889fe5e51b7Smrg    for i in 1 2 3 4 5 6; do
10890fe5e51b7Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
10891fe5e51b7Smrg      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
10892fe5e51b7Smrg      # Solaris 8's {/usr,}/bin/sh.
10893fe5e51b7Smrg      touch sub/conftst$i.h
10894fe5e51b7Smrg    done
10895fe5e51b7Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
10896fe5e51b7Smrg
10897643b027fSmrg    # We check with `-c' and `-o' for the sake of the "dashmstdout"
10898643b027fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
10899643b027fSmrg    # handle `-M -o', and we need to detect this.  Also, some Intel
10900643b027fSmrg    # versions had trouble with output in subdirs
10901643b027fSmrg    am__obj=sub/conftest.${OBJEXT-o}
10902643b027fSmrg    am__minus_obj="-o $am__obj"
10903fe5e51b7Smrg    case $depmode in
10904643b027fSmrg    gcc)
10905643b027fSmrg      # This depmode causes a compiler race in universal mode.
10906643b027fSmrg      test "$am__universal" = false || continue
10907643b027fSmrg      ;;
10908fe5e51b7Smrg    nosideeffect)
10909fe5e51b7Smrg      # after this tag, mechanisms are not by side-effect, so they'll
10910fe5e51b7Smrg      # only be used when explicitly requested
10911fe5e51b7Smrg      if test "x$enable_dependency_tracking" = xyes; then
10912fe5e51b7Smrg	continue
10913fe5e51b7Smrg      else
10914fe5e51b7Smrg	break
10915fe5e51b7Smrg      fi
10916fe5e51b7Smrg      ;;
109170bb88ba4Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
10918643b027fSmrg      # This compiler won't grok `-c -o', but also, the minuso test has
10919643b027fSmrg      # not run yet.  These depmodes are late enough in the game, and
10920643b027fSmrg      # so weak that their functioning should not be impacted.
10921643b027fSmrg      am__obj=conftest.${OBJEXT-o}
10922643b027fSmrg      am__minus_obj=
10923643b027fSmrg      ;;
10924fe5e51b7Smrg    none) break ;;
10925fe5e51b7Smrg    esac
10926fe5e51b7Smrg    if depmode=$depmode \
10927643b027fSmrg       source=sub/conftest.c object=$am__obj \
10928fe5e51b7Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
10929643b027fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
10930fe5e51b7Smrg         >/dev/null 2>conftest.err &&
10931fe5e51b7Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
10932fe5e51b7Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
10933643b027fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
10934fe5e51b7Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
10935fe5e51b7Smrg      # icc doesn't choke on unknown options, it will just issue warnings
10936fe5e51b7Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
10937fe5e51b7Smrg      # that says an option was ignored or not supported.
10938fe5e51b7Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
10939fe5e51b7Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
10940fe5e51b7Smrg      # The diagnosis changed in icc 8.0:
10941fe5e51b7Smrg      #   icc: Command line remark: option '-MP' not supported
10942fe5e51b7Smrg      if (grep 'ignoring option' conftest.err ||
10943fe5e51b7Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
10944fe5e51b7Smrg        am_cv_$1_dependencies_compiler_type=$depmode
10945fe5e51b7Smrg        break
10946fe5e51b7Smrg      fi
10947fe5e51b7Smrg    fi
10948fe5e51b7Smrg  done
10949fe5e51b7Smrg
10950fe5e51b7Smrg  cd ..
10951fe5e51b7Smrg  rm -rf conftest.dir
10952fe5e51b7Smrgelse
10953fe5e51b7Smrg  am_cv_$1_dependencies_compiler_type=none
10954fe5e51b7Smrgfi
10955fe5e51b7Smrg])
10956fe5e51b7SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
10957fe5e51b7SmrgAM_CONDITIONAL([am__fastdep$1], [
10958fe5e51b7Smrg  test "x$enable_dependency_tracking" != xno \
10959fe5e51b7Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
10960fe5e51b7Smrg])
10961fe5e51b7Smrg
10962fe5e51b7Smrg
10963fe5e51b7Smrg# AM_SET_DEPDIR
10964fe5e51b7Smrg# -------------
10965fe5e51b7Smrg# Choose a directory name for dependency files.
10966fe5e51b7Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES
10967fe5e51b7SmrgAC_DEFUN([AM_SET_DEPDIR],
10968fe5e51b7Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
10969fe5e51b7SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
10970fe5e51b7Smrg])
10971fe5e51b7Smrg
10972fe5e51b7Smrg
10973fe5e51b7Smrg# AM_DEP_TRACK
10974fe5e51b7Smrg# ------------
10975fe5e51b7SmrgAC_DEFUN([AM_DEP_TRACK],
10976fe5e51b7Smrg[AC_ARG_ENABLE(dependency-tracking,
10977fe5e51b7Smrg[  --disable-dependency-tracking  speeds up one-time build
10978fe5e51b7Smrg  --enable-dependency-tracking   do not reject slow dependency extractors])
10979fe5e51b7Smrgif test "x$enable_dependency_tracking" != xno; then
10980fe5e51b7Smrg  am_depcomp="$ac_aux_dir/depcomp"
10981fe5e51b7Smrg  AMDEPBACKSLASH='\'
109820bb88ba4Smrg  am__nodep='_no'
10983fe5e51b7Smrgfi
10984fe5e51b7SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
10985fe5e51b7SmrgAC_SUBST([AMDEPBACKSLASH])dnl
10986fe5e51b7Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
109870bb88ba4SmrgAC_SUBST([am__nodep])dnl
109880bb88ba4Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
10989fe5e51b7Smrg])
10990fe5e51b7Smrg
10991fe5e51b7Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
10992fe5e51b7Smrg
10993eda3803bSmrg# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
10994fe5e51b7Smrg# Free Software Foundation, Inc.
10995fe5e51b7Smrg#
10996fe5e51b7Smrg# This file is free software; the Free Software Foundation
10997fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
10998fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
10999fe5e51b7Smrg
11000643b027fSmrg#serial 5
11001fe5e51b7Smrg
11002fe5e51b7Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11003fe5e51b7Smrg# ------------------------------
11004fe5e51b7SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11005643b027fSmrg[{
11006643b027fSmrg  # Autoconf 2.62 quotes --file arguments for eval, but not when files
11007643b027fSmrg  # are listed without --file.  Let's play safe and only enable the eval
11008643b027fSmrg  # if we detect the quoting.
11009643b027fSmrg  case $CONFIG_FILES in
11010643b027fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
11011643b027fSmrg  *)   set x $CONFIG_FILES ;;
11012643b027fSmrg  esac
11013643b027fSmrg  shift
11014643b027fSmrg  for mf
11015643b027fSmrg  do
11016643b027fSmrg    # Strip MF so we end up with the name of the file.
11017643b027fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11018643b027fSmrg    # Check whether this is an Automake generated Makefile or not.
11019643b027fSmrg    # We used to match only the files named `Makefile.in', but
11020643b027fSmrg    # some people rename them; so instead we look at the file content.
11021643b027fSmrg    # Grep'ing the first line is not enough: some people post-process
11022643b027fSmrg    # each Makefile.in and add a new line on top of each file to say so.
11023643b027fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
11024643b027fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
11025643b027fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11026643b027fSmrg      dirpart=`AS_DIRNAME("$mf")`
11027643b027fSmrg    else
11028643b027fSmrg      continue
11029643b027fSmrg    fi
11030643b027fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
11031643b027fSmrg    # from the Makefile without running `make'.
11032643b027fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11033643b027fSmrg    test -z "$DEPDIR" && continue
11034643b027fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11035643b027fSmrg    test -z "am__include" && continue
11036643b027fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11037643b027fSmrg    # When using ansi2knr, U may be empty or an underscore; expand it
11038643b027fSmrg    U=`sed -n 's/^U = //p' < "$mf"`
11039643b027fSmrg    # Find all dependency output files, they are included files with
11040643b027fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11041643b027fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11042643b027fSmrg    # expansion.
11043643b027fSmrg    for file in `sed -n "
11044643b027fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11045643b027fSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
11046643b027fSmrg      # Make sure the directory exists.
11047643b027fSmrg      test -f "$dirpart/$file" && continue
11048643b027fSmrg      fdir=`AS_DIRNAME(["$file"])`
11049643b027fSmrg      AS_MKDIR_P([$dirpart/$fdir])
11050643b027fSmrg      # echo "creating $dirpart/$file"
11051643b027fSmrg      echo '# dummy' > "$dirpart/$file"
11052643b027fSmrg    done
11053fe5e51b7Smrg  done
11054643b027fSmrg}
11055fe5e51b7Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11056fe5e51b7Smrg
11057fe5e51b7Smrg
11058fe5e51b7Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11059fe5e51b7Smrg# -----------------------------
11060fe5e51b7Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
11061fe5e51b7Smrg#
11062fe5e51b7Smrg# This code is only required when automatic dependency tracking
11063fe5e51b7Smrg# is enabled.  FIXME.  This creates each `.P' file that we will
11064fe5e51b7Smrg# need in order to bootstrap the dependency handling code.
11065fe5e51b7SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11066fe5e51b7Smrg[AC_CONFIG_COMMANDS([depfiles],
11067fe5e51b7Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11068fe5e51b7Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11069fe5e51b7Smrg])
11070fe5e51b7Smrg
11071fe5e51b7Smrg# Do all the work for Automake.                             -*- Autoconf -*-
11072fe5e51b7Smrg
11073fe5e51b7Smrg# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
11074643b027fSmrg# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
11075fe5e51b7Smrg#
11076fe5e51b7Smrg# This file is free software; the Free Software Foundation
11077fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11078fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11079fe5e51b7Smrg
11080643b027fSmrg# serial 16
11081fe5e51b7Smrg
11082fe5e51b7Smrg# This macro actually does too much.  Some checks are only needed if
11083fe5e51b7Smrg# your package does certain things.  But this isn't really a big deal.
11084fe5e51b7Smrg
11085fe5e51b7Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11086fe5e51b7Smrg# AM_INIT_AUTOMAKE([OPTIONS])
11087fe5e51b7Smrg# -----------------------------------------------
11088fe5e51b7Smrg# The call with PACKAGE and VERSION arguments is the old style
11089fe5e51b7Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11090fe5e51b7Smrg# and VERSION should now be passed to AC_INIT and removed from
11091fe5e51b7Smrg# the call to AM_INIT_AUTOMAKE.
11092fe5e51b7Smrg# We support both call styles for the transition.  After
11093fe5e51b7Smrg# the next Automake release, Autoconf can make the AC_INIT
11094fe5e51b7Smrg# arguments mandatory, and then we can depend on a new Autoconf
11095fe5e51b7Smrg# release and drop the old call support.
11096fe5e51b7SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11097643b027fSmrg[AC_PREREQ([2.62])dnl
11098fe5e51b7Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11099fe5e51b7Smrgdnl the ones we care about.
11100fe5e51b7Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11101fe5e51b7SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11102fe5e51b7SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11103fe5e51b7Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11104fe5e51b7Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11105fe5e51b7Smrg  # is not polluted with repeated "-I."
11106fe5e51b7Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11107fe5e51b7Smrg  # test to see if srcdir already configured
11108fe5e51b7Smrg  if test -f $srcdir/config.status; then
11109fe5e51b7Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11110fe5e51b7Smrg  fi
11111fe5e51b7Smrgfi
11112fe5e51b7Smrg
11113fe5e51b7Smrg# test whether we have cygpath
11114fe5e51b7Smrgif test -z "$CYGPATH_W"; then
11115fe5e51b7Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11116fe5e51b7Smrg    CYGPATH_W='cygpath -w'
11117fe5e51b7Smrg  else
11118fe5e51b7Smrg    CYGPATH_W=echo
11119fe5e51b7Smrg  fi
11120fe5e51b7Smrgfi
11121fe5e51b7SmrgAC_SUBST([CYGPATH_W])
11122fe5e51b7Smrg
11123fe5e51b7Smrg# Define the identity of the package.
11124fe5e51b7Smrgdnl Distinguish between old-style and new-style calls.
11125fe5e51b7Smrgm4_ifval([$2],
11126fe5e51b7Smrg[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11127fe5e51b7Smrg AC_SUBST([PACKAGE], [$1])dnl
11128fe5e51b7Smrg AC_SUBST([VERSION], [$2])],
11129fe5e51b7Smrg[_AM_SET_OPTIONS([$1])dnl
11130fe5e51b7Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11131fe5e51b7Smrgm4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
11132fe5e51b7Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11133fe5e51b7Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11134fe5e51b7Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11135fe5e51b7Smrg
11136fe5e51b7Smrg_AM_IF_OPTION([no-define],,
11137fe5e51b7Smrg[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
11138fe5e51b7Smrg AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
11139fe5e51b7Smrg
11140fe5e51b7Smrg# Some tools Automake needs.
11141fe5e51b7SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11142fe5e51b7SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11143fe5e51b7SmrgAM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
11144fe5e51b7SmrgAM_MISSING_PROG(AUTOCONF, autoconf)
11145fe5e51b7SmrgAM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
11146fe5e51b7SmrgAM_MISSING_PROG(AUTOHEADER, autoheader)
11147fe5e51b7SmrgAM_MISSING_PROG(MAKEINFO, makeinfo)
11148643b027fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11149643b027fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11150fe5e51b7SmrgAC_REQUIRE([AM_PROG_MKDIR_P])dnl
11151fe5e51b7Smrg# We need awk for the "check" target.  The system "awk" is bad on
11152fe5e51b7Smrg# some platforms.
11153fe5e51b7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
11154fe5e51b7SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11155fe5e51b7SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11156fe5e51b7Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11157643b027fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11158643b027fSmrg			     [_AM_PROG_TAR([v7])])])
11159fe5e51b7Smrg_AM_IF_OPTION([no-dependencies],,
11160fe5e51b7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11161643b027fSmrg		  [_AM_DEPENDENCIES(CC)],
11162643b027fSmrg		  [define([AC_PROG_CC],
11163643b027fSmrg			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
11164fe5e51b7SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11165643b027fSmrg		  [_AM_DEPENDENCIES(CXX)],
11166643b027fSmrg		  [define([AC_PROG_CXX],
11167643b027fSmrg			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
11168fe5e51b7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11169643b027fSmrg		  [_AM_DEPENDENCIES(OBJC)],
11170643b027fSmrg		  [define([AC_PROG_OBJC],
11171643b027fSmrg			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
11172fe5e51b7Smrg])
11173643b027fSmrg_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
11174643b027fSmrgdnl The `parallel-tests' driver may need to know about EXEEXT, so add the
11175643b027fSmrgdnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
11176643b027fSmrgdnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
11177643b027fSmrgAC_CONFIG_COMMANDS_PRE(dnl
11178643b027fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11179643b027fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11180fe5e51b7Smrg])
11181fe5e51b7Smrg
11182643b027fSmrgdnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11183643b027fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11184643b027fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
11185643b027fSmrgm4_define([_AC_COMPILER_EXEEXT],
11186643b027fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11187643b027fSmrg
11188fe5e51b7Smrg
11189fe5e51b7Smrg# When config.status generates a header, we must update the stamp-h file.
11190fe5e51b7Smrg# This file resides in the same directory as the config header
11191fe5e51b7Smrg# that is generated.  The stamp files are numbered to have different names.
11192fe5e51b7Smrg
11193fe5e51b7Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11194fe5e51b7Smrg# loop where config.status creates the headers, so we can generate
11195fe5e51b7Smrg# our stamp files there.
11196fe5e51b7SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11197fe5e51b7Smrg[# Compute $1's index in $config_headers.
11198eda3803bSmrg_am_arg=$1
11199fe5e51b7Smrg_am_stamp_count=1
11200fe5e51b7Smrgfor _am_header in $config_headers :; do
11201fe5e51b7Smrg  case $_am_header in
11202eda3803bSmrg    $_am_arg | $_am_arg:* )
11203fe5e51b7Smrg      break ;;
11204fe5e51b7Smrg    * )
11205fe5e51b7Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11206fe5e51b7Smrg  esac
11207fe5e51b7Smrgdone
11208eda3803bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11209fe5e51b7Smrg
112100bb88ba4Smrg# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
112110bb88ba4Smrg# Inc.
11212fe5e51b7Smrg#
11213fe5e51b7Smrg# This file is free software; the Free Software Foundation
11214fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11215fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11216fe5e51b7Smrg
112170bb88ba4Smrg# serial 1
112180bb88ba4Smrg
11219fe5e51b7Smrg# AM_PROG_INSTALL_SH
11220fe5e51b7Smrg# ------------------
11221fe5e51b7Smrg# Define $install_sh.
11222fe5e51b7SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11223fe5e51b7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11224643b027fSmrgif test x"${install_sh}" != xset; then
11225643b027fSmrg  case $am_aux_dir in
11226643b027fSmrg  *\ * | *\	*)
11227643b027fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11228643b027fSmrg  *)
11229643b027fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11230643b027fSmrg  esac
11231643b027fSmrgfi
11232fe5e51b7SmrgAC_SUBST(install_sh)])
11233fe5e51b7Smrg
11234fe5e51b7Smrg# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
11235fe5e51b7Smrg#
11236fe5e51b7Smrg# This file is free software; the Free Software Foundation
11237fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11238fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11239fe5e51b7Smrg
11240fe5e51b7Smrg# serial 2
11241fe5e51b7Smrg
11242fe5e51b7Smrg# Check whether the underlying file-system supports filenames
11243fe5e51b7Smrg# with a leading dot.  For instance MS-DOS doesn't.
11244fe5e51b7SmrgAC_DEFUN([AM_SET_LEADING_DOT],
11245fe5e51b7Smrg[rm -rf .tst 2>/dev/null
11246fe5e51b7Smrgmkdir .tst 2>/dev/null
11247fe5e51b7Smrgif test -d .tst; then
11248fe5e51b7Smrg  am__leading_dot=.
11249fe5e51b7Smrgelse
11250fe5e51b7Smrg  am__leading_dot=_
11251fe5e51b7Smrgfi
11252fe5e51b7Smrgrmdir .tst 2>/dev/null
11253fe5e51b7SmrgAC_SUBST([am__leading_dot])])
11254fe5e51b7Smrg
11255fe5e51b7Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
11256fe5e51b7Smrg# From Jim Meyering
11257fe5e51b7Smrg
112580bb88ba4Smrg# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
112590bb88ba4Smrg# 2011 Free Software Foundation, Inc.
11260fe5e51b7Smrg#
11261fe5e51b7Smrg# This file is free software; the Free Software Foundation
11262fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11263fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11264fe5e51b7Smrg
11265643b027fSmrg# serial 5
11266fe5e51b7Smrg
11267643b027fSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
11268643b027fSmrg# ----------------------------------
11269643b027fSmrg# Control maintainer-specific portions of Makefiles.
11270643b027fSmrg# Default is to disable them, unless `enable' is passed literally.
11271643b027fSmrg# For symmetry, `disable' may be passed as well.  Anyway, the user
11272643b027fSmrg# can override the default with the --enable/--disable switch.
11273fe5e51b7SmrgAC_DEFUN([AM_MAINTAINER_MODE],
11274643b027fSmrg[m4_case(m4_default([$1], [disable]),
11275643b027fSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
11276643b027fSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
11277643b027fSmrg       [m4_define([am_maintainer_other], [enable])
11278643b027fSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
112790bb88ba4SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
11280643b027fSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
11281643b027fSmrg  AC_ARG_ENABLE([maintainer-mode],
11282643b027fSmrg[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
11283fe5e51b7Smrg			  (and sometimes confusing) to the casual installer],
11284643b027fSmrg      [USE_MAINTAINER_MODE=$enableval],
11285643b027fSmrg      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
11286fe5e51b7Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
11287643b027fSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
11288fe5e51b7Smrg  MAINT=$MAINTAINER_MODE_TRUE
11289643b027fSmrg  AC_SUBST([MAINT])dnl
11290fe5e51b7Smrg]
11291fe5e51b7Smrg)
11292fe5e51b7Smrg
11293fe5e51b7SmrgAU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
11294fe5e51b7Smrg
11295fe5e51b7Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11296fe5e51b7Smrg
11297643b027fSmrg# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
11298fe5e51b7Smrg#
11299fe5e51b7Smrg# This file is free software; the Free Software Foundation
11300fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11301fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11302fe5e51b7Smrg
11303643b027fSmrg# serial 4
11304fe5e51b7Smrg
11305fe5e51b7Smrg# AM_MAKE_INCLUDE()
11306fe5e51b7Smrg# -----------------
11307fe5e51b7Smrg# Check to see how make treats includes.
11308fe5e51b7SmrgAC_DEFUN([AM_MAKE_INCLUDE],
11309fe5e51b7Smrg[am_make=${MAKE-make}
11310fe5e51b7Smrgcat > confinc << 'END'
11311fe5e51b7Smrgam__doit:
11312643b027fSmrg	@echo this is the am__doit target
11313fe5e51b7Smrg.PHONY: am__doit
11314fe5e51b7SmrgEND
11315fe5e51b7Smrg# If we don't find an include directive, just comment out the code.
11316fe5e51b7SmrgAC_MSG_CHECKING([for style of include used by $am_make])
11317fe5e51b7Smrgam__include="#"
11318fe5e51b7Smrgam__quote=
11319fe5e51b7Smrg_am_result=none
11320fe5e51b7Smrg# First try GNU make style include.
11321fe5e51b7Smrgecho "include confinc" > confmf
11322643b027fSmrg# Ignore all kinds of additional output from `make'.
11323643b027fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11324643b027fSmrg*the\ am__doit\ target*)
11325643b027fSmrg  am__include=include
11326643b027fSmrg  am__quote=
11327643b027fSmrg  _am_result=GNU
11328643b027fSmrg  ;;
11329643b027fSmrgesac
11330fe5e51b7Smrg# Now try BSD make style include.
11331fe5e51b7Smrgif test "$am__include" = "#"; then
11332fe5e51b7Smrg   echo '.include "confinc"' > confmf
11333643b027fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11334643b027fSmrg   *the\ am__doit\ target*)
11335643b027fSmrg     am__include=.include
11336643b027fSmrg     am__quote="\""
11337643b027fSmrg     _am_result=BSD
11338643b027fSmrg     ;;
11339643b027fSmrg   esac
11340fe5e51b7Smrgfi
11341fe5e51b7SmrgAC_SUBST([am__include])
11342fe5e51b7SmrgAC_SUBST([am__quote])
11343fe5e51b7SmrgAC_MSG_RESULT([$_am_result])
11344fe5e51b7Smrgrm -f confinc confmf
11345fe5e51b7Smrg])
11346fe5e51b7Smrg
11347fe5e51b7Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11348fe5e51b7Smrg
11349643b027fSmrg# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
11350fe5e51b7Smrg# Free Software Foundation, Inc.
11351fe5e51b7Smrg#
11352fe5e51b7Smrg# This file is free software; the Free Software Foundation
11353fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11354fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11355fe5e51b7Smrg
11356643b027fSmrg# serial 6
11357fe5e51b7Smrg
11358fe5e51b7Smrg# AM_MISSING_PROG(NAME, PROGRAM)
11359fe5e51b7Smrg# ------------------------------
11360fe5e51b7SmrgAC_DEFUN([AM_MISSING_PROG],
11361fe5e51b7Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11362fe5e51b7Smrg$1=${$1-"${am_missing_run}$2"}
11363fe5e51b7SmrgAC_SUBST($1)])
11364fe5e51b7Smrg
11365fe5e51b7Smrg
11366fe5e51b7Smrg# AM_MISSING_HAS_RUN
11367fe5e51b7Smrg# ------------------
11368fe5e51b7Smrg# Define MISSING if not defined so far and test if it supports --run.
11369fe5e51b7Smrg# If it does, set am_missing_run to use it, otherwise, to nothing.
11370fe5e51b7SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11371fe5e51b7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11372fe5e51b7SmrgAC_REQUIRE_AUX_FILE([missing])dnl
11373643b027fSmrgif test x"${MISSING+set}" != xset; then
11374643b027fSmrg  case $am_aux_dir in
11375643b027fSmrg  *\ * | *\	*)
11376643b027fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11377643b027fSmrg  *)
11378643b027fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11379643b027fSmrg  esac
11380643b027fSmrgfi
11381fe5e51b7Smrg# Use eval to expand $SHELL
11382fe5e51b7Smrgif eval "$MISSING --run true"; then
11383fe5e51b7Smrg  am_missing_run="$MISSING --run "
11384fe5e51b7Smrgelse
11385fe5e51b7Smrg  am_missing_run=
11386fe5e51b7Smrg  AC_MSG_WARN([`missing' script is too old or missing])
11387fe5e51b7Smrgfi
11388fe5e51b7Smrg])
11389fe5e51b7Smrg
113900bb88ba4Smrg# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
113910bb88ba4Smrg# Inc.
11392fe5e51b7Smrg#
11393fe5e51b7Smrg# This file is free software; the Free Software Foundation
11394fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11395fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11396fe5e51b7Smrg
113970bb88ba4Smrg# serial 1
113980bb88ba4Smrg
11399fe5e51b7Smrg# AM_PROG_MKDIR_P
11400fe5e51b7Smrg# ---------------
11401fe5e51b7Smrg# Check for `mkdir -p'.
11402fe5e51b7SmrgAC_DEFUN([AM_PROG_MKDIR_P],
11403fe5e51b7Smrg[AC_PREREQ([2.60])dnl
11404fe5e51b7SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11405fe5e51b7Smrgdnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
11406fe5e51b7Smrgdnl while keeping a definition of mkdir_p for backward compatibility.
11407fe5e51b7Smrgdnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
11408fe5e51b7Smrgdnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
11409fe5e51b7Smrgdnl Makefile.ins that do not define MKDIR_P, so we do our own
11410fe5e51b7Smrgdnl adjustment using top_builddir (which is defined more often than
11411fe5e51b7Smrgdnl MKDIR_P).
11412fe5e51b7SmrgAC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
11413fe5e51b7Smrgcase $mkdir_p in
11414fe5e51b7Smrg  [[\\/$]]* | ?:[[\\/]]*) ;;
11415fe5e51b7Smrg  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
11416fe5e51b7Smrgesac
11417fe5e51b7Smrg])
11418fe5e51b7Smrg
11419fe5e51b7Smrg# Helper functions for option handling.                     -*- Autoconf -*-
11420fe5e51b7Smrg
114210bb88ba4Smrg# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
114220bb88ba4Smrg# Foundation, Inc.
11423fe5e51b7Smrg#
11424fe5e51b7Smrg# This file is free software; the Free Software Foundation
11425fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11426fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11427fe5e51b7Smrg
114280bb88ba4Smrg# serial 5
11429fe5e51b7Smrg
11430fe5e51b7Smrg# _AM_MANGLE_OPTION(NAME)
11431fe5e51b7Smrg# -----------------------
11432fe5e51b7SmrgAC_DEFUN([_AM_MANGLE_OPTION],
11433fe5e51b7Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11434fe5e51b7Smrg
11435fe5e51b7Smrg# _AM_SET_OPTION(NAME)
114360bb88ba4Smrg# --------------------
11437fe5e51b7Smrg# Set option NAME.  Presently that only means defining a flag for this option.
11438fe5e51b7SmrgAC_DEFUN([_AM_SET_OPTION],
11439fe5e51b7Smrg[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
11440fe5e51b7Smrg
11441fe5e51b7Smrg# _AM_SET_OPTIONS(OPTIONS)
114420bb88ba4Smrg# ------------------------
11443fe5e51b7Smrg# OPTIONS is a space-separated list of Automake options.
11444fe5e51b7SmrgAC_DEFUN([_AM_SET_OPTIONS],
11445eda3803bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11446fe5e51b7Smrg
11447fe5e51b7Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
11448fe5e51b7Smrg# -------------------------------------------
11449fe5e51b7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11450fe5e51b7SmrgAC_DEFUN([_AM_IF_OPTION],
11451fe5e51b7Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11452fe5e51b7Smrg
11453fe5e51b7Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11454fe5e51b7Smrg
11455643b027fSmrg# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
11456fe5e51b7Smrg# Free Software Foundation, Inc.
11457fe5e51b7Smrg#
11458fe5e51b7Smrg# This file is free software; the Free Software Foundation
11459fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11460fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11461fe5e51b7Smrg
11462643b027fSmrg# serial 5
11463fe5e51b7Smrg
11464fe5e51b7Smrg# AM_SANITY_CHECK
11465fe5e51b7Smrg# ---------------
11466fe5e51b7SmrgAC_DEFUN([AM_SANITY_CHECK],
11467fe5e51b7Smrg[AC_MSG_CHECKING([whether build environment is sane])
11468fe5e51b7Smrg# Just in case
11469fe5e51b7Smrgsleep 1
11470fe5e51b7Smrgecho timestamp > conftest.file
11471643b027fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
11472643b027fSmrg# name.  Accept space and tab only in the latter.
11473643b027fSmrgam_lf='
11474643b027fSmrg'
11475643b027fSmrgcase `pwd` in
11476643b027fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
11477643b027fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
11478643b027fSmrgesac
11479643b027fSmrgcase $srcdir in
11480643b027fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
11481643b027fSmrg    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
11482643b027fSmrgesac
11483643b027fSmrg
11484fe5e51b7Smrg# Do `set' in a subshell so we don't clobber the current shell's
11485fe5e51b7Smrg# arguments.  Must try -L first in case configure is actually a
11486fe5e51b7Smrg# symlink; some systems play weird games with the mod time of symlinks
11487fe5e51b7Smrg# (eg FreeBSD returns the mod time of the symlink's containing
11488fe5e51b7Smrg# directory).
11489fe5e51b7Smrgif (
11490643b027fSmrg   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
11491fe5e51b7Smrg   if test "$[*]" = "X"; then
11492fe5e51b7Smrg      # -L didn't work.
11493643b027fSmrg      set X `ls -t "$srcdir/configure" conftest.file`
11494fe5e51b7Smrg   fi
11495fe5e51b7Smrg   rm -f conftest.file
11496fe5e51b7Smrg   if test "$[*]" != "X $srcdir/configure conftest.file" \
11497fe5e51b7Smrg      && test "$[*]" != "X conftest.file $srcdir/configure"; then
11498fe5e51b7Smrg
11499fe5e51b7Smrg      # If neither matched, then we have a broken ls.  This can happen
11500fe5e51b7Smrg      # if, for instance, CONFIG_SHELL is bash and it inherits a
11501fe5e51b7Smrg      # broken ls alias from the environment.  This has actually
11502fe5e51b7Smrg      # happened.  Such a system could not be considered "sane".
11503fe5e51b7Smrg      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
11504fe5e51b7Smrgalias in your environment])
11505fe5e51b7Smrg   fi
11506fe5e51b7Smrg
11507fe5e51b7Smrg   test "$[2]" = conftest.file
11508fe5e51b7Smrg   )
11509fe5e51b7Smrgthen
11510fe5e51b7Smrg   # Ok.
11511fe5e51b7Smrg   :
11512fe5e51b7Smrgelse
11513fe5e51b7Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
11514fe5e51b7SmrgCheck your system clock])
11515fe5e51b7Smrgfi
11516fe5e51b7SmrgAC_MSG_RESULT(yes)])
11517fe5e51b7Smrg
115180bb88ba4Smrg# Copyright (C) 2009, 2011  Free Software Foundation, Inc.
11519a31a186aSmrg#
11520a31a186aSmrg# This file is free software; the Free Software Foundation
11521a31a186aSmrg# gives unlimited permission to copy and/or distribute it,
11522a31a186aSmrg# with or without modifications, as long as this notice is preserved.
11523a31a186aSmrg
115240bb88ba4Smrg# serial 2
11525a31a186aSmrg
11526a31a186aSmrg# AM_SILENT_RULES([DEFAULT])
11527a31a186aSmrg# --------------------------
11528a31a186aSmrg# Enable less verbose build rules; with the default set to DEFAULT
11529a31a186aSmrg# (`yes' being less verbose, `no' or empty being verbose).
11530a31a186aSmrgAC_DEFUN([AM_SILENT_RULES],
11531a31a186aSmrg[AC_ARG_ENABLE([silent-rules],
11532a31a186aSmrg[  --enable-silent-rules          less verbose build output (undo: `make V=1')
11533a31a186aSmrg  --disable-silent-rules         verbose build output (undo: `make V=0')])
11534a31a186aSmrgcase $enable_silent_rules in
11535a31a186aSmrgyes) AM_DEFAULT_VERBOSITY=0;;
11536a31a186aSmrgno)  AM_DEFAULT_VERBOSITY=1;;
11537a31a186aSmrg*)   AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
11538a31a186aSmrgesac
115390bb88ba4Smrgdnl
115400bb88ba4Smrgdnl A few `make' implementations (e.g., NonStop OS and NextStep)
115410bb88ba4Smrgdnl do not support nested variable expansions.
115420bb88ba4Smrgdnl See automake bug#9928 and bug#10237.
115430bb88ba4Smrgam_make=${MAKE-make}
115440bb88ba4SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
115450bb88ba4Smrg   [am_cv_make_support_nested_variables],
115460bb88ba4Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
115470bb88ba4SmrgBAR0=false
115480bb88ba4SmrgBAR1=true
115490bb88ba4SmrgV=1
115500bb88ba4Smrgam__doit:
115510bb88ba4Smrg	@$(TRUE)
115520bb88ba4Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
115530bb88ba4Smrg  am_cv_make_support_nested_variables=yes
115540bb88ba4Smrgelse
115550bb88ba4Smrg  am_cv_make_support_nested_variables=no
115560bb88ba4Smrgfi])
115570bb88ba4Smrgif test $am_cv_make_support_nested_variables = yes; then
115580bb88ba4Smrg  dnl Using `$V' instead of `$(V)' breaks IRIX make.
115590bb88ba4Smrg  AM_V='$(V)'
115600bb88ba4Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
115610bb88ba4Smrgelse
115620bb88ba4Smrg  AM_V=$AM_DEFAULT_VERBOSITY
115630bb88ba4Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
115640bb88ba4Smrgfi
115650bb88ba4SmrgAC_SUBST([AM_V])dnl
115660bb88ba4SmrgAM_SUBST_NOTMAKE([AM_V])dnl
115670bb88ba4SmrgAC_SUBST([AM_DEFAULT_V])dnl
115680bb88ba4SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
11569a31a186aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
11570a31a186aSmrgAM_BACKSLASH='\'
11571a31a186aSmrgAC_SUBST([AM_BACKSLASH])dnl
11572a31a186aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
11573a31a186aSmrg])
11574a31a186aSmrg
115750bb88ba4Smrg# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
11576fe5e51b7Smrg#
11577fe5e51b7Smrg# This file is free software; the Free Software Foundation
11578fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11579fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11580fe5e51b7Smrg
115810bb88ba4Smrg# serial 1
115820bb88ba4Smrg
11583fe5e51b7Smrg# AM_PROG_INSTALL_STRIP
11584fe5e51b7Smrg# ---------------------
11585fe5e51b7Smrg# One issue with vendor `install' (even GNU) is that you can't
11586fe5e51b7Smrg# specify the program used to strip binaries.  This is especially
11587fe5e51b7Smrg# annoying in cross-compiling environments, where the build's strip
11588fe5e51b7Smrg# is unlikely to handle the host's binaries.
11589fe5e51b7Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
11590fe5e51b7Smrg# always use install-sh in `make install-strip', and initialize
11591fe5e51b7Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
11592fe5e51b7SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
11593fe5e51b7Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11594fe5e51b7Smrg# Installed binaries are usually stripped using `strip' when the user
11595fe5e51b7Smrg# run `make install-strip'.  However `strip' might not be the right
11596fe5e51b7Smrg# tool to use in cross-compilation environments, therefore Automake
11597fe5e51b7Smrg# will honor the `STRIP' environment variable to overrule this program.
11598fe5e51b7Smrgdnl Don't test for $cross_compiling = yes, because it might be `maybe'.
11599fe5e51b7Smrgif test "$cross_compiling" != no; then
11600fe5e51b7Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
11601fe5e51b7Smrgfi
11602fe5e51b7SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
11603fe5e51b7SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
11604fe5e51b7Smrg
116050bb88ba4Smrg# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
11606fe5e51b7Smrg#
11607fe5e51b7Smrg# This file is free software; the Free Software Foundation
11608fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11609fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11610fe5e51b7Smrg
116110bb88ba4Smrg# serial 3
11612643b027fSmrg
11613fe5e51b7Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
11614fe5e51b7Smrg# ---------------------------
11615eda3803bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
11616fe5e51b7Smrg# This macro is traced by Automake.
11617fe5e51b7SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
11618fe5e51b7Smrg
11619643b027fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
116200bb88ba4Smrg# --------------------------
11621643b027fSmrg# Public sister of _AM_SUBST_NOTMAKE.
11622643b027fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
11623643b027fSmrg
11624fe5e51b7Smrg# Check how to create a tarball.                            -*- Autoconf -*-
11625fe5e51b7Smrg
116260bb88ba4Smrg# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
11627fe5e51b7Smrg#
11628fe5e51b7Smrg# This file is free software; the Free Software Foundation
11629fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11630fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11631fe5e51b7Smrg
11632fe5e51b7Smrg# serial 2
11633fe5e51b7Smrg
11634fe5e51b7Smrg# _AM_PROG_TAR(FORMAT)
11635fe5e51b7Smrg# --------------------
11636fe5e51b7Smrg# Check how to create a tarball in format FORMAT.
11637fe5e51b7Smrg# FORMAT should be one of `v7', `ustar', or `pax'.
11638fe5e51b7Smrg#
11639fe5e51b7Smrg# Substitute a variable $(am__tar) that is a command
11640fe5e51b7Smrg# writing to stdout a FORMAT-tarball containing the directory
11641fe5e51b7Smrg# $tardir.
11642fe5e51b7Smrg#     tardir=directory && $(am__tar) > result.tar
11643fe5e51b7Smrg#
11644fe5e51b7Smrg# Substitute a variable $(am__untar) that extract such
11645fe5e51b7Smrg# a tarball read from stdin.
11646fe5e51b7Smrg#     $(am__untar) < result.tar
11647fe5e51b7SmrgAC_DEFUN([_AM_PROG_TAR],
116480bb88ba4Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
116490bb88ba4Smrg# in the wild :-(  We should find a proper way to deprecate it ...
116500bb88ba4SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
11651fe5e51b7Smrgm4_if([$1], [v7],
116520bb88ba4Smrg     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
11653fe5e51b7Smrg     [m4_case([$1], [ustar],, [pax],,
11654fe5e51b7Smrg              [m4_fatal([Unknown tar format])])
11655fe5e51b7SmrgAC_MSG_CHECKING([how to create a $1 tar archive])
11656fe5e51b7Smrg# Loop over all known methods to create a tar archive until one works.
11657fe5e51b7Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
11658fe5e51b7Smrg_am_tools=${am_cv_prog_tar_$1-$_am_tools}
11659fe5e51b7Smrg# Do not fold the above two line into one, because Tru64 sh and
11660fe5e51b7Smrg# Solaris sh will not grok spaces in the rhs of `-'.
11661fe5e51b7Smrgfor _am_tool in $_am_tools
11662fe5e51b7Smrgdo
11663fe5e51b7Smrg  case $_am_tool in
11664fe5e51b7Smrg  gnutar)
11665fe5e51b7Smrg    for _am_tar in tar gnutar gtar;
11666fe5e51b7Smrg    do
11667fe5e51b7Smrg      AM_RUN_LOG([$_am_tar --version]) && break
11668fe5e51b7Smrg    done
11669fe5e51b7Smrg    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
11670fe5e51b7Smrg    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
11671fe5e51b7Smrg    am__untar="$_am_tar -xf -"
11672fe5e51b7Smrg    ;;
11673fe5e51b7Smrg  plaintar)
11674fe5e51b7Smrg    # Must skip GNU tar: if it does not support --format= it doesn't create
11675fe5e51b7Smrg    # ustar tarball either.
11676fe5e51b7Smrg    (tar --version) >/dev/null 2>&1 && continue
11677fe5e51b7Smrg    am__tar='tar chf - "$$tardir"'
11678fe5e51b7Smrg    am__tar_='tar chf - "$tardir"'
11679fe5e51b7Smrg    am__untar='tar xf -'
11680fe5e51b7Smrg    ;;
11681fe5e51b7Smrg  pax)
11682fe5e51b7Smrg    am__tar='pax -L -x $1 -w "$$tardir"'
11683fe5e51b7Smrg    am__tar_='pax -L -x $1 -w "$tardir"'
11684fe5e51b7Smrg    am__untar='pax -r'
11685fe5e51b7Smrg    ;;
11686fe5e51b7Smrg  cpio)
11687fe5e51b7Smrg    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
11688fe5e51b7Smrg    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
11689fe5e51b7Smrg    am__untar='cpio -i -H $1 -d'
11690fe5e51b7Smrg    ;;
11691fe5e51b7Smrg  none)
11692fe5e51b7Smrg    am__tar=false
11693fe5e51b7Smrg    am__tar_=false
11694fe5e51b7Smrg    am__untar=false
11695fe5e51b7Smrg    ;;
11696fe5e51b7Smrg  esac
11697fe5e51b7Smrg
11698fe5e51b7Smrg  # If the value was cached, stop now.  We just wanted to have am__tar
11699fe5e51b7Smrg  # and am__untar set.
11700fe5e51b7Smrg  test -n "${am_cv_prog_tar_$1}" && break
11701fe5e51b7Smrg
11702fe5e51b7Smrg  # tar/untar a dummy directory, and stop if the command works
11703fe5e51b7Smrg  rm -rf conftest.dir
11704fe5e51b7Smrg  mkdir conftest.dir
11705fe5e51b7Smrg  echo GrepMe > conftest.dir/file
11706fe5e51b7Smrg  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
11707fe5e51b7Smrg  rm -rf conftest.dir
11708fe5e51b7Smrg  if test -s conftest.tar; then
11709fe5e51b7Smrg    AM_RUN_LOG([$am__untar <conftest.tar])
11710fe5e51b7Smrg    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
11711fe5e51b7Smrg  fi
11712fe5e51b7Smrgdone
11713fe5e51b7Smrgrm -rf conftest.dir
11714fe5e51b7Smrg
11715fe5e51b7SmrgAC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
11716fe5e51b7SmrgAC_MSG_RESULT([$am_cv_prog_tar_$1])])
11717fe5e51b7SmrgAC_SUBST([am__tar])
11718fe5e51b7SmrgAC_SUBST([am__untar])
11719fe5e51b7Smrg]) # _AM_PROG_TAR
11720fe5e51b7Smrg
11721