aclocal.m4 revision 493f84f4
1493f84f4Smrg# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2acd6767fSmrg
3493f84f4Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4fe5e51b7Smrg
5fe5e51b7Smrg# This file is free software; the Free Software Foundation
6fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
7fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
8fe5e51b7Smrg
9fe5e51b7Smrg# This program is distributed in the hope that it will be useful,
10fe5e51b7Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11fe5e51b7Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12fe5e51b7Smrg# PARTICULAR PURPOSE.
13fe5e51b7Smrg
14493f84f4Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15eda3803bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16eda3803bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17acd6767fSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18acd6767fSmrg[m4_warning([this file was generated for autoconf 2.69.
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.
21acd6767fSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22fe5e51b7Smrg
23fe5e51b7Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24a31a186aSmrg#
25493f84f4Smrg#   Copyright (C) 1996-2001, 2003-2014 Free Software Foundation, Inc.
26a31a186aSmrg#   Written by Gordon Matzigkeit, 1996
27a31a186aSmrg#
28a31a186aSmrg# This file is free software; the Free Software Foundation gives
29a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
30a31a186aSmrg# modifications, as long as this notice is preserved.
31a31a186aSmrg
32a31a186aSmrgm4_define([_LT_COPYING], [dnl
33493f84f4Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
34493f84f4Smrg# This is free software; see the source for copying conditions.  There is NO
35493f84f4Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36493f84f4Smrg
37493f84f4Smrg# GNU Libtool is free software; you can redistribute it and/or modify
38493f84f4Smrg# it under the terms of the GNU General Public License as published by
39493f84f4Smrg# the Free Software Foundation; either version 2 of of the License, or
40493f84f4Smrg# (at your option) any later version.
41a31a186aSmrg#
42493f84f4Smrg# As a special exception to the GNU General Public License, if you
43493f84f4Smrg# distribute this file as part of a program or library that is built
44493f84f4Smrg# using GNU Libtool, you may include this file under the  same
45493f84f4Smrg# distribution terms that you use for the rest of that program.
46a31a186aSmrg#
47493f84f4Smrg# GNU Libtool is distributed in the hope that it will be useful, but
48493f84f4Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49a31a186aSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50a31a186aSmrg# GNU General Public License for more details.
51a31a186aSmrg#
52a31a186aSmrg# You should have received a copy of the GNU General Public License
53493f84f4Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54a31a186aSmrg])
55fe5e51b7Smrg
56493f84f4Smrg# serial 58 LT_INIT
57fe5e51b7Smrg
58fe5e51b7Smrg
59a31a186aSmrg# LT_PREREQ(VERSION)
60a31a186aSmrg# ------------------
61a31a186aSmrg# Complain and exit if this libtool version is less that VERSION.
62a31a186aSmrgm4_defun([LT_PREREQ],
63a31a186aSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64a31a186aSmrg       [m4_default([$3],
65a31a186aSmrg		   [m4_fatal([Libtool version $1 or higher is required],
66a31a186aSmrg		             63)])],
67a31a186aSmrg       [$2])])
68eda3803bSmrg
69eda3803bSmrg
70a31a186aSmrg# _LT_CHECK_BUILDDIR
71a31a186aSmrg# ------------------
72a31a186aSmrg# Complain if the absolute build directory name contains unusual characters
73a31a186aSmrgm4_defun([_LT_CHECK_BUILDDIR],
74a31a186aSmrg[case `pwd` in
75a31a186aSmrg  *\ * | *\	*)
76a31a186aSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77a31a186aSmrgesac
78a31a186aSmrg])
79a31a186aSmrg
80a31a186aSmrg
81a31a186aSmrg# LT_INIT([OPTIONS])
82a31a186aSmrg# ------------------
83a31a186aSmrgAC_DEFUN([LT_INIT],
84493f84f4Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
850bb88ba4SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86a31a186aSmrgAC_BEFORE([$0], [LT_LANG])dnl
87a31a186aSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88a31a186aSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89a31a186aSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
90a31a186aSmrg
91a31a186aSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92a31a186aSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93a31a186aSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94a31a186aSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95a31a186aSmrgdnl unless we require an AC_DEFUNed macro:
96a31a186aSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97a31a186aSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98a31a186aSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99a31a186aSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100a31a186aSmrgm4_require([_LT_PROG_LTMAIN])dnl
101a31a186aSmrg
1020bb88ba4Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
1030bb88ba4Smrg
104a31a186aSmrgdnl Parse OPTIONS
105a31a186aSmrg_LT_SET_OPTIONS([$0], [$1])
106fe5e51b7Smrg
107fe5e51b7Smrg# This can be used to rebuild libtool when needed
108493f84f4SmrgLIBTOOL_DEPS=$ltmain
109fe5e51b7Smrg
110fe5e51b7Smrg# Always use our own libtool.
111fe5e51b7SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112fe5e51b7SmrgAC_SUBST(LIBTOOL)dnl
113fe5e51b7Smrg
114a31a186aSmrg_LT_SETUP
115eda3803bSmrg
116a31a186aSmrg# Only expand once:
117a31a186aSmrgm4_define([LT_INIT])
118a31a186aSmrg])# LT_INIT
119eda3803bSmrg
120a31a186aSmrg# Old names:
121a31a186aSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122a31a186aSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
124a31a186aSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125a31a186aSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126a31a186aSmrg
127a31a186aSmrg
128a31a186aSmrg# _LT_CC_BASENAME(CC)
129a31a186aSmrg# -------------------
130a31a186aSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
131a31a186aSmrgm4_defun([_LT_CC_BASENAME],
132a31a186aSmrg[for cc_temp in $1""; do
133a31a186aSmrg  case $cc_temp in
134a31a186aSmrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
135a31a186aSmrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
136a31a186aSmrg    \-*) ;;
137a31a186aSmrg    *) break;;
138a31a186aSmrg  esac
139a31a186aSmrgdone
1400bb88ba4Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
141a31a186aSmrg])
142a31a186aSmrg
143a31a186aSmrg
144a31a186aSmrg# _LT_FILEUTILS_DEFAULTS
145a31a186aSmrg# ----------------------
146a31a186aSmrg# It is okay to use these file commands and assume they have been set
147493f84f4Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
148a31a186aSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
149a31a186aSmrg[: ${CP="cp -f"}
150a31a186aSmrg: ${MV="mv -f"}
151a31a186aSmrg: ${RM="rm -f"}
152a31a186aSmrg])# _LT_FILEUTILS_DEFAULTS
153a31a186aSmrg
154a31a186aSmrg
155a31a186aSmrg# _LT_SETUP
156a31a186aSmrg# ---------
157a31a186aSmrgm4_defun([_LT_SETUP],
158a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
159fe5e51b7SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
1600bb88ba4SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
1610bb88ba4SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
1620bb88ba4Smrg
1630bb88ba4Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
1640bb88ba4Smrgdnl
165a31a186aSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
166a31a186aSmrg_LT_DECL([], [host], [0])dnl
167a31a186aSmrg_LT_DECL([], [host_os], [0])dnl
168a31a186aSmrgdnl
169a31a186aSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
170a31a186aSmrg_LT_DECL([], [build], [0])dnl
171a31a186aSmrg_LT_DECL([], [build_os], [0])dnl
172a31a186aSmrgdnl
173fe5e51b7SmrgAC_REQUIRE([AC_PROG_CC])dnl
174a31a186aSmrgAC_REQUIRE([LT_PATH_LD])dnl
175a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
176a31a186aSmrgdnl
177fe5e51b7SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
178a31a186aSmrgtest -z "$LN_S" && LN_S="ln -s"
179a31a186aSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
180eda3803bSmrgdnl
181a31a186aSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
182a31a186aSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
183a31a186aSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
184a31a186aSmrgdnl
185a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
186a31a186aSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
1870bb88ba4Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
188a31a186aSmrgm4_require([_LT_CMD_RELOAD])dnl
189a31a186aSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
1900bb88ba4Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
191a31a186aSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
192a31a186aSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
1930bb88ba4Smrgm4_require([_LT_WITH_SYSROOT])dnl
194493f84f4Smrgm4_require([_LT_CMD_TRUNCATE])dnl
195a31a186aSmrg
196a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([
197493f84f4Smrg# See if we are running on zsh, and set the options that allow our
198a31a186aSmrg# commands through without removal of \ escapes INIT.
199493f84f4Smrgif test -n "\${ZSH_VERSION+set}"; then
200a31a186aSmrg   setopt NO_GLOB_SUBST
201a31a186aSmrgfi
202a31a186aSmrg])
203493f84f4Smrgif test -n "${ZSH_VERSION+set}"; then
204a31a186aSmrg   setopt NO_GLOB_SUBST
205a31a186aSmrgfi
206fe5e51b7Smrg
207a31a186aSmrg_LT_CHECK_OBJDIR
208a31a186aSmrg
209a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
210fe5e51b7Smrg
211fe5e51b7Smrgcase $host_os in
212fe5e51b7Smrgaix3*)
213fe5e51b7Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
214fe5e51b7Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
215fe5e51b7Smrg  # vanish in a puff of smoke.
216493f84f4Smrg  if test set != "${COLLECT_NAMES+set}"; then
217fe5e51b7Smrg    COLLECT_NAMES=
218fe5e51b7Smrg    export COLLECT_NAMES
219fe5e51b7Smrg  fi
220fe5e51b7Smrg  ;;
221fe5e51b7Smrgesac
222fe5e51b7Smrg
223fe5e51b7Smrg# Global variables:
224a31a186aSmrgofile=libtool
225fe5e51b7Smrgcan_build_shared=yes
226fe5e51b7Smrg
227493f84f4Smrg# All known linkers require a '.a' archive for static linking (except MSVC,
228fe5e51b7Smrg# which needs '.lib').
229fe5e51b7Smrglibext=a
230fe5e51b7Smrg
231493f84f4Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
232643b027fSmrg
233493f84f4Smrgold_CC=$CC
234493f84f4Smrgold_CFLAGS=$CFLAGS
235fe5e51b7Smrg
236fe5e51b7Smrg# Set sane defaults for various variables
237fe5e51b7Smrgtest -z "$CC" && CC=cc
238fe5e51b7Smrgtest -z "$LTCC" && LTCC=$CC
239fe5e51b7Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
240fe5e51b7Smrgtest -z "$LD" && LD=ld
241fe5e51b7Smrgtest -z "$ac_objext" && ac_objext=o
242fe5e51b7Smrg
243fe5e51b7Smrg_LT_CC_BASENAME([$compiler])
244fe5e51b7Smrg
245fe5e51b7Smrg# Only perform the check for file, if the check method requires it
246a31a186aSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
247fe5e51b7Smrgcase $deplibs_check_method in
248fe5e51b7Smrgfile_magic*)
249fe5e51b7Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
250a31a186aSmrg    _LT_PATH_MAGIC
251fe5e51b7Smrg  fi
252fe5e51b7Smrg  ;;
253fe5e51b7Smrgesac
254fe5e51b7Smrg
255a31a186aSmrg# Use C for the default configuration in the libtool script
256a31a186aSmrgLT_SUPPORTED_TAG([CC])
257a31a186aSmrg_LT_LANG_C_CONFIG
258a31a186aSmrg_LT_LANG_DEFAULT_CONFIG
259a31a186aSmrg_LT_CONFIG_COMMANDS
260a31a186aSmrg])# _LT_SETUP
261eda3803bSmrg
262eda3803bSmrg
2630bb88ba4Smrg# _LT_PREPARE_SED_QUOTE_VARS
2640bb88ba4Smrg# --------------------------
2650bb88ba4Smrg# Define a few sed substitution that help us do robust quoting.
2660bb88ba4Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
2670bb88ba4Smrg[# Backslashify metacharacters that are still active within
2680bb88ba4Smrg# double-quoted strings.
2690bb88ba4Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2700bb88ba4Smrg
2710bb88ba4Smrg# Same as above, but do not quote variable references.
2720bb88ba4Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2730bb88ba4Smrg
2740bb88ba4Smrg# Sed substitution to delay expansion of an escaped shell variable in a
2750bb88ba4Smrg# double_quote_subst'ed string.
2760bb88ba4Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2770bb88ba4Smrg
2780bb88ba4Smrg# Sed substitution to delay expansion of an escaped single quote.
2790bb88ba4Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2800bb88ba4Smrg
2810bb88ba4Smrg# Sed substitution to avoid accidental globbing in evaled expressions
2820bb88ba4Smrgno_glob_subst='s/\*/\\\*/g'
2830bb88ba4Smrg])
2840bb88ba4Smrg
285a31a186aSmrg# _LT_PROG_LTMAIN
286a31a186aSmrg# ---------------
287493f84f4Smrg# Note that this code is called both from 'configure', and 'config.status'
288a31a186aSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
289493f84f4Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
290a31a186aSmrg# so we pass a copy along to make sure it has a sensible value anyway.
291a31a186aSmrgm4_defun([_LT_PROG_LTMAIN],
292a31a186aSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
293a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
294493f84f4Smrgltmain=$ac_aux_dir/ltmain.sh
295a31a186aSmrg])# _LT_PROG_LTMAIN
296eda3803bSmrg
297eda3803bSmrg
298a31a186aSmrg
299a31a186aSmrg# So that we can recreate a full libtool script including additional
300a31a186aSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
301493f84f4Smrg# in macros and then make a single call at the end using the 'libtool'
302a31a186aSmrg# label.
303a31a186aSmrg
304a31a186aSmrg
305a31a186aSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
306a31a186aSmrg# ----------------------------------------
307a31a186aSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
308a31a186aSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
309a31a186aSmrg[m4_ifval([$1],
310a31a186aSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
311a31a186aSmrg                     [$1
312a31a186aSmrg])])])
313a31a186aSmrg
314a31a186aSmrg# Initialize.
315a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
316a31a186aSmrg
317a31a186aSmrg
318a31a186aSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
319a31a186aSmrg# ------------------------------
320a31a186aSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
321a31a186aSmrgm4_define([_LT_CONFIG_LIBTOOL],
322a31a186aSmrg[m4_ifval([$1],
323a31a186aSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
324a31a186aSmrg                     [$1
325a31a186aSmrg])])])
326a31a186aSmrg
327a31a186aSmrg# Initialize.
328a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
329a31a186aSmrg
330a31a186aSmrg
331a31a186aSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
332a31a186aSmrg# -----------------------------------------------------
333a31a186aSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
334a31a186aSmrg[_LT_CONFIG_LIBTOOL([$1])
335a31a186aSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
336a31a186aSmrg])
337a31a186aSmrg
338a31a186aSmrg
339a31a186aSmrg# _LT_FORMAT_COMMENT([COMMENT])
340a31a186aSmrg# -----------------------------
341a31a186aSmrg# Add leading comment marks to the start of each line, and a trailing
342a31a186aSmrg# full-stop to the whole comment if one is not present already.
343a31a186aSmrgm4_define([_LT_FORMAT_COMMENT],
344a31a186aSmrg[m4_ifval([$1], [
345a31a186aSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
346a31a186aSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
347a31a186aSmrg)])
348a31a186aSmrg
349a31a186aSmrg
350a31a186aSmrg
351a31a186aSmrg
352a31a186aSmrg
353a31a186aSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
354a31a186aSmrg# -------------------------------------------------------------------
355a31a186aSmrg# CONFIGNAME is the name given to the value in the libtool script.
356a31a186aSmrg# VARNAME is the (base) name used in the configure script.
357a31a186aSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
358a31a186aSmrg# VARNAME.  Any other value will be used directly.
359a31a186aSmrgm4_define([_LT_DECL],
360a31a186aSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
361a31a186aSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
362a31a186aSmrg	[m4_ifval([$1], [$1], [$2])])
363a31a186aSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
364a31a186aSmrg    m4_ifval([$4],
365a31a186aSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
366a31a186aSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
367a31a186aSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
368a31a186aSmrg])
369a31a186aSmrg
370a31a186aSmrg
371a31a186aSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
372a31a186aSmrg# --------------------------------------------------------
373a31a186aSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
374a31a186aSmrg
375a31a186aSmrg
376a31a186aSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
377a31a186aSmrg# ------------------------------------------------
378a31a186aSmrgm4_define([lt_decl_tag_varnames],
379a31a186aSmrg[_lt_decl_filter([tagged?], [yes], $@)])
380a31a186aSmrg
381a31a186aSmrg
382a31a186aSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
383a31a186aSmrg# ---------------------------------------------------------
384a31a186aSmrgm4_define([_lt_decl_filter],
385a31a186aSmrg[m4_case([$#],
386a31a186aSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
387a31a186aSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
388a31a186aSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
389a31a186aSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
390a31a186aSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
391a31a186aSmrg])
392a31a186aSmrg
393a31a186aSmrg
394a31a186aSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
395a31a186aSmrg# --------------------------------------------------
396a31a186aSmrgm4_define([lt_decl_quote_varnames],
397a31a186aSmrg[_lt_decl_filter([value], [1], $@)])
398a31a186aSmrg
399a31a186aSmrg
400a31a186aSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
401a31a186aSmrg# ---------------------------------------------------
402a31a186aSmrgm4_define([lt_decl_dquote_varnames],
403a31a186aSmrg[_lt_decl_filter([value], [2], $@)])
404a31a186aSmrg
405a31a186aSmrg
406a31a186aSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
407a31a186aSmrg# ---------------------------------------------------
408a31a186aSmrgm4_define([lt_decl_varnames_tagged],
409a31a186aSmrg[m4_assert([$# <= 2])dnl
410a31a186aSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
411a31a186aSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
412a31a186aSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
413a31a186aSmrgm4_define([_lt_decl_varnames_tagged],
414a31a186aSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
415a31a186aSmrg
416a31a186aSmrg
417a31a186aSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
418a31a186aSmrg# ------------------------------------------------
419a31a186aSmrgm4_define([lt_decl_all_varnames],
420a31a186aSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
421a31a186aSmrg     m4_if([$2], [],
422a31a186aSmrg	   m4_quote(lt_decl_varnames),
423a31a186aSmrg	m4_quote(m4_shift($@))))[]dnl
424a31a186aSmrg])
425a31a186aSmrgm4_define([_lt_decl_all_varnames],
426a31a186aSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
427a31a186aSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
428a31a186aSmrg])
429a31a186aSmrg
430a31a186aSmrg
431a31a186aSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
432a31a186aSmrg# ------------------------------------
433493f84f4Smrg# Quote a variable value, and forward it to 'config.status' so that its
434493f84f4Smrg# declaration there will have the same value as in 'configure'.  VARNAME
435a31a186aSmrg# must have a single quote delimited value for this to work.
436a31a186aSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
4370bb88ba4Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
438a31a186aSmrg
439a31a186aSmrg
440a31a186aSmrg# _LT_CONFIG_STATUS_DECLARATIONS
441a31a186aSmrg# ------------------------------
442a31a186aSmrg# We delimit libtool config variables with single quotes, so when
443a31a186aSmrg# we write them to config.status, we have to be sure to quote all
444a31a186aSmrg# embedded single quotes properly.  In configure, this macro expands
445a31a186aSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
446a31a186aSmrg#
4470bb88ba4Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
448a31a186aSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
449a31a186aSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
450a31a186aSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
451a31a186aSmrg
452a31a186aSmrg
453a31a186aSmrg# _LT_LIBTOOL_TAGS
454a31a186aSmrg# ----------------
455a31a186aSmrg# Output comment and list of tags supported by the script
456a31a186aSmrgm4_defun([_LT_LIBTOOL_TAGS],
457a31a186aSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
458493f84f4Smrgavailable_tags='_LT_TAGS'dnl
459a31a186aSmrg])
460a31a186aSmrg
461a31a186aSmrg
462a31a186aSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
463a31a186aSmrg# -----------------------------------
464a31a186aSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
465a31a186aSmrg# expand to a commented shell variable setting:
466a31a186aSmrg#
467a31a186aSmrg#    # Some comment about what VAR is for.
468a31a186aSmrg#    visible_name=$lt_internal_name
469a31a186aSmrgm4_define([_LT_LIBTOOL_DECLARE],
470a31a186aSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
471a31a186aSmrg					   [description])))[]dnl
472a31a186aSmrgm4_pushdef([_libtool_name],
473a31a186aSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
474a31a186aSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
475a31a186aSmrg    [0], [_libtool_name=[$]$1],
476a31a186aSmrg    [1], [_libtool_name=$lt_[]$1],
477a31a186aSmrg    [2], [_libtool_name=$lt_[]$1],
478a31a186aSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
479a31a186aSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
480a31a186aSmrg])
481a31a186aSmrg
482a31a186aSmrg
483a31a186aSmrg# _LT_LIBTOOL_CONFIG_VARS
484a31a186aSmrg# -----------------------
485a31a186aSmrg# Produce commented declarations of non-tagged libtool config variables
486493f84f4Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
487a31a186aSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
488a31a186aSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
489a31a186aSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
490a31a186aSmrg[m4_foreach([_lt_var],
491a31a186aSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
492a31a186aSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
493a31a186aSmrg
494a31a186aSmrg
495a31a186aSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
496a31a186aSmrg# -------------------------
497a31a186aSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
498a31a186aSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
499a31a186aSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
500eda3803bSmrg
501eda3803bSmrg
502a31a186aSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
503a31a186aSmrg# ------------------------------
504a31a186aSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
505a31a186aSmrg
506a31a186aSmrg
507a31a186aSmrg# _LT_CONFIG_COMMANDS
508fe5e51b7Smrg# -------------------
509a31a186aSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
510a31a186aSmrg# variables for single and double quote escaping we saved from calls
511a31a186aSmrg# to _LT_DECL, we can put quote escaped variables declarations
512493f84f4Smrg# into 'config.status', and then the shell code to quote escape them in
513493f84f4Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
514a31a186aSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
515a31a186aSmrgm4_defun([_LT_CONFIG_COMMANDS],
516a31a186aSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
517a31a186aSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
518a31a186aSmrg	dnl instead of duplicating it all over again into config.status,
519a31a186aSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
520a31a186aSmrg	dnl needs to know what name is stored there:
521a31a186aSmrg        [AC_CONFIG_COMMANDS([libtool],
522a31a186aSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
523a31a186aSmrg    dnl If the libtool generation code is destined for config.status,
524a31a186aSmrg    dnl expand the accumulated commands and init code now:
525a31a186aSmrg    [AC_CONFIG_COMMANDS([libtool],
526a31a186aSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
527a31a186aSmrg])#_LT_CONFIG_COMMANDS
528a31a186aSmrg
529a31a186aSmrg
530a31a186aSmrg# Initialize.
531a31a186aSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
532a31a186aSmrg[
533a31a186aSmrg
534a31a186aSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
535a31a186aSmrg# if CDPATH is set.
536a31a186aSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
537a31a186aSmrg
538a31a186aSmrgsed_quote_subst='$sed_quote_subst'
539a31a186aSmrgdouble_quote_subst='$double_quote_subst'
540a31a186aSmrgdelay_variable_subst='$delay_variable_subst'
541a31a186aSmrg_LT_CONFIG_STATUS_DECLARATIONS
542a31a186aSmrgLTCC='$LTCC'
543a31a186aSmrgLTCFLAGS='$LTCFLAGS'
544a31a186aSmrgcompiler='$compiler_DEFAULT'
545a31a186aSmrg
5460bb88ba4Smrg# A function that is used when there is no print builtin or printf.
5470bb88ba4Smrgfunc_fallback_echo ()
5480bb88ba4Smrg{
5490bb88ba4Smrg  eval 'cat <<_LTECHO_EOF
5500bb88ba4Smrg\$[]1
5510bb88ba4Smrg_LTECHO_EOF'
5520bb88ba4Smrg}
5530bb88ba4Smrg
554a31a186aSmrg# Quote evaled strings.
555a31a186aSmrgfor var in lt_decl_all_varnames([[ \
556a31a186aSmrg]], lt_decl_quote_varnames); do
5570bb88ba4Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
558a31a186aSmrg    *[[\\\\\\\`\\"\\\$]]*)
559493f84f4Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
560a31a186aSmrg      ;;
561a31a186aSmrg    *)
562a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
563a31a186aSmrg      ;;
564a31a186aSmrg    esac
565a31a186aSmrgdone
566a31a186aSmrg
567a31a186aSmrg# Double-quote double-evaled strings.
568a31a186aSmrgfor var in lt_decl_all_varnames([[ \
569a31a186aSmrg]], lt_decl_dquote_varnames); do
5700bb88ba4Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
571a31a186aSmrg    *[[\\\\\\\`\\"\\\$]]*)
572493f84f4Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
573a31a186aSmrg      ;;
574a31a186aSmrg    *)
575a31a186aSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
576a31a186aSmrg      ;;
577a31a186aSmrg    esac
578a31a186aSmrgdone
579a31a186aSmrg
580a31a186aSmrg_LT_OUTPUT_LIBTOOL_INIT
581a31a186aSmrg])
582a31a186aSmrg
5830bb88ba4Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
5840bb88ba4Smrg# ------------------------------------
5850bb88ba4Smrg# Generate a child script FILE with all initialization necessary to
5860bb88ba4Smrg# reuse the environment learned by the parent script, and make the
5870bb88ba4Smrg# file executable.  If COMMENT is supplied, it is inserted after the
588493f84f4Smrg# '#!' sequence but before initialization text begins.  After this
5890bb88ba4Smrg# macro, additional text can be appended to FILE to form the body of
5900bb88ba4Smrg# the child script.  The macro ends with non-zero status if the
5910bb88ba4Smrg# file could not be fully written (such as if the disk is full).
5920bb88ba4Smrgm4_ifdef([AS_INIT_GENERATED],
5930bb88ba4Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
5940bb88ba4Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
5950bb88ba4Smrg[m4_require([AS_PREPARE])]dnl
5960bb88ba4Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
5970bb88ba4Smrg[lt_write_fail=0
5980bb88ba4Smrgcat >$1 <<_ASEOF || lt_write_fail=1
5990bb88ba4Smrg#! $SHELL
6000bb88ba4Smrg# Generated by $as_me.
6010bb88ba4Smrg$2
6020bb88ba4SmrgSHELL=\${CONFIG_SHELL-$SHELL}
6030bb88ba4Smrgexport SHELL
6040bb88ba4Smrg_ASEOF
6050bb88ba4Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
6060bb88ba4SmrgAS_SHELL_SANITIZE
6070bb88ba4Smrg_AS_PREPARE
6080bb88ba4Smrgexec AS_MESSAGE_FD>&1
6090bb88ba4Smrg_ASEOF
610493f84f4Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
6110bb88ba4Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
612a31a186aSmrg
613a31a186aSmrg# LT_OUTPUT
614a31a186aSmrg# ---------
615a31a186aSmrg# This macro allows early generation of the libtool script (before
616a31a186aSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
617a31a186aSmrg# tests.
618a31a186aSmrgAC_DEFUN([LT_OUTPUT],
619a31a186aSmrg[: ${CONFIG_LT=./config.lt}
620a31a186aSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
6210bb88ba4Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
6220bb88ba4Smrg[# Run this file to recreate a libtool stub with the current configuration.])
623a31a186aSmrg
624a31a186aSmrgcat >>"$CONFIG_LT" <<\_LTEOF
6250bb88ba4Smrglt_cl_silent=false
626a31a186aSmrgexec AS_MESSAGE_LOG_FD>>config.log
627a31a186aSmrg{
628a31a186aSmrg  echo
629a31a186aSmrg  AS_BOX([Running $as_me.])
630a31a186aSmrg} >&AS_MESSAGE_LOG_FD
631a31a186aSmrg
632a31a186aSmrglt_cl_help="\
633493f84f4Smrg'$as_me' creates a local libtool stub from the current configuration,
634a31a186aSmrgfor use in further configure time tests before the real libtool is
635a31a186aSmrggenerated.
636a31a186aSmrg
637a31a186aSmrgUsage: $[0] [[OPTIONS]]
638a31a186aSmrg
639a31a186aSmrg  -h, --help      print this help, then exit
640a31a186aSmrg  -V, --version   print version number, then exit
641a31a186aSmrg  -q, --quiet     do not print progress messages
642a31a186aSmrg  -d, --debug     don't remove temporary files
643a31a186aSmrg
644a31a186aSmrgReport bugs to <bug-libtool@gnu.org>."
645a31a186aSmrg
646a31a186aSmrglt_cl_version="\
647a31a186aSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
648a31a186aSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
649a31a186aSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
650a31a186aSmrg
6510bb88ba4SmrgCopyright (C) 2011 Free Software Foundation, Inc.
652a31a186aSmrgThis config.lt script is free software; the Free Software Foundation
653a31a186aSmrggives unlimited permision to copy, distribute and modify it."
654a31a186aSmrg
655493f84f4Smrgwhile test 0 != $[#]
656a31a186aSmrgdo
657a31a186aSmrg  case $[1] in
658a31a186aSmrg    --version | --v* | -V )
659a31a186aSmrg      echo "$lt_cl_version"; exit 0 ;;
660a31a186aSmrg    --help | --h* | -h )
661a31a186aSmrg      echo "$lt_cl_help"; exit 0 ;;
662a31a186aSmrg    --debug | --d* | -d )
663a31a186aSmrg      debug=: ;;
664a31a186aSmrg    --quiet | --q* | --silent | --s* | -q )
665a31a186aSmrg      lt_cl_silent=: ;;
666a31a186aSmrg
667a31a186aSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
668493f84f4SmrgTry '$[0] --help' for more information.]) ;;
669a31a186aSmrg
670a31a186aSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
671493f84f4SmrgTry '$[0] --help' for more information.]) ;;
672a31a186aSmrg  esac
673a31a186aSmrg  shift
674a31a186aSmrgdone
675a31a186aSmrg
676a31a186aSmrgif $lt_cl_silent; then
677a31a186aSmrg  exec AS_MESSAGE_FD>/dev/null
678a31a186aSmrgfi
679a31a186aSmrg_LTEOF
680a31a186aSmrg
681a31a186aSmrgcat >>"$CONFIG_LT" <<_LTEOF
682a31a186aSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
683a31a186aSmrg_LTEOF
684a31a186aSmrg
685a31a186aSmrgcat >>"$CONFIG_LT" <<\_LTEOF
686a31a186aSmrgAC_MSG_NOTICE([creating $ofile])
687a31a186aSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
688a31a186aSmrgAS_EXIT(0)
689a31a186aSmrg_LTEOF
690a31a186aSmrgchmod +x "$CONFIG_LT"
691a31a186aSmrg
692a31a186aSmrg# configure is writing to config.log, but config.lt does its own redirection,
693a31a186aSmrg# appending to config.log, which fails on DOS, as config.log is still kept
694a31a186aSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
695a31a186aSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
6960bb88ba4Smrglt_cl_success=:
697493f84f4Smrgtest yes = "$silent" &&
6980bb88ba4Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
6990bb88ba4Smrgexec AS_MESSAGE_LOG_FD>/dev/null
7000bb88ba4Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
7010bb88ba4Smrgexec AS_MESSAGE_LOG_FD>>config.log
7020bb88ba4Smrg$lt_cl_success || AS_EXIT(1)
703a31a186aSmrg])# LT_OUTPUT
704a31a186aSmrg
705a31a186aSmrg
706a31a186aSmrg# _LT_CONFIG(TAG)
707a31a186aSmrg# ---------------
708a31a186aSmrg# If TAG is the built-in tag, create an initial libtool script with a
709a31a186aSmrg# default configuration from the untagged config vars.  Otherwise add code
710a31a186aSmrg# to config.status for appending the configuration named by TAG from the
711a31a186aSmrg# matching tagged config vars.
712a31a186aSmrgm4_defun([_LT_CONFIG],
713a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
714a31a186aSmrg_LT_CONFIG_SAVE_COMMANDS([
715a31a186aSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
716a31a186aSmrg  m4_if(_LT_TAG, [C], [
717493f84f4Smrg    # See if we are running on zsh, and set the options that allow our
718a31a186aSmrg    # commands through without removal of \ escapes.
719493f84f4Smrg    if test -n "${ZSH_VERSION+set}"; then
720a31a186aSmrg      setopt NO_GLOB_SUBST
721a31a186aSmrg    fi
722a31a186aSmrg
723493f84f4Smrg    cfgfile=${ofile}T
724a31a186aSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
725a31a186aSmrg    $RM "$cfgfile"
726a31a186aSmrg
727a31a186aSmrg    cat <<_LT_EOF >> "$cfgfile"
728a31a186aSmrg#! $SHELL
729493f84f4Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
730a31a186aSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
731a31a186aSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
732493f84f4Smrg
733493f84f4Smrg# Provide generalized library-building support services.
734493f84f4Smrg# Written by Gordon Matzigkeit, 1996
735493f84f4Smrg
736a31a186aSmrg_LT_COPYING
737a31a186aSmrg_LT_LIBTOOL_TAGS
738a31a186aSmrg
739a31a186aSmrg# ### BEGIN LIBTOOL CONFIG
740a31a186aSmrg_LT_LIBTOOL_CONFIG_VARS
741a31a186aSmrg_LT_LIBTOOL_TAG_VARS
742a31a186aSmrg# ### END LIBTOOL CONFIG
743a31a186aSmrg
744a31a186aSmrg_LT_EOF
745a31a186aSmrg
746a31a186aSmrg  case $host_os in
747a31a186aSmrg  aix3*)
748a31a186aSmrg    cat <<\_LT_EOF >> "$cfgfile"
749a31a186aSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
750a31a186aSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
751a31a186aSmrg# vanish in a puff of smoke.
752493f84f4Smrgif test set != "${COLLECT_NAMES+set}"; then
753a31a186aSmrg  COLLECT_NAMES=
754a31a186aSmrg  export COLLECT_NAMES
755a31a186aSmrgfi
756a31a186aSmrg_LT_EOF
757a31a186aSmrg    ;;
758a31a186aSmrg  esac
759a31a186aSmrg
760a31a186aSmrg  _LT_PROG_LTMAIN
761a31a186aSmrg
762a31a186aSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
763a31a186aSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
764a31a186aSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
765a31a186aSmrg  # is reportedly fixed, but why not run on old versions too?
7660bb88ba4Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
7670bb88ba4Smrg     || (rm -f "$cfgfile"; exit 1)
768a31a186aSmrg
7690bb88ba4Smrg   mv -f "$cfgfile" "$ofile" ||
770a31a186aSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
771a31a186aSmrg  chmod +x "$ofile"
772a31a186aSmrg],
773a31a186aSmrg[cat <<_LT_EOF >> "$ofile"
774a31a186aSmrg
775a31a186aSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
776a31a186aSmrgdnl in a comment (ie after a #).
777a31a186aSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
778a31a186aSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
779a31a186aSmrg# ### END LIBTOOL TAG CONFIG: $1
780a31a186aSmrg_LT_EOF
781a31a186aSmrg])dnl /m4_if
782a31a186aSmrg],
783a31a186aSmrg[m4_if([$1], [], [
784a31a186aSmrg    PACKAGE='$PACKAGE'
785a31a186aSmrg    VERSION='$VERSION'
786a31a186aSmrg    RM='$RM'
787a31a186aSmrg    ofile='$ofile'], [])
788a31a186aSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
789a31a186aSmrg])# _LT_CONFIG
790a31a186aSmrg
791a31a186aSmrg
792a31a186aSmrg# LT_SUPPORTED_TAG(TAG)
793a31a186aSmrg# ---------------------
794a31a186aSmrg# Trace this macro to discover what tags are supported by the libtool
795a31a186aSmrg# --tag option, using:
796a31a186aSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
797a31a186aSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
798a31a186aSmrg
799a31a186aSmrg
800a31a186aSmrg# C support is built-in for now
801a31a186aSmrgm4_define([_LT_LANG_C_enabled], [])
802a31a186aSmrgm4_define([_LT_TAGS], [])
803a31a186aSmrg
804a31a186aSmrg
805a31a186aSmrg# LT_LANG(LANG)
806a31a186aSmrg# -------------
807a31a186aSmrg# Enable libtool support for the given language if not already enabled.
808a31a186aSmrgAC_DEFUN([LT_LANG],
809a31a186aSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
810a31a186aSmrgm4_case([$1],
811a31a186aSmrg  [C],			[_LT_LANG(C)],
812a31a186aSmrg  [C++],		[_LT_LANG(CXX)],
8130bb88ba4Smrg  [Go],			[_LT_LANG(GO)],
814a31a186aSmrg  [Java],		[_LT_LANG(GCJ)],
815a31a186aSmrg  [Fortran 77],		[_LT_LANG(F77)],
816a31a186aSmrg  [Fortran],		[_LT_LANG(FC)],
817a31a186aSmrg  [Windows Resource],	[_LT_LANG(RC)],
818a31a186aSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
819a31a186aSmrg    [_LT_LANG($1)],
820a31a186aSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
821a31a186aSmrg])# LT_LANG
822a31a186aSmrg
823a31a186aSmrg
824a31a186aSmrg# _LT_LANG(LANGNAME)
825a31a186aSmrg# ------------------
826a31a186aSmrgm4_defun([_LT_LANG],
827a31a186aSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
828a31a186aSmrg  [LT_SUPPORTED_TAG([$1])dnl
829a31a186aSmrg  m4_append([_LT_TAGS], [$1 ])dnl
830a31a186aSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
831a31a186aSmrg  _LT_LANG_$1_CONFIG($1)])dnl
832a31a186aSmrg])# _LT_LANG
833a31a186aSmrg
834a31a186aSmrg
8350bb88ba4Smrgm4_ifndef([AC_PROG_GO], [
8360bb88ba4Smrg# NOTE: This macro has been submitted for inclusion into   #
8370bb88ba4Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
8380bb88ba4Smrg#  a released version of Autoconf we should remove this    #
8390bb88ba4Smrg#  macro and use it instead.                               #
8400bb88ba4Smrgm4_defun([AC_PROG_GO],
8410bb88ba4Smrg[AC_LANG_PUSH(Go)dnl
8420bb88ba4SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
8430bb88ba4SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
8440bb88ba4Smrg_AC_ARG_VAR_LDFLAGS()dnl
8450bb88ba4SmrgAC_CHECK_TOOL(GOC, gccgo)
8460bb88ba4Smrgif test -z "$GOC"; then
8470bb88ba4Smrg  if test -n "$ac_tool_prefix"; then
8480bb88ba4Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
8490bb88ba4Smrg  fi
8500bb88ba4Smrgfi
8510bb88ba4Smrgif test -z "$GOC"; then
8520bb88ba4Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
8530bb88ba4Smrgfi
8540bb88ba4Smrg])#m4_defun
8550bb88ba4Smrg])#m4_ifndef
8560bb88ba4Smrg
8570bb88ba4Smrg
858a31a186aSmrg# _LT_LANG_DEFAULT_CONFIG
859a31a186aSmrg# -----------------------
860a31a186aSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
861a31a186aSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
862a31a186aSmrg  [LT_LANG(CXX)],
863a31a186aSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
864a31a186aSmrg
865a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
866a31a186aSmrg  [LT_LANG(F77)],
867a31a186aSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
868a31a186aSmrg
869a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
870a31a186aSmrg  [LT_LANG(FC)],
871a31a186aSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
872a31a186aSmrg
873a31a186aSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
874a31a186aSmrgdnl pulling things in needlessly.
875a31a186aSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
876a31a186aSmrg  [LT_LANG(GCJ)],
877a31a186aSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
878a31a186aSmrg    [LT_LANG(GCJ)],
879a31a186aSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
880a31a186aSmrg      [LT_LANG(GCJ)],
881a31a186aSmrg      [m4_ifdef([AC_PROG_GCJ],
882a31a186aSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
883a31a186aSmrg       m4_ifdef([A][M_PROG_GCJ],
884a31a186aSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
885a31a186aSmrg       m4_ifdef([LT_PROG_GCJ],
886a31a186aSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
887a31a186aSmrg
8880bb88ba4SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
8890bb88ba4Smrg  [LT_LANG(GO)],
8900bb88ba4Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
8910bb88ba4Smrg
892a31a186aSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
893a31a186aSmrg  [LT_LANG(RC)],
894a31a186aSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
895a31a186aSmrg])# _LT_LANG_DEFAULT_CONFIG
896a31a186aSmrg
897a31a186aSmrg# Obsolete macros:
898a31a186aSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
899a31a186aSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
900a31a186aSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
901a31a186aSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
9020bb88ba4SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
903a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
904a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
905a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
906a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
907a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
9080bb88ba4Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
909a31a186aSmrg
910a31a186aSmrg
911a31a186aSmrg# _LT_TAG_COMPILER
912a31a186aSmrg# ----------------
913a31a186aSmrgm4_defun([_LT_TAG_COMPILER],
914fe5e51b7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
915fe5e51b7Smrg
916a31a186aSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
917a31a186aSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
918a31a186aSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
919a31a186aSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
920a31a186aSmrg
921fe5e51b7Smrg# If no C compiler was specified, use CC.
922fe5e51b7SmrgLTCC=${LTCC-"$CC"}
923fe5e51b7Smrg
924fe5e51b7Smrg# If no C compiler flags were specified, use CFLAGS.
925fe5e51b7SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
926fe5e51b7Smrg
927fe5e51b7Smrg# Allow CC to be a program name with arguments.
928fe5e51b7Smrgcompiler=$CC
929a31a186aSmrg])# _LT_TAG_COMPILER
930fe5e51b7Smrg
931fe5e51b7Smrg
932fe5e51b7Smrg# _LT_COMPILER_BOILERPLATE
933fe5e51b7Smrg# ------------------------
934fe5e51b7Smrg# Check for compiler boilerplate output or warnings with
935fe5e51b7Smrg# the simple compiler test code.
936a31a186aSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
937a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
938fe5e51b7Smrgac_outfile=conftest.$ac_objext
939fe5e51b7Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
940fe5e51b7Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
941fe5e51b7Smrg_lt_compiler_boilerplate=`cat conftest.err`
942a31a186aSmrg$RM conftest*
943fe5e51b7Smrg])# _LT_COMPILER_BOILERPLATE
944fe5e51b7Smrg
945fe5e51b7Smrg
946fe5e51b7Smrg# _LT_LINKER_BOILERPLATE
947fe5e51b7Smrg# ----------------------
948fe5e51b7Smrg# Check for linker boilerplate output or warnings with
949fe5e51b7Smrg# the simple link test code.
950a31a186aSmrgm4_defun([_LT_LINKER_BOILERPLATE],
951a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
952fe5e51b7Smrgac_outfile=conftest.$ac_objext
953fe5e51b7Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
954fe5e51b7Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
955fe5e51b7Smrg_lt_linker_boilerplate=`cat conftest.err`
956a31a186aSmrg$RM -r conftest*
957fe5e51b7Smrg])# _LT_LINKER_BOILERPLATE
958fe5e51b7Smrg
959eda3803bSmrg# _LT_REQUIRED_DARWIN_CHECKS
960a31a186aSmrg# -------------------------
961a31a186aSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
962eda3803bSmrg  case $host_os in
963eda3803bSmrg    rhapsody* | darwin*)
964eda3803bSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
965eda3803bSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
966a31a186aSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
967a31a186aSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
968a31a186aSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
969a31a186aSmrg    _LT_DECL([], [DSYMUTIL], [1],
970a31a186aSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
971a31a186aSmrg    _LT_DECL([], [NMEDIT], [1],
972a31a186aSmrg      [Tool to change global to local symbols on Mac OS X])
973a31a186aSmrg    _LT_DECL([], [LIPO], [1],
974a31a186aSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
975a31a186aSmrg    _LT_DECL([], [OTOOL], [1],
976a31a186aSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
977a31a186aSmrg    _LT_DECL([], [OTOOL64], [1],
978a31a186aSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
979eda3803bSmrg
980eda3803bSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
981eda3803bSmrg      [lt_cv_apple_cc_single_mod=no
982493f84f4Smrg      if test -z "$LT_MULTI_MODULE"; then
983a31a186aSmrg	# By default we will add the -single_module flag. You can override
984a31a186aSmrg	# by either setting the environment variable LT_MULTI_MODULE
985a31a186aSmrg	# non-empty at configure time, or by adding -multi_module to the
986a31a186aSmrg	# link flags.
987a31a186aSmrg	rm -rf libconftest.dylib*
988a31a186aSmrg	echo "int foo(void){return 1;}" > conftest.c
989a31a186aSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
990a31a186aSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
991a31a186aSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
992a31a186aSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
993a31a186aSmrg        _lt_result=$?
9940bb88ba4Smrg	# If there is a non-empty error log, and "single_module"
9950bb88ba4Smrg	# appears in it, assume the flag caused a linker warning
9960bb88ba4Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
9970bb88ba4Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
9980bb88ba4Smrg	# Otherwise, if the output was created with a 0 exit code from
9990bb88ba4Smrg	# the compiler, it worked.
1000493f84f4Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1001a31a186aSmrg	  lt_cv_apple_cc_single_mod=yes
1002a31a186aSmrg	else
1003a31a186aSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1004a31a186aSmrg	fi
1005a31a186aSmrg	rm -rf libconftest.dylib*
1006a31a186aSmrg	rm -f conftest.*
1007eda3803bSmrg      fi])
10080bb88ba4Smrg
1009eda3803bSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1010eda3803bSmrg      [lt_cv_ld_exported_symbols_list],
1011eda3803bSmrg      [lt_cv_ld_exported_symbols_list=no
1012eda3803bSmrg      save_LDFLAGS=$LDFLAGS
1013eda3803bSmrg      echo "_main" > conftest.sym
1014eda3803bSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1015eda3803bSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1016a31a186aSmrg	[lt_cv_ld_exported_symbols_list=yes],
1017a31a186aSmrg	[lt_cv_ld_exported_symbols_list=no])
1018493f84f4Smrg	LDFLAGS=$save_LDFLAGS
1019eda3803bSmrg    ])
10200bb88ba4Smrg
10210bb88ba4Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
10220bb88ba4Smrg      [lt_cv_ld_force_load=no
10230bb88ba4Smrg      cat > conftest.c << _LT_EOF
10240bb88ba4Smrgint forced_loaded() { return 2;}
10250bb88ba4Smrg_LT_EOF
10260bb88ba4Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
10270bb88ba4Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
10280bb88ba4Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
10290bb88ba4Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
10300bb88ba4Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
10310bb88ba4Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
10320bb88ba4Smrg      cat > conftest.c << _LT_EOF
10330bb88ba4Smrgint main() { return 0;}
10340bb88ba4Smrg_LT_EOF
10350bb88ba4Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
10360bb88ba4Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
10370bb88ba4Smrg      _lt_result=$?
10380bb88ba4Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
10390bb88ba4Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1040493f84f4Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
10410bb88ba4Smrg	lt_cv_ld_force_load=yes
10420bb88ba4Smrg      else
10430bb88ba4Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
10440bb88ba4Smrg      fi
10450bb88ba4Smrg        rm -f conftest.err libconftest.a conftest conftest.c
10460bb88ba4Smrg        rm -rf conftest.dSYM
10470bb88ba4Smrg    ])
1048eda3803bSmrg    case $host_os in
1049a31a186aSmrg    rhapsody* | darwin1.[[012]])
1050493f84f4Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1051eda3803bSmrg    darwin1.*)
1052493f84f4Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1053a31a186aSmrg    darwin*) # darwin 5.x on
1054eda3803bSmrg      # if running on 10.5 or later, the deployment target defaults
1055eda3803bSmrg      # to the OS version, if on x86, and 10.4, the deployment
1056eda3803bSmrg      # target defaults to 10.4. Don't you love it?
1057eda3803bSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1058a31a186aSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1059493f84f4Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1060493f84f4Smrg	10.[[012]][[,.]]*)
1061493f84f4Smrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1062a31a186aSmrg	10.*)
1063493f84f4Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1064eda3803bSmrg      esac
1065eda3803bSmrg    ;;
1066eda3803bSmrg  esac
1067493f84f4Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1068eda3803bSmrg      _lt_dar_single_mod='$single_module'
1069eda3803bSmrg    fi
1070493f84f4Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1071493f84f4Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1072eda3803bSmrg    else
1073493f84f4Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1074eda3803bSmrg    fi
1075493f84f4Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1076a31a186aSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1077eda3803bSmrg    else
1078eda3803bSmrg      _lt_dsymutil=
1079eda3803bSmrg    fi
1080eda3803bSmrg    ;;
1081eda3803bSmrg  esac
1082eda3803bSmrg])
1083eda3803bSmrg
1084a31a186aSmrg
10850bb88ba4Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
10860bb88ba4Smrg# ---------------------------------
1087a31a186aSmrg# Checks for linker and compiler features on darwin
1088a31a186aSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1089a31a186aSmrg[
1090a31a186aSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1091a31a186aSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1092a31a186aSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1093a31a186aSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1094a31a186aSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1095493f84f4Smrg  if test yes = "$lt_cv_ld_force_load"; then
1096493f84f4Smrg    _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\"`'
10970bb88ba4Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
10980bb88ba4Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
10990bb88ba4Smrg  else
11000bb88ba4Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
11010bb88ba4Smrg  fi
1102a31a186aSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1103493f84f4Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1104a31a186aSmrg  case $cc_basename in
1105493f84f4Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1106a31a186aSmrg     *) _lt_dar_can_shared=$GCC ;;
1107a31a186aSmrg  esac
1108493f84f4Smrg  if test yes = "$_lt_dar_can_shared"; then
11090bb88ba4Smrg    output_verbose_link_cmd=func_echo_all
1110493f84f4Smrg    _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"
1111493f84f4Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1112493f84f4Smrg    _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"
1113493f84f4Smrg    _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"
1114a31a186aSmrg    m4_if([$1], [CXX],
1115493f84f4Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1116493f84f4Smrg      _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"
1117493f84f4Smrg      _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"
1118a31a186aSmrg    fi
1119a31a186aSmrg],[])
1120a31a186aSmrg  else
1121a31a186aSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1122a31a186aSmrg  fi
1123a31a186aSmrg])
1124a31a186aSmrg
11250bb88ba4Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
11260bb88ba4Smrg# ----------------------------------
1127fe5e51b7Smrg# Links a minimal program and checks the executable
1128fe5e51b7Smrg# for the system default hardcoded library path. In most cases,
1129fe5e51b7Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1130fe5e51b7Smrg# the location of the communication and MPI libs are included too.
1131fe5e51b7Smrg# If we don't find anything, use the default library path according
1132fe5e51b7Smrg# to the aix ld manual.
11330bb88ba4Smrg# Store the results from the different compilers for each TAGNAME.
11340bb88ba4Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1135a31a186aSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1136a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
1137493f84f4Smrgif test set = "${lt_cv_aix_libpath+set}"; then
11380bb88ba4Smrg  aix_libpath=$lt_cv_aix_libpath
11390bb88ba4Smrgelse
11400bb88ba4Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
11410bb88ba4Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
11420bb88ba4Smrg  lt_aix_libpath_sed='[
11430bb88ba4Smrg      /Import File Strings/,/^$/ {
11440bb88ba4Smrg	  /^0/ {
11450bb88ba4Smrg	      s/^0  *\([^ ]*\) *$/\1/
11460bb88ba4Smrg	      p
11470bb88ba4Smrg	  }
11480bb88ba4Smrg      }]'
11490bb88ba4Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11500bb88ba4Smrg  # Check for a 64-bit object if we didn't find anything.
11510bb88ba4Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
11520bb88ba4Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
11530bb88ba4Smrg  fi],[])
11540bb88ba4Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1155493f84f4Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
11560bb88ba4Smrg  fi
11570bb88ba4Smrg  ])
11580bb88ba4Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
11590bb88ba4Smrgfi
1160a31a186aSmrg])# _LT_SYS_MODULE_PATH_AIX
1161fe5e51b7Smrg
1162fe5e51b7Smrg
1163a31a186aSmrg# _LT_SHELL_INIT(ARG)
1164a31a186aSmrg# -------------------
1165a31a186aSmrgm4_define([_LT_SHELL_INIT],
11660bb88ba4Smrg[m4_divert_text([M4SH-INIT], [$1
11670bb88ba4Smrg])])# _LT_SHELL_INIT
11680bb88ba4Smrg
1169fe5e51b7Smrg
1170fe5e51b7Smrg
1171a31a186aSmrg# _LT_PROG_ECHO_BACKSLASH
1172a31a186aSmrg# -----------------------
11730bb88ba4Smrg# Find how we can fake an echo command that does not interpret backslash.
11740bb88ba4Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1175493f84f4Smrg# of the generated configure script that will find a shell with a builtin
1176493f84f4Smrg# printf (that we can use as an echo command).
1177a31a186aSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
11780bb88ba4Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
11790bb88ba4SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
11800bb88ba4SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
11810bb88ba4Smrg
11820bb88ba4SmrgAC_MSG_CHECKING([how to print strings])
11830bb88ba4Smrg# Test print first, because it will be a builtin if present.
11840bb88ba4Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
11850bb88ba4Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
11860bb88ba4Smrg  ECHO='print -r --'
11870bb88ba4Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
11880bb88ba4Smrg  ECHO='printf %s\n'
1189fe5e51b7Smrgelse
11900bb88ba4Smrg  # Use this function as a fallback that always works.
11910bb88ba4Smrg  func_fallback_echo ()
11920bb88ba4Smrg  {
11930bb88ba4Smrg    eval 'cat <<_LTECHO_EOF
11940bb88ba4Smrg$[]1
11950bb88ba4Smrg_LTECHO_EOF'
11960bb88ba4Smrg  }
11970bb88ba4Smrg  ECHO='func_fallback_echo'
1198fe5e51b7Smrgfi
1199fe5e51b7Smrg
12000bb88ba4Smrg# func_echo_all arg...
12010bb88ba4Smrg# Invoke $ECHO with all args, space-separated.
12020bb88ba4Smrgfunc_echo_all ()
12030bb88ba4Smrg{
1204493f84f4Smrg    $ECHO "$*"
12050bb88ba4Smrg}
1206643b027fSmrg
1207493f84f4Smrgcase $ECHO in
12080bb88ba4Smrg  printf*) AC_MSG_RESULT([printf]) ;;
12090bb88ba4Smrg  print*) AC_MSG_RESULT([print -r]) ;;
12100bb88ba4Smrg  *) AC_MSG_RESULT([cat]) ;;
12110bb88ba4Smrgesac
1212fe5e51b7Smrg
12130bb88ba4Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
12140bb88ba4Smrg[_AS_DETECT_SUGGESTED([
12150bb88ba4Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
12160bb88ba4Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
12170bb88ba4Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
12180bb88ba4Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
12190bb88ba4Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
12200bb88ba4Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
12210bb88ba4Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1222fe5e51b7Smrg
1223a31a186aSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
12240bb88ba4Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1225a31a186aSmrg])# _LT_PROG_ECHO_BACKSLASH
1226fe5e51b7Smrg
1227fe5e51b7Smrg
12280bb88ba4Smrg# _LT_WITH_SYSROOT
12290bb88ba4Smrg# ----------------
12300bb88ba4SmrgAC_DEFUN([_LT_WITH_SYSROOT],
12310bb88ba4Smrg[AC_MSG_CHECKING([for sysroot])
12320bb88ba4SmrgAC_ARG_WITH([sysroot],
1233493f84f4Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1234493f84f4Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1235493f84f4Smrg   if not specified).])],
12360bb88ba4Smrg[], [with_sysroot=no])
12370bb88ba4Smrg
12380bb88ba4Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
12390bb88ba4Smrgdnl in case the user passed a directory name.
12400bb88ba4Smrglt_sysroot=
1241493f84f4Smrgcase $with_sysroot in #(
12420bb88ba4Smrg yes)
1243493f84f4Smrg   if test yes = "$GCC"; then
12440bb88ba4Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
12450bb88ba4Smrg   fi
12460bb88ba4Smrg   ;; #(
12470bb88ba4Smrg /*)
12480bb88ba4Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
12490bb88ba4Smrg   ;; #(
12500bb88ba4Smrg no|'')
12510bb88ba4Smrg   ;; #(
12520bb88ba4Smrg *)
1253493f84f4Smrg   AC_MSG_RESULT([$with_sysroot])
12540bb88ba4Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
12550bb88ba4Smrg   ;;
12560bb88ba4Smrgesac
12570bb88ba4Smrg
12580bb88ba4Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
12590bb88ba4Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1260493f84f4Smrg[dependent libraries, and where our libraries should be installed.])])
12610bb88ba4Smrg
1262a31a186aSmrg# _LT_ENABLE_LOCK
1263a31a186aSmrg# ---------------
1264a31a186aSmrgm4_defun([_LT_ENABLE_LOCK],
1265fe5e51b7Smrg[AC_ARG_ENABLE([libtool-lock],
1266a31a186aSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1267a31a186aSmrg    [avoid locking (might break parallel builds)])])
1268493f84f4Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1269fe5e51b7Smrg
1270fe5e51b7Smrg# Some flags need to be propagated to the compiler or linker for good
1271fe5e51b7Smrg# libtool support.
1272fe5e51b7Smrgcase $host in
1273fe5e51b7Smrgia64-*-hpux*)
1274493f84f4Smrg  # Find out what ABI is being produced by ac_compile, and set mode
1275493f84f4Smrg  # options accordingly.
1276fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1277fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1278fe5e51b7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1279a31a186aSmrg      *ELF-32*)
1280493f84f4Smrg	HPUX_IA64_MODE=32
1281a31a186aSmrg	;;
1282a31a186aSmrg      *ELF-64*)
1283493f84f4Smrg	HPUX_IA64_MODE=64
1284a31a186aSmrg	;;
1285fe5e51b7Smrg    esac
1286fe5e51b7Smrg  fi
1287fe5e51b7Smrg  rm -rf conftest*
1288fe5e51b7Smrg  ;;
1289fe5e51b7Smrg*-*-irix6*)
1290493f84f4Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1291493f84f4Smrg  # options accordingly.
12920bb88ba4Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1293fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1294493f84f4Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1295a31a186aSmrg      case `/usr/bin/file conftest.$ac_objext` in
1296a31a186aSmrg	*32-bit*)
1297a31a186aSmrg	  LD="${LD-ld} -melf32bsmip"
1298a31a186aSmrg	  ;;
1299a31a186aSmrg	*N32*)
1300a31a186aSmrg	  LD="${LD-ld} -melf32bmipn32"
1301a31a186aSmrg	  ;;
1302a31a186aSmrg	*64-bit*)
1303a31a186aSmrg	  LD="${LD-ld} -melf64bmip"
1304a31a186aSmrg	;;
1305a31a186aSmrg      esac
1306a31a186aSmrg    else
1307a31a186aSmrg      case `/usr/bin/file conftest.$ac_objext` in
1308a31a186aSmrg	*32-bit*)
1309a31a186aSmrg	  LD="${LD-ld} -32"
1310a31a186aSmrg	  ;;
1311a31a186aSmrg	*N32*)
1312a31a186aSmrg	  LD="${LD-ld} -n32"
1313a31a186aSmrg	  ;;
1314a31a186aSmrg	*64-bit*)
1315a31a186aSmrg	  LD="${LD-ld} -64"
1316a31a186aSmrg	  ;;
1317a31a186aSmrg      esac
1318a31a186aSmrg    fi
1319fe5e51b7Smrg  fi
1320fe5e51b7Smrg  rm -rf conftest*
1321fe5e51b7Smrg  ;;
1322fe5e51b7Smrg
1323493f84f4Smrgmips64*-*linux*)
1324493f84f4Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1325493f84f4Smrg  # options accordingly.
1326493f84f4Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1327493f84f4Smrg  if AC_TRY_EVAL(ac_compile); then
1328493f84f4Smrg    emul=elf
1329493f84f4Smrg    case `/usr/bin/file conftest.$ac_objext` in
1330493f84f4Smrg      *32-bit*)
1331493f84f4Smrg	emul="${emul}32"
1332493f84f4Smrg	;;
1333493f84f4Smrg      *64-bit*)
1334493f84f4Smrg	emul="${emul}64"
1335493f84f4Smrg	;;
1336493f84f4Smrg    esac
1337493f84f4Smrg    case `/usr/bin/file conftest.$ac_objext` in
1338493f84f4Smrg      *MSB*)
1339493f84f4Smrg	emul="${emul}btsmip"
1340493f84f4Smrg	;;
1341493f84f4Smrg      *LSB*)
1342493f84f4Smrg	emul="${emul}ltsmip"
1343493f84f4Smrg	;;
1344493f84f4Smrg    esac
1345493f84f4Smrg    case `/usr/bin/file conftest.$ac_objext` in
1346493f84f4Smrg      *N32*)
1347493f84f4Smrg	emul="${emul}n32"
1348493f84f4Smrg	;;
1349493f84f4Smrg    esac
1350493f84f4Smrg    LD="${LD-ld} -m $emul"
1351493f84f4Smrg  fi
1352493f84f4Smrg  rm -rf conftest*
1353493f84f4Smrg  ;;
1354493f84f4Smrg
1355493f84f4Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1356a31a186aSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1357493f84f4Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1358493f84f4Smrg  # options accordingly.  Note that the listed cases only cover the
1359493f84f4Smrg  # situations where additional linker options are needed (such as when
1360493f84f4Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1361493f84f4Smrg  # vice versa); the common cases where no linker options are needed do
1362493f84f4Smrg  # not appear in the list.
1363fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1364fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1365fe5e51b7Smrg    case `/usr/bin/file conftest.o` in
1366a31a186aSmrg      *32-bit*)
1367a31a186aSmrg	case $host in
1368a31a186aSmrg	  x86_64-*kfreebsd*-gnu)
1369a31a186aSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1370a31a186aSmrg	    ;;
1371a31a186aSmrg	  x86_64-*linux*)
1372493f84f4Smrg	    case `/usr/bin/file conftest.o` in
1373493f84f4Smrg	      *x86-64*)
1374493f84f4Smrg		LD="${LD-ld} -m elf32_x86_64"
1375493f84f4Smrg		;;
1376493f84f4Smrg	      *)
1377493f84f4Smrg		LD="${LD-ld} -m elf_i386"
1378493f84f4Smrg		;;
1379493f84f4Smrg	    esac
1380493f84f4Smrg	    ;;
1381493f84f4Smrg	  powerpc64le-*linux*)
1382493f84f4Smrg	    LD="${LD-ld} -m elf32lppclinux"
1383a31a186aSmrg	    ;;
1384493f84f4Smrg	  powerpc64-*linux*)
1385a31a186aSmrg	    LD="${LD-ld} -m elf32ppclinux"
1386a31a186aSmrg	    ;;
1387a31a186aSmrg	  s390x-*linux*)
1388a31a186aSmrg	    LD="${LD-ld} -m elf_s390"
1389a31a186aSmrg	    ;;
1390a31a186aSmrg	  sparc64-*linux*)
1391a31a186aSmrg	    LD="${LD-ld} -m elf32_sparc"
1392a31a186aSmrg	    ;;
1393a31a186aSmrg	esac
1394a31a186aSmrg	;;
1395a31a186aSmrg      *64-bit*)
1396a31a186aSmrg	case $host in
1397a31a186aSmrg	  x86_64-*kfreebsd*-gnu)
1398a31a186aSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1399a31a186aSmrg	    ;;
1400a31a186aSmrg	  x86_64-*linux*)
1401a31a186aSmrg	    LD="${LD-ld} -m elf_x86_64"
1402a31a186aSmrg	    ;;
1403493f84f4Smrg	  powerpcle-*linux*)
1404493f84f4Smrg	    LD="${LD-ld} -m elf64lppc"
1405493f84f4Smrg	    ;;
1406493f84f4Smrg	  powerpc-*linux*)
1407a31a186aSmrg	    LD="${LD-ld} -m elf64ppc"
1408a31a186aSmrg	    ;;
1409a31a186aSmrg	  s390*-*linux*|s390*-*tpf*)
1410a31a186aSmrg	    LD="${LD-ld} -m elf64_s390"
1411a31a186aSmrg	    ;;
1412a31a186aSmrg	  sparc*-*linux*)
1413a31a186aSmrg	    LD="${LD-ld} -m elf64_sparc"
1414a31a186aSmrg	    ;;
1415a31a186aSmrg	esac
1416a31a186aSmrg	;;
1417fe5e51b7Smrg    esac
1418fe5e51b7Smrg  fi
1419fe5e51b7Smrg  rm -rf conftest*
1420fe5e51b7Smrg  ;;
1421fe5e51b7Smrg
1422fe5e51b7Smrg*-*-sco3.2v5*)
1423fe5e51b7Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1424493f84f4Smrg  SAVE_CFLAGS=$CFLAGS
1425fe5e51b7Smrg  CFLAGS="$CFLAGS -belf"
1426fe5e51b7Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1427fe5e51b7Smrg    [AC_LANG_PUSH(C)
1428a31a186aSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1429fe5e51b7Smrg     AC_LANG_POP])
1430493f84f4Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
1431fe5e51b7Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1432493f84f4Smrg    CFLAGS=$SAVE_CFLAGS
1433fe5e51b7Smrg  fi
1434fe5e51b7Smrg  ;;
14350bb88ba4Smrg*-*solaris*)
1436493f84f4Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1437493f84f4Smrg  # options accordingly.
1438fe5e51b7Smrg  echo 'int i;' > conftest.$ac_ext
1439fe5e51b7Smrg  if AC_TRY_EVAL(ac_compile); then
1440fe5e51b7Smrg    case `/usr/bin/file conftest.o` in
1441fe5e51b7Smrg    *64-bit*)
1442fe5e51b7Smrg      case $lt_cv_prog_gnu_ld in
14430bb88ba4Smrg      yes*)
14440bb88ba4Smrg        case $host in
1445493f84f4Smrg        i?86-*-solaris*|x86_64-*-solaris*)
14460bb88ba4Smrg          LD="${LD-ld} -m elf_x86_64"
14470bb88ba4Smrg          ;;
14480bb88ba4Smrg        sparc*-*-solaris*)
14490bb88ba4Smrg          LD="${LD-ld} -m elf64_sparc"
14500bb88ba4Smrg          ;;
14510bb88ba4Smrg        esac
14520bb88ba4Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
14530bb88ba4Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1454493f84f4Smrg          LD=${LD-ld}_sol2
14550bb88ba4Smrg        fi
14560bb88ba4Smrg        ;;
1457eda3803bSmrg      *)
1458a31a186aSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1459eda3803bSmrg	  LD="${LD-ld} -64"
1460eda3803bSmrg	fi
1461eda3803bSmrg	;;
1462fe5e51b7Smrg      esac
1463fe5e51b7Smrg      ;;
1464fe5e51b7Smrg    esac
1465fe5e51b7Smrg  fi
1466fe5e51b7Smrg  rm -rf conftest*
1467fe5e51b7Smrg  ;;
1468fe5e51b7Smrgesac
1469fe5e51b7Smrg
1470493f84f4Smrgneed_locks=$enable_libtool_lock
1471a31a186aSmrg])# _LT_ENABLE_LOCK
1472a31a186aSmrg
1473a31a186aSmrg
14740bb88ba4Smrg# _LT_PROG_AR
14750bb88ba4Smrg# -----------
14760bb88ba4Smrgm4_defun([_LT_PROG_AR],
14770bb88ba4Smrg[AC_CHECK_TOOLS(AR, [ar], false)
14780bb88ba4Smrg: ${AR=ar}
14790bb88ba4Smrg: ${AR_FLAGS=cru}
14800bb88ba4Smrg_LT_DECL([], [AR], [1], [The archiver])
14810bb88ba4Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
14820bb88ba4Smrg
14830bb88ba4SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
14840bb88ba4Smrg  [lt_cv_ar_at_file=no
14850bb88ba4Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
14860bb88ba4Smrg     [echo conftest.$ac_objext > conftest.lst
14870bb88ba4Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
14880bb88ba4Smrg      AC_TRY_EVAL([lt_ar_try])
1489493f84f4Smrg      if test 0 -eq "$ac_status"; then
14900bb88ba4Smrg	# Ensure the archiver fails upon bogus file names.
14910bb88ba4Smrg	rm -f conftest.$ac_objext libconftest.a
14920bb88ba4Smrg	AC_TRY_EVAL([lt_ar_try])
1493493f84f4Smrg	if test 0 -ne "$ac_status"; then
14940bb88ba4Smrg          lt_cv_ar_at_file=@
14950bb88ba4Smrg        fi
14960bb88ba4Smrg      fi
14970bb88ba4Smrg      rm -f conftest.* libconftest.a
14980bb88ba4Smrg     ])
14990bb88ba4Smrg  ])
15000bb88ba4Smrg
1501493f84f4Smrgif test no = "$lt_cv_ar_at_file"; then
15020bb88ba4Smrg  archiver_list_spec=
15030bb88ba4Smrgelse
15040bb88ba4Smrg  archiver_list_spec=$lt_cv_ar_at_file
15050bb88ba4Smrgfi
15060bb88ba4Smrg_LT_DECL([], [archiver_list_spec], [1],
15070bb88ba4Smrg  [How to feed a file listing to the archiver])
15080bb88ba4Smrg])# _LT_PROG_AR
15090bb88ba4Smrg
15100bb88ba4Smrg
1511a31a186aSmrg# _LT_CMD_OLD_ARCHIVE
1512a31a186aSmrg# -------------------
1513a31a186aSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
15140bb88ba4Smrg[_LT_PROG_AR
1515a31a186aSmrg
1516a31a186aSmrgAC_CHECK_TOOL(STRIP, strip, :)
1517a31a186aSmrgtest -z "$STRIP" && STRIP=:
1518a31a186aSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1519eda3803bSmrg
1520a31a186aSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1521a31a186aSmrgtest -z "$RANLIB" && RANLIB=:
1522a31a186aSmrg_LT_DECL([], [RANLIB], [1],
1523a31a186aSmrg    [Commands used to install an old-style archive])
1524a31a186aSmrg
1525a31a186aSmrg# Determine commands to create old-style static archives.
1526a31a186aSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1527a31a186aSmrgold_postinstall_cmds='chmod 644 $oldlib'
1528a31a186aSmrgold_postuninstall_cmds=
1529a31a186aSmrg
1530a31a186aSmrgif test -n "$RANLIB"; then
1531a31a186aSmrg  case $host_os in
1532493f84f4Smrg  bitrig* | openbsd*)
15330bb88ba4Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1534a31a186aSmrg    ;;
1535a31a186aSmrg  *)
15360bb88ba4Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1537a31a186aSmrg    ;;
1538a31a186aSmrg  esac
15390bb88ba4Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1540a31a186aSmrgfi
15410bb88ba4Smrg
15420bb88ba4Smrgcase $host_os in
15430bb88ba4Smrg  darwin*)
15440bb88ba4Smrg    lock_old_archive_extraction=yes ;;
15450bb88ba4Smrg  *)
15460bb88ba4Smrg    lock_old_archive_extraction=no ;;
15470bb88ba4Smrgesac
1548a31a186aSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1549a31a186aSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1550a31a186aSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1551a31a186aSmrg    [Commands used to build an old-style archive])
15520bb88ba4Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
15530bb88ba4Smrg    [Whether to use a lock for old archive extraction])
1554a31a186aSmrg])# _LT_CMD_OLD_ARCHIVE
1555fe5e51b7Smrg
1556fe5e51b7Smrg
1557a31a186aSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1558fe5e51b7Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1559fe5e51b7Smrg# ----------------------------------------------------------------
1560fe5e51b7Smrg# Check whether the given compiler option works
1561a31a186aSmrgAC_DEFUN([_LT_COMPILER_OPTION],
1562a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1563a31a186aSmrgm4_require([_LT_DECL_SED])dnl
1564fe5e51b7SmrgAC_CACHE_CHECK([$1], [$2],
1565fe5e51b7Smrg  [$2=no
1566a31a186aSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1567fe5e51b7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1568493f84f4Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1569fe5e51b7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1570fe5e51b7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1571fe5e51b7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1572fe5e51b7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1573fe5e51b7Smrg   # The option is referenced via a variable to avoid confusing sed.
1574fe5e51b7Smrg   lt_compile=`echo "$ac_compile" | $SED \
1575fe5e51b7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1576fe5e51b7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1577fe5e51b7Smrg   -e 's:$: $lt_compiler_flag:'`
15780bb88ba4Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1579fe5e51b7Smrg   (eval "$lt_compile" 2>conftest.err)
1580fe5e51b7Smrg   ac_status=$?
1581fe5e51b7Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
15820bb88ba4Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1583fe5e51b7Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1584fe5e51b7Smrg     # The compiler can only warn and ignore the option if not recognized
1585fe5e51b7Smrg     # So say no if there are warnings other than the usual output.
15860bb88ba4Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1587fe5e51b7Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1588fe5e51b7Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1589fe5e51b7Smrg       $2=yes
1590fe5e51b7Smrg     fi
1591fe5e51b7Smrg   fi
1592a31a186aSmrg   $RM conftest*
1593fe5e51b7Smrg])
1594fe5e51b7Smrg
1595493f84f4Smrgif test yes = "[$]$2"; then
1596a31a186aSmrg    m4_if([$5], , :, [$5])
1597fe5e51b7Smrgelse
1598a31a186aSmrg    m4_if([$6], , :, [$6])
1599fe5e51b7Smrgfi
1600a31a186aSmrg])# _LT_COMPILER_OPTION
1601fe5e51b7Smrg
1602a31a186aSmrg# Old name:
1603a31a186aSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1604a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1605a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1606eda3803bSmrg
1607a31a186aSmrg
1608a31a186aSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1609a31a186aSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1610a31a186aSmrg# ----------------------------------------------------
1611a31a186aSmrg# Check whether the given linker option works
1612a31a186aSmrgAC_DEFUN([_LT_LINKER_OPTION],
1613a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1614a31a186aSmrgm4_require([_LT_DECL_SED])dnl
1615fe5e51b7SmrgAC_CACHE_CHECK([$1], [$2],
1616fe5e51b7Smrg  [$2=no
1617493f84f4Smrg   save_LDFLAGS=$LDFLAGS
1618fe5e51b7Smrg   LDFLAGS="$LDFLAGS $3"
1619fe5e51b7Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1620fe5e51b7Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1621fe5e51b7Smrg     # The linker can only warn and ignore the option if not recognized
1622fe5e51b7Smrg     # So say no if there are warnings
1623fe5e51b7Smrg     if test -s conftest.err; then
1624fe5e51b7Smrg       # Append any errors to the config.log.
1625fe5e51b7Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
16260bb88ba4Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1627fe5e51b7Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1628fe5e51b7Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1629fe5e51b7Smrg         $2=yes
1630fe5e51b7Smrg       fi
1631fe5e51b7Smrg     else
1632fe5e51b7Smrg       $2=yes
1633fe5e51b7Smrg     fi
1634fe5e51b7Smrg   fi
1635a31a186aSmrg   $RM -r conftest*
1636493f84f4Smrg   LDFLAGS=$save_LDFLAGS
1637fe5e51b7Smrg])
1638fe5e51b7Smrg
1639493f84f4Smrgif test yes = "[$]$2"; then
1640a31a186aSmrg    m4_if([$4], , :, [$4])
1641fe5e51b7Smrgelse
1642a31a186aSmrg    m4_if([$5], , :, [$5])
1643fe5e51b7Smrgfi
1644a31a186aSmrg])# _LT_LINKER_OPTION
1645fe5e51b7Smrg
1646a31a186aSmrg# Old name:
1647a31a186aSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1648a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1649a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1650fe5e51b7Smrg
1651a31a186aSmrg
1652a31a186aSmrg# LT_CMD_MAX_LEN
1653a31a186aSmrg#---------------
1654a31a186aSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1655a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1656a31a186aSmrg# find the maximum length of command line arguments
1657fe5e51b7SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1658fe5e51b7SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1659fe5e51b7Smrg  i=0
1660493f84f4Smrg  teststring=ABCD
1661fe5e51b7Smrg
1662fe5e51b7Smrg  case $build_os in
1663fe5e51b7Smrg  msdosdjgpp*)
1664fe5e51b7Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1665fe5e51b7Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1666fe5e51b7Smrg    # during glob expansion).  Even if it were fixed, the result of this
1667fe5e51b7Smrg    # check would be larger than it should be.
1668fe5e51b7Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1669fe5e51b7Smrg    ;;
1670fe5e51b7Smrg
1671fe5e51b7Smrg  gnu*)
1672fe5e51b7Smrg    # Under GNU Hurd, this test is not required because there is
1673fe5e51b7Smrg    # no limit to the length of command line arguments.
1674fe5e51b7Smrg    # Libtool will interpret -1 as no limit whatsoever
1675fe5e51b7Smrg    lt_cv_sys_max_cmd_len=-1;
1676fe5e51b7Smrg    ;;
1677fe5e51b7Smrg
1678a31a186aSmrg  cygwin* | mingw* | cegcc*)
1679fe5e51b7Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1680fe5e51b7Smrg    # about 5 minutes as the teststring grows exponentially.
1681fe5e51b7Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1682fe5e51b7Smrg    # you end up with a "frozen" computer, even though with patience
1683fe5e51b7Smrg    # the test eventually succeeds (with a max line length of 256k).
1684fe5e51b7Smrg    # Instead, let's just punt: use the minimum linelength reported by
1685fe5e51b7Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1686fe5e51b7Smrg    lt_cv_sys_max_cmd_len=8192;
1687fe5e51b7Smrg    ;;
1688fe5e51b7Smrg
16890bb88ba4Smrg  mint*)
16900bb88ba4Smrg    # On MiNT this can take a long time and run out of memory.
16910bb88ba4Smrg    lt_cv_sys_max_cmd_len=8192;
16920bb88ba4Smrg    ;;
16930bb88ba4Smrg
1694fe5e51b7Smrg  amigaos*)
1695fe5e51b7Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1696fe5e51b7Smrg    # So we just punt and use a minimum line length of 8192.
1697fe5e51b7Smrg    lt_cv_sys_max_cmd_len=8192;
1698fe5e51b7Smrg    ;;
1699fe5e51b7Smrg
1700493f84f4Smrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1701fe5e51b7Smrg    # This has been around since 386BSD, at least.  Likely further.
1702fe5e51b7Smrg    if test -x /sbin/sysctl; then
1703fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1704fe5e51b7Smrg    elif test -x /usr/sbin/sysctl; then
1705fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1706fe5e51b7Smrg    else
1707fe5e51b7Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1708fe5e51b7Smrg    fi
1709fe5e51b7Smrg    # And add a safety zone
1710fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1711fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1712fe5e51b7Smrg    ;;
1713fe5e51b7Smrg
1714fe5e51b7Smrg  interix*)
1715fe5e51b7Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1716fe5e51b7Smrg    lt_cv_sys_max_cmd_len=196608
1717fe5e51b7Smrg    ;;
1718fe5e51b7Smrg
17190bb88ba4Smrg  os2*)
17200bb88ba4Smrg    # The test takes a long time on OS/2.
17210bb88ba4Smrg    lt_cv_sys_max_cmd_len=8192
17220bb88ba4Smrg    ;;
17230bb88ba4Smrg
1724fe5e51b7Smrg  osf*)
1725fe5e51b7Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1726fe5e51b7Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1727fe5e51b7Smrg    # nice to cause kernel panics so lets avoid the loop below.
1728fe5e51b7Smrg    # First set a reasonable default.
1729fe5e51b7Smrg    lt_cv_sys_max_cmd_len=16384
1730fe5e51b7Smrg    #
1731fe5e51b7Smrg    if test -x /sbin/sysconfig; then
1732fe5e51b7Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1733fe5e51b7Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1734fe5e51b7Smrg      esac
1735fe5e51b7Smrg    fi
1736fe5e51b7Smrg    ;;
1737fe5e51b7Smrg  sco3.2v5*)
1738fe5e51b7Smrg    lt_cv_sys_max_cmd_len=102400
1739fe5e51b7Smrg    ;;
1740fe5e51b7Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1741fe5e51b7Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1742fe5e51b7Smrg    if test -n "$kargmax"; then
1743a31a186aSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1744fe5e51b7Smrg    else
1745fe5e51b7Smrg      lt_cv_sys_max_cmd_len=32768
1746fe5e51b7Smrg    fi
1747fe5e51b7Smrg    ;;
1748fe5e51b7Smrg  *)
1749fe5e51b7Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1750493f84f4Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1751493f84f4Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1752fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1753fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1754fe5e51b7Smrg    else
1755a31a186aSmrg      # Make teststring a little bigger before we do anything with it.
1756a31a186aSmrg      # a 1K string should be a reasonable start.
1757493f84f4Smrg      for i in 1 2 3 4 5 6 7 8; do
1758a31a186aSmrg        teststring=$teststring$teststring
1759a31a186aSmrg      done
1760fe5e51b7Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1761a31a186aSmrg      # If test is not a shell built-in, we'll probably end up computing a
1762a31a186aSmrg      # maximum length that is only half of the actual maximum length, but
1763a31a186aSmrg      # we can't tell.
1764493f84f4Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
17650bb88ba4Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1766493f84f4Smrg	      test 17 != "$i" # 1/2 MB should be enough
1767fe5e51b7Smrg      do
1768fe5e51b7Smrg        i=`expr $i + 1`
1769fe5e51b7Smrg        teststring=$teststring$teststring
1770fe5e51b7Smrg      done
1771a31a186aSmrg      # Only check the string length outside the loop.
1772a31a186aSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1773fe5e51b7Smrg      teststring=
1774a31a186aSmrg      # Add a significant safety factor because C++ compilers can tack on
1775a31a186aSmrg      # massive amounts of additional arguments before passing them to the
1776a31a186aSmrg      # linker.  It appears as though 1/2 is a usable value.
1777fe5e51b7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1778fe5e51b7Smrg    fi
1779fe5e51b7Smrg    ;;
1780fe5e51b7Smrg  esac
1781fe5e51b7Smrg])
1782493f84f4Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
1783fe5e51b7Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1784fe5e51b7Smrgelse
1785fe5e51b7Smrg  AC_MSG_RESULT(none)
1786fe5e51b7Smrgfi
1787a31a186aSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1788a31a186aSmrg_LT_DECL([], [max_cmd_len], [0],
1789a31a186aSmrg    [What is the maximum length of a command?])
1790a31a186aSmrg])# LT_CMD_MAX_LEN
1791fe5e51b7Smrg
1792a31a186aSmrg# Old name:
1793a31a186aSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1794a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
1795a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1796fe5e51b7Smrg
1797a31a186aSmrg
1798a31a186aSmrg# _LT_HEADER_DLFCN
1799a31a186aSmrg# ----------------
1800a31a186aSmrgm4_defun([_LT_HEADER_DLFCN],
1801a31a186aSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1802a31a186aSmrg])# _LT_HEADER_DLFCN
1803fe5e51b7Smrg
1804fe5e51b7Smrg
1805a31a186aSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1806a31a186aSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1807a31a186aSmrg# ----------------------------------------------------------------
1808a31a186aSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1809a31a186aSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1810493f84f4Smrgif test yes = "$cross_compiling"; then :
1811fe5e51b7Smrg  [$4]
1812fe5e51b7Smrgelse
1813fe5e51b7Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1814fe5e51b7Smrg  lt_status=$lt_dlunknown
1815a31a186aSmrg  cat > conftest.$ac_ext <<_LT_EOF
18160bb88ba4Smrg[#line $LINENO "configure"
1817fe5e51b7Smrg#include "confdefs.h"
1818fe5e51b7Smrg
1819fe5e51b7Smrg#if HAVE_DLFCN_H
1820fe5e51b7Smrg#include <dlfcn.h>
1821fe5e51b7Smrg#endif
1822fe5e51b7Smrg
1823fe5e51b7Smrg#include <stdio.h>
1824fe5e51b7Smrg
1825fe5e51b7Smrg#ifdef RTLD_GLOBAL
1826fe5e51b7Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1827fe5e51b7Smrg#else
1828fe5e51b7Smrg#  ifdef DL_GLOBAL
1829fe5e51b7Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1830fe5e51b7Smrg#  else
1831fe5e51b7Smrg#    define LT_DLGLOBAL		0
1832fe5e51b7Smrg#  endif
1833fe5e51b7Smrg#endif
1834fe5e51b7Smrg
1835fe5e51b7Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1836fe5e51b7Smrg   find out it does not work in some platform. */
1837fe5e51b7Smrg#ifndef LT_DLLAZY_OR_NOW
1838fe5e51b7Smrg#  ifdef RTLD_LAZY
1839fe5e51b7Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1840fe5e51b7Smrg#  else
1841fe5e51b7Smrg#    ifdef DL_LAZY
1842fe5e51b7Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1843fe5e51b7Smrg#    else
1844fe5e51b7Smrg#      ifdef RTLD_NOW
1845fe5e51b7Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1846fe5e51b7Smrg#      else
1847fe5e51b7Smrg#        ifdef DL_NOW
1848fe5e51b7Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1849fe5e51b7Smrg#        else
1850fe5e51b7Smrg#          define LT_DLLAZY_OR_NOW	0
1851fe5e51b7Smrg#        endif
1852fe5e51b7Smrg#      endif
1853fe5e51b7Smrg#    endif
1854fe5e51b7Smrg#  endif
1855fe5e51b7Smrg#endif
1856fe5e51b7Smrg
1857493f84f4Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
18580bb88ba4Smrg   correspondingly for the symbols needed.  */
1859493f84f4Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
18600bb88ba4Smrgint fnord () __attribute__((visibility("default")));
18610bb88ba4Smrg#endif
18620bb88ba4Smrg
18630bb88ba4Smrgint fnord () { return 42; }
1864fe5e51b7Smrgint main ()
1865fe5e51b7Smrg{
1866fe5e51b7Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1867fe5e51b7Smrg  int status = $lt_dlunknown;
1868fe5e51b7Smrg
1869fe5e51b7Smrg  if (self)
1870fe5e51b7Smrg    {
1871fe5e51b7Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
18720bb88ba4Smrg      else
18730bb88ba4Smrg        {
18740bb88ba4Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
18750bb88ba4Smrg          else puts (dlerror ());
18760bb88ba4Smrg	}
1877fe5e51b7Smrg      /* dlclose (self); */
1878fe5e51b7Smrg    }
1879fe5e51b7Smrg  else
1880fe5e51b7Smrg    puts (dlerror ());
1881fe5e51b7Smrg
1882a31a186aSmrg  return status;
1883fe5e51b7Smrg}]
1884a31a186aSmrg_LT_EOF
1885493f84f4Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1886fe5e51b7Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1887fe5e51b7Smrg    lt_status=$?
1888fe5e51b7Smrg    case x$lt_status in
1889fe5e51b7Smrg      x$lt_dlno_uscore) $1 ;;
1890fe5e51b7Smrg      x$lt_dlneed_uscore) $2 ;;
1891fe5e51b7Smrg      x$lt_dlunknown|x*) $3 ;;
1892fe5e51b7Smrg    esac
1893fe5e51b7Smrg  else :
1894fe5e51b7Smrg    # compilation failed
1895fe5e51b7Smrg    $3
1896fe5e51b7Smrg  fi
1897fe5e51b7Smrgfi
1898fe5e51b7Smrgrm -fr conftest*
1899a31a186aSmrg])# _LT_TRY_DLOPEN_SELF
1900fe5e51b7Smrg
1901fe5e51b7Smrg
1902a31a186aSmrg# LT_SYS_DLOPEN_SELF
1903a31a186aSmrg# ------------------
1904a31a186aSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1905a31a186aSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1906493f84f4Smrgif test yes != "$enable_dlopen"; then
1907fe5e51b7Smrg  enable_dlopen=unknown
1908fe5e51b7Smrg  enable_dlopen_self=unknown
1909fe5e51b7Smrg  enable_dlopen_self_static=unknown
1910fe5e51b7Smrgelse
1911fe5e51b7Smrg  lt_cv_dlopen=no
1912fe5e51b7Smrg  lt_cv_dlopen_libs=
1913fe5e51b7Smrg
1914fe5e51b7Smrg  case $host_os in
1915fe5e51b7Smrg  beos*)
1916493f84f4Smrg    lt_cv_dlopen=load_add_on
1917fe5e51b7Smrg    lt_cv_dlopen_libs=
1918fe5e51b7Smrg    lt_cv_dlopen_self=yes
1919fe5e51b7Smrg    ;;
1920fe5e51b7Smrg
1921a31a186aSmrg  mingw* | pw32* | cegcc*)
1922493f84f4Smrg    lt_cv_dlopen=LoadLibrary
1923fe5e51b7Smrg    lt_cv_dlopen_libs=
1924a31a186aSmrg    ;;
1925fe5e51b7Smrg
1926fe5e51b7Smrg  cygwin*)
1927493f84f4Smrg    lt_cv_dlopen=dlopen
1928fe5e51b7Smrg    lt_cv_dlopen_libs=
1929a31a186aSmrg    ;;
1930fe5e51b7Smrg
1931fe5e51b7Smrg  darwin*)
1932493f84f4Smrg    # if libdl is installed we need to link against it
1933fe5e51b7Smrg    AC_CHECK_LIB([dl], [dlopen],
1934493f84f4Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1935493f84f4Smrg    lt_cv_dlopen=dyld
1936fe5e51b7Smrg    lt_cv_dlopen_libs=
1937fe5e51b7Smrg    lt_cv_dlopen_self=yes
1938fe5e51b7Smrg    ])
1939a31a186aSmrg    ;;
1940fe5e51b7Smrg
1941493f84f4Smrg  tpf*)
1942493f84f4Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
1943493f84f4Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1944493f84f4Smrg    lt_cv_dlopen=dlopen
1945493f84f4Smrg    lt_cv_dlopen_libs=
1946493f84f4Smrg    lt_cv_dlopen_self=no
1947493f84f4Smrg    ;;
1948493f84f4Smrg
1949fe5e51b7Smrg  *)
1950fe5e51b7Smrg    AC_CHECK_FUNC([shl_load],
1951493f84f4Smrg	  [lt_cv_dlopen=shl_load],
1952fe5e51b7Smrg      [AC_CHECK_LIB([dld], [shl_load],
1953493f84f4Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1954fe5e51b7Smrg	[AC_CHECK_FUNC([dlopen],
1955493f84f4Smrg	      [lt_cv_dlopen=dlopen],
1956fe5e51b7Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1957493f84f4Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1958fe5e51b7Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1959493f84f4Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1960fe5e51b7Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1961493f84f4Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1962fe5e51b7Smrg	      ])
1963fe5e51b7Smrg	    ])
1964fe5e51b7Smrg	  ])
1965fe5e51b7Smrg	])
1966fe5e51b7Smrg      ])
1967fe5e51b7Smrg    ;;
1968fe5e51b7Smrg  esac
1969fe5e51b7Smrg
1970493f84f4Smrg  if test no = "$lt_cv_dlopen"; then
1971fe5e51b7Smrg    enable_dlopen=no
1972493f84f4Smrg  else
1973493f84f4Smrg    enable_dlopen=yes
1974fe5e51b7Smrg  fi
1975fe5e51b7Smrg
1976fe5e51b7Smrg  case $lt_cv_dlopen in
1977fe5e51b7Smrg  dlopen)
1978493f84f4Smrg    save_CPPFLAGS=$CPPFLAGS
1979493f84f4Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
1980fe5e51b7Smrg
1981493f84f4Smrg    save_LDFLAGS=$LDFLAGS
1982fe5e51b7Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
1983fe5e51b7Smrg
1984493f84f4Smrg    save_LIBS=$LIBS
1985fe5e51b7Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
1986fe5e51b7Smrg
1987fe5e51b7Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
1988fe5e51b7Smrg	  lt_cv_dlopen_self, [dnl
1989a31a186aSmrg	  _LT_TRY_DLOPEN_SELF(
1990fe5e51b7Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
1991fe5e51b7Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
1992fe5e51b7Smrg    ])
1993fe5e51b7Smrg
1994493f84f4Smrg    if test yes = "$lt_cv_dlopen_self"; then
1995fe5e51b7Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
1996fe5e51b7Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1997a31a186aSmrg	  lt_cv_dlopen_self_static, [dnl
1998a31a186aSmrg	  _LT_TRY_DLOPEN_SELF(
1999fe5e51b7Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2000fe5e51b7Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2001fe5e51b7Smrg      ])
2002fe5e51b7Smrg    fi
2003fe5e51b7Smrg
2004493f84f4Smrg    CPPFLAGS=$save_CPPFLAGS
2005493f84f4Smrg    LDFLAGS=$save_LDFLAGS
2006493f84f4Smrg    LIBS=$save_LIBS
2007fe5e51b7Smrg    ;;
2008fe5e51b7Smrg  esac
2009fe5e51b7Smrg
2010fe5e51b7Smrg  case $lt_cv_dlopen_self in
2011fe5e51b7Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2012fe5e51b7Smrg  *) enable_dlopen_self=unknown ;;
2013fe5e51b7Smrg  esac
2014fe5e51b7Smrg
2015fe5e51b7Smrg  case $lt_cv_dlopen_self_static in
2016fe5e51b7Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2017fe5e51b7Smrg  *) enable_dlopen_self_static=unknown ;;
2018fe5e51b7Smrg  esac
2019fe5e51b7Smrgfi
2020a31a186aSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2021a31a186aSmrg	 [Whether dlopen is supported])
2022a31a186aSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2023a31a186aSmrg	 [Whether dlopen of programs is supported])
2024a31a186aSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2025a31a186aSmrg	 [Whether dlopen of statically linked programs is supported])
2026a31a186aSmrg])# LT_SYS_DLOPEN_SELF
2027fe5e51b7Smrg
2028a31a186aSmrg# Old name:
2029a31a186aSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2030a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
2031a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2032eda3803bSmrg
2033a31a186aSmrg
2034a31a186aSmrg# _LT_COMPILER_C_O([TAGNAME])
2035a31a186aSmrg# ---------------------------
2036a31a186aSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
2037a31a186aSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2038a31a186aSmrgm4_defun([_LT_COMPILER_C_O],
2039a31a186aSmrg[m4_require([_LT_DECL_SED])dnl
2040a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2041a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
2042fe5e51b7SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2043a31a186aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2044a31a186aSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2045a31a186aSmrg   $RM -r conftest 2>/dev/null
2046fe5e51b7Smrg   mkdir conftest
2047fe5e51b7Smrg   cd conftest
2048fe5e51b7Smrg   mkdir out
2049fe5e51b7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2050fe5e51b7Smrg
2051fe5e51b7Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2052fe5e51b7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2053fe5e51b7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2054fe5e51b7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2055fe5e51b7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2056fe5e51b7Smrg   lt_compile=`echo "$ac_compile" | $SED \
2057fe5e51b7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2058fe5e51b7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2059fe5e51b7Smrg   -e 's:$: $lt_compiler_flag:'`
20600bb88ba4Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2061fe5e51b7Smrg   (eval "$lt_compile" 2>out/conftest.err)
2062fe5e51b7Smrg   ac_status=$?
2063fe5e51b7Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
20640bb88ba4Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2065fe5e51b7Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2066fe5e51b7Smrg   then
2067fe5e51b7Smrg     # The compiler can only warn and ignore the option if not recognized
2068fe5e51b7Smrg     # So say no if there are warnings
20690bb88ba4Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2070fe5e51b7Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2071fe5e51b7Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2072a31a186aSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2073fe5e51b7Smrg     fi
2074fe5e51b7Smrg   fi
2075fe5e51b7Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2076a31a186aSmrg   $RM conftest*
2077fe5e51b7Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2078fe5e51b7Smrg   # template instantiation
2079a31a186aSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2080a31a186aSmrg   $RM out/* && rmdir out
2081fe5e51b7Smrg   cd ..
2082a31a186aSmrg   $RM -r conftest
2083a31a186aSmrg   $RM conftest*
2084fe5e51b7Smrg])
2085a31a186aSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2086a31a186aSmrg	[Does compiler simultaneously support -c and -o options?])
2087a31a186aSmrg])# _LT_COMPILER_C_O
2088fe5e51b7Smrg
2089fe5e51b7Smrg
2090a31a186aSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2091a31a186aSmrg# ----------------------------------
2092fe5e51b7Smrg# Check to see if we can do hard links to lock some files if needed
2093a31a186aSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2094a31a186aSmrg[m4_require([_LT_ENABLE_LOCK])dnl
2095a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2096a31a186aSmrg_LT_COMPILER_C_O([$1])
2097fe5e51b7Smrg
2098493f84f4Smrghard_links=nottested
2099493f84f4Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2100fe5e51b7Smrg  # do not overwrite the value of need_locks provided by the user
2101fe5e51b7Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2102fe5e51b7Smrg  hard_links=yes
2103a31a186aSmrg  $RM conftest*
2104fe5e51b7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2105fe5e51b7Smrg  touch conftest.a
2106fe5e51b7Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2107fe5e51b7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2108fe5e51b7Smrg  AC_MSG_RESULT([$hard_links])
2109493f84f4Smrg  if test no = "$hard_links"; then
2110493f84f4Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2111fe5e51b7Smrg    need_locks=warn
2112fe5e51b7Smrg  fi
2113fe5e51b7Smrgelse
2114fe5e51b7Smrg  need_locks=no
2115fe5e51b7Smrgfi
2116a31a186aSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2117a31a186aSmrg])# _LT_COMPILER_FILE_LOCKS
2118fe5e51b7Smrg
2119fe5e51b7Smrg
2120a31a186aSmrg# _LT_CHECK_OBJDIR
2121a31a186aSmrg# ----------------
2122a31a186aSmrgm4_defun([_LT_CHECK_OBJDIR],
2123fe5e51b7Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2124fe5e51b7Smrg[rm -f .libs 2>/dev/null
2125fe5e51b7Smrgmkdir .libs 2>/dev/null
2126fe5e51b7Smrgif test -d .libs; then
2127fe5e51b7Smrg  lt_cv_objdir=.libs
2128fe5e51b7Smrgelse
2129fe5e51b7Smrg  # MS-DOS does not allow filenames that begin with a dot.
2130fe5e51b7Smrg  lt_cv_objdir=_libs
2131fe5e51b7Smrgfi
2132fe5e51b7Smrgrmdir .libs 2>/dev/null])
2133fe5e51b7Smrgobjdir=$lt_cv_objdir
2134a31a186aSmrg_LT_DECL([], [objdir], [0],
2135a31a186aSmrg         [The name of the directory that contains temporary libtool files])dnl
2136a31a186aSmrgm4_pattern_allow([LT_OBJDIR])dnl
2137493f84f4SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2138493f84f4Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2139a31a186aSmrg])# _LT_CHECK_OBJDIR
2140fe5e51b7Smrg
2141fe5e51b7Smrg
2142a31a186aSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2143a31a186aSmrg# --------------------------------------
2144fe5e51b7Smrg# Check hardcoding attributes.
2145a31a186aSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2146fe5e51b7Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2147a31a186aSmrg_LT_TAGVAR(hardcode_action, $1)=
2148a31a186aSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2149a31a186aSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2150493f84f4Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2151fe5e51b7Smrg
2152a31a186aSmrg  # We can hardcode non-existent directories.
2153493f84f4Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2154fe5e51b7Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2155fe5e51b7Smrg     # have to relink, otherwise we might link with an installed library
2156fe5e51b7Smrg     # when we should be linking with a yet-to-be-installed one
2157493f84f4Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2158493f84f4Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2159fe5e51b7Smrg    # Linking always hardcodes the temporary library directory.
2160a31a186aSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2161fe5e51b7Smrg  else
2162fe5e51b7Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2163a31a186aSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2164fe5e51b7Smrg  fi
2165fe5e51b7Smrgelse
2166fe5e51b7Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2167fe5e51b7Smrg  # directories.
2168a31a186aSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2169fe5e51b7Smrgfi
2170a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2171fe5e51b7Smrg
2172493f84f4Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2173493f84f4Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2174fe5e51b7Smrg  # Fast installation is not supported
2175fe5e51b7Smrg  enable_fast_install=no
2176493f84f4Smrgelif test yes = "$shlibpath_overrides_runpath" ||
2177493f84f4Smrg     test no = "$enable_shared"; then
2178fe5e51b7Smrg  # Fast installation is not necessary
2179fe5e51b7Smrg  enable_fast_install=needless
2180fe5e51b7Smrgfi
2181a31a186aSmrg_LT_TAGDECL([], [hardcode_action], [0],
2182a31a186aSmrg    [How to hardcode a shared library path into an executable])
2183a31a186aSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2184fe5e51b7Smrg
2185fe5e51b7Smrg
2186a31a186aSmrg# _LT_CMD_STRIPLIB
2187a31a186aSmrg# ----------------
2188a31a186aSmrgm4_defun([_LT_CMD_STRIPLIB],
2189a31a186aSmrg[m4_require([_LT_DECL_EGREP])
2190a31a186aSmrgstriplib=
2191fe5e51b7Smrgold_striplib=
2192fe5e51b7SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2193a31a186aSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2194fe5e51b7Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2195fe5e51b7Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2196fe5e51b7Smrg  AC_MSG_RESULT([yes])
2197fe5e51b7Smrgelse
2198fe5e51b7Smrg# FIXME - insert some real tests, host_os isn't really good enough
2199fe5e51b7Smrg  case $host_os in
2200a31a186aSmrg  darwin*)
2201493f84f4Smrg    if test -n "$STRIP"; then
2202a31a186aSmrg      striplib="$STRIP -x"
2203a31a186aSmrg      old_striplib="$STRIP -S"
2204a31a186aSmrg      AC_MSG_RESULT([yes])
2205a31a186aSmrg    else
2206a31a186aSmrg      AC_MSG_RESULT([no])
2207a31a186aSmrg    fi
2208a31a186aSmrg    ;;
2209a31a186aSmrg  *)
2210a31a186aSmrg    AC_MSG_RESULT([no])
2211fe5e51b7Smrg    ;;
2212fe5e51b7Smrg  esac
2213fe5e51b7Smrgfi
2214a31a186aSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2215a31a186aSmrg_LT_DECL([], [striplib], [1])
2216a31a186aSmrg])# _LT_CMD_STRIPLIB
2217fe5e51b7Smrg
2218fe5e51b7Smrg
2219a31a186aSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2220fe5e51b7Smrg# -----------------------------
2221fe5e51b7Smrg# PORTME Fill in your ld.so characteristics
2222a31a186aSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2223a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2224a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
2225a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2226a31a186aSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2227a31a186aSmrgm4_require([_LT_DECL_SED])dnl
22280bb88ba4Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2229fe5e51b7SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2230a31a186aSmrgm4_if([$1],
2231a31a186aSmrg	[], [
2232493f84f4Smrgif test yes = "$GCC"; then
2233fe5e51b7Smrg  case $host_os in
2234493f84f4Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2235493f84f4Smrg    *) lt_awk_arg='/^libraries:/' ;;
2236fe5e51b7Smrg  esac
22370bb88ba4Smrg  case $host_os in
2238493f84f4Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2239493f84f4Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
22400bb88ba4Smrg  esac
22410bb88ba4Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
22420bb88ba4Smrg  case $lt_search_path_spec in
22430bb88ba4Smrg  *\;*)
2244fe5e51b7Smrg    # if the path contains ";" then we assume it to be the separator
2245fe5e51b7Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2246fe5e51b7Smrg    # assumed that no part of a normal pathname contains ";" but that should
2247fe5e51b7Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
22480bb88ba4Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
22490bb88ba4Smrg    ;;
22500bb88ba4Smrg  *)
22510bb88ba4Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
22520bb88ba4Smrg    ;;
22530bb88ba4Smrg  esac
2254fe5e51b7Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2255493f84f4Smrg  # and add multilib dir if necessary...
2256fe5e51b7Smrg  lt_tmp_lt_search_path_spec=
2257493f84f4Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2258493f84f4Smrg  # ...but if some path component already ends with the multilib dir we assume
2259493f84f4Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2260493f84f4Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2261493f84f4Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2262493f84f4Smrg    lt_multi_os_dir=
2263493f84f4Smrg    ;;
2264493f84f4Smrg  esac
2265fe5e51b7Smrg  for lt_sys_path in $lt_search_path_spec; do
2266493f84f4Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2267493f84f4Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2268493f84f4Smrg    elif test -n "$lt_multi_os_dir"; then
2269fe5e51b7Smrg      test -d "$lt_sys_path" && \
2270fe5e51b7Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2271fe5e51b7Smrg    fi
2272fe5e51b7Smrg  done
22730bb88ba4Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2274493f84f4SmrgBEGIN {RS = " "; FS = "/|\n";} {
2275493f84f4Smrg  lt_foo = "";
2276493f84f4Smrg  lt_count = 0;
2277fe5e51b7Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2278fe5e51b7Smrg    if ($lt_i != "" && $lt_i != ".") {
2279fe5e51b7Smrg      if ($lt_i == "..") {
2280fe5e51b7Smrg        lt_count++;
2281fe5e51b7Smrg      } else {
2282fe5e51b7Smrg        if (lt_count == 0) {
2283493f84f4Smrg          lt_foo = "/" $lt_i lt_foo;
2284fe5e51b7Smrg        } else {
2285fe5e51b7Smrg          lt_count--;
2286fe5e51b7Smrg        }
2287fe5e51b7Smrg      }
2288fe5e51b7Smrg    }
2289fe5e51b7Smrg  }
2290fe5e51b7Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2291fe5e51b7Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2292fe5e51b7Smrg}'`
22930bb88ba4Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
22940bb88ba4Smrg  # for these hosts.
22950bb88ba4Smrg  case $host_os in
22960bb88ba4Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2297493f84f4Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
22980bb88ba4Smrg  esac
22990bb88ba4Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2300fe5e51b7Smrgelse
2301fe5e51b7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2302fe5e51b7Smrgfi])
2303a31a186aSmrglibrary_names_spec=
2304a31a186aSmrglibname_spec='lib$name'
2305a31a186aSmrgsoname_spec=
2306493f84f4Smrgshrext_cmds=.so
2307a31a186aSmrgpostinstall_cmds=
2308a31a186aSmrgpostuninstall_cmds=
2309a31a186aSmrgfinish_cmds=
2310a31a186aSmrgfinish_eval=
2311a31a186aSmrgshlibpath_var=
2312a31a186aSmrgshlibpath_overrides_runpath=unknown
2313a31a186aSmrgversion_type=none
2314a31a186aSmrgdynamic_linker="$host_os ld.so"
2315a31a186aSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2316fe5e51b7Smrgneed_lib_prefix=unknown
2317fe5e51b7Smrghardcode_into_libs=no
2318fe5e51b7Smrg
2319fe5e51b7Smrg# when you set need_version to no, make sure it does not cause -set_version
2320fe5e51b7Smrg# flags to be left without arguments
2321fe5e51b7Smrgneed_version=unknown
2322fe5e51b7Smrg
2323fe5e51b7Smrgcase $host_os in
2324fe5e51b7Smrgaix3*)
23250bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2326493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2327fe5e51b7Smrg  shlibpath_var=LIBPATH
2328fe5e51b7Smrg
2329fe5e51b7Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2330493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2331fe5e51b7Smrg  ;;
2332fe5e51b7Smrg
2333eda3803bSmrgaix[[4-9]]*)
23340bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2335fe5e51b7Smrg  need_lib_prefix=no
2336fe5e51b7Smrg  need_version=no
2337fe5e51b7Smrg  hardcode_into_libs=yes
2338493f84f4Smrg  if test ia64 = "$host_cpu"; then
2339fe5e51b7Smrg    # AIX 5 supports IA64
2340493f84f4Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2341fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2342fe5e51b7Smrg  else
2343fe5e51b7Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2344fe5e51b7Smrg    # for dependence libraries.  The import file would start with
2345493f84f4Smrg    # the line '#! .'.  This would cause the generated library to
2346493f84f4Smrg    # depend on '.', always an invalid library.  This was fixed in
2347fe5e51b7Smrg    # development snapshots of GCC prior to 3.0.
2348fe5e51b7Smrg    case $host_os in
2349fe5e51b7Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2350fe5e51b7Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2351fe5e51b7Smrg	   echo ' yes '
2352493f84f4Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2353fe5e51b7Smrg	:
2354fe5e51b7Smrg      else
2355fe5e51b7Smrg	can_build_shared=no
2356fe5e51b7Smrg      fi
2357fe5e51b7Smrg      ;;
2358fe5e51b7Smrg    esac
2359493f84f4Smrg    # Using Import Files as archive members, it is possible to support
2360493f84f4Smrg    # filename-based versioning of shared library archives on AIX. While
2361493f84f4Smrg    # this would work for both with and without runtime linking, it will
2362493f84f4Smrg    # prevent static linking of such archives. So we do filename-based
2363493f84f4Smrg    # shared library versioning with .so extension only, which is used
2364493f84f4Smrg    # when both runtime linking and shared linking is enabled.
2365493f84f4Smrg    # Unfortunately, runtime linking may impact performance, so we do
2366493f84f4Smrg    # not want this to be the default eventually. Also, we use the
2367493f84f4Smrg    # versioned .so libs for executables only if there is the -brtl
2368493f84f4Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2369493f84f4Smrg    # To allow for filename-based versioning support, we need to create
2370493f84f4Smrg    # libNAME.so.V as an archive file, containing:
2371493f84f4Smrg    # *) an Import File, referring to the versioned filename of the
2372493f84f4Smrg    #    archive as well as the shared archive member, telling the
2373493f84f4Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
2374493f84f4Smrg    #    list of exported symbols of that shared object, eventually
2375493f84f4Smrg    #    decorated with the 'weak' keyword
2376493f84f4Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2377493f84f4Smrg    #    it being seen by the linker.
2378493f84f4Smrg    # At run time we better use the real file rather than another symlink,
2379493f84f4Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2380493f84f4Smrg
2381493f84f4Smrg    case $with_aix_soname,$aix_use_runtimelinking in
2382493f84f4Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2383fe5e51b7Smrg    # soname into executable. Probably we can add versioning support to
2384fe5e51b7Smrg    # collect2, so additional links can be useful in future.
2385493f84f4Smrg    aix,yes) # traditional libtool
2386493f84f4Smrg      dynamic_linker='AIX unversionable lib.so'
2387fe5e51b7Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2388fe5e51b7Smrg      # instead of lib<name>.a to let people know that these are not
2389fe5e51b7Smrg      # typical AIX shared libraries.
2390493f84f4Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2391493f84f4Smrg      ;;
2392493f84f4Smrg    aix,no) # traditional AIX only
2393493f84f4Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2394fe5e51b7Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2395fe5e51b7Smrg      # and later when we are not doing run time linking.
2396493f84f4Smrg      library_names_spec='$libname$release.a $libname.a'
2397493f84f4Smrg      soname_spec='$libname$release$shared_ext$major'
2398493f84f4Smrg      ;;
2399493f84f4Smrg    svr4,*) # full svr4 only
2400493f84f4Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2401493f84f4Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2402493f84f4Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2403493f84f4Smrg      shlibpath_overrides_runpath=yes
2404493f84f4Smrg      ;;
2405493f84f4Smrg    *,yes) # both, prefer svr4
2406493f84f4Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2407493f84f4Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2408493f84f4Smrg      # unpreferred sharedlib libNAME.a needs extra handling
2409493f84f4Smrg      postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
2410493f84f4Smrg      postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
2411493f84f4Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2412493f84f4Smrg      shlibpath_overrides_runpath=yes
2413493f84f4Smrg      ;;
2414493f84f4Smrg    *,no) # both, prefer aix
2415493f84f4Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2416493f84f4Smrg      library_names_spec='$libname$release.a $libname.a'
2417493f84f4Smrg      soname_spec='$libname$release$shared_ext$major'
2418493f84f4Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2419493f84f4Smrg      postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
2420493f84f4Smrg      postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
2421493f84f4Smrg      ;;
2422493f84f4Smrg    esac
2423fe5e51b7Smrg    shlibpath_var=LIBPATH
2424fe5e51b7Smrg  fi
2425fe5e51b7Smrg  ;;
2426fe5e51b7Smrg
2427fe5e51b7Smrgamigaos*)
2428a31a186aSmrg  case $host_cpu in
2429a31a186aSmrg  powerpc)
2430a31a186aSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2431a31a186aSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2432493f84f4Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2433a31a186aSmrg    ;;
2434a31a186aSmrg  m68k)
2435a31a186aSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2436a31a186aSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2437493f84f4Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $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'
2438a31a186aSmrg    ;;
2439a31a186aSmrg  esac
2440fe5e51b7Smrg  ;;
2441fe5e51b7Smrg
2442fe5e51b7Smrgbeos*)
2443493f84f4Smrg  library_names_spec='$libname$shared_ext'
2444fe5e51b7Smrg  dynamic_linker="$host_os ld.so"
2445fe5e51b7Smrg  shlibpath_var=LIBRARY_PATH
2446fe5e51b7Smrg  ;;
2447fe5e51b7Smrg
2448fe5e51b7Smrgbsdi[[45]]*)
24490bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2450fe5e51b7Smrg  need_version=no
2451493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2452493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2453fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2454fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2455fe5e51b7Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2456fe5e51b7Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2457fe5e51b7Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2458fe5e51b7Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2459fe5e51b7Smrg  # libtool to hard-code these into programs
2460fe5e51b7Smrg  ;;
2461fe5e51b7Smrg
2462a31a186aSmrgcygwin* | mingw* | pw32* | cegcc*)
2463fe5e51b7Smrg  version_type=windows
2464493f84f4Smrg  shrext_cmds=.dll
2465fe5e51b7Smrg  need_version=no
2466fe5e51b7Smrg  need_lib_prefix=no
2467fe5e51b7Smrg
24680bb88ba4Smrg  case $GCC,$cc_basename in
24690bb88ba4Smrg  yes,*)
24700bb88ba4Smrg    # gcc
2471fe5e51b7Smrg    library_names_spec='$libname.dll.a'
2472fe5e51b7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2473493f84f4Smrg    postinstall_cmds='base_file=`basename \$file`~
2474493f84f4Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2475fe5e51b7Smrg      dldir=$destdir/`dirname \$dlpath`~
2476fe5e51b7Smrg      test -d \$dldir || mkdir -p \$dldir~
2477fe5e51b7Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2478a31a186aSmrg      chmod a+x \$dldir/$dlname~
2479a31a186aSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2480a31a186aSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2481a31a186aSmrg      fi'
2482fe5e51b7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2483fe5e51b7Smrg      dlpath=$dir/\$dldll~
2484a31a186aSmrg       $RM \$dlpath'
2485fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2486fe5e51b7Smrg
2487fe5e51b7Smrg    case $host_os in
2488fe5e51b7Smrg    cygwin*)
2489fe5e51b7Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2490493f84f4Smrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
24910bb88ba4Smrgm4_if([$1], [],[
24920bb88ba4Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2493fe5e51b7Smrg      ;;
2494a31a186aSmrg    mingw* | cegcc*)
2495fe5e51b7Smrg      # MinGW DLLs use traditional 'lib' prefix
2496493f84f4Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2497fe5e51b7Smrg      ;;
2498fe5e51b7Smrg    pw32*)
2499fe5e51b7Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2500493f84f4Smrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2501fe5e51b7Smrg      ;;
2502fe5e51b7Smrg    esac
25030bb88ba4Smrg    dynamic_linker='Win32 ld.exe'
25040bb88ba4Smrg    ;;
25050bb88ba4Smrg
25060bb88ba4Smrg  *,cl*)
25070bb88ba4Smrg    # Native MSVC
25080bb88ba4Smrg    libname_spec='$name'
2509493f84f4Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2510493f84f4Smrg    library_names_spec='$libname.dll.lib'
25110bb88ba4Smrg
25120bb88ba4Smrg    case $build_os in
25130bb88ba4Smrg    mingw*)
25140bb88ba4Smrg      sys_lib_search_path_spec=
25150bb88ba4Smrg      lt_save_ifs=$IFS
25160bb88ba4Smrg      IFS=';'
25170bb88ba4Smrg      for lt_path in $LIB
25180bb88ba4Smrg      do
25190bb88ba4Smrg        IFS=$lt_save_ifs
25200bb88ba4Smrg        # Let DOS variable expansion print the short 8.3 style file name.
25210bb88ba4Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
25220bb88ba4Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
25230bb88ba4Smrg      done
25240bb88ba4Smrg      IFS=$lt_save_ifs
25250bb88ba4Smrg      # Convert to MSYS style.
25260bb88ba4Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
25270bb88ba4Smrg      ;;
25280bb88ba4Smrg    cygwin*)
25290bb88ba4Smrg      # Convert to unix form, then to dos form, then back to unix form
25300bb88ba4Smrg      # but this time dos style (no spaces!) so that the unix form looks
25310bb88ba4Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
25320bb88ba4Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
25330bb88ba4Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
25340bb88ba4Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
25350bb88ba4Smrg      ;;
25360bb88ba4Smrg    *)
2537493f84f4Smrg      sys_lib_search_path_spec=$LIB
25380bb88ba4Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
25390bb88ba4Smrg        # It is most probably a Windows format PATH.
25400bb88ba4Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
25410bb88ba4Smrg      else
25420bb88ba4Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
25430bb88ba4Smrg      fi
25440bb88ba4Smrg      # FIXME: find the short name or the path components, as spaces are
25450bb88ba4Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
25460bb88ba4Smrg      ;;
25470bb88ba4Smrg    esac
25480bb88ba4Smrg
25490bb88ba4Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2550493f84f4Smrg    postinstall_cmds='base_file=`basename \$file`~
2551493f84f4Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
25520bb88ba4Smrg      dldir=$destdir/`dirname \$dlpath`~
25530bb88ba4Smrg      test -d \$dldir || mkdir -p \$dldir~
25540bb88ba4Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
25550bb88ba4Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
25560bb88ba4Smrg      dlpath=$dir/\$dldll~
25570bb88ba4Smrg       $RM \$dlpath'
25580bb88ba4Smrg    shlibpath_overrides_runpath=yes
25590bb88ba4Smrg    dynamic_linker='Win32 link.exe'
2560fe5e51b7Smrg    ;;
2561fe5e51b7Smrg
2562fe5e51b7Smrg  *)
25630bb88ba4Smrg    # Assume MSVC wrapper
2564493f84f4Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
25650bb88ba4Smrg    dynamic_linker='Win32 ld.exe'
2566fe5e51b7Smrg    ;;
2567fe5e51b7Smrg  esac
2568fe5e51b7Smrg  # FIXME: first we should search . and the directory the executable is in
2569fe5e51b7Smrg  shlibpath_var=PATH
2570fe5e51b7Smrg  ;;
2571fe5e51b7Smrg
2572fe5e51b7Smrgdarwin* | rhapsody*)
2573fe5e51b7Smrg  dynamic_linker="$host_os dyld"
2574fe5e51b7Smrg  version_type=darwin
2575fe5e51b7Smrg  need_lib_prefix=no
2576fe5e51b7Smrg  need_version=no
2577493f84f4Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2578493f84f4Smrg  soname_spec='$libname$release$major$shared_ext'
2579fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2580fe5e51b7Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2581fe5e51b7Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2582a31a186aSmrgm4_if([$1], [],[
2583a31a186aSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2584fe5e51b7Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2585fe5e51b7Smrg  ;;
2586fe5e51b7Smrg
2587fe5e51b7Smrgdgux*)
25880bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2589fe5e51b7Smrg  need_lib_prefix=no
2590fe5e51b7Smrg  need_version=no
2591493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2592493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2593fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2594fe5e51b7Smrg  ;;
2595fe5e51b7Smrg
2596fe5e51b7Smrgfreebsd* | dragonfly*)
2597fe5e51b7Smrg  # DragonFly does not have aout.  When/if they implement a new
2598fe5e51b7Smrg  # versioning mechanism, adjust this.
2599fe5e51b7Smrg  if test -x /usr/bin/objformat; then
2600fe5e51b7Smrg    objformat=`/usr/bin/objformat`
2601fe5e51b7Smrg  else
2602fe5e51b7Smrg    case $host_os in
26030bb88ba4Smrg    freebsd[[23]].*) objformat=aout ;;
2604fe5e51b7Smrg    *) objformat=elf ;;
2605fe5e51b7Smrg    esac
2606fe5e51b7Smrg  fi
2607493f84f4Smrg  # Handle Gentoo/FreeBSD as it was Linux
2608493f84f4Smrg  case $host_vendor in
2609493f84f4Smrg    gentoo)
2610493f84f4Smrg      version_type=linux ;;
2611493f84f4Smrg    *)
2612493f84f4Smrg      version_type=freebsd-$objformat ;;
2613493f84f4Smrg  esac
2614493f84f4Smrg
2615fe5e51b7Smrg  case $version_type in
2616fe5e51b7Smrg    freebsd-elf*)
2617493f84f4Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2618fe5e51b7Smrg      need_version=no
2619fe5e51b7Smrg      need_lib_prefix=no
2620fe5e51b7Smrg      ;;
2621fe5e51b7Smrg    freebsd-*)
2622493f84f4Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2623fe5e51b7Smrg      need_version=yes
2624fe5e51b7Smrg      ;;
2625493f84f4Smrg    linux)
2626493f84f4Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2627493f84f4Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2628493f84f4Smrg      need_lib_prefix=no
2629493f84f4Smrg      need_version=no
2630493f84f4Smrg      ;;
2631fe5e51b7Smrg  esac
2632fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2633fe5e51b7Smrg  case $host_os in
26340bb88ba4Smrg  freebsd2.*)
2635fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2636fe5e51b7Smrg    ;;
2637fe5e51b7Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2638fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2639fe5e51b7Smrg    hardcode_into_libs=yes
2640fe5e51b7Smrg    ;;
2641fe5e51b7Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2642fe5e51b7Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2643fe5e51b7Smrg    shlibpath_overrides_runpath=no
2644fe5e51b7Smrg    hardcode_into_libs=yes
2645fe5e51b7Smrg    ;;
2646fe5e51b7Smrg  *) # from 4.6 on, and DragonFly
2647fe5e51b7Smrg    shlibpath_overrides_runpath=yes
2648fe5e51b7Smrg    hardcode_into_libs=yes
2649fe5e51b7Smrg    ;;
2650fe5e51b7Smrg  esac
2651fe5e51b7Smrg  ;;
2652fe5e51b7Smrg
26530bb88ba4Smrghaiku*)
26540bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
26550bb88ba4Smrg  need_lib_prefix=no
26560bb88ba4Smrg  need_version=no
26570bb88ba4Smrg  dynamic_linker="$host_os runtime_loader"
2658493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2659493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
26600bb88ba4Smrg  shlibpath_var=LIBRARY_PATH
2661493f84f4Smrg  shlibpath_overrides_runpath=no
26620bb88ba4Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2663fe5e51b7Smrg  hardcode_into_libs=yes
2664fe5e51b7Smrg  ;;
2665fe5e51b7Smrg
2666fe5e51b7Smrghpux9* | hpux10* | hpux11*)
2667fe5e51b7Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2668fe5e51b7Smrg  # link against other versions.
2669fe5e51b7Smrg  version_type=sunos
2670fe5e51b7Smrg  need_lib_prefix=no
2671fe5e51b7Smrg  need_version=no
2672fe5e51b7Smrg  case $host_cpu in
2673fe5e51b7Smrg  ia64*)
2674fe5e51b7Smrg    shrext_cmds='.so'
2675fe5e51b7Smrg    hardcode_into_libs=yes
2676fe5e51b7Smrg    dynamic_linker="$host_os dld.so"
2677fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2678fe5e51b7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2679493f84f4Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2680493f84f4Smrg    soname_spec='$libname$release$shared_ext$major'
2681493f84f4Smrg    if test 32 = "$HPUX_IA64_MODE"; then
2682fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2683fe5e51b7Smrg    else
2684fe5e51b7Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2685fe5e51b7Smrg    fi
2686fe5e51b7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2687fe5e51b7Smrg    ;;
2688a31a186aSmrg  hppa*64*)
2689a31a186aSmrg    shrext_cmds='.sl'
2690a31a186aSmrg    hardcode_into_libs=yes
2691a31a186aSmrg    dynamic_linker="$host_os dld.sl"
2692a31a186aSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2693a31a186aSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2694493f84f4Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2695493f84f4Smrg    soname_spec='$libname$release$shared_ext$major'
2696a31a186aSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2697a31a186aSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2698a31a186aSmrg    ;;
2699a31a186aSmrg  *)
2700fe5e51b7Smrg    shrext_cmds='.sl'
2701fe5e51b7Smrg    dynamic_linker="$host_os dld.sl"
2702fe5e51b7Smrg    shlibpath_var=SHLIB_PATH
2703fe5e51b7Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2704493f84f4Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2705493f84f4Smrg    soname_spec='$libname$release$shared_ext$major'
2706fe5e51b7Smrg    ;;
2707fe5e51b7Smrg  esac
27080bb88ba4Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2709fe5e51b7Smrg  postinstall_cmds='chmod 555 $lib'
27100bb88ba4Smrg  # or fails outright, so override atomically:
27110bb88ba4Smrg  install_override_mode=555
2712fe5e51b7Smrg  ;;
2713fe5e51b7Smrg
2714fe5e51b7Smrginterix[[3-9]]*)
27150bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2716fe5e51b7Smrg  need_lib_prefix=no
2717fe5e51b7Smrg  need_version=no
2718493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2719493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2720fe5e51b7Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2721fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2722fe5e51b7Smrg  shlibpath_overrides_runpath=no
2723fe5e51b7Smrg  hardcode_into_libs=yes
2724fe5e51b7Smrg  ;;
2725fe5e51b7Smrg
2726fe5e51b7Smrgirix5* | irix6* | nonstopux*)
2727fe5e51b7Smrg  case $host_os in
2728fe5e51b7Smrg    nonstopux*) version_type=nonstopux ;;
2729fe5e51b7Smrg    *)
2730493f84f4Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
27310bb88ba4Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2732fe5e51b7Smrg	else
2733fe5e51b7Smrg		version_type=irix
2734fe5e51b7Smrg	fi ;;
2735fe5e51b7Smrg  esac
2736fe5e51b7Smrg  need_lib_prefix=no
2737fe5e51b7Smrg  need_version=no
2738493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2739493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2740fe5e51b7Smrg  case $host_os in
2741fe5e51b7Smrg  irix5* | nonstopux*)
2742fe5e51b7Smrg    libsuff= shlibsuff=
2743fe5e51b7Smrg    ;;
2744fe5e51b7Smrg  *)
2745fe5e51b7Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2746fe5e51b7Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2747fe5e51b7Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2748fe5e51b7Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2749fe5e51b7Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2750fe5e51b7Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2751fe5e51b7Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2752fe5e51b7Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2753fe5e51b7Smrg    esac
2754fe5e51b7Smrg    ;;
2755fe5e51b7Smrg  esac
2756fe5e51b7Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2757fe5e51b7Smrg  shlibpath_overrides_runpath=no
2758493f84f4Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2759493f84f4Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2760fe5e51b7Smrg  hardcode_into_libs=yes
2761fe5e51b7Smrg  ;;
2762fe5e51b7Smrg
2763fe5e51b7Smrg# No shared lib support for Linux oldld, aout, or coff.
2764fe5e51b7Smrglinux*oldld* | linux*aout* | linux*coff*)
2765fe5e51b7Smrg  dynamic_linker=no
2766fe5e51b7Smrg  ;;
2767fe5e51b7Smrg
2768493f84f4Smrglinux*android*)
2769493f84f4Smrg  version_type=none # Android doesn't support versioned libraries.
2770493f84f4Smrg  need_lib_prefix=no
2771493f84f4Smrg  need_version=no
2772493f84f4Smrg  library_names_spec='$libname$release$shared_ext'
2773493f84f4Smrg  soname_spec='$libname$release$shared_ext'
2774493f84f4Smrg  finish_cmds=
2775493f84f4Smrg  shlibpath_var=LD_LIBRARY_PATH
2776493f84f4Smrg  shlibpath_overrides_runpath=yes
2777493f84f4Smrg
2778493f84f4Smrg  # This implies no fast_install, which is unacceptable.
2779493f84f4Smrg  # Some rework will be needed to allow for fast_install
2780493f84f4Smrg  # before this can be enabled.
2781493f84f4Smrg  hardcode_into_libs=yes
2782493f84f4Smrg
2783493f84f4Smrg  dynamic_linker='Android linker'
2784493f84f4Smrg  # Don't embed -rpath directories since the linker doesn't support them.
2785493f84f4Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2786493f84f4Smrg  ;;
2787493f84f4Smrg
27880bb88ba4Smrg# This must be glibc/ELF.
2789493f84f4Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
27900bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2791fe5e51b7Smrg  need_lib_prefix=no
2792fe5e51b7Smrg  need_version=no
2793493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2794493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2795fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2796fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2797fe5e51b7Smrg  shlibpath_overrides_runpath=no
27980bb88ba4Smrg
2799a31a186aSmrg  # Some binutils ld are patched to set DT_RUNPATH
28000bb88ba4Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
28010bb88ba4Smrg    [lt_cv_shlibpath_overrides_runpath=no
28020bb88ba4Smrg    save_LDFLAGS=$LDFLAGS
28030bb88ba4Smrg    save_libdir=$libdir
28040bb88ba4Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
28050bb88ba4Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
28060bb88ba4Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
28070bb88ba4Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
28080bb88ba4Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
28090bb88ba4Smrg    LDFLAGS=$save_LDFLAGS
28100bb88ba4Smrg    libdir=$save_libdir
28110bb88ba4Smrg    ])
28120bb88ba4Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2813a31a186aSmrg
2814fe5e51b7Smrg  # This implies no fast_install, which is unacceptable.
2815fe5e51b7Smrg  # Some rework will be needed to allow for fast_install
2816fe5e51b7Smrg  # before this can be enabled.
2817fe5e51b7Smrg  hardcode_into_libs=yes
2818a31a186aSmrg
2819fe5e51b7Smrg  # Append ld.so.conf contents to the search path
2820fe5e51b7Smrg  if test -f /etc/ld.so.conf; then
28210bb88ba4Smrg    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' ' '`
2822493f84f4Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2823fe5e51b7Smrg  fi
2824fe5e51b7Smrg
2825fe5e51b7Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2826fe5e51b7Smrg  # powerpc, because MkLinux only supported shared libraries with the
2827fe5e51b7Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2828fe5e51b7Smrg  # most powerpc-linux boxes support dynamic linking these days and
2829fe5e51b7Smrg  # people can always --disable-shared, the test was removed, and we
2830fe5e51b7Smrg  # assume the GNU/Linux dynamic linker is in use.
2831fe5e51b7Smrg  dynamic_linker='GNU/Linux ld.so'
2832fe5e51b7Smrg  ;;
2833fe5e51b7Smrg
2834fe5e51b7Smrgnetbsd*)
2835fe5e51b7Smrg  version_type=sunos
2836fe5e51b7Smrg  need_lib_prefix=no
2837fe5e51b7Smrg  need_version=no
2838a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2839493f84f4Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2840fe5e51b7Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2841fe5e51b7Smrg    dynamic_linker='NetBSD (a.out) ld.so'
2842fe5e51b7Smrg  else
2843493f84f4Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2844493f84f4Smrg    soname_spec='$libname$release$shared_ext$major'
2845fe5e51b7Smrg    dynamic_linker='NetBSD ld.elf_so'
2846fe5e51b7Smrg  fi
2847fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2848fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2849fe5e51b7Smrg  hardcode_into_libs=yes
2850fe5e51b7Smrg  ;;
2851fe5e51b7Smrg
2852fe5e51b7Smrgnewsos6)
28530bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2854493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2855fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2856fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2857fe5e51b7Smrg  ;;
2858fe5e51b7Smrg
2859a31a186aSmrg*nto* | *qnx*)
2860a31a186aSmrg  version_type=qnx
2861fe5e51b7Smrg  need_lib_prefix=no
2862fe5e51b7Smrg  need_version=no
2863493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2864493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2865fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2866a31a186aSmrg  shlibpath_overrides_runpath=no
2867a31a186aSmrg  hardcode_into_libs=yes
2868a31a186aSmrg  dynamic_linker='ldqnx.so'
2869fe5e51b7Smrg  ;;
2870fe5e51b7Smrg
2871493f84f4Smrgopenbsd* | bitrig*)
2872fe5e51b7Smrg  version_type=sunos
2873493f84f4Smrg  sys_lib_dlsearch_path_spec=/usr/lib
2874fe5e51b7Smrg  need_lib_prefix=no
2875493f84f4Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2876493f84f4Smrg    need_version=no
2877fe5e51b7Smrg  else
2878493f84f4Smrg    need_version=yes
2879fe5e51b7Smrg  fi
2880493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2881493f84f4Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2882493f84f4Smrg  shlibpath_var=LD_LIBRARY_PATH
2883493f84f4Smrg  shlibpath_overrides_runpath=yes
2884fe5e51b7Smrg  ;;
2885fe5e51b7Smrg
2886fe5e51b7Smrgos2*)
2887fe5e51b7Smrg  libname_spec='$name'
2888493f84f4Smrg  version_type=windows
2889493f84f4Smrg  shrext_cmds=.dll
2890493f84f4Smrg  need_version=no
2891fe5e51b7Smrg  need_lib_prefix=no
2892493f84f4Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2893493f84f4Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2894493f84f4Smrg    v=$($ECHO $release$versuffix | tr -d .-);
2895493f84f4Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2896493f84f4Smrg    $ECHO $n$v`$shared_ext'
2897493f84f4Smrg  library_names_spec='${libname}_dll.$libext'
2898fe5e51b7Smrg  dynamic_linker='OS/2 ld.exe'
2899493f84f4Smrg  shlibpath_var=BEGINLIBPATH
2900493f84f4Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2901493f84f4Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2902493f84f4Smrg  postinstall_cmds='base_file=`basename \$file`~
2903493f84f4Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2904493f84f4Smrg    dldir=$destdir/`dirname \$dlpath`~
2905493f84f4Smrg    test -d \$dldir || mkdir -p \$dldir~
2906493f84f4Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
2907493f84f4Smrg    chmod a+x \$dldir/$dlname~
2908493f84f4Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2909493f84f4Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2910493f84f4Smrg    fi'
2911493f84f4Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2912493f84f4Smrg    dlpath=$dir/\$dldll~
2913493f84f4Smrg    $RM \$dlpath'
2914fe5e51b7Smrg  ;;
2915fe5e51b7Smrg
2916fe5e51b7Smrgosf3* | osf4* | osf5*)
2917fe5e51b7Smrg  version_type=osf
2918fe5e51b7Smrg  need_lib_prefix=no
2919fe5e51b7Smrg  need_version=no
2920493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2921493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2922fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2923fe5e51b7Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2924493f84f4Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2925fe5e51b7Smrg  ;;
2926fe5e51b7Smrg
2927fe5e51b7Smrgrdos*)
2928fe5e51b7Smrg  dynamic_linker=no
2929fe5e51b7Smrg  ;;
2930fe5e51b7Smrg
2931fe5e51b7Smrgsolaris*)
29320bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2933fe5e51b7Smrg  need_lib_prefix=no
2934fe5e51b7Smrg  need_version=no
2935493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2936493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2937fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2938fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2939fe5e51b7Smrg  hardcode_into_libs=yes
2940fe5e51b7Smrg  # ldd complains unless libraries are executable
2941fe5e51b7Smrg  postinstall_cmds='chmod +x $lib'
2942fe5e51b7Smrg  ;;
2943fe5e51b7Smrg
2944fe5e51b7Smrgsunos4*)
2945fe5e51b7Smrg  version_type=sunos
2946493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2947fe5e51b7Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
2948fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2949fe5e51b7Smrg  shlibpath_overrides_runpath=yes
2950493f84f4Smrg  if test yes = "$with_gnu_ld"; then
2951fe5e51b7Smrg    need_lib_prefix=no
2952fe5e51b7Smrg  fi
2953fe5e51b7Smrg  need_version=yes
2954fe5e51b7Smrg  ;;
2955fe5e51b7Smrg
2956fe5e51b7Smrgsysv4 | sysv4.3*)
29570bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2958493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2959493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2960fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2961fe5e51b7Smrg  case $host_vendor in
2962fe5e51b7Smrg    sni)
2963fe5e51b7Smrg      shlibpath_overrides_runpath=no
2964fe5e51b7Smrg      need_lib_prefix=no
2965fe5e51b7Smrg      runpath_var=LD_RUN_PATH
2966fe5e51b7Smrg      ;;
2967fe5e51b7Smrg    siemens)
2968fe5e51b7Smrg      need_lib_prefix=no
2969fe5e51b7Smrg      ;;
2970fe5e51b7Smrg    motorola)
2971fe5e51b7Smrg      need_lib_prefix=no
2972fe5e51b7Smrg      need_version=no
2973fe5e51b7Smrg      shlibpath_overrides_runpath=no
2974fe5e51b7Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
2975fe5e51b7Smrg      ;;
2976fe5e51b7Smrg  esac
2977fe5e51b7Smrg  ;;
2978fe5e51b7Smrg
2979fe5e51b7Smrgsysv4*MP*)
2980493f84f4Smrg  if test -d /usr/nec; then
29810bb88ba4Smrg    version_type=linux # correct to gnu/linux during the next big refactor
2982493f84f4Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
2983493f84f4Smrg    soname_spec='$libname$shared_ext.$major'
2984fe5e51b7Smrg    shlibpath_var=LD_LIBRARY_PATH
2985fe5e51b7Smrg  fi
2986fe5e51b7Smrg  ;;
2987fe5e51b7Smrg
2988fe5e51b7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
2989493f84f4Smrg  version_type=sco
2990fe5e51b7Smrg  need_lib_prefix=no
2991fe5e51b7Smrg  need_version=no
2992493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
2993493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
2994fe5e51b7Smrg  shlibpath_var=LD_LIBRARY_PATH
2995a31a186aSmrg  shlibpath_overrides_runpath=yes
2996fe5e51b7Smrg  hardcode_into_libs=yes
2997493f84f4Smrg  if test yes = "$with_gnu_ld"; then
2998fe5e51b7Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
2999fe5e51b7Smrg  else
3000fe5e51b7Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3001fe5e51b7Smrg    case $host_os in
3002fe5e51b7Smrg      sco3.2v5*)
3003fe5e51b7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3004fe5e51b7Smrg	;;
3005fe5e51b7Smrg    esac
3006fe5e51b7Smrg  fi
3007fe5e51b7Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
3008fe5e51b7Smrg  ;;
3009fe5e51b7Smrg
3010a31a186aSmrgtpf*)
3011a31a186aSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
30120bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3013a31a186aSmrg  need_lib_prefix=no
3014a31a186aSmrg  need_version=no
3015493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3016a31a186aSmrg  shlibpath_var=LD_LIBRARY_PATH
3017a31a186aSmrg  shlibpath_overrides_runpath=no
3018a31a186aSmrg  hardcode_into_libs=yes
3019a31a186aSmrg  ;;
3020a31a186aSmrg
3021eda3803bSmrguts4*)
30220bb88ba4Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3023493f84f4Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3024493f84f4Smrg  soname_spec='$libname$release$shared_ext$major'
3025eda3803bSmrg  shlibpath_var=LD_LIBRARY_PATH
3026eda3803bSmrg  ;;
3027fe5e51b7Smrg
3028fe5e51b7Smrg*)
3029fe5e51b7Smrg  dynamic_linker=no
3030fe5e51b7Smrg  ;;
3031fe5e51b7Smrgesac
3032fe5e51b7SmrgAC_MSG_RESULT([$dynamic_linker])
3033493f84f4Smrgtest no = "$dynamic_linker" && can_build_shared=no
3034fe5e51b7Smrg
3035fe5e51b7Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3036493f84f4Smrgif test yes = "$GCC"; then
3037fe5e51b7Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3038fe5e51b7Smrgfi
3039fe5e51b7Smrg
3040493f84f4Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3041493f84f4Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3042a31a186aSmrgfi
3043493f84f4Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3044493f84f4Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3045a31a186aSmrgfi
3046fe5e51b7Smrg
3047a31a186aSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3048a31a186aSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3049a31a186aSmrg    restored at link time])
3050a31a186aSmrg_LT_DECL([], [need_lib_prefix], [0],
3051a31a186aSmrg    [Do we need the "lib" prefix for modules?])
3052a31a186aSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3053a31a186aSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3054a31a186aSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3055a31a186aSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3056a31a186aSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3057a31a186aSmrg    [Is shlibpath searched before the hard-coded library search path?])
3058a31a186aSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3059a31a186aSmrg_LT_DECL([], [library_names_spec], [1],
3060a31a186aSmrg    [[List of archive names.  First name is the real one, the rest are links.
3061a31a186aSmrg    The last name is the one that the linker finds with -lNAME]])
3062a31a186aSmrg_LT_DECL([], [soname_spec], [1],
3063a31a186aSmrg    [[The coded name of the library, if different from the real name]])
30640bb88ba4Smrg_LT_DECL([], [install_override_mode], [1],
30650bb88ba4Smrg    [Permission mode override for installation of shared libraries])
3066a31a186aSmrg_LT_DECL([], [postinstall_cmds], [2],
3067a31a186aSmrg    [Command to use after installation of a shared archive])
3068a31a186aSmrg_LT_DECL([], [postuninstall_cmds], [2],
3069a31a186aSmrg    [Command to use after uninstallation of a shared archive])
3070a31a186aSmrg_LT_DECL([], [finish_cmds], [2],
3071a31a186aSmrg    [Commands used to finish a libtool library installation in a directory])
3072a31a186aSmrg_LT_DECL([], [finish_eval], [1],
3073a31a186aSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3074a31a186aSmrg    not shown]])
3075a31a186aSmrg_LT_DECL([], [hardcode_into_libs], [0],
3076a31a186aSmrg    [Whether we should hardcode library paths into libraries])
3077a31a186aSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3078a31a186aSmrg    [Compile-time system search path for libraries])
3079a31a186aSmrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
3080a31a186aSmrg    [Run-time system search path for libraries])
3081a31a186aSmrg])# _LT_SYS_DYNAMIC_LINKER
3082a31a186aSmrg
3083a31a186aSmrg
3084a31a186aSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3085643b027fSmrg# --------------------------
3086493f84f4Smrg# find a file program that can recognize shared library
3087a31a186aSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3088a31a186aSmrg[m4_require([_LT_DECL_EGREP])dnl
3089643b027fSmrgAC_MSG_CHECKING([for $1])
3090643b027fSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3091643b027fSmrg[case $MAGIC_CMD in
3092fe5e51b7Smrg[[\\/*] |  ?:[\\/]*])
3093493f84f4Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3094fe5e51b7Smrg  ;;
3095fe5e51b7Smrg*)
3096493f84f4Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3097493f84f4Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3098fe5e51b7Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3099fe5e51b7Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3100fe5e51b7Smrgdnl not every word.  This closes a longstanding sh security hole.
3101a31a186aSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3102fe5e51b7Smrg  for ac_dir in $ac_dummy; do
3103493f84f4Smrg    IFS=$lt_save_ifs
3104fe5e51b7Smrg    test -z "$ac_dir" && ac_dir=.
3105493f84f4Smrg    if test -f "$ac_dir/$1"; then
3106493f84f4Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3107fe5e51b7Smrg      if test -n "$file_magic_test_file"; then
3108fe5e51b7Smrg	case $deplibs_check_method in
3109fe5e51b7Smrg	"file_magic "*)
3110fe5e51b7Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3111493f84f4Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3112fe5e51b7Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3113fe5e51b7Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
3114fe5e51b7Smrg	    :
3115fe5e51b7Smrg	  else
3116a31a186aSmrg	    cat <<_LT_EOF 1>&2
3117fe5e51b7Smrg
3118fe5e51b7Smrg*** Warning: the command libtool uses to detect shared libraries,
3119fe5e51b7Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3120fe5e51b7Smrg*** The result is that libtool may fail to recognize shared libraries
3121fe5e51b7Smrg*** as such.  This will affect the creation of libtool libraries that
3122fe5e51b7Smrg*** depend on shared libraries, but programs linked with such libtool
3123fe5e51b7Smrg*** libraries will work regardless of this problem.  Nevertheless, you
3124fe5e51b7Smrg*** may want to report the problem to your system manager and/or to
3125fe5e51b7Smrg*** bug-libtool@gnu.org
3126fe5e51b7Smrg
3127a31a186aSmrg_LT_EOF
3128fe5e51b7Smrg	  fi ;;
3129fe5e51b7Smrg	esac
3130fe5e51b7Smrg      fi
3131fe5e51b7Smrg      break
3132fe5e51b7Smrg    fi
3133fe5e51b7Smrg  done
3134493f84f4Smrg  IFS=$lt_save_ifs
3135493f84f4Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
3136fe5e51b7Smrg  ;;
3137fe5e51b7Smrgesac])
3138493f84f4SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3139fe5e51b7Smrgif test -n "$MAGIC_CMD"; then
3140fe5e51b7Smrg  AC_MSG_RESULT($MAGIC_CMD)
3141fe5e51b7Smrgelse
3142fe5e51b7Smrg  AC_MSG_RESULT(no)
3143fe5e51b7Smrgfi
3144a31a186aSmrg_LT_DECL([], [MAGIC_CMD], [0],
3145a31a186aSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3146a31a186aSmrg])# _LT_PATH_TOOL_PREFIX
3147fe5e51b7Smrg
3148a31a186aSmrg# Old name:
3149a31a186aSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3150a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3151a31a186aSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3152eda3803bSmrg
3153a31a186aSmrg
3154a31a186aSmrg# _LT_PATH_MAGIC
3155a31a186aSmrg# --------------
3156493f84f4Smrg# find a file program that can recognize a shared library
3157a31a186aSmrgm4_defun([_LT_PATH_MAGIC],
3158a31a186aSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3159fe5e51b7Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3160fe5e51b7Smrg  if test -n "$ac_tool_prefix"; then
3161a31a186aSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3162fe5e51b7Smrg  else
3163fe5e51b7Smrg    MAGIC_CMD=:
3164fe5e51b7Smrg  fi
3165fe5e51b7Smrgfi
3166a31a186aSmrg])# _LT_PATH_MAGIC
3167fe5e51b7Smrg
3168fe5e51b7Smrg
3169a31a186aSmrg# LT_PATH_LD
3170fe5e51b7Smrg# ----------
3171fe5e51b7Smrg# find the pathname to the GNU or non-GNU linker
3172a31a186aSmrgAC_DEFUN([LT_PATH_LD],
3173a31a186aSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3174643b027fSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3175643b027fSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3176a31a186aSmrgm4_require([_LT_DECL_SED])dnl
3177a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
31780bb88ba4Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3179a31a186aSmrg
3180a31a186aSmrgAC_ARG_WITH([gnu-ld],
3181a31a186aSmrg    [AS_HELP_STRING([--with-gnu-ld],
3182a31a186aSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3183493f84f4Smrg    [test no = "$withval" || with_gnu_ld=yes],
3184a31a186aSmrg    [with_gnu_ld=no])dnl
3185a31a186aSmrg
3186fe5e51b7Smrgac_prog=ld
3187493f84f4Smrgif test yes = "$GCC"; then
3188fe5e51b7Smrg  # Check if gcc -print-prog-name=ld gives a path.
3189fe5e51b7Smrg  AC_MSG_CHECKING([for ld used by $CC])
3190fe5e51b7Smrg  case $host in
3191fe5e51b7Smrg  *-*-mingw*)
3192493f84f4Smrg    # gcc leaves a trailing carriage return, which upsets mingw
3193fe5e51b7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3194fe5e51b7Smrg  *)
3195fe5e51b7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3196fe5e51b7Smrg  esac
3197fe5e51b7Smrg  case $ac_prog in
3198fe5e51b7Smrg    # Accept absolute paths.
3199fe5e51b7Smrg    [[\\/]]* | ?:[[\\/]]*)
3200fe5e51b7Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3201fe5e51b7Smrg      # Canonicalize the pathname of ld
3202a31a186aSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3203a31a186aSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3204a31a186aSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3205fe5e51b7Smrg      done
3206493f84f4Smrg      test -z "$LD" && LD=$ac_prog
3207fe5e51b7Smrg      ;;
3208fe5e51b7Smrg  "")
3209fe5e51b7Smrg    # If it fails, then pretend we aren't using GCC.
3210fe5e51b7Smrg    ac_prog=ld
3211fe5e51b7Smrg    ;;
3212fe5e51b7Smrg  *)
3213fe5e51b7Smrg    # If it is relative, then search for the first ld in PATH.
3214fe5e51b7Smrg    with_gnu_ld=unknown
3215fe5e51b7Smrg    ;;
3216fe5e51b7Smrg  esac
3217493f84f4Smrgelif test yes = "$with_gnu_ld"; then
3218fe5e51b7Smrg  AC_MSG_CHECKING([for GNU ld])
3219fe5e51b7Smrgelse
3220fe5e51b7Smrg  AC_MSG_CHECKING([for non-GNU ld])
3221fe5e51b7Smrgfi
3222fe5e51b7SmrgAC_CACHE_VAL(lt_cv_path_LD,
3223fe5e51b7Smrg[if test -z "$LD"; then
3224493f84f4Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3225fe5e51b7Smrg  for ac_dir in $PATH; do
3226493f84f4Smrg    IFS=$lt_save_ifs
3227fe5e51b7Smrg    test -z "$ac_dir" && ac_dir=.
3228fe5e51b7Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3229493f84f4Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
3230fe5e51b7Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3231fe5e51b7Smrg      # but apparently some variants of GNU ld only accept -v.
3232fe5e51b7Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3233fe5e51b7Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3234fe5e51b7Smrg      *GNU* | *'with BFD'*)
3235493f84f4Smrg	test no != "$with_gnu_ld" && break
3236fe5e51b7Smrg	;;
3237fe5e51b7Smrg      *)
3238493f84f4Smrg	test yes != "$with_gnu_ld" && break
3239fe5e51b7Smrg	;;
3240fe5e51b7Smrg      esac
3241fe5e51b7Smrg    fi
3242fe5e51b7Smrg  done
3243493f84f4Smrg  IFS=$lt_save_ifs
3244fe5e51b7Smrgelse
3245493f84f4Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3246fe5e51b7Smrgfi])
3247493f84f4SmrgLD=$lt_cv_path_LD
3248fe5e51b7Smrgif test -n "$LD"; then
3249fe5e51b7Smrg  AC_MSG_RESULT($LD)
3250fe5e51b7Smrgelse
3251fe5e51b7Smrg  AC_MSG_RESULT(no)
3252fe5e51b7Smrgfi
3253fe5e51b7Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3254a31a186aSmrg_LT_PATH_LD_GNU
3255a31a186aSmrgAC_SUBST([LD])
3256fe5e51b7Smrg
3257a31a186aSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3258a31a186aSmrg])# LT_PATH_LD
3259fe5e51b7Smrg
3260a31a186aSmrg# Old names:
3261a31a186aSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3262a31a186aSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3263a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3264a31a186aSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3265a31a186aSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3266a31a186aSmrg
3267a31a186aSmrg
3268a31a186aSmrg# _LT_PATH_LD_GNU
3269a31a186aSmrg#- --------------
3270a31a186aSmrgm4_defun([_LT_PATH_LD_GNU],
3271a31a186aSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3272fe5e51b7Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3273fe5e51b7Smrgcase `$LD -v 2>&1 </dev/null` in
3274fe5e51b7Smrg*GNU* | *'with BFD'*)
3275fe5e51b7Smrg  lt_cv_prog_gnu_ld=yes
3276fe5e51b7Smrg  ;;
3277fe5e51b7Smrg*)
3278fe5e51b7Smrg  lt_cv_prog_gnu_ld=no
3279fe5e51b7Smrg  ;;
3280fe5e51b7Smrgesac])
3281fe5e51b7Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3282a31a186aSmrg])# _LT_PATH_LD_GNU
3283fe5e51b7Smrg
3284fe5e51b7Smrg
3285a31a186aSmrg# _LT_CMD_RELOAD
3286a31a186aSmrg# --------------
3287fe5e51b7Smrg# find reload flag for linker
3288fe5e51b7Smrg#   -- PORTME Some linkers may need a different reload flag.
3289a31a186aSmrgm4_defun([_LT_CMD_RELOAD],
3290fe5e51b7Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
3291fe5e51b7Smrg  lt_cv_ld_reload_flag,
3292fe5e51b7Smrg  [lt_cv_ld_reload_flag='-r'])
3293fe5e51b7Smrgreload_flag=$lt_cv_ld_reload_flag
3294fe5e51b7Smrgcase $reload_flag in
3295fe5e51b7Smrg"" | " "*) ;;
3296fe5e51b7Smrg*) reload_flag=" $reload_flag" ;;
3297fe5e51b7Smrgesac
3298fe5e51b7Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3299fe5e51b7Smrgcase $host_os in
33000bb88ba4Smrg  cygwin* | mingw* | pw32* | cegcc*)
3301493f84f4Smrg    if test yes != "$GCC"; then
33020bb88ba4Smrg      reload_cmds=false
33030bb88ba4Smrg    fi
33040bb88ba4Smrg    ;;
3305fe5e51b7Smrg  darwin*)
3306493f84f4Smrg    if test yes = "$GCC"; then
3307493f84f4Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3308fe5e51b7Smrg    else
3309fe5e51b7Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3310fe5e51b7Smrg    fi
3311fe5e51b7Smrg    ;;
3312fe5e51b7Smrgesac
33130bb88ba4Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
33140bb88ba4Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3315a31a186aSmrg])# _LT_CMD_RELOAD
3316fe5e51b7Smrg
3317fe5e51b7Smrg
3318493f84f4Smrg# _LT_PATH_DD
3319493f84f4Smrg# -----------
3320493f84f4Smrg# find a working dd
3321493f84f4Smrgm4_defun([_LT_PATH_DD],
3322493f84f4Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3323493f84f4Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3324493f84f4Smrgcat conftest.i conftest.i >conftest2.i
3325493f84f4Smrg: ${lt_DD:=$DD}
3326493f84f4SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3327493f84f4Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3328493f84f4Smrg  cmp -s conftest.i conftest.out \
3329493f84f4Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3330493f84f4Smrgfi])
3331493f84f4Smrgrm -f conftest.i conftest2.i conftest.out])
3332493f84f4Smrg])# _LT_PATH_DD
3333493f84f4Smrg
3334493f84f4Smrg
3335493f84f4Smrg# _LT_CMD_TRUNCATE
3336493f84f4Smrg# ----------------
3337493f84f4Smrg# find command to truncate a binary pipe
3338493f84f4Smrgm4_defun([_LT_CMD_TRUNCATE],
3339493f84f4Smrg[m4_require([_LT_PATH_DD])
3340493f84f4SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3341493f84f4Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3342493f84f4Smrgcat conftest.i conftest.i >conftest2.i
3343493f84f4Smrglt_cv_truncate_bin=
3344493f84f4Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3345493f84f4Smrg  cmp -s conftest.i conftest.out \
3346493f84f4Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3347493f84f4Smrgfi
3348493f84f4Smrgrm -f conftest.i conftest2.i conftest.out
3349493f84f4Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3350493f84f4Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3351493f84f4Smrg  [Command to truncate a binary pipe])
3352493f84f4Smrg])# _LT_CMD_TRUNCATE
3353493f84f4Smrg
3354493f84f4Smrg
3355a31a186aSmrg# _LT_CHECK_MAGIC_METHOD
3356a31a186aSmrg# ----------------------
3357fe5e51b7Smrg# how to check for library dependencies
3358fe5e51b7Smrg#  -- PORTME fill in with the dynamic library characteristics
3359a31a186aSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3360a31a186aSmrg[m4_require([_LT_DECL_EGREP])
3361a31a186aSmrgm4_require([_LT_DECL_OBJDUMP])
3362a31a186aSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3363fe5e51b7Smrglt_cv_deplibs_check_method,
3364fe5e51b7Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3365fe5e51b7Smrglt_cv_file_magic_test_file=
3366fe5e51b7Smrglt_cv_deplibs_check_method='unknown'
3367fe5e51b7Smrg# Need to set the preceding variable on all platforms that support
3368fe5e51b7Smrg# interlibrary dependencies.
3369fe5e51b7Smrg# 'none' -- dependencies not supported.
3370493f84f4Smrg# 'unknown' -- same as none, but documents that we really don't know.
3371fe5e51b7Smrg# 'pass_all' -- all dependencies passed with no checks.
3372fe5e51b7Smrg# 'test_compile' -- check by making test program.
3373fe5e51b7Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3374493f84f4Smrg# that responds to the $file_magic_cmd with a given extended regex.
3375493f84f4Smrg# If you have 'file' or equivalent on your system and you're not sure
3376493f84f4Smrg# whether 'pass_all' will *always* work, you probably want this one.
3377fe5e51b7Smrg
3378fe5e51b7Smrgcase $host_os in
3379eda3803bSmrgaix[[4-9]]*)
3380fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3381fe5e51b7Smrg  ;;
3382fe5e51b7Smrg
3383fe5e51b7Smrgbeos*)
3384fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3385fe5e51b7Smrg  ;;
3386fe5e51b7Smrg
3387fe5e51b7Smrgbsdi[[45]]*)
3388fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3389fe5e51b7Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3390fe5e51b7Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3391fe5e51b7Smrg  ;;
3392fe5e51b7Smrg
3393fe5e51b7Smrgcygwin*)
3394fe5e51b7Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3395fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3396fe5e51b7Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3397fe5e51b7Smrg  ;;
3398fe5e51b7Smrg
3399fe5e51b7Smrgmingw* | pw32*)
3400fe5e51b7Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3401fe5e51b7Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3402fe5e51b7Smrg  # unless we find 'file', for example because we are cross-compiling.
3403493f84f4Smrg  if ( file / ) >/dev/null 2>&1; then
3404fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3405fe5e51b7Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3406fe5e51b7Smrg  else
34070bb88ba4Smrg    # Keep this pattern in sync with the one in func_win32_libid.
34080bb88ba4Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3409fe5e51b7Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3410fe5e51b7Smrg  fi
3411fe5e51b7Smrg  ;;
3412fe5e51b7Smrg
34130bb88ba4Smrgcegcc*)
3414a31a186aSmrg  # use the weaker test based on 'objdump'. See mingw*.
3415a31a186aSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3416a31a186aSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3417a31a186aSmrg  ;;
3418a31a186aSmrg
3419fe5e51b7Smrgdarwin* | rhapsody*)
3420fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3421fe5e51b7Smrg  ;;
3422fe5e51b7Smrg
3423fe5e51b7Smrgfreebsd* | dragonfly*)
3424a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3425fe5e51b7Smrg    case $host_cpu in
3426fe5e51b7Smrg    i*86 )
3427fe5e51b7Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3428fe5e51b7Smrg      # Let's accept both of them until this is cleared up.
3429fe5e51b7Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3430fe5e51b7Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3431fe5e51b7Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3432fe5e51b7Smrg      ;;
3433fe5e51b7Smrg    esac
3434fe5e51b7Smrg  else
3435fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3436fe5e51b7Smrg  fi
3437fe5e51b7Smrg  ;;
3438fe5e51b7Smrg
34390bb88ba4Smrghaiku*)
34400bb88ba4Smrg  lt_cv_deplibs_check_method=pass_all
34410bb88ba4Smrg  ;;
34420bb88ba4Smrg
3443fe5e51b7Smrghpux10.20* | hpux11*)
3444fe5e51b7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3445fe5e51b7Smrg  case $host_cpu in
3446fe5e51b7Smrg  ia64*)
3447fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3448fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3449fe5e51b7Smrg    ;;
3450fe5e51b7Smrg  hppa*64*)
34510bb88ba4Smrg    [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]']
3452fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3453fe5e51b7Smrg    ;;
3454fe5e51b7Smrg  *)
34550bb88ba4Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3456fe5e51b7Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3457fe5e51b7Smrg    ;;
3458fe5e51b7Smrg  esac
3459fe5e51b7Smrg  ;;
3460fe5e51b7Smrg
3461fe5e51b7Smrginterix[[3-9]]*)
3462fe5e51b7Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3463fe5e51b7Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3464fe5e51b7Smrg  ;;
3465fe5e51b7Smrg
3466fe5e51b7Smrgirix5* | irix6* | nonstopux*)
3467fe5e51b7Smrg  case $LD in
3468fe5e51b7Smrg  *-32|*"-32 ") libmagic=32-bit;;
3469fe5e51b7Smrg  *-n32|*"-n32 ") libmagic=N32;;
3470fe5e51b7Smrg  *-64|*"-64 ") libmagic=64-bit;;
3471fe5e51b7Smrg  *) libmagic=never-match;;
3472fe5e51b7Smrg  esac
3473fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3474fe5e51b7Smrg  ;;
3475fe5e51b7Smrg
34760bb88ba4Smrg# This must be glibc/ELF.
3477493f84f4Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3478fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3479fe5e51b7Smrg  ;;
3480fe5e51b7Smrg
3481fe5e51b7Smrgnetbsd*)
3482a31a186aSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3483fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3484fe5e51b7Smrg  else
3485fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3486fe5e51b7Smrg  fi
3487fe5e51b7Smrg  ;;
3488fe5e51b7Smrg
3489fe5e51b7Smrgnewos6*)
3490fe5e51b7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3491fe5e51b7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3492fe5e51b7Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3493fe5e51b7Smrg  ;;
3494fe5e51b7Smrg
3495a31a186aSmrg*nto* | *qnx*)
3496a31a186aSmrg  lt_cv_deplibs_check_method=pass_all
3497fe5e51b7Smrg  ;;
3498fe5e51b7Smrg
3499493f84f4Smrgopenbsd* | bitrig*)
3500493f84f4Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3501fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3502fe5e51b7Smrg  else
3503fe5e51b7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3504fe5e51b7Smrg  fi
3505fe5e51b7Smrg  ;;
3506fe5e51b7Smrg
3507fe5e51b7Smrgosf3* | osf4* | osf5*)
3508fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3509fe5e51b7Smrg  ;;
3510fe5e51b7Smrg
3511fe5e51b7Smrgrdos*)
3512fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3513fe5e51b7Smrg  ;;
3514fe5e51b7Smrg
3515fe5e51b7Smrgsolaris*)
3516fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3517fe5e51b7Smrg  ;;
3518fe5e51b7Smrg
3519a31a186aSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3520a31a186aSmrg  lt_cv_deplibs_check_method=pass_all
3521a31a186aSmrg  ;;
3522a31a186aSmrg
3523fe5e51b7Smrgsysv4 | sysv4.3*)
3524fe5e51b7Smrg  case $host_vendor in
3525fe5e51b7Smrg  motorola)
3526fe5e51b7Smrg    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]]'
3527fe5e51b7Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3528fe5e51b7Smrg    ;;
3529fe5e51b7Smrg  ncr)
3530fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3531fe5e51b7Smrg    ;;
3532fe5e51b7Smrg  sequent)
3533fe5e51b7Smrg    lt_cv_file_magic_cmd='/bin/file'
3534fe5e51b7Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3535fe5e51b7Smrg    ;;
3536fe5e51b7Smrg  sni)
3537fe5e51b7Smrg    lt_cv_file_magic_cmd='/bin/file'
3538fe5e51b7Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3539fe5e51b7Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3540fe5e51b7Smrg    ;;
3541fe5e51b7Smrg  siemens)
3542fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3543fe5e51b7Smrg    ;;
3544fe5e51b7Smrg  pc)
3545fe5e51b7Smrg    lt_cv_deplibs_check_method=pass_all
3546fe5e51b7Smrg    ;;
3547fe5e51b7Smrg  esac
3548fe5e51b7Smrg  ;;
3549fe5e51b7Smrg
3550a31a186aSmrgtpf*)
3551fe5e51b7Smrg  lt_cv_deplibs_check_method=pass_all
3552fe5e51b7Smrg  ;;
3553493f84f4Smrgos2*)
3554493f84f4Smrg  lt_cv_deplibs_check_method=pass_all
3555493f84f4Smrg  ;;
3556fe5e51b7Smrgesac
3557fe5e51b7Smrg])
35580bb88ba4Smrg
35590bb88ba4Smrgfile_magic_glob=
35600bb88ba4Smrgwant_nocaseglob=no
35610bb88ba4Smrgif test "$build" = "$host"; then
35620bb88ba4Smrg  case $host_os in
35630bb88ba4Smrg  mingw* | pw32*)
35640bb88ba4Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
35650bb88ba4Smrg      want_nocaseglob=yes
35660bb88ba4Smrg    else
35670bb88ba4Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
35680bb88ba4Smrg    fi
35690bb88ba4Smrg    ;;
35700bb88ba4Smrg  esac
35710bb88ba4Smrgfi
35720bb88ba4Smrg
3573fe5e51b7Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3574fe5e51b7Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3575fe5e51b7Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3576a31a186aSmrg
3577a31a186aSmrg_LT_DECL([], [deplibs_check_method], [1],
3578a31a186aSmrg    [Method to check whether dependent libraries are shared objects])
3579a31a186aSmrg_LT_DECL([], [file_magic_cmd], [1],
35800bb88ba4Smrg    [Command to use when deplibs_check_method = "file_magic"])
35810bb88ba4Smrg_LT_DECL([], [file_magic_glob], [1],
35820bb88ba4Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
35830bb88ba4Smrg_LT_DECL([], [want_nocaseglob], [1],
35840bb88ba4Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3585a31a186aSmrg])# _LT_CHECK_MAGIC_METHOD
3586eda3803bSmrg
3587fe5e51b7Smrg
3588a31a186aSmrg# LT_PATH_NM
3589fe5e51b7Smrg# ----------
3590a31a186aSmrg# find the pathname to a BSD- or MS-compatible name lister
3591a31a186aSmrgAC_DEFUN([LT_PATH_NM],
3592a31a186aSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3593a31a186aSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3594fe5e51b7Smrg[if test -n "$NM"; then
3595fe5e51b7Smrg  # Let the user override the test.
3596493f84f4Smrg  lt_cv_path_NM=$NM
3597fe5e51b7Smrgelse
3598493f84f4Smrg  lt_nm_to_check=${ac_tool_prefix}nm
3599fe5e51b7Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3600fe5e51b7Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3601fe5e51b7Smrg  fi
3602fe5e51b7Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3603493f84f4Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3604fe5e51b7Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3605493f84f4Smrg      IFS=$lt_save_ifs
3606fe5e51b7Smrg      test -z "$ac_dir" && ac_dir=.
3607493f84f4Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
3608493f84f4Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3609fe5e51b7Smrg	# Check to see if the nm accepts a BSD-compat flag.
3610493f84f4Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3611fe5e51b7Smrg	#   nm: unknown option "B" ignored
3612fe5e51b7Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3613493f84f4Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3614493f84f4Smrg	case $build_os in
3615493f84f4Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3616493f84f4Smrg	*) lt_bad_file=/dev/null ;;
3617493f84f4Smrg	esac
3618493f84f4Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3619493f84f4Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
3620fe5e51b7Smrg	  lt_cv_path_NM="$tmp_nm -B"
3621493f84f4Smrg	  break 2
3622fe5e51b7Smrg	  ;;
3623fe5e51b7Smrg	*)
3624fe5e51b7Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3625fe5e51b7Smrg	  */dev/null*)
3626fe5e51b7Smrg	    lt_cv_path_NM="$tmp_nm -p"
3627493f84f4Smrg	    break 2
3628fe5e51b7Smrg	    ;;
3629fe5e51b7Smrg	  *)
3630fe5e51b7Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3631fe5e51b7Smrg	    continue # so that we can try to find one that supports BSD flags
3632fe5e51b7Smrg	    ;;
3633fe5e51b7Smrg	  esac
3634fe5e51b7Smrg	  ;;
3635fe5e51b7Smrg	esac
3636fe5e51b7Smrg      fi
3637fe5e51b7Smrg    done
3638493f84f4Smrg    IFS=$lt_save_ifs
3639fe5e51b7Smrg  done
3640a31a186aSmrg  : ${lt_cv_path_NM=no}
3641fe5e51b7Smrgfi])
3642493f84f4Smrgif test no != "$lt_cv_path_NM"; then
3643493f84f4Smrg  NM=$lt_cv_path_NM
3644a31a186aSmrgelse
3645a31a186aSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
36460bb88ba4Smrg  if test -n "$DUMPBIN"; then :
36470bb88ba4Smrg    # Let the user override the test.
36480bb88ba4Smrg  else
36490bb88ba4Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3650493f84f4Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
36510bb88ba4Smrg    *COFF*)
3652493f84f4Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
36530bb88ba4Smrg      ;;
36540bb88ba4Smrg    *)
36550bb88ba4Smrg      DUMPBIN=:
36560bb88ba4Smrg      ;;
36570bb88ba4Smrg    esac
36580bb88ba4Smrg  fi
3659a31a186aSmrg  AC_SUBST([DUMPBIN])
3660493f84f4Smrg  if test : != "$DUMPBIN"; then
3661493f84f4Smrg    NM=$DUMPBIN
3662a31a186aSmrg  fi
3663a31a186aSmrgfi
3664a31a186aSmrgtest -z "$NM" && NM=nm
3665a31a186aSmrgAC_SUBST([NM])
3666a31a186aSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3667a31a186aSmrg
3668a31a186aSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3669a31a186aSmrg  [lt_cv_nm_interface="BSD nm"
3670a31a186aSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
36710bb88ba4Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3672a31a186aSmrg  (eval "$ac_compile" 2>conftest.err)
3673a31a186aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
36740bb88ba4Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3675a31a186aSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3676a31a186aSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
36770bb88ba4Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3678a31a186aSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3679a31a186aSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3680a31a186aSmrg    lt_cv_nm_interface="MS dumpbin"
3681a31a186aSmrg  fi
3682a31a186aSmrg  rm -f conftest*])
3683a31a186aSmrg])# LT_PATH_NM
3684fe5e51b7Smrg
3685a31a186aSmrg# Old names:
3686a31a186aSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3687a31a186aSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3688a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3689a31a186aSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3690a31a186aSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3691eda3803bSmrg
36920bb88ba4Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
36930bb88ba4Smrg# --------------------------------
36940bb88ba4Smrg# how to determine the name of the shared library
36950bb88ba4Smrg# associated with a specific link library.
36960bb88ba4Smrg#  -- PORTME fill in with the dynamic library characteristics
36970bb88ba4Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
36980bb88ba4Smrg[m4_require([_LT_DECL_EGREP])
36990bb88ba4Smrgm4_require([_LT_DECL_OBJDUMP])
37000bb88ba4Smrgm4_require([_LT_DECL_DLLTOOL])
37010bb88ba4SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
37020bb88ba4Smrglt_cv_sharedlib_from_linklib_cmd,
37030bb88ba4Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
37040bb88ba4Smrg
37050bb88ba4Smrgcase $host_os in
37060bb88ba4Smrgcygwin* | mingw* | pw32* | cegcc*)
3707493f84f4Smrg  # two different shell functions defined in ltmain.sh;
3708493f84f4Smrg  # decide which one to use based on capabilities of $DLLTOOL
37090bb88ba4Smrg  case `$DLLTOOL --help 2>&1` in
37100bb88ba4Smrg  *--identify-strict*)
37110bb88ba4Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
37120bb88ba4Smrg    ;;
37130bb88ba4Smrg  *)
37140bb88ba4Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
37150bb88ba4Smrg    ;;
37160bb88ba4Smrg  esac
37170bb88ba4Smrg  ;;
37180bb88ba4Smrg*)
37190bb88ba4Smrg  # fallback: assume linklib IS sharedlib
3720493f84f4Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
37210bb88ba4Smrg  ;;
37220bb88ba4Smrgesac
37230bb88ba4Smrg])
37240bb88ba4Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
37250bb88ba4Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
37260bb88ba4Smrg
37270bb88ba4Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
37280bb88ba4Smrg    [Command to associate shared and link libraries])
37290bb88ba4Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
37300bb88ba4Smrg
37310bb88ba4Smrg
37320bb88ba4Smrg# _LT_PATH_MANIFEST_TOOL
37330bb88ba4Smrg# ----------------------
37340bb88ba4Smrg# locate the manifest tool
37350bb88ba4Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
37360bb88ba4Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
37370bb88ba4Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
37380bb88ba4SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
37390bb88ba4Smrg  [lt_cv_path_mainfest_tool=no
37400bb88ba4Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
37410bb88ba4Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
37420bb88ba4Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
37430bb88ba4Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
37440bb88ba4Smrg    lt_cv_path_mainfest_tool=yes
37450bb88ba4Smrg  fi
37460bb88ba4Smrg  rm -f conftest*])
3747493f84f4Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
37480bb88ba4Smrg  MANIFEST_TOOL=:
37490bb88ba4Smrgfi
37500bb88ba4Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
37510bb88ba4Smrg])# _LT_PATH_MANIFEST_TOOL
37520bb88ba4Smrg
3753a31a186aSmrg
3754493f84f4Smrg# _LT_DLL_DEF_P([FILE])
3755493f84f4Smrg# ---------------------
3756493f84f4Smrg# True iff FILE is a Windows DLL '.def' file.
3757493f84f4Smrg# Keep in sync with func_dll_def_p in the libtool script
3758493f84f4SmrgAC_DEFUN([_LT_DLL_DEF_P],
3759493f84f4Smrg[dnl
3760493f84f4Smrg  test DEF = "`$SED -n dnl
3761493f84f4Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3762493f84f4Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3763493f84f4Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3764493f84f4Smrg    -e q dnl                          Only consider the first "real" line
3765493f84f4Smrg    $1`" dnl
3766493f84f4Smrg])# _LT_DLL_DEF_P
3767493f84f4Smrg
3768493f84f4Smrg
3769a31a186aSmrg# LT_LIB_M
3770a31a186aSmrg# --------
3771fe5e51b7Smrg# check for math library
3772a31a186aSmrgAC_DEFUN([LT_LIB_M],
3773fe5e51b7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3774fe5e51b7SmrgLIBM=
3775fe5e51b7Smrgcase $host in
37760bb88ba4Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3777fe5e51b7Smrg  # These system don't have libm, or don't need it
3778fe5e51b7Smrg  ;;
3779fe5e51b7Smrg*-ncr-sysv4.3*)
3780493f84f4Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3781fe5e51b7Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3782fe5e51b7Smrg  ;;
3783fe5e51b7Smrg*)
3784493f84f4Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
3785fe5e51b7Smrg  ;;
3786fe5e51b7Smrgesac
3787a31a186aSmrgAC_SUBST([LIBM])
3788a31a186aSmrg])# LT_LIB_M
3789fe5e51b7Smrg
3790a31a186aSmrg# Old name:
3791a31a186aSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3792a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
3793a31a186aSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3794fe5e51b7Smrg
3795fe5e51b7Smrg
3796a31a186aSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3797a31a186aSmrg# -------------------------------
3798a31a186aSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3799a31a186aSmrg[m4_require([_LT_TAG_COMPILER])dnl
3800fe5e51b7Smrg
3801a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3802fe5e51b7Smrg
3803493f84f4Smrgif test yes = "$GCC"; then
38040bb88ba4Smrg  case $cc_basename in
38050bb88ba4Smrg  nvcc*)
38060bb88ba4Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
38070bb88ba4Smrg  *)
38080bb88ba4Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
38090bb88ba4Smrg  esac
3810fe5e51b7Smrg
3811a31a186aSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3812a31a186aSmrg    lt_cv_prog_compiler_rtti_exceptions,
3813a31a186aSmrg    [-fno-rtti -fno-exceptions], [],
3814a31a186aSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3815a31a186aSmrgfi
3816a31a186aSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3817a31a186aSmrg	[Compiler flag to turn off builtin functions])
3818a31a186aSmrg])# _LT_COMPILER_NO_RTTI
3819fe5e51b7Smrg
3820fe5e51b7Smrg
3821a31a186aSmrg# _LT_CMD_GLOBAL_SYMBOLS
3822a31a186aSmrg# ----------------------
3823a31a186aSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3824a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3825a31a186aSmrgAC_REQUIRE([AC_PROG_CC])dnl
38260bb88ba4SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3827a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
3828a31a186aSmrgAC_REQUIRE([LT_PATH_LD])dnl
3829a31a186aSmrgm4_require([_LT_DECL_SED])dnl
3830a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
3831a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
3832fe5e51b7Smrg
3833a31a186aSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3834a31a186aSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3835a31a186aSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3836fe5e51b7Smrg[
3837a31a186aSmrg# These are sane defaults that work on at least a few old systems.
3838a31a186aSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3839fe5e51b7Smrg
3840a31a186aSmrg# Character class describing NM global symbol codes.
3841a31a186aSmrgsymcode='[[BCDEGRST]]'
3842fe5e51b7Smrg
3843a31a186aSmrg# Regexp to match symbols that can be accessed directly from C.
3844a31a186aSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3845fe5e51b7Smrg
3846a31a186aSmrg# Define system-specific variables.
3847a31a186aSmrgcase $host_os in
3848a31a186aSmrgaix*)
3849a31a186aSmrg  symcode='[[BCDT]]'
3850a31a186aSmrg  ;;
3851a31a186aSmrgcygwin* | mingw* | pw32* | cegcc*)
3852a31a186aSmrg  symcode='[[ABCDGISTW]]'
3853a31a186aSmrg  ;;
3854a31a186aSmrghpux*)
3855493f84f4Smrg  if test ia64 = "$host_cpu"; then
3856a31a186aSmrg    symcode='[[ABCDEGRST]]'
3857a31a186aSmrg  fi
3858a31a186aSmrg  ;;
3859a31a186aSmrgirix* | nonstopux*)
3860a31a186aSmrg  symcode='[[BCDEGRST]]'
3861a31a186aSmrg  ;;
3862a31a186aSmrgosf*)
3863a31a186aSmrg  symcode='[[BCDEGQRST]]'
3864a31a186aSmrg  ;;
3865a31a186aSmrgsolaris*)
3866a31a186aSmrg  symcode='[[BDRT]]'
3867a31a186aSmrg  ;;
3868a31a186aSmrgsco3.2v5*)
3869a31a186aSmrg  symcode='[[DT]]'
3870a31a186aSmrg  ;;
3871a31a186aSmrgsysv4.2uw2*)
3872a31a186aSmrg  symcode='[[DT]]'
3873a31a186aSmrg  ;;
3874a31a186aSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3875a31a186aSmrg  symcode='[[ABDT]]'
3876a31a186aSmrg  ;;
3877a31a186aSmrgsysv4)
3878a31a186aSmrg  symcode='[[DFNSTU]]'
3879a31a186aSmrg  ;;
3880a31a186aSmrgesac
3881fe5e51b7Smrg
3882a31a186aSmrg# If we're using GNU nm, then use its standard symbol codes.
3883a31a186aSmrgcase `$NM -V 2>&1` in
3884a31a186aSmrg*GNU* | *'with BFD'*)
3885a31a186aSmrg  symcode='[[ABCDGIRSTW]]' ;;
3886a31a186aSmrgesac
3887fe5e51b7Smrg
3888493f84f4Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3889493f84f4Smrg  # Gets list of data symbols to import.
3890493f84f4Smrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3891493f84f4Smrg  # Adjust the below global symbol transforms to fixup imported variables.
3892493f84f4Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3893493f84f4Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3894493f84f4Smrg  lt_c_name_lib_hook="\
3895493f84f4Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3896493f84f4Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3897493f84f4Smrgelse
3898493f84f4Smrg  # Disable hooks by default.
3899493f84f4Smrg  lt_cv_sys_global_symbol_to_import=
3900493f84f4Smrg  lt_cdecl_hook=
3901493f84f4Smrg  lt_c_name_hook=
3902493f84f4Smrg  lt_c_name_lib_hook=
3903493f84f4Smrgfi
3904493f84f4Smrg
3905a31a186aSmrg# Transform an extracted symbol line into a proper C declaration.
3906a31a186aSmrg# Some systems (esp. on ia64) link data and code symbols differently,
3907a31a186aSmrg# so use this general approach.
3908493f84f4Smrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
3909493f84f4Smrg$lt_cdecl_hook\
3910493f84f4Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3911493f84f4Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3912fe5e51b7Smrg
3913a31a186aSmrg# Transform an extracted symbol line into symbol name and symbol address
3914493f84f4Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
3915493f84f4Smrg$lt_c_name_hook\
3916493f84f4Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
3917493f84f4Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
3918493f84f4Smrg
3919493f84f4Smrg# Transform an extracted symbol line into symbol name with lib prefix and
3920493f84f4Smrg# symbol address.
3921493f84f4Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
3922493f84f4Smrg$lt_c_name_lib_hook\
3923493f84f4Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
3924493f84f4Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
3925493f84f4Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
3926fe5e51b7Smrg
3927a31a186aSmrg# Handle CRLF in mingw tool chain
3928a31a186aSmrgopt_cr=
3929a31a186aSmrgcase $build_os in
3930a31a186aSmrgmingw*)
3931a31a186aSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3932a31a186aSmrg  ;;
3933a31a186aSmrgesac
3934fe5e51b7Smrg
3935a31a186aSmrg# Try without a prefix underscore, then with it.
3936a31a186aSmrgfor ac_symprfx in "" "_"; do
3937fe5e51b7Smrg
3938a31a186aSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3939a31a186aSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
3940fe5e51b7Smrg
3941a31a186aSmrg  # Write the raw and C identifiers.
3942a31a186aSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3943493f84f4Smrg    # Fake it for dumpbin and say T for any non-static function,
3944493f84f4Smrg    # D for any global variable and I for any imported variable.
3945a31a186aSmrg    # Also find C++ and __fastcall symbols from MSVC++,
3946a31a186aSmrg    # which start with @ or ?.
3947a31a186aSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3948a31a186aSmrg"     {last_section=section; section=\$ 3};"\
39490bb88ba4Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3950a31a186aSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3951493f84f4Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
3952493f84f4Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
3953493f84f4Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
3954a31a186aSmrg"     \$ 0!~/External *\|/{next};"\
3955a31a186aSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3956a31a186aSmrg"     {if(hide[section]) next};"\
3957493f84f4Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
3958493f84f4Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
3959493f84f4Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
3960493f84f4Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
3961a31a186aSmrg"     ' prfx=^$ac_symprfx]"
3962a31a186aSmrg  else
3963a31a186aSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3964643b027fSmrg  fi
39650bb88ba4Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
3966fe5e51b7Smrg
3967a31a186aSmrg  # Check to see that the pipe works correctly.
3968a31a186aSmrg  pipe_works=no
3969fe5e51b7Smrg
3970a31a186aSmrg  rm -f conftest*
3971a31a186aSmrg  cat > conftest.$ac_ext <<_LT_EOF
3972a31a186aSmrg#ifdef __cplusplus
3973a31a186aSmrgextern "C" {
3974a31a186aSmrg#endif
3975a31a186aSmrgchar nm_test_var;
3976a31a186aSmrgvoid nm_test_func(void);
3977a31a186aSmrgvoid nm_test_func(void){}
3978a31a186aSmrg#ifdef __cplusplus
3979a31a186aSmrg}
3980a31a186aSmrg#endif
3981a31a186aSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
3982a31a186aSmrg_LT_EOF
3983643b027fSmrg
3984a31a186aSmrg  if AC_TRY_EVAL(ac_compile); then
3985a31a186aSmrg    # Now try to grab the symbols.
3986a31a186aSmrg    nlist=conftest.nm
39870bb88ba4Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3988a31a186aSmrg      # Try sorting and uniquifying the output.
3989a31a186aSmrg      if sort "$nlist" | uniq > "$nlist"T; then
3990a31a186aSmrg	mv -f "$nlist"T "$nlist"
3991a31a186aSmrg      else
3992a31a186aSmrg	rm -f "$nlist"T
3993a31a186aSmrg      fi
3994643b027fSmrg
3995a31a186aSmrg      # Make sure that we snagged all the symbols we need.
3996a31a186aSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3997a31a186aSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3998a31a186aSmrg	  cat <<_LT_EOF > conftest.$ac_ext
39990bb88ba4Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4000493f84f4Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4001493f84f4Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
40020bb88ba4Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
40030bb88ba4Smrg# define LT@&t@_DLSYM_CONST
4004493f84f4Smrg#elif defined __osf__
40050bb88ba4Smrg/* This system does not cope well with relocations in const data.  */
40060bb88ba4Smrg# define LT@&t@_DLSYM_CONST
40070bb88ba4Smrg#else
40080bb88ba4Smrg# define LT@&t@_DLSYM_CONST const
40090bb88ba4Smrg#endif
40100bb88ba4Smrg
4011a31a186aSmrg#ifdef __cplusplus
4012a31a186aSmrgextern "C" {
4013a31a186aSmrg#endif
4014643b027fSmrg
4015a31a186aSmrg_LT_EOF
4016a31a186aSmrg	  # Now generate the symbol file.
4017a31a186aSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4018643b027fSmrg
4019a31a186aSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4020643b027fSmrg
4021a31a186aSmrg/* The mapping between symbol names and symbols.  */
40220bb88ba4SmrgLT@&t@_DLSYM_CONST struct {
4023a31a186aSmrg  const char *name;
4024a31a186aSmrg  void       *address;
4025a31a186aSmrg}
4026a31a186aSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4027a31a186aSmrg{
4028a31a186aSmrg  { "@PROGRAM@", (void *) 0 },
4029a31a186aSmrg_LT_EOF
4030493f84f4Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4031a31a186aSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4032a31a186aSmrg  {0, (void *) 0}
4033a31a186aSmrg};
4034643b027fSmrg
4035a31a186aSmrg/* This works around a problem in FreeBSD linker */
4036a31a186aSmrg#ifdef FREEBSD_WORKAROUND
4037a31a186aSmrgstatic const void *lt_preloaded_setup() {
4038a31a186aSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4039a31a186aSmrg}
4040a31a186aSmrg#endif
4041643b027fSmrg
4042a31a186aSmrg#ifdef __cplusplus
4043a31a186aSmrg}
4044a31a186aSmrg#endif
4045a31a186aSmrg_LT_EOF
4046a31a186aSmrg	  # Now try linking the two files.
4047a31a186aSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
40480bb88ba4Smrg	  lt_globsym_save_LIBS=$LIBS
40490bb88ba4Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4050493f84f4Smrg	  LIBS=conftstm.$ac_objext
4051a31a186aSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4052493f84f4Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4053a31a186aSmrg	    pipe_works=yes
4054a31a186aSmrg	  fi
40550bb88ba4Smrg	  LIBS=$lt_globsym_save_LIBS
40560bb88ba4Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
4057a31a186aSmrg	else
4058a31a186aSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4059a31a186aSmrg	fi
4060a31a186aSmrg      else
4061a31a186aSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4062a31a186aSmrg      fi
4063fe5e51b7Smrg    else
4064a31a186aSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4065fe5e51b7Smrg    fi
4066fe5e51b7Smrg  else
4067a31a186aSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4068a31a186aSmrg    cat conftest.$ac_ext >&5
4069fe5e51b7Smrg  fi
4070a31a186aSmrg  rm -rf conftest* conftst*
4071fe5e51b7Smrg
4072a31a186aSmrg  # Do not use the global_symbol_pipe unless it works.
4073493f84f4Smrg  if test yes = "$pipe_works"; then
4074a31a186aSmrg    break
4075a31a186aSmrg  else
4076a31a186aSmrg    lt_cv_sys_global_symbol_pipe=
4077a31a186aSmrg  fi
4078a31a186aSmrgdone
4079a31a186aSmrg])
4080a31a186aSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4081a31a186aSmrg  lt_cv_sys_global_symbol_to_cdecl=
4082a31a186aSmrgfi
4083a31a186aSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4084a31a186aSmrg  AC_MSG_RESULT(failed)
4085fe5e51b7Smrgelse
4086a31a186aSmrg  AC_MSG_RESULT(ok)
4087fe5e51b7Smrgfi
4088fe5e51b7Smrg
40890bb88ba4Smrg# Response file support.
40900bb88ba4Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
40910bb88ba4Smrg  nm_file_list_spec='@'
40920bb88ba4Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
40930bb88ba4Smrg  nm_file_list_spec='@'
40940bb88ba4Smrgfi
40950bb88ba4Smrg
4096a31a186aSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4097a31a186aSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4098a31a186aSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4099a31a186aSmrg    [Transform the output of nm in a proper C declaration])
4100493f84f4Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4101493f84f4Smrg    [Transform the output of nm into a list of symbols to manually relocate])
4102a31a186aSmrg_LT_DECL([global_symbol_to_c_name_address],
4103a31a186aSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4104a31a186aSmrg    [Transform the output of nm in a C name address pair])
4105a31a186aSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4106a31a186aSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4107a31a186aSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4108493f84f4Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4109493f84f4Smrg    [The name lister interface])
41100bb88ba4Smrg_LT_DECL([], [nm_file_list_spec], [1],
41110bb88ba4Smrg    [Specify filename containing input files for $NM])
4112a31a186aSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4113fe5e51b7Smrg
4114fe5e51b7Smrg
4115a31a186aSmrg# _LT_COMPILER_PIC([TAGNAME])
4116a31a186aSmrg# ---------------------------
4117a31a186aSmrgm4_defun([_LT_COMPILER_PIC],
4118a31a186aSmrg[m4_require([_LT_TAG_COMPILER])dnl
4119a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4120a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4121a31a186aSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4122fe5e51b7Smrg
4123a31a186aSmrgm4_if([$1], [CXX], [
4124a31a186aSmrg  # C++ specific cases for pic, static, wl, etc.
4125493f84f4Smrg  if test yes = "$GXX"; then
4126a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4127a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4128643b027fSmrg
4129a31a186aSmrg    case $host_os in
4130a31a186aSmrg    aix*)
4131a31a186aSmrg      # All AIX code is PIC.
4132493f84f4Smrg      if test ia64 = "$host_cpu"; then
4133a31a186aSmrg	# AIX 5 now supports IA64 processor
4134a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4135fe5e51b7Smrg      fi
4136493f84f4Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4137fe5e51b7Smrg      ;;
4138fe5e51b7Smrg
4139a31a186aSmrg    amigaos*)
4140fe5e51b7Smrg      case $host_cpu in
4141a31a186aSmrg      powerpc)
4142a31a186aSmrg            # see comment about AmigaOS4 .so support
4143a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4144a31a186aSmrg        ;;
4145a31a186aSmrg      m68k)
4146a31a186aSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4147493f84f4Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4148493f84f4Smrg            # like '-m68040'.
4149a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4150fe5e51b7Smrg        ;;
4151fe5e51b7Smrg      esac
4152643b027fSmrg      ;;
4153eda3803bSmrg
4154a31a186aSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4155a31a186aSmrg      # PIC is the default for these OSes.
4156a31a186aSmrg      ;;
4157a31a186aSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4158a31a186aSmrg      # This hack is so that the source file can tell whether it is being
4159a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
4160a31a186aSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4161a31a186aSmrg      # (--disable-auto-import) libraries
4162a31a186aSmrg      m4_if([$1], [GCJ], [],
4163a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4164493f84f4Smrg      case $host_os in
4165493f84f4Smrg      os2*)
4166493f84f4Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4167493f84f4Smrg	;;
4168493f84f4Smrg      esac
4169a31a186aSmrg      ;;
4170a31a186aSmrg    darwin* | rhapsody*)
4171a31a186aSmrg      # PIC is the default on this platform
4172a31a186aSmrg      # Common symbols not allowed in MH_DYLIB files
4173a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4174a31a186aSmrg      ;;
4175a31a186aSmrg    *djgpp*)
4176a31a186aSmrg      # DJGPP does not support shared libraries at all
4177a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4178a31a186aSmrg      ;;
41790bb88ba4Smrg    haiku*)
41800bb88ba4Smrg      # PIC is the default for Haiku.
41810bb88ba4Smrg      # The "-static" flag exists, but is broken.
41820bb88ba4Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
41830bb88ba4Smrg      ;;
4184a31a186aSmrg    interix[[3-9]]*)
4185a31a186aSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4186a31a186aSmrg      # Instead, we relocate shared libraries at runtime.
4187a31a186aSmrg      ;;
4188a31a186aSmrg    sysv4*MP*)
4189a31a186aSmrg      if test -d /usr/nec; then
4190a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4191a31a186aSmrg      fi
4192a31a186aSmrg      ;;
4193a31a186aSmrg    hpux*)
4194a31a186aSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4195a31a186aSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4196a31a186aSmrg      # sets the default TLS model and affects inlining.
4197a31a186aSmrg      case $host_cpu in
4198a31a186aSmrg      hppa*64*)
4199fe5e51b7Smrg	;;
4200643b027fSmrg      *)
4201a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4202fe5e51b7Smrg	;;
4203a31a186aSmrg      esac
4204a31a186aSmrg      ;;
4205a31a186aSmrg    *qnx* | *nto*)
4206a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4207a31a186aSmrg      # it will coredump.
4208a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4209a31a186aSmrg      ;;
4210a31a186aSmrg    *)
4211a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4212a31a186aSmrg      ;;
4213643b027fSmrg    esac
4214a31a186aSmrg  else
4215a31a186aSmrg    case $host_os in
4216a31a186aSmrg      aix[[4-9]]*)
4217a31a186aSmrg	# All AIX code is PIC.
4218493f84f4Smrg	if test ia64 = "$host_cpu"; then
4219a31a186aSmrg	  # AIX 5 now supports IA64 processor
4220a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4221a31a186aSmrg	else
4222a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4223643b027fSmrg	fi
4224643b027fSmrg	;;
4225a31a186aSmrg      chorus*)
4226a31a186aSmrg	case $cc_basename in
4227a31a186aSmrg	cxch68*)
4228a31a186aSmrg	  # Green Hills C++ Compiler
4229a31a186aSmrg	  # _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"
4230643b027fSmrg	  ;;
4231fe5e51b7Smrg	esac
4232fe5e51b7Smrg	;;
42330bb88ba4Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
42340bb88ba4Smrg	# This hack is so that the source file can tell whether it is being
42350bb88ba4Smrg	# built for inclusion in a dll (and should export symbols for example).
42360bb88ba4Smrg	m4_if([$1], [GCJ], [],
42370bb88ba4Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
42380bb88ba4Smrg	;;
4239a31a186aSmrg      dgux*)
4240a31a186aSmrg	case $cc_basename in
4241a31a186aSmrg	  ec++*)
4242a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4243a31a186aSmrg	    ;;
4244a31a186aSmrg	  ghcx*)
4245a31a186aSmrg	    # Green Hills C++ Compiler
4246a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4247a31a186aSmrg	    ;;
4248a31a186aSmrg	  *)
4249a31a186aSmrg	    ;;
4250eda3803bSmrg	esac
4251fe5e51b7Smrg	;;
4252a31a186aSmrg      freebsd* | dragonfly*)
4253a31a186aSmrg	# FreeBSD uses GNU C++
4254fe5e51b7Smrg	;;
4255a31a186aSmrg      hpux9* | hpux10* | hpux11*)
4256a31a186aSmrg	case $cc_basename in
4257a31a186aSmrg	  CC*)
4258a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4259493f84f4Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4260493f84f4Smrg	    if test ia64 != "$host_cpu"; then
4261a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4262a31a186aSmrg	    fi
4263a31a186aSmrg	    ;;
4264a31a186aSmrg	  aCC*)
4265a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4266493f84f4Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4267a31a186aSmrg	    case $host_cpu in
4268a31a186aSmrg	    hppa*64*|ia64*)
4269a31a186aSmrg	      # +Z the default
4270a31a186aSmrg	      ;;
4271a31a186aSmrg	    *)
4272a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4273a31a186aSmrg	      ;;
4274a31a186aSmrg	    esac
4275a31a186aSmrg	    ;;
4276a31a186aSmrg	  *)
4277a31a186aSmrg	    ;;
4278a31a186aSmrg	esac
4279fe5e51b7Smrg	;;
4280a31a186aSmrg      interix*)
4281a31a186aSmrg	# This is c89, which is MS Visual C++ (no shared libs)
4282a31a186aSmrg	# Anyone wants to do a port?
4283fe5e51b7Smrg	;;
4284a31a186aSmrg      irix5* | irix6* | nonstopux*)
4285a31a186aSmrg	case $cc_basename in
4286a31a186aSmrg	  CC*)
4287a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4288a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4289a31a186aSmrg	    # CC pic flag -KPIC is the default.
4290a31a186aSmrg	    ;;
4291a31a186aSmrg	  *)
4292a31a186aSmrg	    ;;
4293a31a186aSmrg	esac
4294fe5e51b7Smrg	;;
4295493f84f4Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4296a31a186aSmrg	case $cc_basename in
4297a31a186aSmrg	  KCC*)
4298a31a186aSmrg	    # KAI C++ Compiler
4299a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4300a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4301a31a186aSmrg	    ;;
4302a31a186aSmrg	  ecpc* )
4303493f84f4Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
4304a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4305a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4306a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4307a31a186aSmrg	    ;;
4308a31a186aSmrg	  icpc* )
4309a31a186aSmrg	    # Intel C++, used to be incompatible with GCC.
4310a31a186aSmrg	    # ICC 10 doesn't accept -KPIC any more.
4311a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4312a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4313a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4314a31a186aSmrg	    ;;
4315a31a186aSmrg	  pgCC* | pgcpp*)
4316a31a186aSmrg	    # Portland Group C++ compiler
4317a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4318a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4319a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4320a31a186aSmrg	    ;;
4321a31a186aSmrg	  cxx*)
4322a31a186aSmrg	    # Compaq C++
4323a31a186aSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4324a31a186aSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4325a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4326a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4327a31a186aSmrg	    ;;
43280bb88ba4Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
43290bb88ba4Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4330a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4331a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4332a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4333a31a186aSmrg	    ;;
4334a31a186aSmrg	  *)
4335a31a186aSmrg	    case `$CC -V 2>&1 | sed 5q` in
4336a31a186aSmrg	    *Sun\ C*)
4337a31a186aSmrg	      # Sun C++ 5.9
4338a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4339a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4340a31a186aSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4341a31a186aSmrg	      ;;
4342a31a186aSmrg	    esac
4343a31a186aSmrg	    ;;
4344a31a186aSmrg	esac
4345fe5e51b7Smrg	;;
4346a31a186aSmrg      lynxos*)
4347fe5e51b7Smrg	;;
4348a31a186aSmrg      m88k*)
4349fe5e51b7Smrg	;;
4350a31a186aSmrg      mvs*)
4351a31a186aSmrg	case $cc_basename in
4352a31a186aSmrg	  cxx*)
4353a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4354a31a186aSmrg	    ;;
4355a31a186aSmrg	  *)
4356a31a186aSmrg	    ;;
4357a31a186aSmrg	esac
4358fe5e51b7Smrg	;;
4359a31a186aSmrg      netbsd*)
4360643b027fSmrg	;;
4361a31a186aSmrg      *qnx* | *nto*)
4362a31a186aSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4363a31a186aSmrg        # it will coredump.
4364a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4365a31a186aSmrg        ;;
4366a31a186aSmrg      osf3* | osf4* | osf5*)
4367a31a186aSmrg	case $cc_basename in
4368a31a186aSmrg	  KCC*)
4369a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4370a31a186aSmrg	    ;;
4371a31a186aSmrg	  RCC*)
4372a31a186aSmrg	    # Rational C++ 2.4.1
4373a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4374a31a186aSmrg	    ;;
4375a31a186aSmrg	  cxx*)
4376a31a186aSmrg	    # Digital/Compaq C++
4377a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4378a31a186aSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4379a31a186aSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4380a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4381a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4382a31a186aSmrg	    ;;
4383a31a186aSmrg	  *)
4384a31a186aSmrg	    ;;
4385a31a186aSmrg	esac
4386643b027fSmrg	;;
4387a31a186aSmrg      psos*)
4388643b027fSmrg	;;
4389a31a186aSmrg      solaris*)
4390a31a186aSmrg	case $cc_basename in
43910bb88ba4Smrg	  CC* | sunCC*)
4392a31a186aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
4393a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4394a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4395a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4396a31a186aSmrg	    ;;
4397a31a186aSmrg	  gcx*)
4398a31a186aSmrg	    # Green Hills C++ Compiler
4399a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4400a31a186aSmrg	    ;;
4401a31a186aSmrg	  *)
4402a31a186aSmrg	    ;;
4403a31a186aSmrg	esac
4404643b027fSmrg	;;
4405a31a186aSmrg      sunos4*)
4406a31a186aSmrg	case $cc_basename in
4407a31a186aSmrg	  CC*)
4408a31a186aSmrg	    # Sun C++ 4.x
4409a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4410a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4411a31a186aSmrg	    ;;
4412a31a186aSmrg	  lcc*)
4413a31a186aSmrg	    # Lucid
4414a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4415a31a186aSmrg	    ;;
4416fe5e51b7Smrg	  *)
4417fe5e51b7Smrg	    ;;
4418fe5e51b7Smrg	esac
4419fe5e51b7Smrg	;;
4420a31a186aSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4421a31a186aSmrg	case $cc_basename in
4422a31a186aSmrg	  CC*)
4423a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4424a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4425a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4426a31a186aSmrg	    ;;
4427a31a186aSmrg	esac
4428fe5e51b7Smrg	;;
4429a31a186aSmrg      tandem*)
4430a31a186aSmrg	case $cc_basename in
4431a31a186aSmrg	  NCC*)
4432a31a186aSmrg	    # NonStop-UX NCC 3.20
4433a31a186aSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4434a31a186aSmrg	    ;;
4435643b027fSmrg	  *)
4436643b027fSmrg	    ;;
4437a31a186aSmrg	esac
4438643b027fSmrg	;;
4439a31a186aSmrg      vxworks*)
4440fe5e51b7Smrg	;;
4441fe5e51b7Smrg      *)
4442a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4443fe5e51b7Smrg	;;
4444fe5e51b7Smrg    esac
4445a31a186aSmrg  fi
4446a31a186aSmrg],
4447a31a186aSmrg[
4448493f84f4Smrg  if test yes = "$GCC"; then
4449a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4450a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4451a31a186aSmrg
4452a31a186aSmrg    case $host_os in
4453a31a186aSmrg      aix*)
4454a31a186aSmrg      # All AIX code is PIC.
4455493f84f4Smrg      if test ia64 = "$host_cpu"; then
4456a31a186aSmrg	# AIX 5 now supports IA64 processor
4457a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4458a31a186aSmrg      fi
4459493f84f4Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4460a31a186aSmrg      ;;
4461a31a186aSmrg
4462a31a186aSmrg    amigaos*)
4463a31a186aSmrg      case $host_cpu in
4464a31a186aSmrg      powerpc)
4465a31a186aSmrg            # see comment about AmigaOS4 .so support
4466a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4467a31a186aSmrg        ;;
4468a31a186aSmrg      m68k)
4469a31a186aSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4470493f84f4Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4471493f84f4Smrg            # like '-m68040'.
4472a31a186aSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4473a31a186aSmrg        ;;
4474a31a186aSmrg      esac
4475a31a186aSmrg      ;;
4476a31a186aSmrg
4477a31a186aSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4478a31a186aSmrg      # PIC is the default for these OSes.
4479a31a186aSmrg      ;;
4480a31a186aSmrg
4481a31a186aSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4482a31a186aSmrg      # This hack is so that the source file can tell whether it is being
4483a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
4484a31a186aSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4485a31a186aSmrg      # (--disable-auto-import) libraries
4486a31a186aSmrg      m4_if([$1], [GCJ], [],
4487a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4488493f84f4Smrg      case $host_os in
4489493f84f4Smrg      os2*)
4490493f84f4Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4491493f84f4Smrg	;;
4492493f84f4Smrg      esac
4493a31a186aSmrg      ;;
4494a31a186aSmrg
4495a31a186aSmrg    darwin* | rhapsody*)
4496a31a186aSmrg      # PIC is the default on this platform
4497a31a186aSmrg      # Common symbols not allowed in MH_DYLIB files
4498a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4499a31a186aSmrg      ;;
4500a31a186aSmrg
45010bb88ba4Smrg    haiku*)
45020bb88ba4Smrg      # PIC is the default for Haiku.
45030bb88ba4Smrg      # The "-static" flag exists, but is broken.
45040bb88ba4Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
45050bb88ba4Smrg      ;;
45060bb88ba4Smrg
4507a31a186aSmrg    hpux*)
4508a31a186aSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4509a31a186aSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4510a31a186aSmrg      # sets the default TLS model and affects inlining.
4511a31a186aSmrg      case $host_cpu in
4512a31a186aSmrg      hppa*64*)
4513a31a186aSmrg	# +Z the default
4514fe5e51b7Smrg	;;
4515fe5e51b7Smrg      *)
4516a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4517eda3803bSmrg	;;
4518a31a186aSmrg      esac
4519a31a186aSmrg      ;;
4520a31a186aSmrg
4521a31a186aSmrg    interix[[3-9]]*)
4522a31a186aSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4523a31a186aSmrg      # Instead, we relocate shared libraries at runtime.
4524a31a186aSmrg      ;;
4525a31a186aSmrg
4526a31a186aSmrg    msdosdjgpp*)
4527a31a186aSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4528a31a186aSmrg      # on systems that don't support them.
4529a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4530a31a186aSmrg      enable_shared=no
4531a31a186aSmrg      ;;
4532a31a186aSmrg
4533a31a186aSmrg    *nto* | *qnx*)
4534a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4535a31a186aSmrg      # it will coredump.
4536a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4537a31a186aSmrg      ;;
4538a31a186aSmrg
4539a31a186aSmrg    sysv4*MP*)
4540a31a186aSmrg      if test -d /usr/nec; then
4541a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4542a31a186aSmrg      fi
4543a31a186aSmrg      ;;
4544a31a186aSmrg
4545a31a186aSmrg    *)
4546a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4547a31a186aSmrg      ;;
4548643b027fSmrg    esac
45490bb88ba4Smrg
45500bb88ba4Smrg    case $cc_basename in
45510bb88ba4Smrg    nvcc*) # Cuda Compiler Driver 2.2
45520bb88ba4Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
45530bb88ba4Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
45540bb88ba4Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
45550bb88ba4Smrg      fi
45560bb88ba4Smrg      ;;
45570bb88ba4Smrg    esac
4558a31a186aSmrg  else
4559a31a186aSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
4560a31a186aSmrg    case $host_os in
4561a31a186aSmrg    aix*)
4562a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4563493f84f4Smrg      if test ia64 = "$host_cpu"; then
4564a31a186aSmrg	# AIX 5 now supports IA64 processor
4565a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4566a31a186aSmrg      else
4567a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4568a31a186aSmrg      fi
4569a31a186aSmrg      ;;
4570a31a186aSmrg
4571493f84f4Smrg    darwin* | rhapsody*)
4572493f84f4Smrg      # PIC is the default on this platform
4573493f84f4Smrg      # Common symbols not allowed in MH_DYLIB files
4574493f84f4Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4575493f84f4Smrg      case $cc_basename in
4576493f84f4Smrg      nagfor*)
4577493f84f4Smrg        # NAG Fortran compiler
4578493f84f4Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4579493f84f4Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4580493f84f4Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4581493f84f4Smrg        ;;
4582493f84f4Smrg      esac
4583493f84f4Smrg      ;;
4584493f84f4Smrg
4585a31a186aSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4586a31a186aSmrg      # This hack is so that the source file can tell whether it is being
4587a31a186aSmrg      # built for inclusion in a dll (and should export symbols for example).
4588a31a186aSmrg      m4_if([$1], [GCJ], [],
4589a31a186aSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4590493f84f4Smrg      case $host_os in
4591493f84f4Smrg      os2*)
4592493f84f4Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4593493f84f4Smrg	;;
4594493f84f4Smrg      esac
4595a31a186aSmrg      ;;
4596a31a186aSmrg
4597a31a186aSmrg    hpux9* | hpux10* | hpux11*)
4598a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4599a31a186aSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4600a31a186aSmrg      # not for PA HP-UX.
4601a31a186aSmrg      case $host_cpu in
4602a31a186aSmrg      hppa*64*|ia64*)
4603a31a186aSmrg	# +Z the default
4604fe5e51b7Smrg	;;
4605fe5e51b7Smrg      *)
4606a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4607fe5e51b7Smrg	;;
4608a31a186aSmrg      esac
4609a31a186aSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4610493f84f4Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4611a31a186aSmrg      ;;
4612fe5e51b7Smrg
4613a31a186aSmrg    irix5* | irix6* | nonstopux*)
4614a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4615a31a186aSmrg      # PIC (with -KPIC) is the default.
4616a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4617a31a186aSmrg      ;;
4618fe5e51b7Smrg
4619493f84f4Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4620a31a186aSmrg      case $cc_basename in
4621493f84f4Smrg      # old Intel for x86_64, which still supported -KPIC.
4622a31a186aSmrg      ecc*)
4623a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4624a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4625a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4626a31a186aSmrg        ;;
4627a31a186aSmrg      # icc used to be incompatible with GCC.
4628a31a186aSmrg      # ICC 10 doesn't accept -KPIC any more.
4629a31a186aSmrg      icc* | ifort*)
4630a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4631a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4632a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4633a31a186aSmrg        ;;
4634a31a186aSmrg      # Lahey Fortran 8.1.
4635a31a186aSmrg      lf95*)
4636a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4637a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4638a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4639a31a186aSmrg	;;
46400bb88ba4Smrg      nagfor*)
46410bb88ba4Smrg	# NAG Fortran compiler
46420bb88ba4Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
46430bb88ba4Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
46440bb88ba4Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46450bb88ba4Smrg	;;
4646493f84f4Smrg      tcc*)
4647493f84f4Smrg	# Fabrice Bellard et al's Tiny C Compiler
4648493f84f4Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4649493f84f4Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4650493f84f4Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4651493f84f4Smrg	;;
46520bb88ba4Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4653a31a186aSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4654a31a186aSmrg	# which looks to be a dead project)
4655a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4656a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4657a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4658a31a186aSmrg        ;;
4659a31a186aSmrg      ccc*)
4660a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4661a31a186aSmrg        # All Alpha code is PIC.
4662a31a186aSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4663a31a186aSmrg        ;;
46640bb88ba4Smrg      xl* | bgxl* | bgf* | mpixl*)
46650bb88ba4Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4666a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4667a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4668a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4669a31a186aSmrg	;;
4670a31a186aSmrg      *)
4671a31a186aSmrg	case `$CC -V 2>&1 | sed 5q` in
46720bb88ba4Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
46730bb88ba4Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
46740bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
46750bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46760bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
46770bb88ba4Smrg	  ;;
46780bb88ba4Smrg	*Sun\ F* | *Sun*Fortran*)
46790bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
46800bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
46810bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
46820bb88ba4Smrg	  ;;
4683a31a186aSmrg	*Sun\ C*)
4684a31a186aSmrg	  # Sun C 5.9
4685a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4686a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4687a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4688a31a186aSmrg	  ;;
46890bb88ba4Smrg        *Intel*\ [[CF]]*Compiler*)
46900bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46910bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
46920bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
46930bb88ba4Smrg	  ;;
46940bb88ba4Smrg	*Portland\ Group*)
46950bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
46960bb88ba4Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4697a31a186aSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4698a31a186aSmrg	  ;;
4699a31a186aSmrg	esac
4700a31a186aSmrg	;;
4701a31a186aSmrg      esac
4702a31a186aSmrg      ;;
4703fe5e51b7Smrg
4704a31a186aSmrg    newsos6)
4705a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4706a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4707a31a186aSmrg      ;;
4708fe5e51b7Smrg
4709a31a186aSmrg    *nto* | *qnx*)
4710a31a186aSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4711a31a186aSmrg      # it will coredump.
4712a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4713a31a186aSmrg      ;;
4714fe5e51b7Smrg
4715a31a186aSmrg    osf3* | osf4* | osf5*)
4716a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4717a31a186aSmrg      # All OSF/1 code is PIC.
4718a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4719a31a186aSmrg      ;;
4720fe5e51b7Smrg
4721a31a186aSmrg    rdos*)
4722a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4723a31a186aSmrg      ;;
4724fe5e51b7Smrg
4725a31a186aSmrg    solaris*)
4726a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4727a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4728a31a186aSmrg      case $cc_basename in
47290bb88ba4Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4730a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4731a31a186aSmrg      *)
4732a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4733a31a186aSmrg      esac
4734a31a186aSmrg      ;;
4735fe5e51b7Smrg
4736a31a186aSmrg    sunos4*)
4737a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4738a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4739a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4740a31a186aSmrg      ;;
4741fe5e51b7Smrg
4742a31a186aSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4743a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4744a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4745a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4746a31a186aSmrg      ;;
4747fe5e51b7Smrg
4748a31a186aSmrg    sysv4*MP*)
4749493f84f4Smrg      if test -d /usr/nec; then
4750a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4751a31a186aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4752a31a186aSmrg      fi
4753a31a186aSmrg      ;;
4754fe5e51b7Smrg
4755a31a186aSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4756a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4757a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4758a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4759a31a186aSmrg      ;;
4760643b027fSmrg
4761a31a186aSmrg    unicos*)
4762a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4763a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4764a31a186aSmrg      ;;
4765fe5e51b7Smrg
4766a31a186aSmrg    uts4*)
4767a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4768a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4769a31a186aSmrg      ;;
4770a31a186aSmrg
4771a31a186aSmrg    *)
4772a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4773a31a186aSmrg      ;;
4774fe5e51b7Smrg    esac
4775a31a186aSmrg  fi
4776a31a186aSmrg])
4777a31a186aSmrgcase $host_os in
4778493f84f4Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
4779a31a186aSmrg  *djgpp*)
4780a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4781a31a186aSmrg    ;;
4782a31a186aSmrg  *)
4783a31a186aSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4784a31a186aSmrg    ;;
4785a31a186aSmrgesac
47860bb88ba4Smrg
47870bb88ba4SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
47880bb88ba4Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
47890bb88ba4Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
47900bb88ba4Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4791fe5e51b7Smrg
4792a31a186aSmrg#
4793a31a186aSmrg# Check to make sure the PIC flag actually works.
4794a31a186aSmrg#
4795a31a186aSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4796a31a186aSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4797a31a186aSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4798a31a186aSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4799a31a186aSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4800a31a186aSmrg     "" | " "*) ;;
4801a31a186aSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4802a31a186aSmrg     esac],
4803a31a186aSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4804a31a186aSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4805fe5e51b7Smrgfi
4806a31a186aSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4807a31a186aSmrg	[Additional compiler flags for building library objects])
4808fe5e51b7Smrg
48090bb88ba4Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
48100bb88ba4Smrg	[How to pass a linker flag through the compiler])
4811a31a186aSmrg#
4812a31a186aSmrg# Check to make sure the static flag actually works.
4813a31a186aSmrg#
4814a31a186aSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4815a31a186aSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4816a31a186aSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4817a31a186aSmrg  $lt_tmp_static_flag,
4818a31a186aSmrg  [],
4819a31a186aSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4820a31a186aSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4821a31a186aSmrg	[Compiler flag to prevent dynamic linking])
4822a31a186aSmrg])# _LT_COMPILER_PIC
4823fe5e51b7Smrg
4824643b027fSmrg
4825a31a186aSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4826a31a186aSmrg# ----------------------------
4827a31a186aSmrg# See if the linker supports building shared libraries.
4828a31a186aSmrgm4_defun([_LT_LINKER_SHLIBS],
4829a31a186aSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4830a31a186aSmrgAC_REQUIRE([LT_PATH_NM])dnl
48310bb88ba4Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4832a31a186aSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4833a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
4834a31a186aSmrgm4_require([_LT_DECL_SED])dnl
4835a31a186aSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4836a31a186aSmrgm4_require([_LT_TAG_COMPILER])dnl
4837a31a186aSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4838a31a186aSmrgm4_if([$1], [CXX], [
4839a31a186aSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
48400bb88ba4Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4841a31a186aSmrg  case $host_os in
4842a31a186aSmrg  aix[[4-9]]*)
4843a31a186aSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4844493f84f4Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4845493f84f4Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4846493f84f4Smrg    # weak defined symbols like other global defined symbols, whereas
4847493f84f4Smrg    # GNU nm marks them as "W".
4848493f84f4Smrg    # While the 'weak' keyword is ignored in the Export File, we need
4849493f84f4Smrg    # it in the Import File for the 'aix-soname' feature, so we have
4850493f84f4Smrg    # to replace the "-B" option with "-P" for AIX nm.
4851a31a186aSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4852493f84f4Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
4853a31a186aSmrg    else
4854493f84f4Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
4855fe5e51b7Smrg    fi
4856fe5e51b7Smrg    ;;
4857a31a186aSmrg  pw32*)
4858493f84f4Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
48590bb88ba4Smrg    ;;
4860a31a186aSmrg  cygwin* | mingw* | cegcc*)
48610bb88ba4Smrg    case $cc_basename in
48620bb88ba4Smrg    cl*)
48630bb88ba4Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
48640bb88ba4Smrg      ;;
48650bb88ba4Smrg    *)
48660bb88ba4Smrg      _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'
48670bb88ba4Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
48680bb88ba4Smrg      ;;
48690bb88ba4Smrg    esac
48700bb88ba4Smrg    ;;
4871a31a186aSmrg  *)
4872a31a186aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
48730bb88ba4Smrg    ;;
4874a31a186aSmrg  esac
4875a31a186aSmrg], [
4876a31a186aSmrg  runpath_var=
4877a31a186aSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4878a31a186aSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4879a31a186aSmrg  _LT_TAGVAR(archive_cmds, $1)=
4880a31a186aSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4881a31a186aSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4882a31a186aSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4883a31a186aSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4884a31a186aSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4885a31a186aSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4886a31a186aSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4887a31a186aSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4888a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4889a31a186aSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4890a31a186aSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4891a31a186aSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4892a31a186aSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4893a31a186aSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4894a31a186aSmrg  _LT_TAGVAR(module_cmds, $1)=
4895a31a186aSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4896a31a186aSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4897a31a186aSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4898a31a186aSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4899a31a186aSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4900a31a186aSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4901a31a186aSmrg  # included in the symbol list
4902a31a186aSmrg  _LT_TAGVAR(include_expsyms, $1)=
4903a31a186aSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4904493f84f4Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
4905493f84f4Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4906493f84f4Smrg  # as well as any symbol that contains 'd'.
4907a31a186aSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4908a31a186aSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4909a31a186aSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4910a31a186aSmrg  # the symbol is explicitly referenced.  Since portable code cannot
4911a31a186aSmrg  # rely on this symbol name, it's probably fine to never include it in
4912a31a186aSmrg  # preloaded symbol tables.
4913a31a186aSmrg  # Exclude shared library initialization/finalization symbols.
4914a31a186aSmrgdnl Note also adjust exclude_expsyms for C++ above.
4915a31a186aSmrg  extract_expsyms_cmds=
4916fe5e51b7Smrg
4917a31a186aSmrg  case $host_os in
4918a31a186aSmrg  cygwin* | mingw* | pw32* | cegcc*)
4919a31a186aSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4920a31a186aSmrg    # When not using gcc, we currently assume that we are using
4921a31a186aSmrg    # Microsoft Visual C++.
4922493f84f4Smrg    if test yes != "$GCC"; then
4923a31a186aSmrg      with_gnu_ld=no
4924fe5e51b7Smrg    fi
4925fe5e51b7Smrg    ;;
4926a31a186aSmrg  interix*)
4927a31a186aSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4928a31a186aSmrg    with_gnu_ld=yes
4929a31a186aSmrg    ;;
4930493f84f4Smrg  openbsd* | bitrig*)
4931a31a186aSmrg    with_gnu_ld=no
4932a31a186aSmrg    ;;
4933fe5e51b7Smrg  esac
4934fe5e51b7Smrg
4935a31a186aSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
49360bb88ba4Smrg
49370bb88ba4Smrg  # On some targets, GNU ld is compatible enough with the native linker
49380bb88ba4Smrg  # that we're better off using the native interface for both.
49390bb88ba4Smrg  lt_use_gnu_ld_interface=no
4940493f84f4Smrg  if test yes = "$with_gnu_ld"; then
49410bb88ba4Smrg    case $host_os in
49420bb88ba4Smrg      aix*)
49430bb88ba4Smrg	# The AIX port of GNU ld has always aspired to compatibility
49440bb88ba4Smrg	# with the native linker.  However, as the warning in the GNU ld
49450bb88ba4Smrg	# block says, versions before 2.19.5* couldn't really create working
49460bb88ba4Smrg	# shared libraries, regardless of the interface used.
49470bb88ba4Smrg	case `$LD -v 2>&1` in
49480bb88ba4Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
49490bb88ba4Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
49500bb88ba4Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
49510bb88ba4Smrg	  *)
49520bb88ba4Smrg	    lt_use_gnu_ld_interface=yes
49530bb88ba4Smrg	    ;;
49540bb88ba4Smrg	esac
49550bb88ba4Smrg	;;
49560bb88ba4Smrg      *)
49570bb88ba4Smrg	lt_use_gnu_ld_interface=yes
49580bb88ba4Smrg	;;
49590bb88ba4Smrg    esac
49600bb88ba4Smrg  fi
49610bb88ba4Smrg
4962493f84f4Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
4963a31a186aSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4964493f84f4Smrg    wlarc='$wl'
4965fe5e51b7Smrg
4966a31a186aSmrg    # Set some defaults for GNU ld with shared library support. These
4967a31a186aSmrg    # are reset later if shared libraries are not supported. Putting them
4968a31a186aSmrg    # here allows them to be overridden if necessary.
4969a31a186aSmrg    runpath_var=LD_RUN_PATH
4970493f84f4Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
4971493f84f4Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
4972a31a186aSmrg    # ancient GNU ld didn't support --whole-archive et. al.
4973a31a186aSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4974493f84f4Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
4975a31a186aSmrg    else
4976a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4977a31a186aSmrg    fi
4978a31a186aSmrg    supports_anon_versioning=no
4979493f84f4Smrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
49800bb88ba4Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4981a31a186aSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4982a31a186aSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4983a31a186aSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4984a31a186aSmrg      *\ 2.11.*) ;; # other 2.11 versions
4985a31a186aSmrg      *) supports_anon_versioning=yes ;;
4986a31a186aSmrg    esac
4987fe5e51b7Smrg
4988a31a186aSmrg    # See if GNU ld supports shared libraries.
4989a31a186aSmrg    case $host_os in
4990a31a186aSmrg    aix[[3-9]]*)
4991a31a186aSmrg      # On AIX/PPC, the GNU linker is very broken
4992493f84f4Smrg      if test ia64 != "$host_cpu"; then
4993a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
4994a31a186aSmrg	cat <<_LT_EOF 1>&2
4995fe5e51b7Smrg
49960bb88ba4Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
4997a31a186aSmrg*** to be unable to reliably create shared libraries on AIX.
4998a31a186aSmrg*** Therefore, libtool is disabling shared libraries support.  If you
49990bb88ba4Smrg*** really care for shared libraries, you may want to install binutils
50000bb88ba4Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
50010bb88ba4Smrg*** You will then need to restart the configuration process.
5002fe5e51b7Smrg
5003a31a186aSmrg_LT_EOF
5004a31a186aSmrg      fi
5005a31a186aSmrg      ;;
5006fe5e51b7Smrg
5007a31a186aSmrg    amigaos*)
5008a31a186aSmrg      case $host_cpu in
5009a31a186aSmrg      powerpc)
5010a31a186aSmrg            # see comment about AmigaOS4 .so support
5011493f84f4Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5012a31a186aSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5013a31a186aSmrg        ;;
5014a31a186aSmrg      m68k)
5015a31a186aSmrg            _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)'
5016a31a186aSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5017a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5018a31a186aSmrg        ;;
5019a31a186aSmrg      esac
5020a31a186aSmrg      ;;
5021fe5e51b7Smrg
5022a31a186aSmrg    beos*)
5023a31a186aSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5024a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5025a31a186aSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5026a31a186aSmrg	# support --undefined.  This deserves some investigation.  FIXME
5027493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5028a31a186aSmrg      else
5029a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5030a31a186aSmrg      fi
5031a31a186aSmrg      ;;
5032fe5e51b7Smrg
5033a31a186aSmrg    cygwin* | mingw* | pw32* | cegcc*)
5034a31a186aSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5035a31a186aSmrg      # as there is no search path for DLLs.
5036a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5037493f84f4Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5038a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5039a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5040a31a186aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
50410bb88ba4Smrg      _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'
50420bb88ba4Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5043a31a186aSmrg
5044a31a186aSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5045493f84f4Smrg        _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'
5046493f84f4Smrg	# If the export-symbols file already is a .def file, use it as
5047493f84f4Smrg	# is; otherwise, prepend EXPORTS...
5048493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5049493f84f4Smrg          cp $export_symbols $output_objdir/$soname.def;
5050493f84f4Smrg        else
5051493f84f4Smrg          echo EXPORTS > $output_objdir/$soname.def;
5052493f84f4Smrg          cat $export_symbols >> $output_objdir/$soname.def;
5053493f84f4Smrg        fi~
5054493f84f4Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5055a31a186aSmrg      else
5056a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5057a31a186aSmrg      fi
5058a31a186aSmrg      ;;
5059fe5e51b7Smrg
50600bb88ba4Smrg    haiku*)
5061493f84f4Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
50620bb88ba4Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
50630bb88ba4Smrg      ;;
50640bb88ba4Smrg
5065493f84f4Smrg    os2*)
5066493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5067493f84f4Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5068493f84f4Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5069493f84f4Smrg      shrext_cmds=.dll
5070493f84f4Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5071493f84f4Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5072493f84f4Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5073493f84f4Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5074493f84f4Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5075493f84f4Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5076493f84f4Smrg	emximp -o $lib $output_objdir/$libname.def'
5077493f84f4Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5078493f84f4Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5079493f84f4Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5080493f84f4Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5081493f84f4Smrg	prefix_cmds="$SED"~
5082493f84f4Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5083493f84f4Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5084493f84f4Smrg	fi~
5085493f84f4Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5086493f84f4Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5087493f84f4Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5088493f84f4Smrg	emximp -o $lib $output_objdir/$libname.def'
5089493f84f4Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5090493f84f4Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5091493f84f4Smrg      ;;
5092493f84f4Smrg
5093a31a186aSmrg    interix[[3-9]]*)
5094a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5095a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5096493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5097493f84f4Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5098a31a186aSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5099a31a186aSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5100a31a186aSmrg      # default) and relocated if they conflict, which is a slow very memory
5101a31a186aSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5102a31a186aSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5103a31a186aSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5104493f84f4Smrg      _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'
5105493f84f4Smrg      _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'
5106a31a186aSmrg      ;;
5107fe5e51b7Smrg
51080bb88ba4Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5109a31a186aSmrg      tmp_diet=no
5110493f84f4Smrg      if test linux-dietlibc = "$host_os"; then
5111a31a186aSmrg	case $cc_basename in
5112a31a186aSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5113a31a186aSmrg	esac
5114a31a186aSmrg      fi
5115a31a186aSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5116493f84f4Smrg	 && test no = "$tmp_diet"
5117a31a186aSmrg      then
51180bb88ba4Smrg	tmp_addflag=' $pic_flag'
5119a31a186aSmrg	tmp_sharedflag='-shared'
5120a31a186aSmrg	case $cc_basename,$host_cpu in
5121a31a186aSmrg        pgcc*)				# Portland Group C compiler
5122493f84f4Smrg	  _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'
5123a31a186aSmrg	  tmp_addflag=' $pic_flag'
5124a31a186aSmrg	  ;;
51250bb88ba4Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
51260bb88ba4Smrg					# Portland Group f77 and f90 compilers
5127493f84f4Smrg	  _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'
5128a31a186aSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5129a31a186aSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5130a31a186aSmrg	  tmp_addflag=' -i_dynamic' ;;
5131a31a186aSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5132a31a186aSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5133a31a186aSmrg	ifc* | ifort*)			# Intel Fortran compiler
5134a31a186aSmrg	  tmp_addflag=' -nofor_main' ;;
5135a31a186aSmrg	lf95*)				# Lahey Fortran 8.1
5136a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5137a31a186aSmrg	  tmp_sharedflag='--shared' ;;
5138493f84f4Smrg        nagfor*)                        # NAGFOR 5.3
5139493f84f4Smrg          tmp_sharedflag='-Wl,-shared' ;;
51400bb88ba4Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5141a31a186aSmrg	  tmp_sharedflag='-qmkshrobj'
5142a31a186aSmrg	  tmp_addflag= ;;
51430bb88ba4Smrg	nvcc*)	# Cuda Compiler Driver 2.2
5144493f84f4Smrg	  _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'
51450bb88ba4Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
51460bb88ba4Smrg	  ;;
5147a31a186aSmrg	esac
5148a31a186aSmrg	case `$CC -V 2>&1 | sed 5q` in
5149a31a186aSmrg	*Sun\ C*)			# Sun C 5.9
5150493f84f4Smrg	  _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'
5151a31a186aSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5152a31a186aSmrg	  tmp_sharedflag='-G' ;;
5153a31a186aSmrg	*Sun\ F*)			# Sun Fortran 8.3
5154a31a186aSmrg	  tmp_sharedflag='-G' ;;
5155a31a186aSmrg	esac
5156493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5157fe5e51b7Smrg
5158493f84f4Smrg        if test yes = "$supports_anon_versioning"; then
5159a31a186aSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5160493f84f4Smrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5161493f84f4Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5162493f84f4Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5163a31a186aSmrg        fi
5164fe5e51b7Smrg
5165a31a186aSmrg	case $cc_basename in
5166493f84f4Smrg	tcc*)
5167493f84f4Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5168493f84f4Smrg	  ;;
51690bb88ba4Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
5170a31a186aSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5171a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5172493f84f4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
51730bb88ba4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5174493f84f4Smrg	  if test yes = "$supports_anon_versioning"; then
5175a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5176493f84f4Smrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5177493f84f4Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5178493f84f4Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5179a31a186aSmrg	  fi
5180a31a186aSmrg	  ;;
5181a31a186aSmrg	esac
5182a31a186aSmrg      else
5183a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5184a31a186aSmrg      fi
5185a31a186aSmrg      ;;
5186fe5e51b7Smrg
5187a31a186aSmrg    netbsd*)
5188a31a186aSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5189a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5190a31a186aSmrg	wlarc=
5191a31a186aSmrg      else
5192493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5193493f84f4Smrg	_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'
5194a31a186aSmrg      fi
5195a31a186aSmrg      ;;
5196fe5e51b7Smrg
5197a31a186aSmrg    solaris*)
5198a31a186aSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5199a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5200a31a186aSmrg	cat <<_LT_EOF 1>&2
5201fe5e51b7Smrg
5202a31a186aSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5203a31a186aSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5204a31a186aSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5205a31a186aSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5206a31a186aSmrg*** your PATH or compiler configuration so that the native linker is
5207a31a186aSmrg*** used, and then restart.
5208fe5e51b7Smrg
5209a31a186aSmrg_LT_EOF
5210a31a186aSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5211493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5212493f84f4Smrg	_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'
5213a31a186aSmrg      else
5214a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5215a31a186aSmrg      fi
5216a31a186aSmrg      ;;
5217fe5e51b7Smrg
5218a31a186aSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5219a31a186aSmrg      case `$LD -v 2>&1` in
5220a31a186aSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5221a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5222a31a186aSmrg	cat <<_LT_EOF 1>&2
5223fe5e51b7Smrg
5224493f84f4Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5225a31a186aSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5226a31a186aSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5227a31a186aSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5228a31a186aSmrg*** your PATH or compiler configuration so that the native linker is
5229a31a186aSmrg*** used, and then restart.
5230fe5e51b7Smrg
5231a31a186aSmrg_LT_EOF
5232a31a186aSmrg	;;
5233a31a186aSmrg	*)
5234a31a186aSmrg	  # For security reasons, it is highly recommended that you always
5235a31a186aSmrg	  # use absolute paths for naming shared libraries, and exclude the
5236a31a186aSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5237a31a186aSmrg	  # requires that you compile everything twice, which is a pain.
5238a31a186aSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5239493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5240493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5241493f84f4Smrg	    _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'
5242a31a186aSmrg	  else
5243a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5244a31a186aSmrg	  fi
5245a31a186aSmrg	;;
5246a31a186aSmrg      esac
5247a31a186aSmrg      ;;
5248fe5e51b7Smrg
5249a31a186aSmrg    sunos4*)
5250a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5251a31a186aSmrg      wlarc=
5252a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5253a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5254a31a186aSmrg      ;;
5255fe5e51b7Smrg
5256a31a186aSmrg    *)
5257a31a186aSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5258493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5259493f84f4Smrg	_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'
5260a31a186aSmrg      else
5261a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5262a31a186aSmrg      fi
5263a31a186aSmrg      ;;
5264a31a186aSmrg    esac
5265fe5e51b7Smrg
5266493f84f4Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5267a31a186aSmrg      runpath_var=
5268a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5269a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5270a31a186aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5271a31a186aSmrg    fi
5272a31a186aSmrg  else
5273a31a186aSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5274a31a186aSmrg    case $host_os in
5275a31a186aSmrg    aix3*)
5276a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5277a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5278a31a186aSmrg      _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'
5279a31a186aSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5280a31a186aSmrg      # are no directories specified by -L.
5281a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5282493f84f4Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5283a31a186aSmrg	# Neither direct hardcoding nor static linking is supported with a
5284a31a186aSmrg	# broken collect2.
5285a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5286a31a186aSmrg      fi
5287a31a186aSmrg      ;;
5288fe5e51b7Smrg
5289a31a186aSmrg    aix[[4-9]]*)
5290493f84f4Smrg      if test ia64 = "$host_cpu"; then
5291a31a186aSmrg	# On IA64, the linker does run time linking by default, so we don't
5292a31a186aSmrg	# have to do anything special.
5293a31a186aSmrg	aix_use_runtimelinking=no
5294a31a186aSmrg	exp_sym_flag='-Bexport'
5295493f84f4Smrg	no_entry_flag=
5296a31a186aSmrg      else
5297a31a186aSmrg	# If we're using GNU nm, then we don't want the "-C" option.
5298493f84f4Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5299493f84f4Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5300493f84f4Smrg	# weak defined symbols like other global defined symbols, whereas
5301493f84f4Smrg	# GNU nm marks them as "W".
5302493f84f4Smrg	# While the 'weak' keyword is ignored in the Export File, we need
5303493f84f4Smrg	# it in the Import File for the 'aix-soname' feature, so we have
5304493f84f4Smrg	# to replace the "-B" option with "-P" for AIX nm.
5305a31a186aSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5306493f84f4Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
5307a31a186aSmrg	else
5308493f84f4Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
5309a31a186aSmrg	fi
5310a31a186aSmrg	aix_use_runtimelinking=no
5311fe5e51b7Smrg
5312a31a186aSmrg	# Test if we are trying to use run time linking or normal
5313a31a186aSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5314493f84f4Smrg	# have runtime linking enabled, and use it for executables.
5315493f84f4Smrg	# For shared libraries, we enable/disable runtime linking
5316493f84f4Smrg	# depending on the kind of the shared library created -
5317493f84f4Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5318493f84f4Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5319493f84f4Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5320493f84f4Smrg	#            lib.a           static archive
5321493f84f4Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5322493f84f4Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5323493f84f4Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5324493f84f4Smrg	#            lib.a(lib.so.V) shared, rtl:no
5325493f84f4Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5326493f84f4Smrg	#            lib.a           static archive
5327a31a186aSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5328a31a186aSmrg	  for ld_flag in $LDFLAGS; do
5329493f84f4Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5330a31a186aSmrg	    aix_use_runtimelinking=yes
5331a31a186aSmrg	    break
5332a31a186aSmrg	  fi
5333a31a186aSmrg	  done
5334493f84f4Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5335493f84f4Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5336493f84f4Smrg	    # so we don't have lib.a shared libs to link our executables.
5337493f84f4Smrg	    # We have to force runtime linking in this case.
5338493f84f4Smrg	    aix_use_runtimelinking=yes
5339493f84f4Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5340493f84f4Smrg	  fi
5341a31a186aSmrg	  ;;
5342a31a186aSmrg	esac
5343fe5e51b7Smrg
5344a31a186aSmrg	exp_sym_flag='-bexport'
5345a31a186aSmrg	no_entry_flag='-bnoentry'
5346a31a186aSmrg      fi
5347fe5e51b7Smrg
5348a31a186aSmrg      # When large executables or shared objects are built, AIX ld can
5349a31a186aSmrg      # have problems creating the table of contents.  If linking a library
5350a31a186aSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
5351a31a186aSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5352a31a186aSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5353a31a186aSmrg
5354a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)=''
5355a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5356a31a186aSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5357a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5358a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5359493f84f4Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5360493f84f4Smrg      case $with_aix_soname,$aix_use_runtimelinking in
5361493f84f4Smrg      aix,*) ;; # traditional, no import file
5362493f84f4Smrg      svr4,* | *,yes) # use import file
5363493f84f4Smrg	# The Import File defines what to hardcode.
5364493f84f4Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5365493f84f4Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5366493f84f4Smrg	;;
5367493f84f4Smrg      esac
5368fe5e51b7Smrg
5369493f84f4Smrg      if test yes = "$GCC"; then
5370a31a186aSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5371a31a186aSmrg	# We only want to do this on AIX 4.2 and lower, the check
5372a31a186aSmrg	# below for broken collect2 doesn't work under 4.3+
5373493f84f4Smrg	  collect2name=`$CC -print-prog-name=collect2`
5374a31a186aSmrg	  if test -f "$collect2name" &&
5375a31a186aSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5376a31a186aSmrg	  then
5377a31a186aSmrg	  # We have reworked collect2
5378a31a186aSmrg	  :
5379a31a186aSmrg	  else
5380a31a186aSmrg	  # We have old collect2
5381a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5382a31a186aSmrg	  # It fails to find uninstalled libraries when the uninstalled
5383a31a186aSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5384a31a186aSmrg	  # to unsupported forces relinking
5385a31a186aSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5386a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5387a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5388a31a186aSmrg	  fi
5389a31a186aSmrg	  ;;
5390a31a186aSmrg	esac
5391a31a186aSmrg	shared_flag='-shared'
5392493f84f4Smrg	if test yes = "$aix_use_runtimelinking"; then
5393493f84f4Smrg	  shared_flag="$shared_flag "'$wl-G'
5394a31a186aSmrg	fi
5395493f84f4Smrg	# Need to ensure runtime linking is disabled for the traditional
5396493f84f4Smrg	# shared library, or the linker may eventually find shared libraries
5397493f84f4Smrg	# /with/ Import File - we do not want to mix them.
5398493f84f4Smrg	shared_flag_aix='-shared'
5399493f84f4Smrg	shared_flag_svr4='-shared $wl-G'
5400a31a186aSmrg      else
5401a31a186aSmrg	# not using gcc
5402493f84f4Smrg	if test ia64 = "$host_cpu"; then
5403a31a186aSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5404a31a186aSmrg	# chokes on -Wl,-G. The following line is correct:
5405a31a186aSmrg	  shared_flag='-G'
5406a31a186aSmrg	else
5407493f84f4Smrg	  if test yes = "$aix_use_runtimelinking"; then
5408493f84f4Smrg	    shared_flag='$wl-G'
5409a31a186aSmrg	  else
5410493f84f4Smrg	    shared_flag='$wl-bM:SRE'
5411a31a186aSmrg	  fi
5412493f84f4Smrg	  shared_flag_aix='$wl-bM:SRE'
5413493f84f4Smrg	  shared_flag_svr4='$wl-G'
5414a31a186aSmrg	fi
5415a31a186aSmrg      fi
5416fe5e51b7Smrg
5417493f84f4Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5418a31a186aSmrg      # It seems that -bexpall does not export symbols beginning with
5419a31a186aSmrg      # underscore (_), so it is better to generate a list of symbols to export.
5420a31a186aSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5421493f84f4Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5422a31a186aSmrg	# Warning - without using the other runtime loading flags (-brtl),
5423a31a186aSmrg	# -berok will link without error, but may produce a broken library.
5424a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5425a31a186aSmrg        # Determine the default libpath from the value encoded in an
5426a31a186aSmrg        # empty executable.
54270bb88ba4Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5428493f84f4Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5429493f84f4Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
5430a31a186aSmrg      else
5431493f84f4Smrg	if test ia64 = "$host_cpu"; then
5432493f84f4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5433a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5434493f84f4Smrg	  _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"
5435a31a186aSmrg	else
5436a31a186aSmrg	 # Determine the default libpath from the value encoded in an
5437a31a186aSmrg	 # empty executable.
54380bb88ba4Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5439493f84f4Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5440a31a186aSmrg	  # Warning - without using the other run time loading flags,
5441a31a186aSmrg	  # -berok will link without error, but may produce a broken library.
5442493f84f4Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5443493f84f4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5444493f84f4Smrg	  if test yes = "$with_gnu_ld"; then
54450bb88ba4Smrg	    # We only use this code for GNU lds that support --whole-archive.
5446493f84f4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
54470bb88ba4Smrg	  else
54480bb88ba4Smrg	    # Exported symbols can be pulled into shared objects from archives
54490bb88ba4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
54500bb88ba4Smrg	  fi
5451a31a186aSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5452493f84f4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5453493f84f4Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5454493f84f4Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5455493f84f4Smrg	  if test svr4 != "$with_aix_soname"; then
5456493f84f4Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
5457493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
5458493f84f4Smrg	  fi
5459493f84f4Smrg	  if test aix != "$with_aix_soname"; then
5460493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
5461493f84f4Smrg	  else
5462493f84f4Smrg	    # used by -dlpreopen to get the symbols
5463493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5464493f84f4Smrg	  fi
5465493f84f4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5466a31a186aSmrg	fi
5467a31a186aSmrg      fi
5468a31a186aSmrg      ;;
5469fe5e51b7Smrg
5470a31a186aSmrg    amigaos*)
5471a31a186aSmrg      case $host_cpu in
5472a31a186aSmrg      powerpc)
5473a31a186aSmrg            # see comment about AmigaOS4 .so support
5474493f84f4Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5475a31a186aSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5476a31a186aSmrg        ;;
5477a31a186aSmrg      m68k)
5478a31a186aSmrg            _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)'
5479a31a186aSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5480a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5481a31a186aSmrg        ;;
5482a31a186aSmrg      esac
5483a31a186aSmrg      ;;
5484fe5e51b7Smrg
5485a31a186aSmrg    bsdi[[45]]*)
5486a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5487a31a186aSmrg      ;;
5488fe5e51b7Smrg
5489a31a186aSmrg    cygwin* | mingw* | pw32* | cegcc*)
5490a31a186aSmrg      # When not using gcc, we currently assume that we are using
5491a31a186aSmrg      # Microsoft Visual C++.
5492a31a186aSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5493a31a186aSmrg      # no search path for DLLs.
54940bb88ba4Smrg      case $cc_basename in
54950bb88ba4Smrg      cl*)
54960bb88ba4Smrg	# Native MSVC
54970bb88ba4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
54980bb88ba4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
54990bb88ba4Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
55000bb88ba4Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
55010bb88ba4Smrg	# Tell ltmain to make .lib files, not .a files.
55020bb88ba4Smrg	libext=lib
55030bb88ba4Smrg	# Tell ltmain to make .dll files, not .so files.
5504493f84f4Smrg	shrext_cmds=.dll
55050bb88ba4Smrg	# FIXME: Setting linknames here is a bad hack.
5506493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5507493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5508493f84f4Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
5509493f84f4Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5510493f84f4Smrg          else
5511493f84f4Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5512493f84f4Smrg          fi~
5513493f84f4Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5514493f84f4Smrg          linknames='
55150bb88ba4Smrg	# The linker will not automatically build a static lib if we build a DLL.
55160bb88ba4Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
55170bb88ba4Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
55180bb88ba4Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
55190bb88ba4Smrg	_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'
55200bb88ba4Smrg	# Don't use ranlib
55210bb88ba4Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
55220bb88ba4Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5523493f84f4Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5524493f84f4Smrg          case $lt_outputfile in
5525493f84f4Smrg            *.exe|*.EXE) ;;
5526493f84f4Smrg            *)
5527493f84f4Smrg              lt_outputfile=$lt_outputfile.exe
5528493f84f4Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5529493f84f4Smrg              ;;
5530493f84f4Smrg          esac~
5531493f84f4Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5532493f84f4Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5533493f84f4Smrg            $RM "$lt_outputfile.manifest";
5534493f84f4Smrg          fi'
55350bb88ba4Smrg	;;
55360bb88ba4Smrg      *)
55370bb88ba4Smrg	# Assume MSVC wrapper
55380bb88ba4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
55390bb88ba4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
55400bb88ba4Smrg	# Tell ltmain to make .lib files, not .a files.
55410bb88ba4Smrg	libext=lib
55420bb88ba4Smrg	# Tell ltmain to make .dll files, not .so files.
5543493f84f4Smrg	shrext_cmds=.dll
55440bb88ba4Smrg	# FIXME: Setting linknames here is a bad hack.
55450bb88ba4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
55460bb88ba4Smrg	# The linker will automatically build a .lib file if we build a DLL.
55470bb88ba4Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
55480bb88ba4Smrg	# FIXME: Should let the user specify the lib program.
55490bb88ba4Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
55500bb88ba4Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
55510bb88ba4Smrg	;;
55520bb88ba4Smrg      esac
5553a31a186aSmrg      ;;
5554fe5e51b7Smrg
5555a31a186aSmrg    darwin* | rhapsody*)
5556a31a186aSmrg      _LT_DARWIN_LINKER_FEATURES($1)
5557a31a186aSmrg      ;;
5558fe5e51b7Smrg
5559a31a186aSmrg    dgux*)
5560a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5561a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5562a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5563a31a186aSmrg      ;;
5564fe5e51b7Smrg
5565a31a186aSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5566a31a186aSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5567a31a186aSmrg    # does not break anything, and helps significantly (at the cost of a little
5568a31a186aSmrg    # extra space).
5569a31a186aSmrg    freebsd2.2*)
5570a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5571a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5572a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5573a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5574a31a186aSmrg      ;;
5575fe5e51b7Smrg
5576a31a186aSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
55770bb88ba4Smrg    freebsd2.*)
5578a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5579a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5580a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5581a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5582a31a186aSmrg      ;;
5583fe5e51b7Smrg
5584a31a186aSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5585a31a186aSmrg    freebsd* | dragonfly*)
55860bb88ba4Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5587a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5588a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5589a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5590a31a186aSmrg      ;;
5591fe5e51b7Smrg
5592a31a186aSmrg    hpux9*)
5593493f84f4Smrg      if test yes = "$GCC"; then
5594493f84f4Smrg	_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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5595a31a186aSmrg      else
5596493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
5597a31a186aSmrg      fi
5598493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5599a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5600a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5601fe5e51b7Smrg
5602a31a186aSmrg      # hardcode_minus_L: Not really in the search PATH,
5603a31a186aSmrg      # but as the default location of the library.
5604a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5605493f84f4Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5606a31a186aSmrg      ;;
5607fe5e51b7Smrg
5608a31a186aSmrg    hpux10*)
5609493f84f4Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5610493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5611a31a186aSmrg      else
5612a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5613a31a186aSmrg      fi
5614493f84f4Smrg      if test no = "$with_gnu_ld"; then
5615493f84f4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5616a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5617a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5618a31a186aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5619493f84f4Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5620a31a186aSmrg	# hardcode_minus_L: Not really in the search PATH,
5621a31a186aSmrg	# but as the default location of the library.
5622a31a186aSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5623a31a186aSmrg      fi
5624a31a186aSmrg      ;;
5625fe5e51b7Smrg
5626a31a186aSmrg    hpux11*)
5627493f84f4Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5628a31a186aSmrg	case $host_cpu in
5629a31a186aSmrg	hppa*64*)
5630493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5631a31a186aSmrg	  ;;
5632a31a186aSmrg	ia64*)
5633493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5634a31a186aSmrg	  ;;
5635a31a186aSmrg	*)
5636493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5637a31a186aSmrg	  ;;
5638a31a186aSmrg	esac
5639a31a186aSmrg      else
5640a31a186aSmrg	case $host_cpu in
5641a31a186aSmrg	hppa*64*)
5642493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5643a31a186aSmrg	  ;;
5644a31a186aSmrg	ia64*)
5645493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5646a31a186aSmrg	  ;;
5647a31a186aSmrg	*)
56480bb88ba4Smrg	m4_if($1, [], [
56490bb88ba4Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
56500bb88ba4Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
56510bb88ba4Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
56520bb88ba4Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5653493f84f4Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
56540bb88ba4Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5655493f84f4Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5656a31a186aSmrg	  ;;
5657a31a186aSmrg	esac
5658a31a186aSmrg      fi
5659493f84f4Smrg      if test no = "$with_gnu_ld"; then
5660493f84f4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5661a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5662fe5e51b7Smrg
5663a31a186aSmrg	case $host_cpu in
5664a31a186aSmrg	hppa*64*|ia64*)
5665a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5666a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5667a31a186aSmrg	  ;;
5668a31a186aSmrg	*)
5669a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5670a31a186aSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5671493f84f4Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5672fe5e51b7Smrg
5673a31a186aSmrg	  # hardcode_minus_L: Not really in the search PATH,
5674a31a186aSmrg	  # but as the default location of the library.
5675a31a186aSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5676a31a186aSmrg	  ;;
5677a31a186aSmrg	esac
5678a31a186aSmrg      fi
5679eda3803bSmrg      ;;
5680a31a186aSmrg
5681a31a186aSmrg    irix5* | irix6* | nonstopux*)
5682493f84f4Smrg      if test yes = "$GCC"; then
5683493f84f4Smrg	_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'
5684a31a186aSmrg	# Try to use the -exported_symbol ld option, if it does not
5685a31a186aSmrg	# work, assume that -exports_file does not work either and
5686a31a186aSmrg	# implicitly export all symbols.
56870bb88ba4Smrg	# This should be the same for all languages, so no per-tag cache variable.
56880bb88ba4Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
56890bb88ba4Smrg	  [lt_cv_irix_exported_symbol],
5690493f84f4Smrg	  [save_LDFLAGS=$LDFLAGS
5691493f84f4Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
56920bb88ba4Smrg	   AC_LINK_IFELSE(
56930bb88ba4Smrg	     [AC_LANG_SOURCE(
56940bb88ba4Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
56950bb88ba4Smrg			      [C++], [[int foo (void) { return 0; }]],
56960bb88ba4Smrg			      [Fortran 77], [[
56970bb88ba4Smrg      subroutine foo
56980bb88ba4Smrg      end]],
56990bb88ba4Smrg			      [Fortran], [[
57000bb88ba4Smrg      subroutine foo
57010bb88ba4Smrg      end]])])],
57020bb88ba4Smrg	      [lt_cv_irix_exported_symbol=yes],
57030bb88ba4Smrg	      [lt_cv_irix_exported_symbol=no])
5704493f84f4Smrg           LDFLAGS=$save_LDFLAGS])
5705493f84f4Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5706493f84f4Smrg          _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'
57070bb88ba4Smrg	fi
5708a31a186aSmrg      else
5709493f84f4Smrg	_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'
5710493f84f4Smrg	_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'
5711a31a186aSmrg      fi
5712a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5713493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5714a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5715a31a186aSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5716a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5717fe5e51b7Smrg      ;;
5718eda3803bSmrg
5719493f84f4Smrg    linux*)
5720493f84f4Smrg      case $cc_basename in
5721493f84f4Smrg      tcc*)
5722493f84f4Smrg	# Fabrice Bellard et al's Tiny C Compiler
5723493f84f4Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5724493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5725493f84f4Smrg	;;
5726493f84f4Smrg      esac
5727493f84f4Smrg      ;;
5728493f84f4Smrg
5729a31a186aSmrg    netbsd*)
5730a31a186aSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5731a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5732a31a186aSmrg      else
5733a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5734a31a186aSmrg      fi
5735a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5736a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5737a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5738a31a186aSmrg      ;;
5739fe5e51b7Smrg
5740a31a186aSmrg    newsos6)
5741a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5742a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5743493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5744a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5745a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5746a31a186aSmrg      ;;
5747fe5e51b7Smrg
5748a31a186aSmrg    *nto* | *qnx*)
5749a31a186aSmrg      ;;
5750fe5e51b7Smrg
5751493f84f4Smrg    openbsd* | bitrig*)
5752a31a186aSmrg      if test -f /usr/libexec/ld.so; then
5753a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5754a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5755a31a186aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5756493f84f4Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5757a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5758493f84f4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5759493f84f4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5760493f84f4Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5761a31a186aSmrg	else
5762493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5763493f84f4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5764a31a186aSmrg	fi
5765a31a186aSmrg      else
5766a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5767a31a186aSmrg      fi
5768a31a186aSmrg      ;;
5769fe5e51b7Smrg
5770a31a186aSmrg    os2*)
5771a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5772a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5773a31a186aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5774493f84f4Smrg      shrext_cmds=.dll
5775493f84f4Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5776493f84f4Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5777493f84f4Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5778493f84f4Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5779493f84f4Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5780493f84f4Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5781493f84f4Smrg	emximp -o $lib $output_objdir/$libname.def'
5782493f84f4Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5783493f84f4Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5784493f84f4Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5785493f84f4Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5786493f84f4Smrg	prefix_cmds="$SED"~
5787493f84f4Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5788493f84f4Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5789493f84f4Smrg	fi~
5790493f84f4Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5791493f84f4Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5792493f84f4Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5793493f84f4Smrg	emximp -o $lib $output_objdir/$libname.def'
5794493f84f4Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5795493f84f4Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5796a31a186aSmrg      ;;
5797fe5e51b7Smrg
5798a31a186aSmrg    osf3*)
5799493f84f4Smrg      if test yes = "$GCC"; then
5800493f84f4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5801493f84f4Smrg	_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'
5802a31a186aSmrg      else
5803a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5804493f84f4Smrg	_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'
5805a31a186aSmrg      fi
5806a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5807493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5808a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5809a31a186aSmrg      ;;
5810fe5e51b7Smrg
5811a31a186aSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5812493f84f4Smrg      if test yes = "$GCC"; then
5813493f84f4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5814493f84f4Smrg	_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'
5815493f84f4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5816a31a186aSmrg      else
5817a31a186aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5818493f84f4Smrg	_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'
5819a31a186aSmrg	_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~
5820493f84f4Smrg          $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'
5821fe5e51b7Smrg
5822a31a186aSmrg	# Both c and cxx compiler support -rpath directly
5823a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5824a31a186aSmrg      fi
5825a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5826a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5827a31a186aSmrg      ;;
5828fe5e51b7Smrg
5829a31a186aSmrg    solaris*)
5830a31a186aSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5831493f84f4Smrg      if test yes = "$GCC"; then
5832493f84f4Smrg	wlarc='$wl'
5833493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5834a31a186aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5835493f84f4Smrg          $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'
5836a31a186aSmrg      else
5837a31a186aSmrg	case `$CC -V 2>&1` in
5838a31a186aSmrg	*"Compilers 5.0"*)
5839a31a186aSmrg	  wlarc=''
5840493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5841a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5842493f84f4Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5843a31a186aSmrg	  ;;
5844a31a186aSmrg	*)
5845493f84f4Smrg	  wlarc='$wl'
5846493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5847a31a186aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5848493f84f4Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5849a31a186aSmrg	  ;;
5850a31a186aSmrg	esac
5851a31a186aSmrg      fi
5852a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5853a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5854a31a186aSmrg      case $host_os in
5855a31a186aSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5856a31a186aSmrg      *)
5857a31a186aSmrg	# The compiler driver will combine and reorder linker options,
5858493f84f4Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5859a31a186aSmrg	# but is careful enough not to reorder.
5860a31a186aSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5861493f84f4Smrg	if test yes = "$GCC"; then
5862493f84f4Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5863a31a186aSmrg	else
5864a31a186aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5865a31a186aSmrg	fi
5866a31a186aSmrg	;;
5867a31a186aSmrg      esac
5868a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5869a31a186aSmrg      ;;
5870fe5e51b7Smrg
5871a31a186aSmrg    sunos4*)
5872493f84f4Smrg      if test sequent = "$host_vendor"; then
5873a31a186aSmrg	# Use $CC to link under sequent, because it throws in some extra .o
5874a31a186aSmrg	# files that make .init and .fini sections work.
5875493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5876a31a186aSmrg      else
5877a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5878a31a186aSmrg      fi
5879a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5880a31a186aSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5881a31a186aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5882a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5883a31a186aSmrg      ;;
5884fe5e51b7Smrg
5885a31a186aSmrg    sysv4)
5886a31a186aSmrg      case $host_vendor in
5887a31a186aSmrg	sni)
5888a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5889a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5890a31a186aSmrg	;;
5891a31a186aSmrg	siemens)
5892a31a186aSmrg	  ## LD is ld it makes a PLAMLIB
5893a31a186aSmrg	  ## CC just makes a GrossModule.
5894a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5895a31a186aSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5896a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5897a31a186aSmrg        ;;
5898a31a186aSmrg	motorola)
5899a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5900a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5901a31a186aSmrg	;;
5902a31a186aSmrg      esac
5903a31a186aSmrg      runpath_var='LD_RUN_PATH'
5904a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5905a31a186aSmrg      ;;
5906fe5e51b7Smrg
5907a31a186aSmrg    sysv4.3*)
5908a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5909a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5910a31a186aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5911a31a186aSmrg      ;;
5912fe5e51b7Smrg
5913a31a186aSmrg    sysv4*MP*)
5914a31a186aSmrg      if test -d /usr/nec; then
5915a31a186aSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5916a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5917a31a186aSmrg	runpath_var=LD_RUN_PATH
5918a31a186aSmrg	hardcode_runpath_var=yes
5919a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5920a31a186aSmrg      fi
5921a31a186aSmrg      ;;
5922fe5e51b7Smrg
5923a31a186aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5924493f84f4Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
5925a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5926a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5927a31a186aSmrg      runpath_var='LD_RUN_PATH'
5928fe5e51b7Smrg
5929493f84f4Smrg      if test yes = "$GCC"; then
5930493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5931493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5932a31a186aSmrg      else
5933493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5934493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5935a31a186aSmrg      fi
5936a31a186aSmrg      ;;
5937fe5e51b7Smrg
5938a31a186aSmrg    sysv5* | sco3.2v5* | sco5v6*)
5939493f84f4Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
5940a31a186aSmrg      # link with -lc, and that would cause any symbols used from libc to
5941a31a186aSmrg      # always be unresolved, which means just about no library would
5942a31a186aSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
5943a31a186aSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
5944a31a186aSmrg      # as -z defs.
5945493f84f4Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
5946493f84f4Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
5947a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5948a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5949493f84f4Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
5950a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5951a31a186aSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5952493f84f4Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
5953a31a186aSmrg      runpath_var='LD_RUN_PATH'
5954fe5e51b7Smrg
5955493f84f4Smrg      if test yes = "$GCC"; then
5956493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5957493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5958a31a186aSmrg      else
5959493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5960493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5961a31a186aSmrg      fi
5962a31a186aSmrg      ;;
5963fe5e51b7Smrg
5964a31a186aSmrg    uts4*)
5965a31a186aSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5966a31a186aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5967a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5968a31a186aSmrg      ;;
5969fe5e51b7Smrg
5970a31a186aSmrg    *)
5971a31a186aSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
5972a31a186aSmrg      ;;
5973a31a186aSmrg    esac
5974fe5e51b7Smrg
5975493f84f4Smrg    if test sni = "$host_vendor"; then
5976a31a186aSmrg      case $host in
5977a31a186aSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5978493f84f4Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
5979a31a186aSmrg	;;
5980a31a186aSmrg      esac
5981a31a186aSmrg    fi
5982a31a186aSmrg  fi
5983a31a186aSmrg])
5984a31a186aSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5985493f84f4Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
5986fe5e51b7Smrg
5987a31a186aSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
5988fe5e51b7Smrg
5989a31a186aSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5990a31a186aSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5991a31a186aSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
5992a31a186aSmrg    [The commands to extract the exported symbol list from a shared archive])
5993fe5e51b7Smrg
5994a31a186aSmrg#
5995a31a186aSmrg# Do we need to explicitly link libc?
5996a31a186aSmrg#
5997a31a186aSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5998a31a186aSmrgx|xyes)
5999a31a186aSmrg  # Assume -lc should be added
6000a31a186aSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6001fe5e51b7Smrg
6002493f84f4Smrg  if test yes,yes = "$GCC,$enable_shared"; then
6003a31a186aSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
6004a31a186aSmrg    *'~'*)
6005a31a186aSmrg      # FIXME: we may have to deal with multi-command sequences.
6006a31a186aSmrg      ;;
6007a31a186aSmrg    '$CC '*)
6008a31a186aSmrg      # Test whether the compiler implicitly links with -lc since on some
6009a31a186aSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6010a31a186aSmrg      # to ld, don't add -lc before -lgcc.
60110bb88ba4Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
60120bb88ba4Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
60130bb88ba4Smrg	[$RM conftest*
60140bb88ba4Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
60150bb88ba4Smrg
60160bb88ba4Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
60170bb88ba4Smrg	  soname=conftest
60180bb88ba4Smrg	  lib=conftest
60190bb88ba4Smrg	  libobjs=conftest.$ac_objext
60200bb88ba4Smrg	  deplibs=
60210bb88ba4Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
60220bb88ba4Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
60230bb88ba4Smrg	  compiler_flags=-v
60240bb88ba4Smrg	  linker_flags=-v
60250bb88ba4Smrg	  verstring=
60260bb88ba4Smrg	  output_objdir=.
60270bb88ba4Smrg	  libname=conftest
60280bb88ba4Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
60290bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
60300bb88ba4Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
60310bb88ba4Smrg	  then
60320bb88ba4Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
60330bb88ba4Smrg	  else
60340bb88ba4Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
60350bb88ba4Smrg	  fi
60360bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
60370bb88ba4Smrg	else
60380bb88ba4Smrg	  cat conftest.err 1>&5
60390bb88ba4Smrg	fi
60400bb88ba4Smrg	$RM conftest*
60410bb88ba4Smrg	])
60420bb88ba4Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6043a31a186aSmrg      ;;
6044a31a186aSmrg    esac
6045a31a186aSmrg  fi
6046a31a186aSmrg  ;;
6047a31a186aSmrgesac
6048fe5e51b7Smrg
6049a31a186aSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6050a31a186aSmrg    [Whether or not to add -lc for building shared libraries])
6051a31a186aSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6052a31a186aSmrg    [enable_shared_with_static_runtimes], [0],
6053a31a186aSmrg    [Whether or not to disallow shared libs when runtime libs are static])
6054a31a186aSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6055a31a186aSmrg    [Compiler flag to allow reflexive dlopens])
6056a31a186aSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6057a31a186aSmrg    [Compiler flag to generate shared objects directly from archives])
6058a31a186aSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
6059a31a186aSmrg    [Whether the compiler copes with passing no objects directly])
6060a31a186aSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6061a31a186aSmrg    [Create an old-style archive from a shared archive])
6062a31a186aSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6063a31a186aSmrg    [Create a temporary old-style archive to link instead of a shared archive])
6064a31a186aSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6065a31a186aSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6066a31a186aSmrg_LT_TAGDECL([], [module_cmds], [2],
6067a31a186aSmrg    [Commands used to build a loadable module if different from building
6068a31a186aSmrg    a shared archive.])
6069a31a186aSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6070a31a186aSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
6071a31a186aSmrg    [Whether we are building with GNU ld or not])
6072a31a186aSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6073a31a186aSmrg    [Flag that allows shared libraries with undefined symbols to be built])
6074a31a186aSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
6075a31a186aSmrg    [Flag that enforces no undefined symbols])
6076a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6077a31a186aSmrg    [Flag to hardcode $libdir into a binary during linking.
6078a31a186aSmrg    This must work even if $libdir does not exist])
6079a31a186aSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6080a31a186aSmrg    [Whether we need a single "-rpath" flag with a separated argument])
6081a31a186aSmrg_LT_TAGDECL([], [hardcode_direct], [0],
6082493f84f4Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6083a31a186aSmrg    DIR into the resulting binary])
6084a31a186aSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6085493f84f4Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6086a31a186aSmrg    DIR into the resulting binary and the resulting library dependency is
6087493f84f4Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
6088a31a186aSmrg    library is relocated])
6089a31a186aSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6090a31a186aSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6091a31a186aSmrg    into the resulting binary])
6092a31a186aSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6093a31a186aSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6094a31a186aSmrg    into the resulting binary])
6095a31a186aSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
6096a31a186aSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6097a31a186aSmrg    into the library and all subsequent libraries and executables linked
6098a31a186aSmrg    against it])
6099a31a186aSmrg_LT_TAGDECL([], [inherit_rpath], [0],
6100a31a186aSmrg    [Set to yes if linker adds runtime paths of dependent libraries
6101a31a186aSmrg    to runtime path list])
6102a31a186aSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
6103a31a186aSmrg    [Whether libtool must link a program against all its dependency libraries])
6104a31a186aSmrg_LT_TAGDECL([], [always_export_symbols], [0],
6105a31a186aSmrg    [Set to "yes" if exported symbols are required])
6106a31a186aSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6107a31a186aSmrg    [The commands to list exported symbols])
6108a31a186aSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
6109a31a186aSmrg    [Symbols that should not be listed in the preloaded symbols])
6110a31a186aSmrg_LT_TAGDECL([], [include_expsyms], [1],
6111a31a186aSmrg    [Symbols that must always be exported])
6112a31a186aSmrg_LT_TAGDECL([], [prelink_cmds], [2],
6113a31a186aSmrg    [Commands necessary for linking programs (against libraries) with templates])
61140bb88ba4Smrg_LT_TAGDECL([], [postlink_cmds], [2],
61150bb88ba4Smrg    [Commands necessary for finishing linking programs])
6116a31a186aSmrg_LT_TAGDECL([], [file_list_spec], [1],
6117a31a186aSmrg    [Specify filename containing input files])
6118a31a186aSmrgdnl FIXME: Not yet implemented
6119a31a186aSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6120a31a186aSmrgdnl    [Compiler flag to generate thread safe objects])
6121a31a186aSmrg])# _LT_LINKER_SHLIBS
6122a31a186aSmrg
6123a31a186aSmrg
6124a31a186aSmrg# _LT_LANG_C_CONFIG([TAG])
6125a31a186aSmrg# ------------------------
6126a31a186aSmrg# Ensure that the configuration variables for a C compiler are suitably
6127a31a186aSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6128493f84f4Smrg# the compiler configuration to 'libtool'.
6129a31a186aSmrgm4_defun([_LT_LANG_C_CONFIG],
6130a31a186aSmrg[m4_require([_LT_DECL_EGREP])dnl
6131493f84f4Smrglt_save_CC=$CC
6132a31a186aSmrgAC_LANG_PUSH(C)
6133fe5e51b7Smrg
6134a31a186aSmrg# Source file extension for C test sources.
6135a31a186aSmrgac_ext=c
6136fe5e51b7Smrg
6137a31a186aSmrg# Object file extension for compiled C test sources.
6138a31a186aSmrgobjext=o
6139a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
6140fe5e51b7Smrg
6141a31a186aSmrg# Code to be used in simple compile tests
6142a31a186aSmrglt_simple_compile_test_code="int some_variable = 0;"
6143fe5e51b7Smrg
6144a31a186aSmrg# Code to be used in simple link tests
6145a31a186aSmrglt_simple_link_test_code='int main(){return(0);}'
6146fe5e51b7Smrg
6147a31a186aSmrg_LT_TAG_COMPILER
6148a31a186aSmrg# Save the default compiler, since it gets overwritten when the other
6149a31a186aSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6150a31a186aSmrgcompiler_DEFAULT=$CC
6151fe5e51b7Smrg
6152a31a186aSmrg# save warnings/boilerplate of simple test code
6153a31a186aSmrg_LT_COMPILER_BOILERPLATE
6154a31a186aSmrg_LT_LINKER_BOILERPLATE
6155fe5e51b7Smrg
6156a31a186aSmrgif test -n "$compiler"; then
6157a31a186aSmrg  _LT_COMPILER_NO_RTTI($1)
6158a31a186aSmrg  _LT_COMPILER_PIC($1)
6159a31a186aSmrg  _LT_COMPILER_C_O($1)
6160a31a186aSmrg  _LT_COMPILER_FILE_LOCKS($1)
6161a31a186aSmrg  _LT_LINKER_SHLIBS($1)
6162a31a186aSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6163a31a186aSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6164a31a186aSmrg  LT_SYS_DLOPEN_SELF
6165a31a186aSmrg  _LT_CMD_STRIPLIB
6166a31a186aSmrg
6167493f84f4Smrg  # Report what library types will actually be built
6168a31a186aSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6169a31a186aSmrg  AC_MSG_RESULT([$can_build_shared])
6170a31a186aSmrg
6171a31a186aSmrg  AC_MSG_CHECKING([whether to build shared libraries])
6172493f84f4Smrg  test no = "$can_build_shared" && enable_shared=no
6173a31a186aSmrg
6174a31a186aSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6175a31a186aSmrg  # are all built from PIC.
6176a31a186aSmrg  case $host_os in
6177a31a186aSmrg  aix3*)
6178493f84f4Smrg    test yes = "$enable_shared" && enable_static=no
6179a31a186aSmrg    if test -n "$RANLIB"; then
6180a31a186aSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6181a31a186aSmrg      postinstall_cmds='$RANLIB $lib'
6182a31a186aSmrg    fi
6183a31a186aSmrg    ;;
6184fe5e51b7Smrg
6185a31a186aSmrg  aix[[4-9]]*)
6186493f84f4Smrg    if test ia64 != "$host_cpu"; then
6187493f84f4Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6188493f84f4Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
6189493f84f4Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6190493f84f4Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6191493f84f4Smrg      esac
6192a31a186aSmrg    fi
6193a31a186aSmrg    ;;
6194a31a186aSmrg  esac
6195a31a186aSmrg  AC_MSG_RESULT([$enable_shared])
6196fe5e51b7Smrg
6197a31a186aSmrg  AC_MSG_CHECKING([whether to build static libraries])
6198a31a186aSmrg  # Make sure either enable_shared or enable_static is yes.
6199493f84f4Smrg  test yes = "$enable_shared" || enable_static=yes
6200a31a186aSmrg  AC_MSG_RESULT([$enable_static])
6201fe5e51b7Smrg
6202a31a186aSmrg  _LT_CONFIG($1)
6203a31a186aSmrgfi
6204a31a186aSmrgAC_LANG_POP
6205493f84f4SmrgCC=$lt_save_CC
6206a31a186aSmrg])# _LT_LANG_C_CONFIG
6207fe5e51b7Smrg
6208fe5e51b7Smrg
6209a31a186aSmrg# _LT_LANG_CXX_CONFIG([TAG])
6210a31a186aSmrg# --------------------------
6211a31a186aSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6212a31a186aSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6213493f84f4Smrg# the compiler configuration to 'libtool'.
6214a31a186aSmrgm4_defun([_LT_LANG_CXX_CONFIG],
62150bb88ba4Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6216a31a186aSmrgm4_require([_LT_DECL_EGREP])dnl
62170bb88ba4Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6218493f84f4Smrgif test -n "$CXX" && ( test no != "$CXX" &&
6219493f84f4Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6220493f84f4Smrg    (test g++ != "$CXX"))); then
62210bb88ba4Smrg  AC_PROG_CXXCPP
62220bb88ba4Smrgelse
62230bb88ba4Smrg  _lt_caught_CXX_error=yes
62240bb88ba4Smrgfi
6225a31a186aSmrg
6226a31a186aSmrgAC_LANG_PUSH(C++)
6227a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6228a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6229a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6230a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6231a31a186aSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6232a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6233a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6234a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6235a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6236a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6237a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6238a31a186aSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6239a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6240a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6241a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
6242a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6243a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6244a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
62450bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
62460bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6247a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6248a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6249a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6250fe5e51b7Smrg
6251a31a186aSmrg# Source file extension for C++ test sources.
6252a31a186aSmrgac_ext=cpp
6253fe5e51b7Smrg
6254a31a186aSmrg# Object file extension for compiled C++ test sources.
6255a31a186aSmrgobjext=o
6256a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
6257a31a186aSmrg
6258a31a186aSmrg# No sense in running all these tests if we already determined that
6259a31a186aSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6260a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
6261a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
6262493f84f4Smrgif test yes != "$_lt_caught_CXX_error"; then
6263a31a186aSmrg  # Code to be used in simple compile tests
6264a31a186aSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6265a31a186aSmrg
6266a31a186aSmrg  # Code to be used in simple link tests
6267a31a186aSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6268a31a186aSmrg
6269a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6270a31a186aSmrg  _LT_TAG_COMPILER
6271a31a186aSmrg
6272a31a186aSmrg  # save warnings/boilerplate of simple test code
6273a31a186aSmrg  _LT_COMPILER_BOILERPLATE
6274a31a186aSmrg  _LT_LINKER_BOILERPLATE
6275a31a186aSmrg
6276a31a186aSmrg  # Allow CC to be a program name with arguments.
6277a31a186aSmrg  lt_save_CC=$CC
62780bb88ba4Smrg  lt_save_CFLAGS=$CFLAGS
6279a31a186aSmrg  lt_save_LD=$LD
6280a31a186aSmrg  lt_save_GCC=$GCC
6281a31a186aSmrg  GCC=$GXX
6282a31a186aSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6283a31a186aSmrg  lt_save_path_LD=$lt_cv_path_LD
6284a31a186aSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6285a31a186aSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6286a31a186aSmrg  else
6287a31a186aSmrg    $as_unset lt_cv_prog_gnu_ld
6288a31a186aSmrg  fi
6289a31a186aSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6290a31a186aSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6291a31a186aSmrg  else
6292a31a186aSmrg    $as_unset lt_cv_path_LD
6293a31a186aSmrg  fi
6294a31a186aSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6295a31a186aSmrg  CC=${CXX-"c++"}
62960bb88ba4Smrg  CFLAGS=$CXXFLAGS
6297a31a186aSmrg  compiler=$CC
6298a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
6299a31a186aSmrg  _LT_CC_BASENAME([$compiler])
6300fe5e51b7Smrg
6301a31a186aSmrg  if test -n "$compiler"; then
6302a31a186aSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6303a31a186aSmrg    # no_builtin_flag separately
6304493f84f4Smrg    if test yes = "$GXX"; then
6305a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6306a31a186aSmrg    else
6307a31a186aSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6308a31a186aSmrg    fi
6309fe5e51b7Smrg
6310493f84f4Smrg    if test yes = "$GXX"; then
6311a31a186aSmrg      # Set up default GNU C++ configuration
6312fe5e51b7Smrg
6313a31a186aSmrg      LT_PATH_LD
6314fe5e51b7Smrg
6315a31a186aSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6316a31a186aSmrg      # archiving commands below assume that GNU ld is being used.
6317493f84f4Smrg      if test yes = "$with_gnu_ld"; then
6318493f84f4Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6319493f84f4Smrg        _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'
6320fe5e51b7Smrg
6321493f84f4Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6322493f84f4Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6323fe5e51b7Smrg
6324a31a186aSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6325a31a186aSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6326a31a186aSmrg        #     investigate it a little bit more. (MM)
6327493f84f4Smrg        wlarc='$wl'
6328fe5e51b7Smrg
6329a31a186aSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6330a31a186aSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6331a31a186aSmrg	  $GREP 'no-whole-archive' > /dev/null; then
6332493f84f4Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6333a31a186aSmrg        else
6334a31a186aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6335a31a186aSmrg        fi
6336a31a186aSmrg      else
6337a31a186aSmrg        with_gnu_ld=no
6338a31a186aSmrg        wlarc=
6339a31a186aSmrg
6340a31a186aSmrg        # A generic and very simple default shared library creation
6341a31a186aSmrg        # command for GNU C++ for the case where it uses the native
6342a31a186aSmrg        # linker, instead of GNU ld.  If possible, this setting should
6343a31a186aSmrg        # overridden to take advantage of the native linker features on
6344a31a186aSmrg        # the platform it is being used on.
6345a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6346a31a186aSmrg      fi
6347fe5e51b7Smrg
6348a31a186aSmrg      # Commands to make compiler produce verbose output that lists
6349a31a186aSmrg      # what "hidden" libraries, object files and flags are used when
6350a31a186aSmrg      # linking a shared library.
63510bb88ba4Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6352fe5e51b7Smrg
6353a31a186aSmrg    else
6354a31a186aSmrg      GXX=no
6355a31a186aSmrg      with_gnu_ld=no
6356a31a186aSmrg      wlarc=
6357a31a186aSmrg    fi
6358fe5e51b7Smrg
6359a31a186aSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6360a31a186aSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6361a31a186aSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6362a31a186aSmrg    case $host_os in
6363a31a186aSmrg      aix3*)
6364a31a186aSmrg        # FIXME: insert proper C++ library support
6365a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6366a31a186aSmrg        ;;
6367a31a186aSmrg      aix[[4-9]]*)
6368493f84f4Smrg        if test ia64 = "$host_cpu"; then
6369a31a186aSmrg          # On IA64, the linker does run time linking by default, so we don't
6370a31a186aSmrg          # have to do anything special.
6371a31a186aSmrg          aix_use_runtimelinking=no
6372a31a186aSmrg          exp_sym_flag='-Bexport'
6373493f84f4Smrg          no_entry_flag=
6374a31a186aSmrg        else
6375a31a186aSmrg          aix_use_runtimelinking=no
6376a31a186aSmrg
6377a31a186aSmrg          # Test if we are trying to use run time linking or normal
6378a31a186aSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6379493f84f4Smrg          # have runtime linking enabled, and use it for executables.
6380493f84f4Smrg          # For shared libraries, we enable/disable runtime linking
6381493f84f4Smrg          # depending on the kind of the shared library created -
6382493f84f4Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6383493f84f4Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6384493f84f4Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6385493f84f4Smrg          #            lib.a           static archive
6386493f84f4Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6387493f84f4Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6388493f84f4Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6389493f84f4Smrg          #            lib.a(lib.so.V) shared, rtl:no
6390493f84f4Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6391493f84f4Smrg          #            lib.a           static archive
6392a31a186aSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6393a31a186aSmrg	    for ld_flag in $LDFLAGS; do
6394a31a186aSmrg	      case $ld_flag in
6395a31a186aSmrg	      *-brtl*)
6396a31a186aSmrg	        aix_use_runtimelinking=yes
6397a31a186aSmrg	        break
6398a31a186aSmrg	        ;;
6399a31a186aSmrg	      esac
6400a31a186aSmrg	    done
6401493f84f4Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6402493f84f4Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6403493f84f4Smrg	      # so we don't have lib.a shared libs to link our executables.
6404493f84f4Smrg	      # We have to force runtime linking in this case.
6405493f84f4Smrg	      aix_use_runtimelinking=yes
6406493f84f4Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6407493f84f4Smrg	    fi
6408a31a186aSmrg	    ;;
6409a31a186aSmrg          esac
6410fe5e51b7Smrg
6411a31a186aSmrg          exp_sym_flag='-bexport'
6412a31a186aSmrg          no_entry_flag='-bnoentry'
6413a31a186aSmrg        fi
6414fe5e51b7Smrg
6415a31a186aSmrg        # When large executables or shared objects are built, AIX ld can
6416a31a186aSmrg        # have problems creating the table of contents.  If linking a library
6417a31a186aSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
6418a31a186aSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6419a31a186aSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6420a31a186aSmrg
6421a31a186aSmrg        _LT_TAGVAR(archive_cmds, $1)=''
6422a31a186aSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6423a31a186aSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6424a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6425a31a186aSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6426493f84f4Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6427493f84f4Smrg        case $with_aix_soname,$aix_use_runtimelinking in
6428493f84f4Smrg        aix,*) ;;	# no import file
6429493f84f4Smrg        svr4,* | *,yes) # use import file
6430493f84f4Smrg          # The Import File defines what to hardcode.
6431493f84f4Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
6432493f84f4Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6433493f84f4Smrg          ;;
6434493f84f4Smrg        esac
6435a31a186aSmrg
6436493f84f4Smrg        if test yes = "$GXX"; then
6437a31a186aSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6438a31a186aSmrg          # We only want to do this on AIX 4.2 and lower, the check
6439a31a186aSmrg          # below for broken collect2 doesn't work under 4.3+
6440493f84f4Smrg	  collect2name=`$CC -print-prog-name=collect2`
6441a31a186aSmrg	  if test -f "$collect2name" &&
6442a31a186aSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6443a31a186aSmrg	  then
6444a31a186aSmrg	    # We have reworked collect2
6445a31a186aSmrg	    :
6446a31a186aSmrg	  else
6447a31a186aSmrg	    # We have old collect2
6448a31a186aSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6449a31a186aSmrg	    # It fails to find uninstalled libraries when the uninstalled
6450a31a186aSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6451a31a186aSmrg	    # to unsupported forces relinking
6452a31a186aSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6453a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6454a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6455a31a186aSmrg	  fi
6456a31a186aSmrg          esac
6457a31a186aSmrg          shared_flag='-shared'
6458493f84f4Smrg	  if test yes = "$aix_use_runtimelinking"; then
6459493f84f4Smrg	    shared_flag=$shared_flag' $wl-G'
6460a31a186aSmrg	  fi
6461493f84f4Smrg	  # Need to ensure runtime linking is disabled for the traditional
6462493f84f4Smrg	  # shared library, or the linker may eventually find shared libraries
6463493f84f4Smrg	  # /with/ Import File - we do not want to mix them.
6464493f84f4Smrg	  shared_flag_aix='-shared'
6465493f84f4Smrg	  shared_flag_svr4='-shared $wl-G'
6466a31a186aSmrg        else
6467a31a186aSmrg          # not using gcc
6468493f84f4Smrg          if test ia64 = "$host_cpu"; then
6469a31a186aSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6470a31a186aSmrg	  # chokes on -Wl,-G. The following line is correct:
6471a31a186aSmrg	  shared_flag='-G'
6472a31a186aSmrg          else
6473493f84f4Smrg	    if test yes = "$aix_use_runtimelinking"; then
6474493f84f4Smrg	      shared_flag='$wl-G'
6475a31a186aSmrg	    else
6476493f84f4Smrg	      shared_flag='$wl-bM:SRE'
6477a31a186aSmrg	    fi
6478493f84f4Smrg	    shared_flag_aix='$wl-bM:SRE'
6479493f84f4Smrg	    shared_flag_svr4='$wl-G'
6480a31a186aSmrg          fi
6481a31a186aSmrg        fi
6482fe5e51b7Smrg
6483493f84f4Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6484a31a186aSmrg        # It seems that -bexpall does not export symbols beginning with
6485a31a186aSmrg        # underscore (_), so it is better to generate a list of symbols to
6486a31a186aSmrg	# export.
6487a31a186aSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6488493f84f4Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6489a31a186aSmrg          # Warning - without using the other runtime loading flags (-brtl),
6490a31a186aSmrg          # -berok will link without error, but may produce a broken library.
6491493f84f4Smrg          # The "-G" linker flag allows undefined symbols.
6492493f84f4Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6493a31a186aSmrg          # Determine the default libpath from the value encoded in an empty
6494a31a186aSmrg          # executable.
64950bb88ba4Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6496493f84f4Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6497a31a186aSmrg
6498493f84f4Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
6499a31a186aSmrg        else
6500493f84f4Smrg          if test ia64 = "$host_cpu"; then
6501493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6502a31a186aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6503493f84f4Smrg	    _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"
6504a31a186aSmrg          else
6505a31a186aSmrg	    # Determine the default libpath from the value encoded in an
6506a31a186aSmrg	    # empty executable.
65070bb88ba4Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6508493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6509a31a186aSmrg	    # Warning - without using the other run time loading flags,
6510a31a186aSmrg	    # -berok will link without error, but may produce a broken library.
6511493f84f4Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6512493f84f4Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6513493f84f4Smrg	    if test yes = "$with_gnu_ld"; then
65140bb88ba4Smrg	      # We only use this code for GNU lds that support --whole-archive.
6515493f84f4Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
65160bb88ba4Smrg	    else
65170bb88ba4Smrg	      # Exported symbols can be pulled into shared objects from archives
65180bb88ba4Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
65190bb88ba4Smrg	    fi
6520a31a186aSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6521493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6522493f84f4Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6523493f84f4Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6524493f84f4Smrg	    if test svr4 != "$with_aix_soname"; then
6525493f84f4Smrg	      # This is similar to how AIX traditionally builds its shared
6526493f84f4Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6527493f84f4Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
6528493f84f4Smrg	    fi
6529493f84f4Smrg	    if test aix != "$with_aix_soname"; then
6530493f84f4Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
6531493f84f4Smrg	    else
6532493f84f4Smrg	      # used by -dlpreopen to get the symbols
6533493f84f4Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6534493f84f4Smrg	    fi
6535493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6536a31a186aSmrg          fi
6537a31a186aSmrg        fi
6538a31a186aSmrg        ;;
6539fe5e51b7Smrg
6540a31a186aSmrg      beos*)
6541a31a186aSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6542a31a186aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6543a31a186aSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6544a31a186aSmrg	  # support --undefined.  This deserves some investigation.  FIXME
6545493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6546a31a186aSmrg	else
6547a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6548a31a186aSmrg	fi
6549a31a186aSmrg	;;
6550fe5e51b7Smrg
6551a31a186aSmrg      chorus*)
6552a31a186aSmrg        case $cc_basename in
6553a31a186aSmrg          *)
6554a31a186aSmrg	  # FIXME: insert proper C++ library support
6555a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6556a31a186aSmrg	  ;;
6557a31a186aSmrg        esac
6558a31a186aSmrg        ;;
6559fe5e51b7Smrg
6560a31a186aSmrg      cygwin* | mingw* | pw32* | cegcc*)
65610bb88ba4Smrg	case $GXX,$cc_basename in
65620bb88ba4Smrg	,cl* | no,cl*)
65630bb88ba4Smrg	  # Native MSVC
65640bb88ba4Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
65650bb88ba4Smrg	  # no search path for DLLs.
65660bb88ba4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
65670bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
65680bb88ba4Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
65690bb88ba4Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
65700bb88ba4Smrg	  # Tell ltmain to make .lib files, not .a files.
65710bb88ba4Smrg	  libext=lib
65720bb88ba4Smrg	  # Tell ltmain to make .dll files, not .so files.
6573493f84f4Smrg	  shrext_cmds=.dll
65740bb88ba4Smrg	  # FIXME: Setting linknames here is a bad hack.
6575493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6576493f84f4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6577493f84f4Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
6578493f84f4Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6579493f84f4Smrg            else
6580493f84f4Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6581493f84f4Smrg            fi~
6582493f84f4Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6583493f84f4Smrg            linknames='
65840bb88ba4Smrg	  # The linker will not automatically build a static lib if we build a DLL.
65850bb88ba4Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
65860bb88ba4Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
65870bb88ba4Smrg	  # Don't use ranlib
65880bb88ba4Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
65890bb88ba4Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6590493f84f4Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6591493f84f4Smrg            case $lt_outputfile in
6592493f84f4Smrg              *.exe|*.EXE) ;;
6593493f84f4Smrg              *)
6594493f84f4Smrg                lt_outputfile=$lt_outputfile.exe
6595493f84f4Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6596493f84f4Smrg                ;;
6597493f84f4Smrg            esac~
6598493f84f4Smrg            func_to_tool_file "$lt_outputfile"~
6599493f84f4Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6600493f84f4Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6601493f84f4Smrg              $RM "$lt_outputfile.manifest";
6602493f84f4Smrg            fi'
66030bb88ba4Smrg	  ;;
66040bb88ba4Smrg	*)
66050bb88ba4Smrg	  # g++
66060bb88ba4Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
66070bb88ba4Smrg	  # as there is no search path for DLLs.
66080bb88ba4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6609493f84f4Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
66100bb88ba4Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66110bb88ba4Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
66120bb88ba4Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66130bb88ba4Smrg
66140bb88ba4Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6615493f84f4Smrg	    _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'
6616493f84f4Smrg	    # If the export-symbols file already is a .def file, use it as
6617493f84f4Smrg	    # is; otherwise, prepend EXPORTS...
6618493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6619493f84f4Smrg              cp $export_symbols $output_objdir/$soname.def;
6620493f84f4Smrg            else
6621493f84f4Smrg              echo EXPORTS > $output_objdir/$soname.def;
6622493f84f4Smrg              cat $export_symbols >> $output_objdir/$soname.def;
6623493f84f4Smrg            fi~
6624493f84f4Smrg            $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'
66250bb88ba4Smrg	  else
66260bb88ba4Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
66270bb88ba4Smrg	  fi
66280bb88ba4Smrg	  ;;
66290bb88ba4Smrg	esac
66300bb88ba4Smrg	;;
6631a31a186aSmrg      darwin* | rhapsody*)
6632a31a186aSmrg        _LT_DARWIN_LINKER_FEATURES($1)
6633a31a186aSmrg	;;
6634fe5e51b7Smrg
6635493f84f4Smrg      os2*)
6636493f84f4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6637493f84f4Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6638493f84f4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6639493f84f4Smrg	shrext_cmds=.dll
6640493f84f4Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6641493f84f4Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6642493f84f4Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6643493f84f4Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6644493f84f4Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6645493f84f4Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6646493f84f4Smrg	  emximp -o $lib $output_objdir/$libname.def'
6647493f84f4Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6648493f84f4Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6649493f84f4Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6650493f84f4Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6651493f84f4Smrg	  prefix_cmds="$SED"~
6652493f84f4Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6653493f84f4Smrg	    prefix_cmds="$prefix_cmds -e 1d";
6654493f84f4Smrg	  fi~
6655493f84f4Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6656493f84f4Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6657493f84f4Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6658493f84f4Smrg	  emximp -o $lib $output_objdir/$libname.def'
6659493f84f4Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6660493f84f4Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6661493f84f4Smrg	;;
6662493f84f4Smrg
6663a31a186aSmrg      dgux*)
6664a31a186aSmrg        case $cc_basename in
6665a31a186aSmrg          ec++*)
6666a31a186aSmrg	    # FIXME: insert proper C++ library support
6667a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6668a31a186aSmrg	    ;;
6669a31a186aSmrg          ghcx*)
6670a31a186aSmrg	    # Green Hills C++ Compiler
6671a31a186aSmrg	    # FIXME: insert proper C++ library support
6672a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6673a31a186aSmrg	    ;;
6674a31a186aSmrg          *)
6675a31a186aSmrg	    # FIXME: insert proper C++ library support
6676a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6677a31a186aSmrg	    ;;
6678a31a186aSmrg        esac
6679a31a186aSmrg        ;;
6680fe5e51b7Smrg
66810bb88ba4Smrg      freebsd2.*)
6682a31a186aSmrg        # C++ shared libraries reported to be fairly broken before
6683a31a186aSmrg	# switch to ELF
6684a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6685a31a186aSmrg        ;;
6686fe5e51b7Smrg
6687a31a186aSmrg      freebsd-elf*)
6688a31a186aSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6689a31a186aSmrg        ;;
6690a31a186aSmrg
6691a31a186aSmrg      freebsd* | dragonfly*)
6692a31a186aSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6693a31a186aSmrg        # conventions
6694a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6695a31a186aSmrg        ;;
6696fe5e51b7Smrg
66970bb88ba4Smrg      haiku*)
6698493f84f4Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
66990bb88ba4Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
67000bb88ba4Smrg        ;;
67010bb88ba4Smrg
6702a31a186aSmrg      hpux9*)
6703493f84f4Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6704a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6705493f84f4Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6706a31a186aSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6707a31a186aSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6708a31a186aSmrg				             # but as the default
6709a31a186aSmrg				             # location of the library.
6710a31a186aSmrg
6711a31a186aSmrg        case $cc_basename in
6712a31a186aSmrg          CC*)
6713a31a186aSmrg            # FIXME: insert proper C++ library support
6714a31a186aSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
6715a31a186aSmrg            ;;
6716a31a186aSmrg          aCC*)
6717493f84f4Smrg            _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6718a31a186aSmrg            # Commands to make compiler produce verbose output that lists
6719a31a186aSmrg            # what "hidden" libraries, object files and flags are used when
6720a31a186aSmrg            # linking a shared library.
6721a31a186aSmrg            #
6722a31a186aSmrg            # There doesn't appear to be a way to prevent this compiler from
6723a31a186aSmrg            # explicitly linking system object files so we need to strip them
6724a31a186aSmrg            # from the output so that they don't get included in the library
6725a31a186aSmrg            # dependencies.
6726493f84f4Smrg            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"'
6727a31a186aSmrg            ;;
6728a31a186aSmrg          *)
6729493f84f4Smrg            if test yes = "$GXX"; then
6730493f84f4Smrg              _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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
6731a31a186aSmrg            else
6732a31a186aSmrg              # FIXME: insert proper C++ library support
6733a31a186aSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
6734a31a186aSmrg            fi
6735a31a186aSmrg            ;;
6736a31a186aSmrg        esac
6737a31a186aSmrg        ;;
6738fe5e51b7Smrg
6739a31a186aSmrg      hpux10*|hpux11*)
6740493f84f4Smrg        if test no = "$with_gnu_ld"; then
6741493f84f4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6742a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6743a31a186aSmrg
6744a31a186aSmrg          case $host_cpu in
6745a31a186aSmrg            hppa*64*|ia64*)
6746a31a186aSmrg              ;;
6747a31a186aSmrg            *)
6748493f84f4Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6749a31a186aSmrg              ;;
6750a31a186aSmrg          esac
6751a31a186aSmrg        fi
6752a31a186aSmrg        case $host_cpu in
6753a31a186aSmrg          hppa*64*|ia64*)
6754a31a186aSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
6755a31a186aSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6756a31a186aSmrg            ;;
6757a31a186aSmrg          *)
6758a31a186aSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6759a31a186aSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6760a31a186aSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6761a31a186aSmrg					         # but as the default
6762a31a186aSmrg					         # location of the library.
6763a31a186aSmrg            ;;
6764a31a186aSmrg        esac
6765a31a186aSmrg
6766a31a186aSmrg        case $cc_basename in
6767a31a186aSmrg          CC*)
6768a31a186aSmrg	    # FIXME: insert proper C++ library support
6769a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6770a31a186aSmrg	    ;;
6771a31a186aSmrg          aCC*)
6772a31a186aSmrg	    case $host_cpu in
6773a31a186aSmrg	      hppa*64*)
6774493f84f4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6775a31a186aSmrg	        ;;
6776a31a186aSmrg	      ia64*)
6777493f84f4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6778a31a186aSmrg	        ;;
6779a31a186aSmrg	      *)
6780493f84f4Smrg	        _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'
6781a31a186aSmrg	        ;;
6782a31a186aSmrg	    esac
6783a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6784a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6785a31a186aSmrg	    # linking a shared library.
6786a31a186aSmrg	    #
6787a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6788a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6789a31a186aSmrg	    # from the output so that they don't get included in the library
6790a31a186aSmrg	    # dependencies.
6791493f84f4Smrg	    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"'
6792a31a186aSmrg	    ;;
6793a31a186aSmrg          *)
6794493f84f4Smrg	    if test yes = "$GXX"; then
6795493f84f4Smrg	      if test no = "$with_gnu_ld"; then
6796a31a186aSmrg	        case $host_cpu in
6797a31a186aSmrg	          hppa*64*)
6798493f84f4Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6799a31a186aSmrg	            ;;
6800a31a186aSmrg	          ia64*)
6801493f84f4Smrg	            _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'
6802a31a186aSmrg	            ;;
6803a31a186aSmrg	          *)
6804493f84f4Smrg	            _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'
6805a31a186aSmrg	            ;;
6806a31a186aSmrg	        esac
6807a31a186aSmrg	      fi
6808a31a186aSmrg	    else
6809a31a186aSmrg	      # FIXME: insert proper C++ library support
6810a31a186aSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6811a31a186aSmrg	    fi
6812a31a186aSmrg	    ;;
6813a31a186aSmrg        esac
6814a31a186aSmrg        ;;
6815fe5e51b7Smrg
6816a31a186aSmrg      interix[[3-9]]*)
6817a31a186aSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
6818a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6819493f84f4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6820493f84f4Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6821a31a186aSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6822a31a186aSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6823a31a186aSmrg	# default) and relocated if they conflict, which is a slow very memory
6824a31a186aSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6825a31a186aSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6826a31a186aSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6827493f84f4Smrg	_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'
6828493f84f4Smrg	_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'
6829a31a186aSmrg	;;
6830a31a186aSmrg      irix5* | irix6*)
6831a31a186aSmrg        case $cc_basename in
6832a31a186aSmrg          CC*)
6833a31a186aSmrg	    # SGI C++
6834493f84f4Smrg	    _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'
6835a31a186aSmrg
6836a31a186aSmrg	    # Archives containing C++ object files must be created using
6837a31a186aSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6838a31a186aSmrg	    # necessary to make sure instantiated templates are included
6839a31a186aSmrg	    # in the archive.
6840a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6841a31a186aSmrg	    ;;
6842a31a186aSmrg          *)
6843493f84f4Smrg	    if test yes = "$GXX"; then
6844493f84f4Smrg	      if test no = "$with_gnu_ld"; then
6845493f84f4Smrg	        _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'
6846a31a186aSmrg	      else
6847493f84f4Smrg	        _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'
6848a31a186aSmrg	      fi
6849a31a186aSmrg	    fi
6850a31a186aSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6851a31a186aSmrg	    ;;
6852a31a186aSmrg        esac
6853493f84f4Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6854a31a186aSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6855a31a186aSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6856a31a186aSmrg        ;;
6857fe5e51b7Smrg
6858493f84f4Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6859a31a186aSmrg        case $cc_basename in
6860a31a186aSmrg          KCC*)
6861a31a186aSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6862a31a186aSmrg
6863a31a186aSmrg	    # KCC will only create a shared library if the output file
6864a31a186aSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6865a31a186aSmrg	    # to its proper name (with version) after linking.
6866493f84f4Smrg	    _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'
6867493f84f4Smrg	    _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'
6868a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6869a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6870a31a186aSmrg	    # linking a shared library.
6871a31a186aSmrg	    #
6872a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6873a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6874a31a186aSmrg	    # from the output so that they don't get included in the library
6875a31a186aSmrg	    # dependencies.
6876493f84f4Smrg	    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"'
6877a31a186aSmrg
6878493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6879493f84f4Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6880a31a186aSmrg
6881a31a186aSmrg	    # Archives containing C++ object files must be created using
6882a31a186aSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6883a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6884a31a186aSmrg	    ;;
6885a31a186aSmrg	  icpc* | ecpc* )
6886a31a186aSmrg	    # Intel C++
6887a31a186aSmrg	    with_gnu_ld=yes
6888a31a186aSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6889a31a186aSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6890a31a186aSmrg	    # earlier do not add the objects themselves.
6891a31a186aSmrg	    case `$CC -V 2>&1` in
6892a31a186aSmrg	      *"Version 7."*)
6893493f84f4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6894493f84f4Smrg		_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'
6895a31a186aSmrg		;;
6896a31a186aSmrg	      *)  # Version 8.0 or newer
6897a31a186aSmrg	        tmp_idyn=
6898a31a186aSmrg	        case $host_cpu in
6899a31a186aSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
6900a31a186aSmrg		esac
6901493f84f4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6902493f84f4Smrg		_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'
6903a31a186aSmrg		;;
6904a31a186aSmrg	    esac
6905a31a186aSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6906493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6907493f84f4Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6908493f84f4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6909a31a186aSmrg	    ;;
6910a31a186aSmrg          pgCC* | pgcpp*)
6911a31a186aSmrg            # Portland Group C++ compiler
6912a31a186aSmrg	    case `$CC -V` in
69130bb88ba4Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6914a31a186aSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6915493f84f4Smrg               rm -rf $tpldir~
6916493f84f4Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6917493f84f4Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6918a31a186aSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6919493f84f4Smrg                rm -rf $tpldir~
6920493f84f4Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6921493f84f4Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6922493f84f4Smrg                $RANLIB $oldlib'
6923a31a186aSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6924493f84f4Smrg                rm -rf $tpldir~
6925493f84f4Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6926493f84f4Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6927a31a186aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6928493f84f4Smrg                rm -rf $tpldir~
6929493f84f4Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6930493f84f4Smrg                $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'
6931a31a186aSmrg	      ;;
69320bb88ba4Smrg	    *) # Version 6 and above use weak symbols
6933493f84f4Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6934493f84f4Smrg	      _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'
6935a31a186aSmrg	      ;;
6936a31a186aSmrg	    esac
6937fe5e51b7Smrg
6938493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
6939493f84f4Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6940493f84f4Smrg	    _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'
6941a31a186aSmrg            ;;
6942a31a186aSmrg	  cxx*)
6943a31a186aSmrg	    # Compaq C++
6944493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6945493f84f4Smrg	    _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'
6946fe5e51b7Smrg
6947a31a186aSmrg	    runpath_var=LD_RUN_PATH
6948a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6949a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6950fe5e51b7Smrg
6951a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
6952a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
6953a31a186aSmrg	    # linking a shared library.
6954a31a186aSmrg	    #
6955a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
6956a31a186aSmrg	    # explicitly linking system object files so we need to strip them
6957a31a186aSmrg	    # from the output so that they don't get included in the library
6958a31a186aSmrg	    # dependencies.
6959493f84f4Smrg	    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'
6960a31a186aSmrg	    ;;
69610bb88ba4Smrg	  xl* | mpixl* | bgxl*)
6962a31a186aSmrg	    # IBM XL 8.0 on PPC, with GNU ld
6963493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6964493f84f4Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6965493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6966493f84f4Smrg	    if test yes = "$supports_anon_versioning"; then
6967a31a186aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6968493f84f4Smrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6969493f84f4Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
6970493f84f4Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
6971a31a186aSmrg	    fi
6972a31a186aSmrg	    ;;
6973a31a186aSmrg	  *)
6974a31a186aSmrg	    case `$CC -V 2>&1 | sed 5q` in
6975a31a186aSmrg	    *Sun\ C*)
6976a31a186aSmrg	      # Sun C++ 5.9
6977a31a186aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6978493f84f4Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6979493f84f4Smrg	      _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'
6980a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6981493f84f4Smrg	      _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'
6982a31a186aSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6983a31a186aSmrg
6984a31a186aSmrg	      # Not sure whether something based on
6985a31a186aSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6986a31a186aSmrg	      # would be better.
69870bb88ba4Smrg	      output_verbose_link_cmd='func_echo_all'
6988a31a186aSmrg
6989a31a186aSmrg	      # Archives containing C++ object files must be created using
6990a31a186aSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6991a31a186aSmrg	      # necessary to make sure instantiated templates are included
6992a31a186aSmrg	      # in the archive.
6993a31a186aSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6994a31a186aSmrg	      ;;
6995a31a186aSmrg	    esac
6996a31a186aSmrg	    ;;
6997a31a186aSmrg	esac
6998a31a186aSmrg	;;
6999fe5e51b7Smrg
7000a31a186aSmrg      lynxos*)
7001a31a186aSmrg        # FIXME: insert proper C++ library support
7002a31a186aSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7003a31a186aSmrg	;;
7004fe5e51b7Smrg
7005a31a186aSmrg      m88k*)
7006a31a186aSmrg        # FIXME: insert proper C++ library support
7007a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7008a31a186aSmrg	;;
7009fe5e51b7Smrg
7010a31a186aSmrg      mvs*)
7011a31a186aSmrg        case $cc_basename in
7012a31a186aSmrg          cxx*)
7013a31a186aSmrg	    # FIXME: insert proper C++ library support
7014a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7015a31a186aSmrg	    ;;
7016a31a186aSmrg	  *)
7017a31a186aSmrg	    # FIXME: insert proper C++ library support
7018a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7019a31a186aSmrg	    ;;
7020a31a186aSmrg	esac
7021a31a186aSmrg	;;
7022fe5e51b7Smrg
7023a31a186aSmrg      netbsd*)
7024a31a186aSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7025a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7026a31a186aSmrg	  wlarc=
7027a31a186aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7028a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7029a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7030a31a186aSmrg	fi
7031a31a186aSmrg	# Workaround some broken pre-1.5 toolchains
7032a31a186aSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7033a31a186aSmrg	;;
7034fe5e51b7Smrg
7035a31a186aSmrg      *nto* | *qnx*)
7036a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7037a31a186aSmrg	;;
7038fe5e51b7Smrg
7039493f84f4Smrg      openbsd* | bitrig*)
7040a31a186aSmrg	if test -f /usr/libexec/ld.so; then
7041a31a186aSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7042a31a186aSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7043a31a186aSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7044a31a186aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7045493f84f4Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7046493f84f4Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7047493f84f4Smrg	    _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'
7048493f84f4Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7049493f84f4Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7050a31a186aSmrg	  fi
70510bb88ba4Smrg	  output_verbose_link_cmd=func_echo_all
7052a31a186aSmrg	else
7053a31a186aSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7054a31a186aSmrg	fi
7055a31a186aSmrg	;;
7056fe5e51b7Smrg
7057a31a186aSmrg      osf3* | osf4* | osf5*)
7058a31a186aSmrg        case $cc_basename in
7059a31a186aSmrg          KCC*)
7060a31a186aSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7061a31a186aSmrg
7062a31a186aSmrg	    # KCC will only create a shared library if the output file
7063a31a186aSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7064a31a186aSmrg	    # to its proper name (with version) after linking.
7065493f84f4Smrg	    _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'
7066a31a186aSmrg
7067493f84f4Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7068a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7069a31a186aSmrg
7070a31a186aSmrg	    # Archives containing C++ object files must be created using
7071a31a186aSmrg	    # the KAI C++ compiler.
7072a31a186aSmrg	    case $host in
7073a31a186aSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7074a31a186aSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7075a31a186aSmrg	    esac
7076a31a186aSmrg	    ;;
7077a31a186aSmrg          RCC*)
7078a31a186aSmrg	    # Rational C++ 2.4.1
7079a31a186aSmrg	    # FIXME: insert proper C++ library support
7080a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7081a31a186aSmrg	    ;;
7082a31a186aSmrg          cxx*)
7083a31a186aSmrg	    case $host in
7084a31a186aSmrg	      osf3*)
7085493f84f4Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7086493f84f4Smrg	        _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'
7087493f84f4Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7088a31a186aSmrg		;;
7089a31a186aSmrg	      *)
7090a31a186aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7091493f84f4Smrg	        _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'
7092a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7093493f84f4Smrg                  echo "-hidden">> $lib.exp~
7094493f84f4Smrg                  $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~
7095493f84f4Smrg                  $RM $lib.exp'
7096a31a186aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7097a31a186aSmrg		;;
7098a31a186aSmrg	    esac
7099fe5e51b7Smrg
7100a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7101fe5e51b7Smrg
7102a31a186aSmrg	    # Commands to make compiler produce verbose output that lists
7103a31a186aSmrg	    # what "hidden" libraries, object files and flags are used when
7104a31a186aSmrg	    # linking a shared library.
7105a31a186aSmrg	    #
7106a31a186aSmrg	    # There doesn't appear to be a way to prevent this compiler from
7107a31a186aSmrg	    # explicitly linking system object files so we need to strip them
7108a31a186aSmrg	    # from the output so that they don't get included in the library
7109a31a186aSmrg	    # dependencies.
7110493f84f4Smrg	    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"'
7111a31a186aSmrg	    ;;
7112a31a186aSmrg	  *)
7113493f84f4Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7114493f84f4Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7115a31a186aSmrg	      case $host in
7116a31a186aSmrg	        osf3*)
7117493f84f4Smrg	          _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'
7118a31a186aSmrg		  ;;
7119a31a186aSmrg	        *)
7120493f84f4Smrg	          _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'
7121a31a186aSmrg		  ;;
7122a31a186aSmrg	      esac
7123a31a186aSmrg
7124493f84f4Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7125a31a186aSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7126a31a186aSmrg
7127a31a186aSmrg	      # Commands to make compiler produce verbose output that lists
7128a31a186aSmrg	      # what "hidden" libraries, object files and flags are used when
7129a31a186aSmrg	      # linking a shared library.
71300bb88ba4Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7131a31a186aSmrg
7132a31a186aSmrg	    else
7133a31a186aSmrg	      # FIXME: insert proper C++ library support
7134a31a186aSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7135a31a186aSmrg	    fi
7136a31a186aSmrg	    ;;
7137a31a186aSmrg        esac
7138a31a186aSmrg        ;;
7139fe5e51b7Smrg
7140a31a186aSmrg      psos*)
7141a31a186aSmrg        # FIXME: insert proper C++ library support
7142a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7143a31a186aSmrg        ;;
7144fe5e51b7Smrg
7145a31a186aSmrg      sunos4*)
7146a31a186aSmrg        case $cc_basename in
7147a31a186aSmrg          CC*)
7148a31a186aSmrg	    # Sun C++ 4.x
7149a31a186aSmrg	    # FIXME: insert proper C++ library support
7150a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7151a31a186aSmrg	    ;;
7152a31a186aSmrg          lcc*)
7153a31a186aSmrg	    # Lucid
7154a31a186aSmrg	    # FIXME: insert proper C++ library support
7155a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7156a31a186aSmrg	    ;;
7157a31a186aSmrg          *)
7158a31a186aSmrg	    # FIXME: insert proper C++ library support
7159a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7160a31a186aSmrg	    ;;
7161a31a186aSmrg        esac
7162a31a186aSmrg        ;;
7163fe5e51b7Smrg
7164a31a186aSmrg      solaris*)
7165a31a186aSmrg        case $cc_basename in
71660bb88ba4Smrg          CC* | sunCC*)
7167a31a186aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7168a31a186aSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7169a31a186aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7170493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7171a31a186aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7172493f84f4Smrg              $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'
7173a31a186aSmrg
7174a31a186aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7175a31a186aSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7176a31a186aSmrg	    case $host_os in
7177a31a186aSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7178a31a186aSmrg	      *)
7179a31a186aSmrg		# The compiler driver will combine and reorder linker options,
7180493f84f4Smrg		# but understands '-z linker_flag'.
7181a31a186aSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7182a31a186aSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7183a31a186aSmrg	        ;;
7184a31a186aSmrg	    esac
7185a31a186aSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7186fe5e51b7Smrg
71870bb88ba4Smrg	    output_verbose_link_cmd='func_echo_all'
7188fe5e51b7Smrg
7189a31a186aSmrg	    # Archives containing C++ object files must be created using
7190a31a186aSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7191a31a186aSmrg	    # necessary to make sure instantiated templates are included
7192a31a186aSmrg	    # in the archive.
7193a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7194a31a186aSmrg	    ;;
7195a31a186aSmrg          gcx*)
7196a31a186aSmrg	    # Green Hills C++ Compiler
7197493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7198fe5e51b7Smrg
7199a31a186aSmrg	    # The C++ compiler must be used to create the archive.
7200a31a186aSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7201a31a186aSmrg	    ;;
7202a31a186aSmrg          *)
7203a31a186aSmrg	    # GNU C++ compiler with Solaris linker
7204493f84f4Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7205493f84f4Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7206a31a186aSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7207493f84f4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7208a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7209493f84f4Smrg                  $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7210a31a186aSmrg
7211a31a186aSmrg	        # Commands to make compiler produce verbose output that lists
7212a31a186aSmrg	        # what "hidden" libraries, object files and flags are used when
7213a31a186aSmrg	        # linking a shared library.
72140bb88ba4Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7215a31a186aSmrg	      else
7216493f84f4Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7217a31a186aSmrg	        # platform.
7218493f84f4Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7219a31a186aSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7220493f84f4Smrg                  $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
7221a31a186aSmrg
7222a31a186aSmrg	        # Commands to make compiler produce verbose output that lists
7223a31a186aSmrg	        # what "hidden" libraries, object files and flags are used when
7224a31a186aSmrg	        # linking a shared library.
72250bb88ba4Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7226a31a186aSmrg	      fi
7227a31a186aSmrg
7228493f84f4Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7229a31a186aSmrg	      case $host_os in
7230a31a186aSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7231a31a186aSmrg		*)
7232493f84f4Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7233a31a186aSmrg		  ;;
7234a31a186aSmrg	      esac
7235a31a186aSmrg	    fi
7236a31a186aSmrg	    ;;
7237a31a186aSmrg        esac
7238a31a186aSmrg        ;;
7239fe5e51b7Smrg
7240a31a186aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7241493f84f4Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7242a31a186aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7243a31a186aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7244a31a186aSmrg      runpath_var='LD_RUN_PATH'
7245fe5e51b7Smrg
7246a31a186aSmrg      case $cc_basename in
7247a31a186aSmrg        CC*)
7248493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7249493f84f4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7250a31a186aSmrg	  ;;
7251a31a186aSmrg	*)
7252493f84f4Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7253493f84f4Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7254a31a186aSmrg	  ;;
7255a31a186aSmrg      esac
7256a31a186aSmrg      ;;
7257fe5e51b7Smrg
7258a31a186aSmrg      sysv5* | sco3.2v5* | sco5v6*)
7259493f84f4Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7260a31a186aSmrg	# link with -lc, and that would cause any symbols used from libc to
7261a31a186aSmrg	# always be unresolved, which means just about no library would
7262a31a186aSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7263a31a186aSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7264a31a186aSmrg	# as -z defs.
7265493f84f4Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7266493f84f4Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7267a31a186aSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7268a31a186aSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7269493f84f4Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7270a31a186aSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7271a31a186aSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7272493f84f4Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7273a31a186aSmrg	runpath_var='LD_RUN_PATH'
7274fe5e51b7Smrg
7275a31a186aSmrg	case $cc_basename in
7276a31a186aSmrg          CC*)
7277493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7278493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
72790bb88ba4Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7280493f84f4Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
72810bb88ba4Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7282493f84f4Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7283a31a186aSmrg	    ;;
7284a31a186aSmrg	  *)
7285493f84f4Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7286493f84f4Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7287a31a186aSmrg	    ;;
7288a31a186aSmrg	esac
7289a31a186aSmrg      ;;
7290fe5e51b7Smrg
7291a31a186aSmrg      tandem*)
7292a31a186aSmrg        case $cc_basename in
7293a31a186aSmrg          NCC*)
7294a31a186aSmrg	    # NonStop-UX NCC 3.20
7295a31a186aSmrg	    # FIXME: insert proper C++ library support
7296a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7297a31a186aSmrg	    ;;
7298a31a186aSmrg          *)
7299a31a186aSmrg	    # FIXME: insert proper C++ library support
7300a31a186aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7301a31a186aSmrg	    ;;
7302a31a186aSmrg        esac
7303a31a186aSmrg        ;;
7304fe5e51b7Smrg
7305a31a186aSmrg      vxworks*)
7306a31a186aSmrg        # FIXME: insert proper C++ library support
7307a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7308a31a186aSmrg        ;;
7309fe5e51b7Smrg
7310a31a186aSmrg      *)
7311a31a186aSmrg        # FIXME: insert proper C++ library support
7312a31a186aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7313a31a186aSmrg        ;;
7314a31a186aSmrg    esac
7315fe5e51b7Smrg
7316a31a186aSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7317493f84f4Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7318a31a186aSmrg
7319493f84f4Smrg    _LT_TAGVAR(GCC, $1)=$GXX
7320493f84f4Smrg    _LT_TAGVAR(LD, $1)=$LD
7321a31a186aSmrg
7322a31a186aSmrg    ## CAVEAT EMPTOR:
7323a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
7324a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
7325a31a186aSmrg    ## what you are doing...
7326a31a186aSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7327a31a186aSmrg    _LT_COMPILER_PIC($1)
7328a31a186aSmrg    _LT_COMPILER_C_O($1)
7329a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
7330a31a186aSmrg    _LT_LINKER_SHLIBS($1)
7331a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7332a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7333a31a186aSmrg
7334a31a186aSmrg    _LT_CONFIG($1)
7335a31a186aSmrg  fi # test -n "$compiler"
7336a31a186aSmrg
7337a31a186aSmrg  CC=$lt_save_CC
73380bb88ba4Smrg  CFLAGS=$lt_save_CFLAGS
7339a31a186aSmrg  LDCXX=$LD
7340a31a186aSmrg  LD=$lt_save_LD
7341a31a186aSmrg  GCC=$lt_save_GCC
7342a31a186aSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7343a31a186aSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7344a31a186aSmrg  lt_cv_path_LD=$lt_save_path_LD
7345a31a186aSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7346a31a186aSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7347493f84f4Smrgfi # test yes != "$_lt_caught_CXX_error"
7348fe5e51b7Smrg
7349a31a186aSmrgAC_LANG_POP
7350a31a186aSmrg])# _LT_LANG_CXX_CONFIG
7351fe5e51b7Smrg
7352fe5e51b7Smrg
73530bb88ba4Smrg# _LT_FUNC_STRIPNAME_CNF
73540bb88ba4Smrg# ----------------------
73550bb88ba4Smrg# func_stripname_cnf prefix suffix name
73560bb88ba4Smrg# strip PREFIX and SUFFIX off of NAME.
73570bb88ba4Smrg# PREFIX and SUFFIX must not contain globbing or regex special
73580bb88ba4Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
73590bb88ba4Smrg# dot (in which case that matches only a dot).
73600bb88ba4Smrg#
73610bb88ba4Smrg# This function is identical to the (non-XSI) version of func_stripname,
73620bb88ba4Smrg# except this one can be used by m4 code that may be executed by configure,
73630bb88ba4Smrg# rather than the libtool script.
73640bb88ba4Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
73650bb88ba4SmrgAC_REQUIRE([_LT_DECL_SED])
73660bb88ba4SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
73670bb88ba4Smrgfunc_stripname_cnf ()
73680bb88ba4Smrg{
7369493f84f4Smrg  case @S|@2 in
7370493f84f4Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7371493f84f4Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
73720bb88ba4Smrg  esac
73730bb88ba4Smrg} # func_stripname_cnf
73740bb88ba4Smrg])# _LT_FUNC_STRIPNAME_CNF
73750bb88ba4Smrg
7376a31a186aSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7377a31a186aSmrg# ---------------------------------
7378a31a186aSmrg# Figure out "hidden" library dependencies from verbose
7379a31a186aSmrg# compiler output when linking a shared library.
7380a31a186aSmrg# Parse the compiler output and extract the necessary
7381a31a186aSmrg# objects, libraries and library flags.
7382a31a186aSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7383a31a186aSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
73840bb88ba4SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7385a31a186aSmrg# Dependencies to place before and after the object being linked:
7386a31a186aSmrg_LT_TAGVAR(predep_objects, $1)=
7387a31a186aSmrg_LT_TAGVAR(postdep_objects, $1)=
7388a31a186aSmrg_LT_TAGVAR(predeps, $1)=
7389a31a186aSmrg_LT_TAGVAR(postdeps, $1)=
7390a31a186aSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7391fe5e51b7Smrg
7392a31a186aSmrgdnl we can't use the lt_simple_compile_test_code here,
7393a31a186aSmrgdnl because it contains code intended for an executable,
7394a31a186aSmrgdnl not a library.  It's possible we should let each
7395a31a186aSmrgdnl tag define a new lt_????_link_test_code variable,
7396a31a186aSmrgdnl but it's only used here...
7397a31a186aSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7398a31a186aSmrgint a;
7399a31a186aSmrgvoid foo (void) { a = 0; }
7400a31a186aSmrg_LT_EOF
7401a31a186aSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7402a31a186aSmrgclass Foo
7403a31a186aSmrg{
7404a31a186aSmrgpublic:
7405a31a186aSmrg  Foo (void) { a = 0; }
7406a31a186aSmrgprivate:
7407a31a186aSmrg  int a;
7408a31a186aSmrg};
7409a31a186aSmrg_LT_EOF
7410a31a186aSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7411a31a186aSmrg      subroutine foo
7412a31a186aSmrg      implicit none
7413a31a186aSmrg      integer*4 a
7414a31a186aSmrg      a=0
7415a31a186aSmrg      return
7416a31a186aSmrg      end
7417a31a186aSmrg_LT_EOF
7418a31a186aSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7419a31a186aSmrg      subroutine foo
7420a31a186aSmrg      implicit none
7421a31a186aSmrg      integer a
7422a31a186aSmrg      a=0
7423a31a186aSmrg      return
7424a31a186aSmrg      end
7425a31a186aSmrg_LT_EOF
7426a31a186aSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7427a31a186aSmrgpublic class foo {
7428a31a186aSmrg  private int a;
7429a31a186aSmrg  public void bar (void) {
7430a31a186aSmrg    a = 0;
7431a31a186aSmrg  }
7432a31a186aSmrg};
7433a31a186aSmrg_LT_EOF
74340bb88ba4Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
74350bb88ba4Smrgpackage foo
74360bb88ba4Smrgfunc foo() {
74370bb88ba4Smrg}
74380bb88ba4Smrg_LT_EOF
7439a31a186aSmrg])
74400bb88ba4Smrg
74410bb88ba4Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
74420bb88ba4Smrgcase "$CC $CFLAGS " in #(
74430bb88ba4Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
74440bb88ba4Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
74450bb88ba4Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
74460bb88ba4Smrgesac
74470bb88ba4Smrg
7448a31a186aSmrgdnl Parse the compiler output and extract the necessary
7449a31a186aSmrgdnl objects, libraries and library flags.
7450a31a186aSmrgif AC_TRY_EVAL(ac_compile); then
7451a31a186aSmrg  # Parse the compiler output and extract the necessary
7452a31a186aSmrg  # objects, libraries and library flags.
7453fe5e51b7Smrg
7454a31a186aSmrg  # Sentinel used to keep track of whether or not we are before
7455a31a186aSmrg  # the conftest object file.
7456a31a186aSmrg  pre_test_object_deps_done=no
7457fe5e51b7Smrg
7458a31a186aSmrg  for p in `eval "$output_verbose_link_cmd"`; do
7459493f84f4Smrg    case $prev$p in
7460fe5e51b7Smrg
7461a31a186aSmrg    -L* | -R* | -l*)
7462a31a186aSmrg       # Some compilers place space between "-{L,R}" and the path.
7463a31a186aSmrg       # Remove the space.
7464493f84f4Smrg       if test x-L = "$p" ||
7465493f84f4Smrg          test x-R = "$p"; then
7466a31a186aSmrg	 prev=$p
7467a31a186aSmrg	 continue
7468a31a186aSmrg       fi
7469fe5e51b7Smrg
74700bb88ba4Smrg       # Expand the sysroot to ease extracting the directories later.
74710bb88ba4Smrg       if test -z "$prev"; then
74720bb88ba4Smrg         case $p in
74730bb88ba4Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
74740bb88ba4Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
74750bb88ba4Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
74760bb88ba4Smrg         esac
74770bb88ba4Smrg       fi
74780bb88ba4Smrg       case $p in
74790bb88ba4Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
74800bb88ba4Smrg       esac
7481493f84f4Smrg       if test no = "$pre_test_object_deps_done"; then
7482493f84f4Smrg	 case $prev in
74830bb88ba4Smrg	 -L | -R)
7484a31a186aSmrg	   # Internal compiler library paths should come after those
7485a31a186aSmrg	   # provided the user.  The postdeps already come after the
7486a31a186aSmrg	   # user supplied libs so there is no need to process them.
7487a31a186aSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7488493f84f4Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7489a31a186aSmrg	   else
7490493f84f4Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7491a31a186aSmrg	   fi
7492a31a186aSmrg	   ;;
7493a31a186aSmrg	 # The "-l" case would never come before the object being
7494a31a186aSmrg	 # linked, so don't bother handling this case.
7495a31a186aSmrg	 esac
7496a31a186aSmrg       else
7497a31a186aSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7498493f84f4Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7499a31a186aSmrg	 else
7500493f84f4Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7501a31a186aSmrg	 fi
7502a31a186aSmrg       fi
75030bb88ba4Smrg       prev=
7504a31a186aSmrg       ;;
7505fe5e51b7Smrg
75060bb88ba4Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7507a31a186aSmrg    *.$objext)
7508a31a186aSmrg       # This assumes that the test object file only shows up
7509a31a186aSmrg       # once in the compiler output.
7510a31a186aSmrg       if test "$p" = "conftest.$objext"; then
7511a31a186aSmrg	 pre_test_object_deps_done=yes
7512a31a186aSmrg	 continue
7513a31a186aSmrg       fi
7514fe5e51b7Smrg
7515493f84f4Smrg       if test no = "$pre_test_object_deps_done"; then
7516a31a186aSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7517493f84f4Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
7518a31a186aSmrg	 else
7519a31a186aSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7520a31a186aSmrg	 fi
7521a31a186aSmrg       else
7522a31a186aSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7523493f84f4Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7524a31a186aSmrg	 else
7525a31a186aSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7526a31a186aSmrg	 fi
7527a31a186aSmrg       fi
7528a31a186aSmrg       ;;
7529fe5e51b7Smrg
7530a31a186aSmrg    *) ;; # Ignore the rest.
7531fe5e51b7Smrg
7532a31a186aSmrg    esac
7533a31a186aSmrg  done
7534fe5e51b7Smrg
7535a31a186aSmrg  # Clean up.
7536a31a186aSmrg  rm -f a.out a.exe
7537eda3803bSmrgelse
7538a31a186aSmrg  echo "libtool.m4: error: problem compiling $1 test program"
7539fe5e51b7Smrgfi
7540fe5e51b7Smrg
7541a31a186aSmrg$RM -f confest.$objext
75420bb88ba4SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7543fe5e51b7Smrg
7544a31a186aSmrg# PORTME: override above test on systems where it is broken
7545a31a186aSmrgm4_if([$1], [CXX],
7546a31a186aSmrg[case $host_os in
7547a31a186aSmrginterix[[3-9]]*)
7548a31a186aSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7549a31a186aSmrg  # hack all around it, let's just trust "g++" to DTRT.
7550a31a186aSmrg  _LT_TAGVAR(predep_objects,$1)=
7551a31a186aSmrg  _LT_TAGVAR(postdep_objects,$1)=
7552a31a186aSmrg  _LT_TAGVAR(postdeps,$1)=
7553a31a186aSmrg  ;;
7554eda3803bSmrg
7555a31a186aSmrglinux*)
7556a31a186aSmrg  case `$CC -V 2>&1 | sed 5q` in
7557a31a186aSmrg  *Sun\ C*)
7558a31a186aSmrg    # Sun C++ 5.9
7559fe5e51b7Smrg
7560a31a186aSmrg    # The more standards-conforming stlport4 library is
7561a31a186aSmrg    # incompatible with the Cstd library. Avoid specifying
7562a31a186aSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
7563a31a186aSmrg    # -library=stlport4 depends on it.
7564a31a186aSmrg    case " $CXX $CXXFLAGS " in
7565a31a186aSmrg    *" -library=stlport4 "*)
7566a31a186aSmrg      solaris_use_stlport4=yes
7567a31a186aSmrg      ;;
7568a31a186aSmrg    esac
7569fe5e51b7Smrg
7570493f84f4Smrg    if test yes != "$solaris_use_stlport4"; then
7571a31a186aSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7572a31a186aSmrg    fi
7573a31a186aSmrg    ;;
7574a31a186aSmrg  esac
7575a31a186aSmrg  ;;
7576a31a186aSmrg
7577a31a186aSmrgsolaris*)
7578a31a186aSmrg  case $cc_basename in
75790bb88ba4Smrg  CC* | sunCC*)
7580a31a186aSmrg    # The more standards-conforming stlport4 library is
7581a31a186aSmrg    # incompatible with the Cstd library. Avoid specifying
7582a31a186aSmrg    # it if it's in CXXFLAGS. Ignore libCrun as
7583a31a186aSmrg    # -library=stlport4 depends on it.
7584a31a186aSmrg    case " $CXX $CXXFLAGS " in
7585a31a186aSmrg    *" -library=stlport4 "*)
7586a31a186aSmrg      solaris_use_stlport4=yes
7587a31a186aSmrg      ;;
7588a31a186aSmrg    esac
7589fe5e51b7Smrg
7590a31a186aSmrg    # Adding this requires a known-good setup of shared libraries for
7591a31a186aSmrg    # Sun compiler versions before 5.6, else PIC objects from an old
7592a31a186aSmrg    # archive will be linked into the output, leading to subtle bugs.
7593493f84f4Smrg    if test yes != "$solaris_use_stlport4"; then
7594a31a186aSmrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7595a31a186aSmrg    fi
7596a31a186aSmrg    ;;
7597a31a186aSmrg  esac
7598a31a186aSmrg  ;;
7599a31a186aSmrgesac
7600a31a186aSmrg])
7601fe5e51b7Smrg
7602a31a186aSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
7603a31a186aSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7604a31a186aSmrgesac
7605a31a186aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7606a31a186aSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7607493f84f4Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7608a31a186aSmrgfi
7609a31a186aSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7610a31a186aSmrg    [The directories searched by this compiler when creating a shared library])
7611a31a186aSmrg_LT_TAGDECL([], [predep_objects], [1],
7612a31a186aSmrg    [Dependencies to place before and after the objects being linked to
7613a31a186aSmrg    create a shared library])
7614a31a186aSmrg_LT_TAGDECL([], [postdep_objects], [1])
7615a31a186aSmrg_LT_TAGDECL([], [predeps], [1])
7616a31a186aSmrg_LT_TAGDECL([], [postdeps], [1])
7617a31a186aSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7618a31a186aSmrg    [The library search path used internally by the compiler when linking
7619a31a186aSmrg    a shared library])
7620a31a186aSmrg])# _LT_SYS_HIDDEN_LIBDEPS
7621a31a186aSmrg
7622a31a186aSmrg
7623a31a186aSmrg# _LT_LANG_F77_CONFIG([TAG])
7624a31a186aSmrg# --------------------------
7625a31a186aSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
7626a31a186aSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7627493f84f4Smrg# to write the compiler configuration to 'libtool'.
7628a31a186aSmrgm4_defun([_LT_LANG_F77_CONFIG],
76290bb88ba4Smrg[AC_LANG_PUSH(Fortran 77)
7630493f84f4Smrgif test -z "$F77" || test no = "$F77"; then
76310bb88ba4Smrg  _lt_disable_F77=yes
76320bb88ba4Smrgfi
7633eda3803bSmrg
7634a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7635a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7636a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7637a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7638a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7639a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7640a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7641a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7642a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7643a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7644a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7645a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7646a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
7647a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7648a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7649a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
76500bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
76510bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7652a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7653a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7654a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7655fe5e51b7Smrg
7656a31a186aSmrg# Source file extension for f77 test sources.
7657a31a186aSmrgac_ext=f
7658eda3803bSmrg
7659a31a186aSmrg# Object file extension for compiled f77 test sources.
7660a31a186aSmrgobjext=o
7661a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7662a31a186aSmrg
7663a31a186aSmrg# No sense in running all these tests if we already determined that
7664a31a186aSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7665a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
7666a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
7667493f84f4Smrgif test yes != "$_lt_disable_F77"; then
7668a31a186aSmrg  # Code to be used in simple compile tests
7669a31a186aSmrg  lt_simple_compile_test_code="\
7670a31a186aSmrg      subroutine t
7671a31a186aSmrg      return
7672a31a186aSmrg      end
7673a31a186aSmrg"
7674eda3803bSmrg
7675a31a186aSmrg  # Code to be used in simple link tests
7676a31a186aSmrg  lt_simple_link_test_code="\
7677a31a186aSmrg      program t
7678a31a186aSmrg      end
7679a31a186aSmrg"
7680fe5e51b7Smrg
7681a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7682a31a186aSmrg  _LT_TAG_COMPILER
7683fe5e51b7Smrg
7684a31a186aSmrg  # save warnings/boilerplate of simple test code
7685a31a186aSmrg  _LT_COMPILER_BOILERPLATE
7686a31a186aSmrg  _LT_LINKER_BOILERPLATE
7687fe5e51b7Smrg
7688a31a186aSmrg  # Allow CC to be a program name with arguments.
7689493f84f4Smrg  lt_save_CC=$CC
7690a31a186aSmrg  lt_save_GCC=$GCC
76910bb88ba4Smrg  lt_save_CFLAGS=$CFLAGS
7692a31a186aSmrg  CC=${F77-"f77"}
76930bb88ba4Smrg  CFLAGS=$FFLAGS
7694a31a186aSmrg  compiler=$CC
7695a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
7696a31a186aSmrg  _LT_CC_BASENAME([$compiler])
7697a31a186aSmrg  GCC=$G77
7698a31a186aSmrg  if test -n "$compiler"; then
7699a31a186aSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7700a31a186aSmrg    AC_MSG_RESULT([$can_build_shared])
7701eda3803bSmrg
7702a31a186aSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7703493f84f4Smrg    test no = "$can_build_shared" && enable_shared=no
7704eda3803bSmrg
7705a31a186aSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7706a31a186aSmrg    # are all built from PIC.
7707a31a186aSmrg    case $host_os in
7708a31a186aSmrg      aix3*)
7709493f84f4Smrg        test yes = "$enable_shared" && enable_static=no
7710a31a186aSmrg        if test -n "$RANLIB"; then
7711a31a186aSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7712a31a186aSmrg          postinstall_cmds='$RANLIB $lib'
7713a31a186aSmrg        fi
7714a31a186aSmrg        ;;
7715a31a186aSmrg      aix[[4-9]]*)
7716493f84f4Smrg	if test ia64 != "$host_cpu"; then
7717493f84f4Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7718493f84f4Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7719493f84f4Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7720493f84f4Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7721493f84f4Smrg	  esac
7722a31a186aSmrg	fi
7723a31a186aSmrg        ;;
7724a31a186aSmrg    esac
7725a31a186aSmrg    AC_MSG_RESULT([$enable_shared])
7726a31a186aSmrg
7727a31a186aSmrg    AC_MSG_CHECKING([whether to build static libraries])
7728a31a186aSmrg    # Make sure either enable_shared or enable_static is yes.
7729493f84f4Smrg    test yes = "$enable_shared" || enable_static=yes
7730a31a186aSmrg    AC_MSG_RESULT([$enable_static])
7731a31a186aSmrg
7732493f84f4Smrg    _LT_TAGVAR(GCC, $1)=$G77
7733493f84f4Smrg    _LT_TAGVAR(LD, $1)=$LD
7734a31a186aSmrg
7735a31a186aSmrg    ## CAVEAT EMPTOR:
7736a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
7737a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
7738a31a186aSmrg    ## what you are doing...
7739a31a186aSmrg    _LT_COMPILER_PIC($1)
7740a31a186aSmrg    _LT_COMPILER_C_O($1)
7741a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
7742a31a186aSmrg    _LT_LINKER_SHLIBS($1)
7743a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7744a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7745a31a186aSmrg
7746a31a186aSmrg    _LT_CONFIG($1)
7747a31a186aSmrg  fi # test -n "$compiler"
7748a31a186aSmrg
7749a31a186aSmrg  GCC=$lt_save_GCC
7750493f84f4Smrg  CC=$lt_save_CC
7751493f84f4Smrg  CFLAGS=$lt_save_CFLAGS
7752493f84f4Smrgfi # test yes != "$_lt_disable_F77"
7753eda3803bSmrg
7754a31a186aSmrgAC_LANG_POP
7755a31a186aSmrg])# _LT_LANG_F77_CONFIG
7756eda3803bSmrg
7757fe5e51b7Smrg
7758a31a186aSmrg# _LT_LANG_FC_CONFIG([TAG])
7759a31a186aSmrg# -------------------------
7760a31a186aSmrg# Ensure that the configuration variables for a Fortran compiler are
7761a31a186aSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7762493f84f4Smrg# to write the compiler configuration to 'libtool'.
7763a31a186aSmrgm4_defun([_LT_LANG_FC_CONFIG],
77640bb88ba4Smrg[AC_LANG_PUSH(Fortran)
77650bb88ba4Smrg
7766493f84f4Smrgif test -z "$FC" || test no = "$FC"; then
77670bb88ba4Smrg  _lt_disable_FC=yes
77680bb88ba4Smrgfi
7769a31a186aSmrg
7770a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7771a31a186aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7772a31a186aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7773a31a186aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7774a31a186aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7775a31a186aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7776a31a186aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7777a31a186aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7778a31a186aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7779a31a186aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7780a31a186aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7781a31a186aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7782a31a186aSmrg_LT_TAGVAR(module_cmds, $1)=
7783a31a186aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7784a31a186aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7785a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
77860bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
77870bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7788a31a186aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7789a31a186aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7790a31a186aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7791a31a186aSmrg
7792a31a186aSmrg# Source file extension for fc test sources.
7793a31a186aSmrgac_ext=${ac_fc_srcext-f}
7794a31a186aSmrg
7795a31a186aSmrg# Object file extension for compiled fc test sources.
7796a31a186aSmrgobjext=o
7797a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7798a31a186aSmrg
7799a31a186aSmrg# No sense in running all these tests if we already determined that
7800a31a186aSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
7801a31a186aSmrg# are currently assumed to apply to all compilers on this platform,
7802a31a186aSmrg# and will be corrupted by setting them based on a non-working compiler.
7803493f84f4Smrgif test yes != "$_lt_disable_FC"; then
7804a31a186aSmrg  # Code to be used in simple compile tests
7805a31a186aSmrg  lt_simple_compile_test_code="\
7806a31a186aSmrg      subroutine t
7807a31a186aSmrg      return
7808a31a186aSmrg      end
7809a31a186aSmrg"
7810fe5e51b7Smrg
7811a31a186aSmrg  # Code to be used in simple link tests
7812a31a186aSmrg  lt_simple_link_test_code="\
7813a31a186aSmrg      program t
7814a31a186aSmrg      end
7815a31a186aSmrg"
7816fe5e51b7Smrg
7817a31a186aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7818a31a186aSmrg  _LT_TAG_COMPILER
7819fe5e51b7Smrg
7820a31a186aSmrg  # save warnings/boilerplate of simple test code
7821a31a186aSmrg  _LT_COMPILER_BOILERPLATE
7822a31a186aSmrg  _LT_LINKER_BOILERPLATE
7823fe5e51b7Smrg
7824a31a186aSmrg  # Allow CC to be a program name with arguments.
7825493f84f4Smrg  lt_save_CC=$CC
7826a31a186aSmrg  lt_save_GCC=$GCC
78270bb88ba4Smrg  lt_save_CFLAGS=$CFLAGS
7828a31a186aSmrg  CC=${FC-"f95"}
78290bb88ba4Smrg  CFLAGS=$FCFLAGS
7830a31a186aSmrg  compiler=$CC
7831a31a186aSmrg  GCC=$ac_cv_fc_compiler_gnu
7832a31a186aSmrg
7833a31a186aSmrg  _LT_TAGVAR(compiler, $1)=$CC
7834a31a186aSmrg  _LT_CC_BASENAME([$compiler])
7835fe5e51b7Smrg
7836a31a186aSmrg  if test -n "$compiler"; then
7837a31a186aSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7838a31a186aSmrg    AC_MSG_RESULT([$can_build_shared])
7839a31a186aSmrg
7840a31a186aSmrg    AC_MSG_CHECKING([whether to build shared libraries])
7841493f84f4Smrg    test no = "$can_build_shared" && enable_shared=no
7842a31a186aSmrg
7843a31a186aSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7844a31a186aSmrg    # are all built from PIC.
7845643b027fSmrg    case $host_os in
7846a31a186aSmrg      aix3*)
7847493f84f4Smrg        test yes = "$enable_shared" && enable_static=no
7848a31a186aSmrg        if test -n "$RANLIB"; then
7849a31a186aSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7850a31a186aSmrg          postinstall_cmds='$RANLIB $lib'
7851a31a186aSmrg        fi
7852a31a186aSmrg        ;;
7853643b027fSmrg      aix[[4-9]]*)
7854493f84f4Smrg	if test ia64 != "$host_cpu"; then
7855493f84f4Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7856493f84f4Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7857493f84f4Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7858493f84f4Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7859493f84f4Smrg	  esac
7860643b027fSmrg	fi
7861a31a186aSmrg        ;;
7862643b027fSmrg    esac
7863a31a186aSmrg    AC_MSG_RESULT([$enable_shared])
7864a31a186aSmrg
7865a31a186aSmrg    AC_MSG_CHECKING([whether to build static libraries])
7866a31a186aSmrg    # Make sure either enable_shared or enable_static is yes.
7867493f84f4Smrg    test yes = "$enable_shared" || enable_static=yes
7868a31a186aSmrg    AC_MSG_RESULT([$enable_static])
7869a31a186aSmrg
7870493f84f4Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7871493f84f4Smrg    _LT_TAGVAR(LD, $1)=$LD
7872a31a186aSmrg
7873a31a186aSmrg    ## CAVEAT EMPTOR:
7874a31a186aSmrg    ## There is no encapsulation within the following macros, do not change
7875a31a186aSmrg    ## the running order or otherwise move them around unless you know exactly
7876a31a186aSmrg    ## what you are doing...
7877a31a186aSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7878a31a186aSmrg    _LT_COMPILER_PIC($1)
7879a31a186aSmrg    _LT_COMPILER_C_O($1)
7880a31a186aSmrg    _LT_COMPILER_FILE_LOCKS($1)
7881a31a186aSmrg    _LT_LINKER_SHLIBS($1)
7882a31a186aSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7883a31a186aSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7884a31a186aSmrg
7885a31a186aSmrg    _LT_CONFIG($1)
7886a31a186aSmrg  fi # test -n "$compiler"
7887a31a186aSmrg
7888a31a186aSmrg  GCC=$lt_save_GCC
78890bb88ba4Smrg  CC=$lt_save_CC
78900bb88ba4Smrg  CFLAGS=$lt_save_CFLAGS
7891493f84f4Smrgfi # test yes != "$_lt_disable_FC"
7892eda3803bSmrg
7893a31a186aSmrgAC_LANG_POP
7894a31a186aSmrg])# _LT_LANG_FC_CONFIG
7895eda3803bSmrg
7896eda3803bSmrg
7897a31a186aSmrg# _LT_LANG_GCJ_CONFIG([TAG])
7898a31a186aSmrg# --------------------------
7899a31a186aSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7900a31a186aSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7901493f84f4Smrg# to write the compiler configuration to 'libtool'.
7902a31a186aSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
7903a31a186aSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7904a31a186aSmrgAC_LANG_SAVE
7905eda3803bSmrg
7906a31a186aSmrg# Source file extension for Java test sources.
7907a31a186aSmrgac_ext=java
7908eda3803bSmrg
7909a31a186aSmrg# Object file extension for compiled Java test sources.
7910a31a186aSmrgobjext=o
7911a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7912eda3803bSmrg
7913a31a186aSmrg# Code to be used in simple compile tests
7914a31a186aSmrglt_simple_compile_test_code="class foo {}"
7915eda3803bSmrg
7916a31a186aSmrg# Code to be used in simple link tests
7917a31a186aSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7918fe5e51b7Smrg
7919a31a186aSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7920a31a186aSmrg_LT_TAG_COMPILER
7921fe5e51b7Smrg
7922a31a186aSmrg# save warnings/boilerplate of simple test code
7923a31a186aSmrg_LT_COMPILER_BOILERPLATE
7924a31a186aSmrg_LT_LINKER_BOILERPLATE
7925fe5e51b7Smrg
7926a31a186aSmrg# Allow CC to be a program name with arguments.
79270bb88ba4Smrglt_save_CC=$CC
79280bb88ba4Smrglt_save_CFLAGS=$CFLAGS
7929a31a186aSmrglt_save_GCC=$GCC
7930a31a186aSmrgGCC=yes
7931a31a186aSmrgCC=${GCJ-"gcj"}
79320bb88ba4SmrgCFLAGS=$GCJFLAGS
7933a31a186aSmrgcompiler=$CC
7934a31a186aSmrg_LT_TAGVAR(compiler, $1)=$CC
7935493f84f4Smrg_LT_TAGVAR(LD, $1)=$LD
7936a31a186aSmrg_LT_CC_BASENAME([$compiler])
7937a31a186aSmrg
7938a31a186aSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7939a31a186aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7940a31a186aSmrg
7941a31a186aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
79420bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
79430bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7944a31a186aSmrg
7945a31a186aSmrgif test -n "$compiler"; then
7946a31a186aSmrg  _LT_COMPILER_NO_RTTI($1)
7947a31a186aSmrg  _LT_COMPILER_PIC($1)
7948a31a186aSmrg  _LT_COMPILER_C_O($1)
7949a31a186aSmrg  _LT_COMPILER_FILE_LOCKS($1)
7950a31a186aSmrg  _LT_LINKER_SHLIBS($1)
7951a31a186aSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7952a31a186aSmrg
7953a31a186aSmrg  _LT_CONFIG($1)
7954a31a186aSmrgfi
7955a31a186aSmrg
7956a31a186aSmrgAC_LANG_RESTORE
7957a31a186aSmrg
7958a31a186aSmrgGCC=$lt_save_GCC
79590bb88ba4SmrgCC=$lt_save_CC
79600bb88ba4SmrgCFLAGS=$lt_save_CFLAGS
7961a31a186aSmrg])# _LT_LANG_GCJ_CONFIG
7962a31a186aSmrg
7963a31a186aSmrg
79640bb88ba4Smrg# _LT_LANG_GO_CONFIG([TAG])
79650bb88ba4Smrg# --------------------------
79660bb88ba4Smrg# Ensure that the configuration variables for the GNU Go compiler
7967a31a186aSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7968493f84f4Smrg# to write the compiler configuration to 'libtool'.
79690bb88ba4Smrgm4_defun([_LT_LANG_GO_CONFIG],
79700bb88ba4Smrg[AC_REQUIRE([LT_PROG_GO])dnl
7971a31a186aSmrgAC_LANG_SAVE
7972a31a186aSmrg
79730bb88ba4Smrg# Source file extension for Go test sources.
79740bb88ba4Smrgac_ext=go
7975a31a186aSmrg
79760bb88ba4Smrg# Object file extension for compiled Go test sources.
7977a31a186aSmrgobjext=o
7978a31a186aSmrg_LT_TAGVAR(objext, $1)=$objext
7979a31a186aSmrg
7980a31a186aSmrg# Code to be used in simple compile tests
79810bb88ba4Smrglt_simple_compile_test_code="package main; func main() { }"
7982a31a186aSmrg
7983a31a186aSmrg# Code to be used in simple link tests
79840bb88ba4Smrglt_simple_link_test_code='package main; func main() { }'
7985a31a186aSmrg
7986a31a186aSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7987a31a186aSmrg_LT_TAG_COMPILER
7988a31a186aSmrg
7989a31a186aSmrg# save warnings/boilerplate of simple test code
7990a31a186aSmrg_LT_COMPILER_BOILERPLATE
7991a31a186aSmrg_LT_LINKER_BOILERPLATE
7992fe5e51b7Smrg
7993a31a186aSmrg# Allow CC to be a program name with arguments.
79940bb88ba4Smrglt_save_CC=$CC
79950bb88ba4Smrglt_save_CFLAGS=$CFLAGS
7996a31a186aSmrglt_save_GCC=$GCC
79970bb88ba4SmrgGCC=yes
79980bb88ba4SmrgCC=${GOC-"gccgo"}
79990bb88ba4SmrgCFLAGS=$GOFLAGS
8000a31a186aSmrgcompiler=$CC
8001a31a186aSmrg_LT_TAGVAR(compiler, $1)=$CC
8002493f84f4Smrg_LT_TAGVAR(LD, $1)=$LD
8003a31a186aSmrg_LT_CC_BASENAME([$compiler])
80040bb88ba4Smrg
80050bb88ba4Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
80060bb88ba4Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
80070bb88ba4Smrg
80080bb88ba4Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
80090bb88ba4Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
80100bb88ba4Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8011fe5e51b7Smrg
8012a31a186aSmrgif test -n "$compiler"; then
80130bb88ba4Smrg  _LT_COMPILER_NO_RTTI($1)
80140bb88ba4Smrg  _LT_COMPILER_PIC($1)
80150bb88ba4Smrg  _LT_COMPILER_C_O($1)
80160bb88ba4Smrg  _LT_COMPILER_FILE_LOCKS($1)
80170bb88ba4Smrg  _LT_LINKER_SHLIBS($1)
80180bb88ba4Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
80190bb88ba4Smrg
8020a31a186aSmrg  _LT_CONFIG($1)
8021a31a186aSmrgfi
8022fe5e51b7Smrg
8023a31a186aSmrgAC_LANG_RESTORE
8024fe5e51b7Smrg
80250bb88ba4SmrgGCC=$lt_save_GCC
80260bb88ba4SmrgCC=$lt_save_CC
80270bb88ba4SmrgCFLAGS=$lt_save_CFLAGS
80280bb88ba4Smrg])# _LT_LANG_GO_CONFIG
8029fe5e51b7Smrg
80300bb88ba4Smrg
80310bb88ba4Smrg# _LT_LANG_RC_CONFIG([TAG])
80320bb88ba4Smrg# -------------------------
80330bb88ba4Smrg# Ensure that the configuration variables for the Windows resource compiler
80340bb88ba4Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8035493f84f4Smrg# to write the compiler configuration to 'libtool'.
80360bb88ba4Smrgm4_defun([_LT_LANG_RC_CONFIG],
80370bb88ba4Smrg[AC_REQUIRE([LT_PROG_RC])dnl
80380bb88ba4SmrgAC_LANG_SAVE
80390bb88ba4Smrg
80400bb88ba4Smrg# Source file extension for RC test sources.
80410bb88ba4Smrgac_ext=rc
80420bb88ba4Smrg
80430bb88ba4Smrg# Object file extension for compiled RC test sources.
80440bb88ba4Smrgobjext=o
80450bb88ba4Smrg_LT_TAGVAR(objext, $1)=$objext
80460bb88ba4Smrg
80470bb88ba4Smrg# Code to be used in simple compile tests
80480bb88ba4Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
80490bb88ba4Smrg
80500bb88ba4Smrg# Code to be used in simple link tests
8051493f84f4Smrglt_simple_link_test_code=$lt_simple_compile_test_code
80520bb88ba4Smrg
80530bb88ba4Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80540bb88ba4Smrg_LT_TAG_COMPILER
80550bb88ba4Smrg
80560bb88ba4Smrg# save warnings/boilerplate of simple test code
80570bb88ba4Smrg_LT_COMPILER_BOILERPLATE
80580bb88ba4Smrg_LT_LINKER_BOILERPLATE
80590bb88ba4Smrg
80600bb88ba4Smrg# Allow CC to be a program name with arguments.
8061493f84f4Smrglt_save_CC=$CC
80620bb88ba4Smrglt_save_CFLAGS=$CFLAGS
80630bb88ba4Smrglt_save_GCC=$GCC
80640bb88ba4SmrgGCC=
80650bb88ba4SmrgCC=${RC-"windres"}
80660bb88ba4SmrgCFLAGS=
80670bb88ba4Smrgcompiler=$CC
80680bb88ba4Smrg_LT_TAGVAR(compiler, $1)=$CC
80690bb88ba4Smrg_LT_CC_BASENAME([$compiler])
80700bb88ba4Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
80710bb88ba4Smrg
80720bb88ba4Smrgif test -n "$compiler"; then
80730bb88ba4Smrg  :
80740bb88ba4Smrg  _LT_CONFIG($1)
80750bb88ba4Smrgfi
80760bb88ba4Smrg
80770bb88ba4SmrgGCC=$lt_save_GCC
80780bb88ba4SmrgAC_LANG_RESTORE
80790bb88ba4SmrgCC=$lt_save_CC
80800bb88ba4SmrgCFLAGS=$lt_save_CFLAGS
80810bb88ba4Smrg])# _LT_LANG_RC_CONFIG
80820bb88ba4Smrg
80830bb88ba4Smrg
80840bb88ba4Smrg# LT_PROG_GCJ
80850bb88ba4Smrg# -----------
80860bb88ba4SmrgAC_DEFUN([LT_PROG_GCJ],
80870bb88ba4Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8088a31a186aSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8089a31a186aSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
8090493f84f4Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8091a31a186aSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
8092a31a186aSmrg])
8093fe5e51b7Smrg
8094a31a186aSmrg# Old name:
8095a31a186aSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8096a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8097a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8098fe5e51b7Smrg
8099fe5e51b7Smrg
81000bb88ba4Smrg# LT_PROG_GO
81010bb88ba4Smrg# ----------
81020bb88ba4SmrgAC_DEFUN([LT_PROG_GO],
81030bb88ba4Smrg[AC_CHECK_TOOL(GOC, gccgo,)
81040bb88ba4Smrg])
81050bb88ba4Smrg
81060bb88ba4Smrg
8107a31a186aSmrg# LT_PROG_RC
8108a31a186aSmrg# ----------
8109a31a186aSmrgAC_DEFUN([LT_PROG_RC],
8110a31a186aSmrg[AC_CHECK_TOOL(RC, windres,)
8111a31a186aSmrg])
8112fe5e51b7Smrg
8113a31a186aSmrg# Old name:
8114a31a186aSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8115a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8116a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8117fe5e51b7Smrg
8118fe5e51b7Smrg
8119a31a186aSmrg# _LT_DECL_EGREP
8120a31a186aSmrg# --------------
8121a31a186aSmrg# If we don't have a new enough Autoconf to choose the best grep
8122a31a186aSmrg# available, choose the one first in the user's PATH.
8123a31a186aSmrgm4_defun([_LT_DECL_EGREP],
8124a31a186aSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8125a31a186aSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8126a31a186aSmrgtest -z "$GREP" && GREP=grep
8127a31a186aSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8128a31a186aSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8129a31a186aSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8130a31a186aSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8131a31a186aSmrgAC_SUBST([GREP])
8132a31a186aSmrg])
8133fe5e51b7Smrg
8134eda3803bSmrg
8135a31a186aSmrg# _LT_DECL_OBJDUMP
8136a31a186aSmrg# --------------
8137a31a186aSmrg# If we don't have a new enough Autoconf to choose the best objdump
8138a31a186aSmrg# available, choose the one first in the user's PATH.
8139a31a186aSmrgm4_defun([_LT_DECL_OBJDUMP],
8140a31a186aSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8141a31a186aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8142a31a186aSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8143a31a186aSmrgAC_SUBST([OBJDUMP])
8144a31a186aSmrg])
8145eda3803bSmrg
81460bb88ba4Smrg# _LT_DECL_DLLTOOL
81470bb88ba4Smrg# ----------------
81480bb88ba4Smrg# Ensure DLLTOOL variable is set.
81490bb88ba4Smrgm4_defun([_LT_DECL_DLLTOOL],
81500bb88ba4Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
81510bb88ba4Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
81520bb88ba4Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
81530bb88ba4SmrgAC_SUBST([DLLTOOL])
81540bb88ba4Smrg])
8155eda3803bSmrg
8156a31a186aSmrg# _LT_DECL_SED
8157a31a186aSmrg# ------------
8158a31a186aSmrg# Check for a fully-functional sed program, that truncates
8159a31a186aSmrg# as few characters as possible.  Prefer GNU sed if found.
8160a31a186aSmrgm4_defun([_LT_DECL_SED],
8161a31a186aSmrg[AC_PROG_SED
8162a31a186aSmrgtest -z "$SED" && SED=sed
8163a31a186aSmrgXsed="$SED -e 1s/^X//"
8164a31a186aSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8165a31a186aSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8166a31a186aSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8167a31a186aSmrg])# _LT_DECL_SED
8168a31a186aSmrg
8169a31a186aSmrgm4_ifndef([AC_PROG_SED], [
8170a31a186aSmrg# NOTE: This macro has been submitted for inclusion into   #
8171a31a186aSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8172a31a186aSmrg#  a released version of Autoconf we should remove this    #
8173a31a186aSmrg#  macro and use it instead.                               #
8174a31a186aSmrg
8175a31a186aSmrgm4_defun([AC_PROG_SED],
8176a31a186aSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8177a31a186aSmrgAC_CACHE_VAL(lt_cv_path_SED,
8178a31a186aSmrg[# Loop through the user's path and test for sed and gsed.
8179a31a186aSmrg# Then use that list of sed's as ones to test for truncation.
8180a31a186aSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8181a31a186aSmrgfor as_dir in $PATH
8182a31a186aSmrgdo
8183a31a186aSmrg  IFS=$as_save_IFS
8184a31a186aSmrg  test -z "$as_dir" && as_dir=.
8185a31a186aSmrg  for lt_ac_prog in sed gsed; do
8186a31a186aSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8187a31a186aSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8188a31a186aSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8189a31a186aSmrg      fi
8190a31a186aSmrg    done
8191a31a186aSmrg  done
8192a31a186aSmrgdone
8193a31a186aSmrgIFS=$as_save_IFS
8194a31a186aSmrglt_ac_max=0
8195a31a186aSmrglt_ac_count=0
8196a31a186aSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8197a31a186aSmrg# along with /bin/sed that truncates output.
8198a31a186aSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8199493f84f4Smrg  test ! -f "$lt_ac_sed" && continue
8200a31a186aSmrg  cat /dev/null > conftest.in
8201a31a186aSmrg  lt_ac_count=0
8202a31a186aSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8203a31a186aSmrg  # Check for GNU sed and select it if it is found.
8204a31a186aSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8205a31a186aSmrg    lt_cv_path_SED=$lt_ac_sed
8206a31a186aSmrg    break
8207fe5e51b7Smrg  fi
8208a31a186aSmrg  while true; do
8209a31a186aSmrg    cat conftest.in conftest.in >conftest.tmp
8210a31a186aSmrg    mv conftest.tmp conftest.in
8211a31a186aSmrg    cp conftest.in conftest.nl
8212a31a186aSmrg    echo >>conftest.nl
8213a31a186aSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8214a31a186aSmrg    cmp -s conftest.out conftest.nl || break
8215a31a186aSmrg    # 10000 chars as input seems more than enough
8216493f84f4Smrg    test 10 -lt "$lt_ac_count" && break
8217a31a186aSmrg    lt_ac_count=`expr $lt_ac_count + 1`
8218493f84f4Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8219a31a186aSmrg      lt_ac_max=$lt_ac_count
8220a31a186aSmrg      lt_cv_path_SED=$lt_ac_sed
8221a31a186aSmrg    fi
8222a31a186aSmrg  done
8223a31a186aSmrgdone
8224fe5e51b7Smrg])
8225a31a186aSmrgSED=$lt_cv_path_SED
8226a31a186aSmrgAC_SUBST([SED])
8227a31a186aSmrgAC_MSG_RESULT([$SED])
8228a31a186aSmrg])#AC_PROG_SED
8229a31a186aSmrg])#m4_ifndef
8230fe5e51b7Smrg
8231a31a186aSmrg# Old name:
8232a31a186aSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8233a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8234a31a186aSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8235a31a186aSmrg
8236a31a186aSmrg
8237a31a186aSmrg# _LT_CHECK_SHELL_FEATURES
8238a31a186aSmrg# ------------------------
8239a31a186aSmrg# Find out whether the shell is Bourne or XSI compatible,
8240a31a186aSmrg# or has some other useful features.
8241a31a186aSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8242493f84f4Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8243a31a186aSmrg  lt_unset=unset
8244a31a186aSmrgelse
8245a31a186aSmrg  lt_unset=false
8246fe5e51b7Smrgfi
8247a31a186aSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8248a31a186aSmrg
8249a31a186aSmrg# test EBCDIC or ASCII
8250a31a186aSmrgcase `echo X|tr X '\101'` in
8251a31a186aSmrg A) # ASCII based system
8252a31a186aSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8253a31a186aSmrg  lt_SP2NL='tr \040 \012'
8254a31a186aSmrg  lt_NL2SP='tr \015\012 \040\040'
8255a31a186aSmrg  ;;
8256a31a186aSmrg *) # EBCDIC based system
8257a31a186aSmrg  lt_SP2NL='tr \100 \n'
8258a31a186aSmrg  lt_NL2SP='tr \r\n \100\100'
8259a31a186aSmrg  ;;
8260fe5e51b7Smrgesac
8261a31a186aSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8262a31a186aSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8263a31a186aSmrg])# _LT_CHECK_SHELL_FEATURES
8264eda3803bSmrg
8265eda3803bSmrg
82660bb88ba4Smrg# _LT_PATH_CONVERSION_FUNCTIONS
82670bb88ba4Smrg# -----------------------------
8268493f84f4Smrg# Determine what file name conversion functions should be used by
82690bb88ba4Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
82700bb88ba4Smrg# for certain cross-compile configurations and native mingw.
82710bb88ba4Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
82720bb88ba4Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
82730bb88ba4SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
82740bb88ba4SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
82750bb88ba4SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
82760bb88ba4Smrg[case $host in
82770bb88ba4Smrg  *-*-mingw* )
82780bb88ba4Smrg    case $build in
82790bb88ba4Smrg      *-*-mingw* ) # actually msys
82800bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
82810bb88ba4Smrg        ;;
82820bb88ba4Smrg      *-*-cygwin* )
82830bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
82840bb88ba4Smrg        ;;
82850bb88ba4Smrg      * ) # otherwise, assume *nix
82860bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
82870bb88ba4Smrg        ;;
82880bb88ba4Smrg    esac
8289a31a186aSmrg    ;;
82900bb88ba4Smrg  *-*-cygwin* )
82910bb88ba4Smrg    case $build in
82920bb88ba4Smrg      *-*-mingw* ) # actually msys
82930bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
82940bb88ba4Smrg        ;;
82950bb88ba4Smrg      *-*-cygwin* )
82960bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
82970bb88ba4Smrg        ;;
82980bb88ba4Smrg      * ) # otherwise, assume *nix
82990bb88ba4Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
83000bb88ba4Smrg        ;;
83010bb88ba4Smrg    esac
8302a31a186aSmrg    ;;
83030bb88ba4Smrg  * ) # unhandled hosts (and "normal" native builds)
83040bb88ba4Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
83050bb88ba4Smrg    ;;
83060bb88ba4Smrgesac
83070bb88ba4Smrg])
83080bb88ba4Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
83090bb88ba4SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
83100bb88ba4Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
83110bb88ba4Smrg         [0], [convert $build file names to $host format])dnl
83120bb88ba4Smrg
83130bb88ba4SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
83140bb88ba4SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
83150bb88ba4Smrg[#assume ordinary cross tools, or native build.
83160bb88ba4Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
83170bb88ba4Smrgcase $host in
83180bb88ba4Smrg  *-*-mingw* )
83190bb88ba4Smrg    case $build in
83200bb88ba4Smrg      *-*-mingw* ) # actually msys
83210bb88ba4Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
83220bb88ba4Smrg        ;;
83230bb88ba4Smrg    esac
83240bb88ba4Smrg    ;;
83250bb88ba4Smrgesac
8326a31a186aSmrg])
83270bb88ba4Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
83280bb88ba4SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
83290bb88ba4Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
83300bb88ba4Smrg         [0], [convert $build files to toolchain format])dnl
83310bb88ba4Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
8332fe5e51b7Smrg
8333a31a186aSmrg# Helper functions for option handling.                    -*- Autoconf -*-
8334a31a186aSmrg#
8335493f84f4Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2014 Free Software
8336493f84f4Smrg#   Foundation, Inc.
8337a31a186aSmrg#   Written by Gary V. Vaughan, 2004
8338a31a186aSmrg#
8339a31a186aSmrg# This file is free software; the Free Software Foundation gives
8340a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8341a31a186aSmrg# modifications, as long as this notice is preserved.
8342fe5e51b7Smrg
8343493f84f4Smrg# serial 8 ltoptions.m4
8344fe5e51b7Smrg
8345a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8346a31a186aSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8347fe5e51b7Smrg
8348fe5e51b7Smrg
8349a31a186aSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8350a31a186aSmrg# ------------------------------------------
8351a31a186aSmrgm4_define([_LT_MANGLE_OPTION],
8352a31a186aSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8353fe5e51b7Smrg
8354fe5e51b7Smrg
8355a31a186aSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8356a31a186aSmrg# ---------------------------------------
8357a31a186aSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8358a31a186aSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8359a31a186aSmrg# saved as a flag.
8360a31a186aSmrgm4_define([_LT_SET_OPTION],
8361a31a186aSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8362a31a186aSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8363a31a186aSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
8364493f84f4Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
8365a31a186aSmrg])
8366fe5e51b7Smrg
8367fe5e51b7Smrg
8368a31a186aSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8369a31a186aSmrg# ------------------------------------------------------------
8370a31a186aSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8371a31a186aSmrgm4_define([_LT_IF_OPTION],
8372a31a186aSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8373a31a186aSmrg
8374a31a186aSmrg
8375a31a186aSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8376a31a186aSmrg# -------------------------------------------------------
8377a31a186aSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8378a31a186aSmrg# are set.
8379a31a186aSmrgm4_define([_LT_UNLESS_OPTIONS],
8380a31a186aSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8381a31a186aSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8382a31a186aSmrg		      [m4_define([$0_found])])])[]dnl
8383a31a186aSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8384a31a186aSmrg])[]dnl
8385a31a186aSmrg])
8386fe5e51b7Smrg
8387fe5e51b7Smrg
8388a31a186aSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8389a31a186aSmrg# ----------------------------------------
8390a31a186aSmrg# OPTION-LIST is a space-separated list of Libtool options associated
8391a31a186aSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8392a31a186aSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8393a31a186aSmrg# the unknown option and exit.
8394a31a186aSmrgm4_defun([_LT_SET_OPTIONS],
8395a31a186aSmrg[# Set options
8396a31a186aSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8397a31a186aSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
8398a31a186aSmrg
8399a31a186aSmrgm4_if([$1],[LT_INIT],[
8400a31a186aSmrg  dnl
8401a31a186aSmrg  dnl Simply set some default values (i.e off) if boolean options were not
8402a31a186aSmrg  dnl specified:
8403a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8404a31a186aSmrg  ])
8405a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8406a31a186aSmrg  ])
8407a31a186aSmrg  dnl
8408a31a186aSmrg  dnl If no reference was made to various pairs of opposing options, then
8409a31a186aSmrg  dnl we run the default mode handler for the pair.  For example, if neither
8410493f84f4Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8411a31a186aSmrg  dnl archives by default:
8412a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8413a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8414a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8415a31a186aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8416493f84f4Smrg		   [_LT_ENABLE_FAST_INSTALL])
8417493f84f4Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8418493f84f4Smrg		   [_LT_WITH_AIX_SONAME([aix])])
8419a31a186aSmrg  ])
8420a31a186aSmrg])# _LT_SET_OPTIONS
8421fe5e51b7Smrg
8422fe5e51b7Smrg
8423fe5e51b7Smrg
8424a31a186aSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8425a31a186aSmrg# -----------------------------------------
8426a31a186aSmrgm4_define([_LT_MANGLE_DEFUN],
8427a31a186aSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8428eda3803bSmrg
8429eda3803bSmrg
8430a31a186aSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8431a31a186aSmrg# -----------------------------------------------
8432a31a186aSmrgm4_define([LT_OPTION_DEFINE],
8433a31a186aSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8434a31a186aSmrg])# LT_OPTION_DEFINE
8435eda3803bSmrg
8436eda3803bSmrg
8437a31a186aSmrg# dlopen
8438a31a186aSmrg# ------
8439a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8440a31a186aSmrg])
8441a31a186aSmrg
8442a31a186aSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8443a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8444a31a186aSmrgAC_DIAGNOSE([obsolete],
8445a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8446493f84f4Smrgput the 'dlopen' option into LT_INIT's first parameter.])
8447a31a186aSmrg])
8448a31a186aSmrg
8449a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8450a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8451a31a186aSmrg
8452a31a186aSmrg
8453a31a186aSmrg# win32-dll
8454a31a186aSmrg# ---------
8455a31a186aSmrg# Declare package support for building win32 dll's.
8456a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8457a31a186aSmrg[enable_win32_dll=yes
8458a31a186aSmrg
8459a31a186aSmrgcase $host in
84600bb88ba4Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8461a31a186aSmrg  AC_CHECK_TOOL(AS, as, false)
8462a31a186aSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8463a31a186aSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8464a31a186aSmrg  ;;
8465a31a186aSmrgesac
8466fe5e51b7Smrg
8467a31a186aSmrgtest -z "$AS" && AS=as
84680bb88ba4Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8469fe5e51b7Smrg
8470a31a186aSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
84710bb88ba4Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8472fe5e51b7Smrg
8473a31a186aSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
84740bb88ba4Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8475a31a186aSmrg])# win32-dll
8476fe5e51b7Smrg
8477a31a186aSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8478a31a186aSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8479a31a186aSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8480a31a186aSmrgAC_DIAGNOSE([obsolete],
8481a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8482493f84f4Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
8483a31a186aSmrg])
8484fe5e51b7Smrg
8485a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8486a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8487fe5e51b7Smrg
8488fe5e51b7Smrg
8489a31a186aSmrg# _LT_ENABLE_SHARED([DEFAULT])
8490a31a186aSmrg# ----------------------------
8491493f84f4Smrg# implement the --enable-shared flag, and supports the 'shared' and
8492493f84f4Smrg# 'disable-shared' LT_INIT options.
8493493f84f4Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8494a31a186aSmrgm4_define([_LT_ENABLE_SHARED],
8495a31a186aSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8496a31a186aSmrgAC_ARG_ENABLE([shared],
8497a31a186aSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8498a31a186aSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8499a31a186aSmrg    [p=${PACKAGE-default}
8500a31a186aSmrg    case $enableval in
8501a31a186aSmrg    yes) enable_shared=yes ;;
8502a31a186aSmrg    no) enable_shared=no ;;
8503a31a186aSmrg    *)
8504a31a186aSmrg      enable_shared=no
8505a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
8506493f84f4Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8507a31a186aSmrg      for pkg in $enableval; do
8508493f84f4Smrg	IFS=$lt_save_ifs
8509a31a186aSmrg	if test "X$pkg" = "X$p"; then
8510a31a186aSmrg	  enable_shared=yes
8511a31a186aSmrg	fi
8512a31a186aSmrg      done
8513493f84f4Smrg      IFS=$lt_save_ifs
8514fe5e51b7Smrg      ;;
8515a31a186aSmrg    esac],
8516a31a186aSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8517fe5e51b7Smrg
8518a31a186aSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8519a31a186aSmrg	[Whether or not to build shared libraries])
8520a31a186aSmrg])# _LT_ENABLE_SHARED
8521fe5e51b7Smrg
8522a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8523a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8524fe5e51b7Smrg
8525a31a186aSmrg# Old names:
8526a31a186aSmrgAC_DEFUN([AC_ENABLE_SHARED],
8527a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8528a31a186aSmrg])
8529fe5e51b7Smrg
8530a31a186aSmrgAC_DEFUN([AC_DISABLE_SHARED],
8531a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8532a31a186aSmrg])
8533fe5e51b7Smrg
8534a31a186aSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8535a31a186aSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8536fe5e51b7Smrg
8537a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8538a31a186aSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8539a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8540fe5e51b7Smrg
8541fe5e51b7Smrg
8542fe5e51b7Smrg
8543a31a186aSmrg# _LT_ENABLE_STATIC([DEFAULT])
8544a31a186aSmrg# ----------------------------
8545493f84f4Smrg# implement the --enable-static flag, and support the 'static' and
8546493f84f4Smrg# 'disable-static' LT_INIT options.
8547493f84f4Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8548a31a186aSmrgm4_define([_LT_ENABLE_STATIC],
8549a31a186aSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8550a31a186aSmrgAC_ARG_ENABLE([static],
8551a31a186aSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8552a31a186aSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8553a31a186aSmrg    [p=${PACKAGE-default}
8554a31a186aSmrg    case $enableval in
8555a31a186aSmrg    yes) enable_static=yes ;;
8556a31a186aSmrg    no) enable_static=no ;;
8557a31a186aSmrg    *)
8558a31a186aSmrg     enable_static=no
8559a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
8560493f84f4Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8561a31a186aSmrg      for pkg in $enableval; do
8562493f84f4Smrg	IFS=$lt_save_ifs
8563a31a186aSmrg	if test "X$pkg" = "X$p"; then
8564a31a186aSmrg	  enable_static=yes
8565a31a186aSmrg	fi
8566a31a186aSmrg      done
8567493f84f4Smrg      IFS=$lt_save_ifs
8568fe5e51b7Smrg      ;;
8569a31a186aSmrg    esac],
8570a31a186aSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8571fe5e51b7Smrg
8572a31a186aSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
8573a31a186aSmrg	[Whether or not to build static libraries])
8574a31a186aSmrg])# _LT_ENABLE_STATIC
8575fe5e51b7Smrg
8576a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8577a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8578fe5e51b7Smrg
8579a31a186aSmrg# Old names:
8580a31a186aSmrgAC_DEFUN([AC_ENABLE_STATIC],
8581a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8582a31a186aSmrg])
8583fe5e51b7Smrg
8584a31a186aSmrgAC_DEFUN([AC_DISABLE_STATIC],
8585a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8586a31a186aSmrg])
8587fe5e51b7Smrg
8588a31a186aSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8589a31a186aSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8590fe5e51b7Smrg
8591a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8592a31a186aSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8593a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8594fe5e51b7Smrg
8595fe5e51b7Smrg
8596fe5e51b7Smrg
8597a31a186aSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8598a31a186aSmrg# ----------------------------------
8599493f84f4Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
8600493f84f4Smrg# and 'disable-fast-install' LT_INIT options.
8601493f84f4Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8602a31a186aSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
8603a31a186aSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8604a31a186aSmrgAC_ARG_ENABLE([fast-install],
8605a31a186aSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8606a31a186aSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8607a31a186aSmrg    [p=${PACKAGE-default}
8608a31a186aSmrg    case $enableval in
8609a31a186aSmrg    yes) enable_fast_install=yes ;;
8610a31a186aSmrg    no) enable_fast_install=no ;;
8611a31a186aSmrg    *)
8612a31a186aSmrg      enable_fast_install=no
8613a31a186aSmrg      # Look at the argument we got.  We use all the common list separators.
8614493f84f4Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8615a31a186aSmrg      for pkg in $enableval; do
8616493f84f4Smrg	IFS=$lt_save_ifs
8617a31a186aSmrg	if test "X$pkg" = "X$p"; then
8618a31a186aSmrg	  enable_fast_install=yes
8619eda3803bSmrg	fi
8620a31a186aSmrg      done
8621493f84f4Smrg      IFS=$lt_save_ifs
8622fe5e51b7Smrg      ;;
8623a31a186aSmrg    esac],
8624a31a186aSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8625fe5e51b7Smrg
8626a31a186aSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
8627a31a186aSmrg	 [Whether or not to optimize for fast installation])dnl
8628a31a186aSmrg])# _LT_ENABLE_FAST_INSTALL
8629fe5e51b7Smrg
8630a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8631a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8632fe5e51b7Smrg
8633a31a186aSmrg# Old names:
8634a31a186aSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8635a31a186aSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8636a31a186aSmrgAC_DIAGNOSE([obsolete],
8637a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8638493f84f4Smrgthe 'fast-install' option into LT_INIT's first parameter.])
8639a31a186aSmrg])
8640fe5e51b7Smrg
8641a31a186aSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8642a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8643a31a186aSmrgAC_DIAGNOSE([obsolete],
8644a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8645493f84f4Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
8646a31a186aSmrg])
8647fe5e51b7Smrg
8648a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8649a31a186aSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8650a31a186aSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8651fe5e51b7Smrg
8652fe5e51b7Smrg
8653493f84f4Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
8654493f84f4Smrg# ----------------------------------
8655493f84f4Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8656493f84f4Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8657493f84f4Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8658493f84f4Smrgm4_define([_LT_WITH_AIX_SONAME],
8659493f84f4Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8660493f84f4Smrgshared_archive_member_spec=
8661493f84f4Smrgcase $host,$enable_shared in
8662493f84f4Smrgpower*-*-aix[[5-9]]*,yes)
8663493f84f4Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8664493f84f4Smrg  AC_ARG_WITH([aix-soname],
8665493f84f4Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8666493f84f4Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8667493f84f4Smrg    [case $withval in
8668493f84f4Smrg    aix|svr4|both)
8669493f84f4Smrg      ;;
8670493f84f4Smrg    *)
8671493f84f4Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8672493f84f4Smrg      ;;
8673493f84f4Smrg    esac
8674493f84f4Smrg    lt_cv_with_aix_soname=$with_aix_soname],
8675493f84f4Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8676493f84f4Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8677493f84f4Smrg    with_aix_soname=$lt_cv_with_aix_soname])
8678493f84f4Smrg  AC_MSG_RESULT([$with_aix_soname])
8679493f84f4Smrg  if test aix != "$with_aix_soname"; then
8680493f84f4Smrg    # For the AIX way of multilib, we name the shared archive member
8681493f84f4Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8682493f84f4Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8683493f84f4Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8684493f84f4Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8685493f84f4Smrg    if test 64 = "${OBJECT_MODE-32}"; then
8686493f84f4Smrg      shared_archive_member_spec=shr_64
8687493f84f4Smrg    else
8688493f84f4Smrg      shared_archive_member_spec=shr
8689493f84f4Smrg    fi
8690493f84f4Smrg  fi
8691493f84f4Smrg  ;;
8692493f84f4Smrg*)
8693493f84f4Smrg  with_aix_soname=aix
8694493f84f4Smrg  ;;
8695493f84f4Smrgesac
8696493f84f4Smrg
8697493f84f4Smrg_LT_DECL([], [shared_archive_member_spec], [0],
8698493f84f4Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8699493f84f4Smrg])# _LT_WITH_AIX_SONAME
8700493f84f4Smrg
8701493f84f4SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8702493f84f4SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8703493f84f4SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8704493f84f4Smrg
8705493f84f4Smrg
8706a31a186aSmrg# _LT_WITH_PIC([MODE])
8707a31a186aSmrg# --------------------
8708493f84f4Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8709a31a186aSmrg# LT_INIT options.
8710493f84f4Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8711a31a186aSmrgm4_define([_LT_WITH_PIC],
8712a31a186aSmrg[AC_ARG_WITH([pic],
87130bb88ba4Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8714a31a186aSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
87150bb88ba4Smrg    [lt_p=${PACKAGE-default}
87160bb88ba4Smrg    case $withval in
87170bb88ba4Smrg    yes|no) pic_mode=$withval ;;
87180bb88ba4Smrg    *)
87190bb88ba4Smrg      pic_mode=default
87200bb88ba4Smrg      # Look at the argument we got.  We use all the common list separators.
8721493f84f4Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
87220bb88ba4Smrg      for lt_pkg in $withval; do
8723493f84f4Smrg	IFS=$lt_save_ifs
87240bb88ba4Smrg	if test "X$lt_pkg" = "X$lt_p"; then
87250bb88ba4Smrg	  pic_mode=yes
87260bb88ba4Smrg	fi
87270bb88ba4Smrg      done
8728493f84f4Smrg      IFS=$lt_save_ifs
87290bb88ba4Smrg      ;;
87300bb88ba4Smrg    esac],
8731493f84f4Smrg    [pic_mode=m4_default([$1], [default])])
8732fe5e51b7Smrg
8733a31a186aSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8734a31a186aSmrg])# _LT_WITH_PIC
8735eda3803bSmrg
8736a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8737a31a186aSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8738eda3803bSmrg
8739a31a186aSmrg# Old name:
8740a31a186aSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8741a31a186aSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8742a31a186aSmrgAC_DIAGNOSE([obsolete],
8743a31a186aSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8744493f84f4Smrgput the 'pic-only' option into LT_INIT's first parameter.])
8745fe5e51b7Smrg])
8746fe5e51b7Smrg
8747a31a186aSmrgdnl aclocal-1.4 backwards compatibility:
8748a31a186aSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8749fe5e51b7Smrg
8750fe5e51b7Smrg
8751a31a186aSmrgm4_define([_LTDL_MODE], [])
8752a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8753a31a186aSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8754a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8755a31a186aSmrg		 [m4_define([_LTDL_MODE], [recursive])])
8756a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8757a31a186aSmrg		 [m4_define([_LTDL_MODE], [subproject])])
8758fe5e51b7Smrg
8759a31a186aSmrgm4_define([_LTDL_TYPE], [])
8760a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8761a31a186aSmrg		 [m4_define([_LTDL_TYPE], [installable])])
8762a31a186aSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8763a31a186aSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
8764fe5e51b7Smrg
8765a31a186aSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8766fe5e51b7Smrg#
8767493f84f4Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2014 Free Software
8768493f84f4Smrg# Foundation, Inc.
8769a31a186aSmrg# Written by Gary V. Vaughan, 2004
8770fe5e51b7Smrg#
8771a31a186aSmrg# This file is free software; the Free Software Foundation gives
8772a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8773a31a186aSmrg# modifications, as long as this notice is preserved.
8774a31a186aSmrg
8775a31a186aSmrg# serial 6 ltsugar.m4
8776a31a186aSmrg
8777a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8778a31a186aSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8779a31a186aSmrg
8780a31a186aSmrg
8781a31a186aSmrg# lt_join(SEP, ARG1, [ARG2...])
8782a31a186aSmrg# -----------------------------
8783a31a186aSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8784a31a186aSmrg# associated separator.
8785a31a186aSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8786a31a186aSmrg# versions in m4sugar had bugs.
8787a31a186aSmrgm4_define([lt_join],
8788a31a186aSmrg[m4_if([$#], [1], [],
8789a31a186aSmrg       [$#], [2], [[$2]],
8790a31a186aSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8791a31a186aSmrgm4_define([_lt_join],
8792a31a186aSmrg[m4_if([$#$2], [2], [],
8793a31a186aSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8794a31a186aSmrg
8795a31a186aSmrg
8796a31a186aSmrg# lt_car(LIST)
8797a31a186aSmrg# lt_cdr(LIST)
8798a31a186aSmrg# ------------
8799a31a186aSmrg# Manipulate m4 lists.
8800a31a186aSmrg# These macros are necessary as long as will still need to support
8801493f84f4Smrg# Autoconf-2.59, which quotes differently.
8802a31a186aSmrgm4_define([lt_car], [[$1]])
8803a31a186aSmrgm4_define([lt_cdr],
8804a31a186aSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8805a31a186aSmrg       [$#], 1, [],
8806a31a186aSmrg       [m4_dquote(m4_shift($@))])])
8807a31a186aSmrgm4_define([lt_unquote], $1)
8808a31a186aSmrg
8809a31a186aSmrg
8810a31a186aSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8811a31a186aSmrg# ------------------------------------------
8812493f84f4Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8813a31a186aSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8814a31a186aSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8815a31a186aSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8816a31a186aSmrg# than defined and empty).
8817643b027fSmrg#
8818a31a186aSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8819a31a186aSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8820a31a186aSmrgm4_define([lt_append],
8821a31a186aSmrg[m4_define([$1],
8822a31a186aSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8823a31a186aSmrg
8824a31a186aSmrg
8825a31a186aSmrg
8826a31a186aSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8827a31a186aSmrg# ----------------------------------------------------------
8828a31a186aSmrg# Produce a SEP delimited list of all paired combinations of elements of
8829a31a186aSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8830a31a186aSmrg# has the form PREFIXmINFIXSUFFIXn.
8831a31a186aSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8832a31a186aSmrgm4_define([lt_combine],
8833a31a186aSmrg[m4_if(m4_eval([$# > 3]), [1],
8834a31a186aSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8835a31a186aSmrg[[m4_foreach([_Lt_prefix], [$2],
8836a31a186aSmrg	     [m4_foreach([_Lt_suffix],
8837a31a186aSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8838a31a186aSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8839a31a186aSmrg
8840a31a186aSmrg
8841a31a186aSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8842a31a186aSmrg# -----------------------------------------------------------------------
8843a31a186aSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8844a31a186aSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8845a31a186aSmrgm4_define([lt_if_append_uniq],
8846a31a186aSmrg[m4_ifdef([$1],
8847a31a186aSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8848a31a186aSmrg		 [lt_append([$1], [$2], [$3])$4],
8849a31a186aSmrg		 [$5])],
8850a31a186aSmrg	  [lt_append([$1], [$2], [$3])$4])])
8851a31a186aSmrg
8852a31a186aSmrg
8853a31a186aSmrg# lt_dict_add(DICT, KEY, VALUE)
8854a31a186aSmrg# -----------------------------
8855a31a186aSmrgm4_define([lt_dict_add],
8856a31a186aSmrg[m4_define([$1($2)], [$3])])
8857fe5e51b7Smrg
8858eda3803bSmrg
8859a31a186aSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8860a31a186aSmrg# --------------------------------------------
8861a31a186aSmrgm4_define([lt_dict_add_subkey],
8862a31a186aSmrg[m4_define([$1($2:$3)], [$4])])
8863fe5e51b7Smrg
8864fe5e51b7Smrg
8865a31a186aSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8866a31a186aSmrg# ----------------------------------
8867a31a186aSmrgm4_define([lt_dict_fetch],
8868a31a186aSmrg[m4_ifval([$3],
8869a31a186aSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8870a31a186aSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8871fe5e51b7Smrg
8872fe5e51b7Smrg
8873a31a186aSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8874a31a186aSmrg# -----------------------------------------------------------------
8875a31a186aSmrgm4_define([lt_if_dict_fetch],
8876a31a186aSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8877a31a186aSmrg	[$5],
8878a31a186aSmrg    [$6])])
8879fe5e51b7Smrg
8880a31a186aSmrg
8881a31a186aSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8882a31a186aSmrg# --------------------------------------------------------------
8883a31a186aSmrgm4_define([lt_dict_filter],
8884a31a186aSmrg[m4_if([$5], [], [],
8885a31a186aSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8886a31a186aSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8887a31a186aSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8888fe5e51b7Smrg])
8889fe5e51b7Smrg
8890a31a186aSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8891a31a186aSmrg#
8892493f84f4Smrg#   Copyright (C) 2004, 2011-2014 Free Software Foundation, Inc.
8893a31a186aSmrg#   Written by Scott James Remnant, 2004
8894a31a186aSmrg#
8895a31a186aSmrg# This file is free software; the Free Software Foundation gives
8896a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8897a31a186aSmrg# modifications, as long as this notice is preserved.
8898fe5e51b7Smrg
88990bb88ba4Smrg# @configure_input@
8900fe5e51b7Smrg
8901493f84f4Smrg# serial 4151 ltversion.m4
8902a31a186aSmrg# This file is part of GNU Libtool
8903fe5e51b7Smrg
8904493f84f4Smrgm4_define([LT_PACKAGE_VERSION], [2.4.4])
8905493f84f4Smrgm4_define([LT_PACKAGE_REVISION], [2.4.4])
8906fe5e51b7Smrg
8907a31a186aSmrgAC_DEFUN([LTVERSION_VERSION],
8908493f84f4Smrg[macro_version='2.4.4'
8909493f84f4Smrgmacro_revision='2.4.4'
8910a31a186aSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8911a31a186aSmrg_LT_DECL(, macro_revision, 0)
8912fe5e51b7Smrg])
8913eda3803bSmrg
8914a31a186aSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8915a31a186aSmrg#
8916493f84f4Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2014 Free Software
8917493f84f4Smrg#   Foundation, Inc.
8918a31a186aSmrg#   Written by Scott James Remnant, 2004.
8919a31a186aSmrg#
8920a31a186aSmrg# This file is free software; the Free Software Foundation gives
8921a31a186aSmrg# unlimited permission to copy and/or distribute it, with or without
8922a31a186aSmrg# modifications, as long as this notice is preserved.
8923a31a186aSmrg
89240bb88ba4Smrg# serial 5 lt~obsolete.m4
8925a31a186aSmrg
8926a31a186aSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
8927a31a186aSmrg#
8928493f84f4Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8929a31a186aSmrg# which have later been changed to m4_define as they aren't part of the
8930a31a186aSmrg# exported API, or moved to Autoconf or Automake where they belong.
8931a31a186aSmrg#
8932a31a186aSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8933a31a186aSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8934a31a186aSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
8935a31a186aSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8936a31a186aSmrg# and doesn't know about Autoconf macros at all.)
8937a31a186aSmrg#
8938a31a186aSmrg# So we provide this file, which has a silly filename so it's always
8939a31a186aSmrg# included after everything else.  This provides aclocal with the
8940a31a186aSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8941a31a186aSmrg# because those macros already exist, or will be overwritten later.
8942493f84f4Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8943a31a186aSmrg#
8944a31a186aSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8945a31a186aSmrg# Yes, that means every name once taken will need to remain here until
8946a31a186aSmrg# we give up compatibility with versions before 1.7, at which point
8947a31a186aSmrg# we need to keep only those names which we still refer to.
8948a31a186aSmrg
8949a31a186aSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8950a31a186aSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8951a31a186aSmrg
8952a31a186aSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8953a31a186aSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8954a31a186aSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8955a31a186aSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8956a31a186aSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8957a31a186aSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8958a31a186aSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8959a31a186aSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8960a31a186aSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8961a31a186aSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8962a31a186aSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8963a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8964a31a186aSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8965a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8966a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8967a31a186aSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8968a31a186aSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8969a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8970a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8971a31a186aSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8972a31a186aSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8973a31a186aSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8974a31a186aSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8975a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8976a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8977a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8978a31a186aSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8979a31a186aSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8980a31a186aSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8981a31a186aSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8982a31a186aSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8983a31a186aSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8984a31a186aSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8985a31a186aSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8986a31a186aSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8987a31a186aSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8988a31a186aSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8989a31a186aSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8990a31a186aSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8991a31a186aSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8992a31a186aSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8993a31a186aSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8994a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8995a31a186aSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8996a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8997a31a186aSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8998a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8999a31a186aSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9000a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9001a31a186aSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9002a31a186aSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9003a31a186aSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9004a31a186aSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9005a31a186aSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
90060bb88ba4Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
90070bb88ba4Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
90080bb88ba4Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
90090bb88ba4Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
90100bb88ba4Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
90110bb88ba4Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
90120bb88ba4Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9013a31a186aSmrg
9014fe5e51b7Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
90150bb88ba4Smrg# serial 1 (pkg-config-0.24)
9016fe5e51b7Smrg# 
9017fe5e51b7Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9018fe5e51b7Smrg#
9019fe5e51b7Smrg# This program is free software; you can redistribute it and/or modify
9020fe5e51b7Smrg# it under the terms of the GNU General Public License as published by
9021fe5e51b7Smrg# the Free Software Foundation; either version 2 of the License, or
9022fe5e51b7Smrg# (at your option) any later version.
9023fe5e51b7Smrg#
9024fe5e51b7Smrg# This program is distributed in the hope that it will be useful, but
9025fe5e51b7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
9026fe5e51b7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9027fe5e51b7Smrg# General Public License for more details.
9028fe5e51b7Smrg#
9029fe5e51b7Smrg# You should have received a copy of the GNU General Public License
9030fe5e51b7Smrg# along with this program; if not, write to the Free Software
9031fe5e51b7Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9032fe5e51b7Smrg#
9033fe5e51b7Smrg# As a special exception to the GNU General Public License, if you
9034fe5e51b7Smrg# distribute this file as part of a program that contains a
9035fe5e51b7Smrg# configuration script generated by Autoconf, you may include it under
9036fe5e51b7Smrg# the same distribution terms that you use for the rest of that program.
9037fe5e51b7Smrg
9038fe5e51b7Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9039fe5e51b7Smrg# ----------------------------------
9040fe5e51b7SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9041fe5e51b7Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9042acd6767fSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9043acd6767fSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
90440bb88ba4SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
90450bb88ba4SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
90460bb88ba4SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
90470bb88ba4Smrg
9048fe5e51b7Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9049fe5e51b7Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9050fe5e51b7Smrgfi
9051fe5e51b7Smrgif test -n "$PKG_CONFIG"; then
9052fe5e51b7Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
9053fe5e51b7Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9054fe5e51b7Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9055fe5e51b7Smrg		AC_MSG_RESULT([yes])
9056fe5e51b7Smrg	else
9057fe5e51b7Smrg		AC_MSG_RESULT([no])
9058fe5e51b7Smrg		PKG_CONFIG=""
9059fe5e51b7Smrg	fi
9060fe5e51b7Smrgfi[]dnl
9061fe5e51b7Smrg])# PKG_PROG_PKG_CONFIG
9062fe5e51b7Smrg
9063fe5e51b7Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9064fe5e51b7Smrg#
9065fe5e51b7Smrg# Check to see whether a particular set of modules exists.  Similar
9066fe5e51b7Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9067fe5e51b7Smrg#
90680bb88ba4Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
90690bb88ba4Smrg# only at the first occurence in configure.ac, so if the first place
90700bb88ba4Smrg# it's called might be skipped (such as if it is within an "if", you
90710bb88ba4Smrg# have to call PKG_CHECK_EXISTS manually
9072fe5e51b7Smrg# --------------------------------------------------------------
9073fe5e51b7SmrgAC_DEFUN([PKG_CHECK_EXISTS],
9074fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9075fe5e51b7Smrgif test -n "$PKG_CONFIG" && \
9076fe5e51b7Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
90770bb88ba4Smrg  m4_default([$2], [:])
9078fe5e51b7Smrgm4_ifvaln([$3], [else
9079fe5e51b7Smrg  $3])dnl
9080fe5e51b7Smrgfi])
9081fe5e51b7Smrg
9082fe5e51b7Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9083fe5e51b7Smrg# ---------------------------------------------
9084fe5e51b7Smrgm4_define([_PKG_CONFIG],
9085eda3803bSmrg[if test -n "$$1"; then
9086eda3803bSmrg    pkg_cv_[]$1="$$1"
9087eda3803bSmrg elif test -n "$PKG_CONFIG"; then
9088eda3803bSmrg    PKG_CHECK_EXISTS([$3],
9089acd6767fSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9090acd6767fSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9091eda3803bSmrg		     [pkg_failed=yes])
9092eda3803bSmrg else
9093eda3803bSmrg    pkg_failed=untried
9094fe5e51b7Smrgfi[]dnl
9095fe5e51b7Smrg])# _PKG_CONFIG
9096fe5e51b7Smrg
9097fe5e51b7Smrg# _PKG_SHORT_ERRORS_SUPPORTED
9098fe5e51b7Smrg# -----------------------------
9099fe5e51b7SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9100fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9101fe5e51b7Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9102fe5e51b7Smrg        _pkg_short_errors_supported=yes
9103fe5e51b7Smrgelse
9104fe5e51b7Smrg        _pkg_short_errors_supported=no
9105fe5e51b7Smrgfi[]dnl
9106fe5e51b7Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
9107fe5e51b7Smrg
9108fe5e51b7Smrg
9109fe5e51b7Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9110fe5e51b7Smrg# [ACTION-IF-NOT-FOUND])
9111fe5e51b7Smrg#
9112fe5e51b7Smrg#
9113fe5e51b7Smrg# Note that if there is a possibility the first call to
9114fe5e51b7Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
9115fe5e51b7Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9116fe5e51b7Smrg#
9117fe5e51b7Smrg#
9118fe5e51b7Smrg# --------------------------------------------------------------
9119fe5e51b7SmrgAC_DEFUN([PKG_CHECK_MODULES],
9120fe5e51b7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9121fe5e51b7SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9122fe5e51b7SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9123fe5e51b7Smrg
9124fe5e51b7Smrgpkg_failed=no
9125fe5e51b7SmrgAC_MSG_CHECKING([for $1])
9126fe5e51b7Smrg
9127fe5e51b7Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9128fe5e51b7Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9129fe5e51b7Smrg
9130fe5e51b7Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9131fe5e51b7Smrgand $1[]_LIBS to avoid the need to call pkg-config.
9132fe5e51b7SmrgSee the pkg-config man page for more details.])
9133fe5e51b7Smrg
9134fe5e51b7Smrgif test $pkg_failed = yes; then
91350bb88ba4Smrg   	AC_MSG_RESULT([no])
9136fe5e51b7Smrg        _PKG_SHORT_ERRORS_SUPPORTED
9137fe5e51b7Smrg        if test $_pkg_short_errors_supported = yes; then
9138acd6767fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9139fe5e51b7Smrg        else 
9140acd6767fSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9141fe5e51b7Smrg        fi
9142fe5e51b7Smrg	# Put the nasty error message in config.log where it belongs
9143fe5e51b7Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9144fe5e51b7Smrg
91450bb88ba4Smrg	m4_default([$4], [AC_MSG_ERROR(
9146fe5e51b7Smrg[Package requirements ($2) were not met:
9147fe5e51b7Smrg
9148fe5e51b7Smrg$$1_PKG_ERRORS
9149fe5e51b7Smrg
9150fe5e51b7SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9151fe5e51b7Smrginstalled software in a non-standard prefix.
9152fe5e51b7Smrg
9153acd6767fSmrg_PKG_TEXT])[]dnl
91540bb88ba4Smrg        ])
9155fe5e51b7Smrgelif test $pkg_failed = untried; then
91560bb88ba4Smrg     	AC_MSG_RESULT([no])
91570bb88ba4Smrg	m4_default([$4], [AC_MSG_FAILURE(
9158fe5e51b7Smrg[The pkg-config script could not be found or is too old.  Make sure it
9159fe5e51b7Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
9160fe5e51b7Smrgpath to pkg-config.
9161fe5e51b7Smrg
9162fe5e51b7Smrg_PKG_TEXT
9163fe5e51b7Smrg
9164acd6767fSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
91650bb88ba4Smrg        ])
9166fe5e51b7Smrgelse
9167fe5e51b7Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9168fe5e51b7Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9169fe5e51b7Smrg        AC_MSG_RESULT([yes])
91700bb88ba4Smrg	$3
9171fe5e51b7Smrgfi[]dnl
9172fe5e51b7Smrg])# PKG_CHECK_MODULES
9173fe5e51b7Smrg
9174acd6767fSmrg
9175acd6767fSmrg# PKG_INSTALLDIR(DIRECTORY)
9176acd6767fSmrg# -------------------------
9177acd6767fSmrg# Substitutes the variable pkgconfigdir as the location where a module
9178acd6767fSmrg# should install pkg-config .pc files. By default the directory is
9179acd6767fSmrg# $libdir/pkgconfig, but the default can be changed by passing
9180acd6767fSmrg# DIRECTORY. The user can override through the --with-pkgconfigdir
9181acd6767fSmrg# parameter.
9182acd6767fSmrgAC_DEFUN([PKG_INSTALLDIR],
9183acd6767fSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9184acd6767fSmrgm4_pushdef([pkg_description],
9185acd6767fSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9186acd6767fSmrgAC_ARG_WITH([pkgconfigdir],
9187acd6767fSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9188acd6767fSmrg    [with_pkgconfigdir=]pkg_default)
9189acd6767fSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9190acd6767fSmrgm4_popdef([pkg_default])
9191acd6767fSmrgm4_popdef([pkg_description])
9192acd6767fSmrg]) dnl PKG_INSTALLDIR
9193acd6767fSmrg
9194acd6767fSmrg
9195acd6767fSmrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
9196acd6767fSmrg# -------------------------
9197acd6767fSmrg# Substitutes the variable noarch_pkgconfigdir as the location where a
9198acd6767fSmrg# module should install arch-independent pkg-config .pc files. By
9199acd6767fSmrg# default the directory is $datadir/pkgconfig, but the default can be
9200acd6767fSmrg# changed by passing DIRECTORY. The user can override through the
9201acd6767fSmrg# --with-noarch-pkgconfigdir parameter.
9202acd6767fSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9203acd6767fSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9204acd6767fSmrgm4_pushdef([pkg_description],
9205acd6767fSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9206acd6767fSmrgAC_ARG_WITH([noarch-pkgconfigdir],
9207acd6767fSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9208acd6767fSmrg    [with_noarch_pkgconfigdir=]pkg_default)
9209acd6767fSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9210acd6767fSmrgm4_popdef([pkg_default])
9211acd6767fSmrgm4_popdef([pkg_description])
9212acd6767fSmrg]) dnl PKG_NOARCH_INSTALLDIR
9213acd6767fSmrg
9214493f84f4Smrg
9215493f84f4Smrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9216493f84f4Smrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9217493f84f4Smrg# -------------------------------------------
9218493f84f4Smrg# Retrieves the value of the pkg-config variable for the given module.
9219493f84f4SmrgAC_DEFUN([PKG_CHECK_VAR],
9220493f84f4Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9221493f84f4SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
9222493f84f4Smrg
9223493f84f4Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9224493f84f4SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
9225493f84f4Smrg
9226493f84f4SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9227493f84f4Smrg])# PKG_CHECK_VAR
9228493f84f4Smrg
9229eda3803bSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9230fe5e51b7Smrgdnl
92310bb88ba4Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9232493f84f4Smrgdnl
9233fe5e51b7Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9234d7be9c72Smrgdnl copy of this software and associated documentation files (the "Software"),
9235d7be9c72Smrgdnl to deal in the Software without restriction, including without limitation
9236d7be9c72Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9237d7be9c72Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
9238d7be9c72Smrgdnl Software is furnished to do so, subject to the following conditions:
9239fe5e51b7Smrgdnl
9240d7be9c72Smrgdnl The above copyright notice and this permission notice (including the next
9241d7be9c72Smrgdnl paragraph) shall be included in all copies or substantial portions of the
9242d7be9c72Smrgdnl Software.
9243fe5e51b7Smrgdnl
9244d7be9c72Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9245d7be9c72Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9246d7be9c72Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9247d7be9c72Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9248d7be9c72Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9249d7be9c72Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9250d7be9c72Smrgdnl DEALINGS IN THE SOFTWARE.
9251fe5e51b7Smrg
9252fe5e51b7Smrg# XORG_MACROS_VERSION(required-version)
9253fe5e51b7Smrg# -------------------------------------
9254fe5e51b7Smrg# Minimum version: 1.1.0
9255fe5e51b7Smrg#
9256fe5e51b7Smrg# If you're using a macro added in Version 1.1 or newer, include this in
9257fe5e51b7Smrg# your configure.ac with the minimum required version, such as:
9258fe5e51b7Smrg# XORG_MACROS_VERSION(1.1)
9259fe5e51b7Smrg#
9260a31a186aSmrg# To ensure that this macro is defined, also add:
9261a31a186aSmrg# m4_ifndef([XORG_MACROS_VERSION],
9262a31a186aSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9263fe5e51b7Smrg#
9264fe5e51b7Smrg#
9265493f84f4Smrg# See the "minimum version" comment for each macro you use to see what
9266fe5e51b7Smrg# version you require.
9267a31a186aSmrgm4_defun([XORG_MACROS_VERSION],[
9268493f84f4Smrgm4_define([vers_have], [1.18.0])
9269a31a186aSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9270a31a186aSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9271a31a186aSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9272a31a186aSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9273a31a186aSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9274a31a186aSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9275a31a186aSmrgm4_undefine([vers_have])
9276a31a186aSmrgm4_undefine([maj_have])
9277a31a186aSmrgm4_undefine([maj_needed])
9278fe5e51b7Smrg]) # XORG_MACROS_VERSION
9279fe5e51b7Smrg
9280fe5e51b7Smrg# XORG_PROG_RAWCPP()
9281fe5e51b7Smrg# ------------------
9282fe5e51b7Smrg# Minimum version: 1.0.0
9283fe5e51b7Smrg#
9284fe5e51b7Smrg# Find cpp program and necessary flags for use in pre-processing text files
9285fe5e51b7Smrg# such as man pages and config files
9286fe5e51b7SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9287fe5e51b7SmrgAC_REQUIRE([AC_PROG_CPP])
9288493f84f4SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9289fe5e51b7Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9290fe5e51b7Smrg
9291fe5e51b7Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9292fe5e51b7Smrg# which is not the best choice for supporting other OS'es, but covers most
9293fe5e51b7Smrg# of the ones we need for now.
9294fe5e51b7SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
92950bb88ba4SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9296fe5e51b7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9297fe5e51b7Smrg	AC_MSG_RESULT([no])
9298fe5e51b7Smrgelse
9299fe5e51b7Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9300fe5e51b7Smrg		RAWCPPFLAGS=-undef
9301fe5e51b7Smrg		AC_MSG_RESULT([yes])
9302eda3803bSmrg	# under Cygwin unix is still defined even with -undef
9303eda3803bSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9304eda3803bSmrg		RAWCPPFLAGS="-undef -ansi"
9305eda3803bSmrg		AC_MSG_RESULT([yes, with -ansi])
9306fe5e51b7Smrg	else
9307fe5e51b7Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9308fe5e51b7Smrg	fi
9309fe5e51b7Smrgfi
9310fe5e51b7Smrgrm -f conftest.$ac_ext
9311fe5e51b7Smrg
9312fe5e51b7SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
93130bb88ba4SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9314fe5e51b7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9315fe5e51b7Smrg	AC_MSG_RESULT([no])
9316fe5e51b7Smrgelse
9317fe5e51b7Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9318fe5e51b7Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9319fe5e51b7Smrg		AC_MSG_RESULT([yes])
9320fe5e51b7Smrg	else
9321fe5e51b7Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9322fe5e51b7Smrg	fi
9323fe5e51b7Smrgfi
9324fe5e51b7Smrgrm -f conftest.$ac_ext
9325fe5e51b7SmrgAC_SUBST(RAWCPPFLAGS)
9326fe5e51b7Smrg]) # XORG_PROG_RAWCPP
9327fe5e51b7Smrg
9328fe5e51b7Smrg# XORG_MANPAGE_SECTIONS()
9329fe5e51b7Smrg# -----------------------
9330fe5e51b7Smrg# Minimum version: 1.0.0
9331fe5e51b7Smrg#
9332fe5e51b7Smrg# Determine which sections man pages go in for the different man page types
9333fe5e51b7Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9334fe5e51b7Smrg# Not sure if there's any better way than just hardcoding by OS name.
9335fe5e51b7Smrg# Override default settings by setting environment variables
9336d7be9c72Smrg# Added MAN_SUBSTS in version 1.8
9337d7be9c72Smrg# Added AC_PROG_SED in version 1.8
9338fe5e51b7Smrg
9339fe5e51b7SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9340fe5e51b7SmrgAC_REQUIRE([AC_CANONICAL_HOST])
9341d7be9c72SmrgAC_REQUIRE([AC_PROG_SED])
9342fe5e51b7Smrg
9343fe5e51b7Smrgif test x$APP_MAN_SUFFIX = x    ; then
9344fe5e51b7Smrg    APP_MAN_SUFFIX=1
9345fe5e51b7Smrgfi
9346fe5e51b7Smrgif test x$APP_MAN_DIR = x    ; then
9347fe5e51b7Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9348fe5e51b7Smrgfi
9349fe5e51b7Smrg
9350fe5e51b7Smrgif test x$LIB_MAN_SUFFIX = x    ; then
9351fe5e51b7Smrg    LIB_MAN_SUFFIX=3
9352fe5e51b7Smrgfi
9353fe5e51b7Smrgif test x$LIB_MAN_DIR = x    ; then
9354fe5e51b7Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9355fe5e51b7Smrgfi
9356fe5e51b7Smrg
9357fe5e51b7Smrgif test x$FILE_MAN_SUFFIX = x    ; then
9358fe5e51b7Smrg    case $host_os in
9359fe5e51b7Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9360fe5e51b7Smrg	*)		FILE_MAN_SUFFIX=5  ;;
9361fe5e51b7Smrg    esac
9362fe5e51b7Smrgfi
9363fe5e51b7Smrgif test x$FILE_MAN_DIR = x    ; then
9364fe5e51b7Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9365fe5e51b7Smrgfi
9366fe5e51b7Smrg
9367fe5e51b7Smrgif test x$MISC_MAN_SUFFIX = x    ; then
9368fe5e51b7Smrg    case $host_os in
9369fe5e51b7Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9370fe5e51b7Smrg	*)		MISC_MAN_SUFFIX=7  ;;
9371fe5e51b7Smrg    esac
9372fe5e51b7Smrgfi
9373fe5e51b7Smrgif test x$MISC_MAN_DIR = x    ; then
9374fe5e51b7Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9375fe5e51b7Smrgfi
9376fe5e51b7Smrg
9377fe5e51b7Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9378fe5e51b7Smrg    case $host_os in
9379fe5e51b7Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9380fe5e51b7Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9381fe5e51b7Smrg    esac
9382fe5e51b7Smrgfi
9383fe5e51b7Smrgif test x$DRIVER_MAN_DIR = x    ; then
9384fe5e51b7Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9385fe5e51b7Smrgfi
9386fe5e51b7Smrg
9387fe5e51b7Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9388fe5e51b7Smrg    case $host_os in
9389fe5e51b7Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9390fe5e51b7Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9391fe5e51b7Smrg    esac
9392fe5e51b7Smrgfi
9393fe5e51b7Smrgif test x$ADMIN_MAN_DIR = x    ; then
9394fe5e51b7Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9395fe5e51b7Smrgfi
9396fe5e51b7Smrg
9397fe5e51b7Smrg
9398fe5e51b7SmrgAC_SUBST([APP_MAN_SUFFIX])
9399fe5e51b7SmrgAC_SUBST([LIB_MAN_SUFFIX])
9400fe5e51b7SmrgAC_SUBST([FILE_MAN_SUFFIX])
9401fe5e51b7SmrgAC_SUBST([MISC_MAN_SUFFIX])
9402fe5e51b7SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9403fe5e51b7SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9404fe5e51b7SmrgAC_SUBST([APP_MAN_DIR])
9405fe5e51b7SmrgAC_SUBST([LIB_MAN_DIR])
9406fe5e51b7SmrgAC_SUBST([FILE_MAN_DIR])
9407fe5e51b7SmrgAC_SUBST([MISC_MAN_DIR])
9408fe5e51b7SmrgAC_SUBST([DRIVER_MAN_DIR])
9409fe5e51b7SmrgAC_SUBST([ADMIN_MAN_DIR])
9410d7be9c72Smrg
9411d7be9c72SmrgXORG_MAN_PAGE="X Version 11"
9412d7be9c72SmrgAC_SUBST([XORG_MAN_PAGE])
9413d7be9c72SmrgMAN_SUBSTS="\
9414d7be9c72Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9415d7be9c72Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9416d7be9c72Smrg	-e 's|__xservername__|Xorg|g' \
9417d7be9c72Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
9418d7be9c72Smrg	-e 's|__projectroot__|\$(prefix)|g' \
94190bb88ba4Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9420d7be9c72Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9421d7be9c72Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9422d7be9c72Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9423d7be9c72Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9424d7be9c72Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9425d7be9c72Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9426d7be9c72SmrgAC_SUBST([MAN_SUBSTS])
9427d7be9c72Smrg
9428fe5e51b7Smrg]) # XORG_MANPAGE_SECTIONS
9429fe5e51b7Smrg
9430d7be9c72Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9431d7be9c72Smrg# ------------------------
9432d7be9c72Smrg# Minimum version: 1.7.0
9433d7be9c72Smrg#
9434d7be9c72Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9435d7be9c72Smrg# provided by xorg-sgml-doctools, if installed.
9436d7be9c72SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9437d7be9c72SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9438d7be9c72SmrgXORG_SGML_PATH=
9439d7be9c72SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9440d7be9c72Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9441d7be9c72Smrg    [m4_ifval([$1],[:],
9442d7be9c72Smrg        [if test x"$cross_compiling" != x"yes" ; then
9443d7be9c72Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9444d7be9c72Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9445d7be9c72Smrg         fi])
9446d7be9c72Smrg    ])
9447d7be9c72Smrg
9448d7be9c72Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9449d7be9c72Smrg# the path and the name of the doc stylesheet
9450d7be9c72Smrgif test "x$XORG_SGML_PATH" != "x" ; then
9451d7be9c72Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9452d7be9c72Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9453d7be9c72Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9454d7be9c72Smrgelse
9455d7be9c72Smrg   AC_MSG_RESULT([no])
9456d7be9c72Smrgfi
9457d7be9c72Smrg
9458d7be9c72SmrgAC_SUBST(XORG_SGML_PATH)
9459d7be9c72SmrgAC_SUBST(STYLESHEET_SRCDIR)
9460d7be9c72SmrgAC_SUBST(XSL_STYLESHEET)
9461d7be9c72SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9462d7be9c72Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9463d7be9c72Smrg
9464fe5e51b7Smrg# XORG_CHECK_LINUXDOC
9465fe5e51b7Smrg# -------------------
9466fe5e51b7Smrg# Minimum version: 1.0.0
9467fe5e51b7Smrg#
9468fe5e51b7Smrg# Defines the variable MAKE_TEXT if the necessary tools and
9469fe5e51b7Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9470fe5e51b7Smrg# Whether or not the necessary tools and files are found can be checked
9471fe5e51b7Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9472fe5e51b7SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9473d7be9c72SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9474d7be9c72SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9475fe5e51b7Smrg
9476fe5e51b7SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9477fe5e51b7Smrg
9478d7be9c72SmrgAC_MSG_CHECKING([whether to build documentation])
9479fe5e51b7Smrg
9480d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9481fe5e51b7Smrg   BUILDDOC=yes
9482fe5e51b7Smrgelse
9483fe5e51b7Smrg   BUILDDOC=no
9484fe5e51b7Smrgfi
9485fe5e51b7Smrg
9486fe5e51b7SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9487fe5e51b7Smrg
9488fe5e51b7SmrgAC_MSG_RESULT([$BUILDDOC])
9489fe5e51b7Smrg
9490d7be9c72SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9491fe5e51b7Smrg
9492d7be9c72Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9493fe5e51b7Smrg   BUILDPDFDOC=yes
9494fe5e51b7Smrgelse
9495fe5e51b7Smrg   BUILDPDFDOC=no
9496fe5e51b7Smrgfi
9497fe5e51b7Smrg
9498fe5e51b7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9499fe5e51b7Smrg
9500fe5e51b7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9501fe5e51b7Smrg
9502d7be9c72SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9503fe5e51b7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9504fe5e51b7SmrgMAKE_PDF="$PS2PDF"
9505fe5e51b7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9506fe5e51b7Smrg
9507fe5e51b7SmrgAC_SUBST(MAKE_TEXT)
9508fe5e51b7SmrgAC_SUBST(MAKE_PS)
9509fe5e51b7SmrgAC_SUBST(MAKE_PDF)
9510fe5e51b7SmrgAC_SUBST(MAKE_HTML)
9511fe5e51b7Smrg]) # XORG_CHECK_LINUXDOC
9512fe5e51b7Smrg
9513fe5e51b7Smrg# XORG_CHECK_DOCBOOK
9514fe5e51b7Smrg# -------------------
9515fe5e51b7Smrg# Minimum version: 1.0.0
9516fe5e51b7Smrg#
9517fe5e51b7Smrg# Checks for the ability to build output formats from SGML DocBook source.
9518fe5e51b7Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9519fe5e51b7Smrg# indicates whether the necessary tools and files are found and, if set,
9520fe5e51b7Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9521fe5e51b7SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9522d7be9c72SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9523d7be9c72Smrg
9524fe5e51b7SmrgBUILDTXTDOC=no
9525fe5e51b7SmrgBUILDPDFDOC=no
9526fe5e51b7SmrgBUILDPSDOC=no
9527fe5e51b7SmrgBUILDHTMLDOC=no
9528fe5e51b7Smrg
9529fe5e51b7SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9530fe5e51b7SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9531fe5e51b7SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9532fe5e51b7SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9533fe5e51b7Smrg
9534d7be9c72SmrgAC_MSG_CHECKING([whether to build text documentation])
9535d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9536fe5e51b7Smrg   test x$BUILD_TXTDOC != xno; then
9537fe5e51b7Smrg	BUILDTXTDOC=yes
9538fe5e51b7Smrgfi
9539fe5e51b7SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9540fe5e51b7SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9541fe5e51b7Smrg
9542d7be9c72SmrgAC_MSG_CHECKING([whether to build PDF documentation])
9543d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9544fe5e51b7Smrg   test x$BUILD_PDFDOC != xno; then
9545fe5e51b7Smrg	BUILDPDFDOC=yes
9546fe5e51b7Smrgfi
9547fe5e51b7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9548fe5e51b7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9549fe5e51b7Smrg
9550d7be9c72SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9551d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9552fe5e51b7Smrg   test x$BUILD_PSDOC != xno; then
9553fe5e51b7Smrg	BUILDPSDOC=yes
9554fe5e51b7Smrgfi
9555fe5e51b7SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9556fe5e51b7SmrgAC_MSG_RESULT([$BUILDPSDOC])
9557fe5e51b7Smrg
9558d7be9c72SmrgAC_MSG_CHECKING([whether to build HTML documentation])
9559d7be9c72Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9560fe5e51b7Smrg   test x$BUILD_HTMLDOC != xno; then
9561fe5e51b7Smrg	BUILDHTMLDOC=yes
9562fe5e51b7Smrgfi
9563fe5e51b7SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9564fe5e51b7SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9565fe5e51b7Smrg
9566fe5e51b7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9567fe5e51b7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9568fe5e51b7SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9569fe5e51b7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9570fe5e51b7Smrg
9571fe5e51b7SmrgAC_SUBST(MAKE_TEXT)
9572fe5e51b7SmrgAC_SUBST(MAKE_PS)
9573fe5e51b7SmrgAC_SUBST(MAKE_PDF)
9574fe5e51b7SmrgAC_SUBST(MAKE_HTML)
9575fe5e51b7Smrg]) # XORG_CHECK_DOCBOOK
9576fe5e51b7Smrg
95770bb88ba4Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9578d7be9c72Smrg# ----------------
9579d7be9c72Smrg# Minimum version: 1.5.0
95800bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9581d7be9c72Smrg#
9582d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9583d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9584d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9585d7be9c72Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
95860bb88ba4Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
95870bb88ba4Smrg# --with-xmlto assumes 'auto'.
9588d7be9c72Smrg#
9589d7be9c72Smrg# Interface to module:
9590d7be9c72Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9591d7be9c72Smrg# XMLTO:	returns the path of the xmlto program found
9592d7be9c72Smrg#		returns the path set by the user in the environment
9593d7be9c72Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9594d7be9c72Smrg#		'no' user instructs the module not to use xmlto
9595d7be9c72Smrg#
9596d7be9c72Smrg# Added in version 1.10.0
9597d7be9c72Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9598d7be9c72Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9599d7be9c72Smrg#
9600d7be9c72Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9601d7be9c72Smrg#
9602d7be9c72SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9603d7be9c72SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
96040bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9605d7be9c72SmrgAC_ARG_WITH(xmlto,
9606d7be9c72Smrg	AS_HELP_STRING([--with-xmlto],
96070bb88ba4Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
96080bb88ba4Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
96090bb88ba4Smrgm4_undefine([_defopt])
9610d7be9c72Smrg
9611d7be9c72Smrgif test "x$use_xmlto" = x"auto"; then
9612d7be9c72Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9613d7be9c72Smrg   if test "x$XMLTO" = "x"; then
9614d7be9c72Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9615d7be9c72Smrg	have_xmlto=no
9616d7be9c72Smrg   else
9617d7be9c72Smrg        have_xmlto=yes
9618d7be9c72Smrg   fi
9619d7be9c72Smrgelif test "x$use_xmlto" = x"yes" ; then
9620d7be9c72Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9621d7be9c72Smrg   if test "x$XMLTO" = "x"; then
9622d7be9c72Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9623d7be9c72Smrg   fi
9624d7be9c72Smrg   have_xmlto=yes
9625d7be9c72Smrgelif test "x$use_xmlto" = x"no" ; then
9626d7be9c72Smrg   if test "x$XMLTO" != "x"; then
9627d7be9c72Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9628d7be9c72Smrg   fi
9629d7be9c72Smrg   have_xmlto=no
9630d7be9c72Smrgelse
9631d7be9c72Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9632d7be9c72Smrgfi
9633d7be9c72Smrg
9634d7be9c72Smrg# Test for a minimum version of xmlto, if provided.
9635d7be9c72Smrgm4_ifval([$1],
9636d7be9c72Smrg[if test "$have_xmlto" = yes; then
9637d7be9c72Smrg    # scrape the xmlto version
9638d7be9c72Smrg    AC_MSG_CHECKING([the xmlto version])
9639d7be9c72Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9640d7be9c72Smrg    AC_MSG_RESULT([$xmlto_version])
9641d7be9c72Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9642d7be9c72Smrg        [if test "x$use_xmlto" = xauto; then
9643d7be9c72Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9644d7be9c72Smrg            have_xmlto=no
9645d7be9c72Smrg        else
9646d7be9c72Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9647d7be9c72Smrg        fi])
9648d7be9c72Smrgfi])
9649d7be9c72Smrg
9650d7be9c72Smrg# Test for the ability of xmlto to generate a text target
9651d7be9c72Smrghave_xmlto_text=no
9652d7be9c72Smrgcat > conftest.xml << "EOF"
9653d7be9c72SmrgEOF
9654d7be9c72SmrgAS_IF([test "$have_xmlto" = yes],
9655d7be9c72Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9656d7be9c72Smrg             [have_xmlto_text=yes],
9657d7be9c72Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9658d7be9c72Smrgrm -f conftest.xml
9659d7be9c72SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9660d7be9c72SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9661d7be9c72Smrg]) # XORG_WITH_XMLTO
9662d7be9c72Smrg
96630bb88ba4Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
96640bb88ba4Smrg# --------------------------------------------
96650bb88ba4Smrg# Minimum version: 1.12.0
96660bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.12.0
96670bb88ba4Smrg#
96680bb88ba4Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
96690bb88ba4Smrg# XML-based language used for the transformation of XML documents.
96700bb88ba4Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
96710bb88ba4Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
96720bb88ba4Smrg# The XSLT processor is often used as a standalone tool for transformations.
96730bb88ba4Smrg# It should not be assumed that this tool is used only to work with documnetation.
96740bb88ba4Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
96750bb88ba4Smrg#
96760bb88ba4Smrg# Interface to module:
96770bb88ba4Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
96780bb88ba4Smrg# XSLTPROC:	 returns the path of the xsltproc program found
96790bb88ba4Smrg#		 returns the path set by the user in the environment
96800bb88ba4Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
96810bb88ba4Smrg#		  'no' user instructs the module not to use xsltproc
96820bb88ba4Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
96830bb88ba4Smrg#
96840bb88ba4Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
96850bb88ba4Smrg#
96860bb88ba4SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
96870bb88ba4SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
96880bb88ba4Smrg# Preserves the interface, should it be implemented later
96890bb88ba4Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
96900bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
96910bb88ba4SmrgAC_ARG_WITH(xsltproc,
96920bb88ba4Smrg	AS_HELP_STRING([--with-xsltproc],
96930bb88ba4Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
96940bb88ba4Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
96950bb88ba4Smrgm4_undefine([_defopt])
96960bb88ba4Smrg
96970bb88ba4Smrgif test "x$use_xsltproc" = x"auto"; then
96980bb88ba4Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
96990bb88ba4Smrg   if test "x$XSLTPROC" = "x"; then
97000bb88ba4Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
97010bb88ba4Smrg	have_xsltproc=no
97020bb88ba4Smrg   else
97030bb88ba4Smrg        have_xsltproc=yes
97040bb88ba4Smrg   fi
97050bb88ba4Smrgelif test "x$use_xsltproc" = x"yes" ; then
97060bb88ba4Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
97070bb88ba4Smrg   if test "x$XSLTPROC" = "x"; then
97080bb88ba4Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
97090bb88ba4Smrg   fi
97100bb88ba4Smrg   have_xsltproc=yes
97110bb88ba4Smrgelif test "x$use_xsltproc" = x"no" ; then
97120bb88ba4Smrg   if test "x$XSLTPROC" != "x"; then
97130bb88ba4Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
97140bb88ba4Smrg   fi
97150bb88ba4Smrg   have_xsltproc=no
97160bb88ba4Smrgelse
97170bb88ba4Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
97180bb88ba4Smrgfi
97190bb88ba4Smrg
97200bb88ba4SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
97210bb88ba4Smrg]) # XORG_WITH_XSLTPROC
97220bb88ba4Smrg
97230bb88ba4Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
97240bb88ba4Smrg# ----------------------------------------
97250bb88ba4Smrg# Minimum version: 1.15.0
97260bb88ba4Smrg#
97270bb88ba4Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
97280bb88ba4Smrg# scanning arbitrary text files, extracting information from those text files,
97290bb88ba4Smrg# and printing reports based on that information.
97300bb88ba4Smrg#
97310bb88ba4Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
97320bb88ba4Smrg#
97330bb88ba4Smrg# Interface to module:
97340bb88ba4Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
97350bb88ba4Smrg# PERL:	     returns the path of the perl program found
97360bb88ba4Smrg#	     returns the path set by the user in the environment
97370bb88ba4Smrg# --with-perl: 'yes' user instructs the module to use perl
97380bb88ba4Smrg#	       'no' user instructs the module not to use perl
97390bb88ba4Smrg# have_perl: returns yes if perl found in PATH or no
97400bb88ba4Smrg#
97410bb88ba4Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
97420bb88ba4Smrg#
97430bb88ba4SmrgAC_DEFUN([XORG_WITH_PERL],[
97440bb88ba4SmrgAC_ARG_VAR([PERL], [Path to perl command])
97450bb88ba4Smrg# Preserves the interface, should it be implemented later
97460bb88ba4Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
97470bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
97480bb88ba4SmrgAC_ARG_WITH(perl,
97490bb88ba4Smrg	AS_HELP_STRING([--with-perl],
97500bb88ba4Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
97510bb88ba4Smrg	   [use_perl=$withval], [use_perl=]_defopt)
97520bb88ba4Smrgm4_undefine([_defopt])
97530bb88ba4Smrg
97540bb88ba4Smrgif test "x$use_perl" = x"auto"; then
97550bb88ba4Smrg   AC_PATH_PROG([PERL], [perl])
97560bb88ba4Smrg   if test "x$PERL" = "x"; then
97570bb88ba4Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
97580bb88ba4Smrg	have_perl=no
97590bb88ba4Smrg   else
97600bb88ba4Smrg        have_perl=yes
97610bb88ba4Smrg   fi
97620bb88ba4Smrgelif test "x$use_perl" = x"yes" ; then
97630bb88ba4Smrg   AC_PATH_PROG([PERL], [perl])
97640bb88ba4Smrg   if test "x$PERL" = "x"; then
97650bb88ba4Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
97660bb88ba4Smrg   fi
97670bb88ba4Smrg   have_perl=yes
97680bb88ba4Smrgelif test "x$use_perl" = x"no" ; then
97690bb88ba4Smrg   if test "x$PERL" != "x"; then
97700bb88ba4Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
97710bb88ba4Smrg   fi
97720bb88ba4Smrg   have_perl=no
97730bb88ba4Smrgelse
97740bb88ba4Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
97750bb88ba4Smrgfi
97760bb88ba4Smrg
97770bb88ba4SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
97780bb88ba4Smrg]) # XORG_WITH_PERL
97790bb88ba4Smrg
97800bb88ba4Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9781d7be9c72Smrg# ----------------
9782d7be9c72Smrg# Minimum version: 1.5.0
97830bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9784d7be9c72Smrg#
9785d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9786d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9787d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9788d7be9c72Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
97890bb88ba4Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
97900bb88ba4Smrg# --with-asciidoc assumes 'auto'.
9791d7be9c72Smrg#
9792d7be9c72Smrg# Interface to module:
9793d7be9c72Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9794d7be9c72Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
9795d7be9c72Smrg#		 returns the path set by the user in the environment
9796d7be9c72Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9797d7be9c72Smrg#		  'no' user instructs the module not to use asciidoc
9798d7be9c72Smrg#
9799d7be9c72Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9800d7be9c72Smrg#
9801d7be9c72SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9802d7be9c72SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
98030bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9804d7be9c72SmrgAC_ARG_WITH(asciidoc,
9805d7be9c72Smrg	AS_HELP_STRING([--with-asciidoc],
98060bb88ba4Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
98070bb88ba4Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
98080bb88ba4Smrgm4_undefine([_defopt])
9809d7be9c72Smrg
9810d7be9c72Smrgif test "x$use_asciidoc" = x"auto"; then
9811d7be9c72Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9812d7be9c72Smrg   if test "x$ASCIIDOC" = "x"; then
9813d7be9c72Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9814d7be9c72Smrg	have_asciidoc=no
9815d7be9c72Smrg   else
9816d7be9c72Smrg        have_asciidoc=yes
9817d7be9c72Smrg   fi
9818d7be9c72Smrgelif test "x$use_asciidoc" = x"yes" ; then
9819d7be9c72Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9820d7be9c72Smrg   if test "x$ASCIIDOC" = "x"; then
9821d7be9c72Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9822d7be9c72Smrg   fi
9823d7be9c72Smrg   have_asciidoc=yes
9824d7be9c72Smrgelif test "x$use_asciidoc" = x"no" ; then
9825d7be9c72Smrg   if test "x$ASCIIDOC" != "x"; then
9826d7be9c72Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9827d7be9c72Smrg   fi
9828d7be9c72Smrg   have_asciidoc=no
9829d7be9c72Smrgelse
9830d7be9c72Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9831d7be9c72Smrgfi
9832d7be9c72Smrgm4_ifval([$1],
9833d7be9c72Smrg[if test "$have_asciidoc" = yes; then
9834d7be9c72Smrg    # scrape the asciidoc version
9835d7be9c72Smrg    AC_MSG_CHECKING([the asciidoc version])
9836d7be9c72Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9837d7be9c72Smrg    AC_MSG_RESULT([$asciidoc_version])
9838d7be9c72Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9839d7be9c72Smrg        [if test "x$use_asciidoc" = xauto; then
9840d7be9c72Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9841d7be9c72Smrg            have_asciidoc=no
9842d7be9c72Smrg        else
9843d7be9c72Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9844d7be9c72Smrg        fi])
9845d7be9c72Smrgfi])
9846d7be9c72SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9847d7be9c72Smrg]) # XORG_WITH_ASCIIDOC
9848d7be9c72Smrg
98490bb88ba4Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9850493f84f4Smrg# -------------------------------------------
9851d7be9c72Smrg# Minimum version: 1.5.0
98520bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9853493f84f4Smrg# Minimum version for optional DOT checking: 1.18.0
9854d7be9c72Smrg#
9855d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9856d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9857d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9858d7be9c72Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
98590bb88ba4Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
98600bb88ba4Smrg# --with-doxygen assumes 'auto'.
9861d7be9c72Smrg#
9862d7be9c72Smrg# Interface to module:
9863d7be9c72Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9864d7be9c72Smrg# DOXYGEN:	 returns the path of the doxygen program found
9865d7be9c72Smrg#		 returns the path set by the user in the environment
9866d7be9c72Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9867d7be9c72Smrg#		  'no' user instructs the module not to use doxygen
9868d7be9c72Smrg#
9869d7be9c72Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9870d7be9c72Smrg#
9871d7be9c72SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9872d7be9c72SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9873493f84f4SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
98740bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
9875d7be9c72SmrgAC_ARG_WITH(doxygen,
9876d7be9c72Smrg	AS_HELP_STRING([--with-doxygen],
98770bb88ba4Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
98780bb88ba4Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
98790bb88ba4Smrgm4_undefine([_defopt])
9880d7be9c72Smrg
9881d7be9c72Smrgif test "x$use_doxygen" = x"auto"; then
9882d7be9c72Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9883d7be9c72Smrg   if test "x$DOXYGEN" = "x"; then
9884d7be9c72Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9885d7be9c72Smrg	have_doxygen=no
9886d7be9c72Smrg   else
9887d7be9c72Smrg        have_doxygen=yes
9888d7be9c72Smrg   fi
9889d7be9c72Smrgelif test "x$use_doxygen" = x"yes" ; then
9890d7be9c72Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9891d7be9c72Smrg   if test "x$DOXYGEN" = "x"; then
9892d7be9c72Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9893d7be9c72Smrg   fi
9894d7be9c72Smrg   have_doxygen=yes
9895d7be9c72Smrgelif test "x$use_doxygen" = x"no" ; then
9896d7be9c72Smrg   if test "x$DOXYGEN" != "x"; then
9897d7be9c72Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9898d7be9c72Smrg   fi
9899d7be9c72Smrg   have_doxygen=no
9900d7be9c72Smrgelse
9901d7be9c72Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
9902d7be9c72Smrgfi
9903d7be9c72Smrgm4_ifval([$1],
9904d7be9c72Smrg[if test "$have_doxygen" = yes; then
9905d7be9c72Smrg    # scrape the doxygen version
9906d7be9c72Smrg    AC_MSG_CHECKING([the doxygen version])
9907d7be9c72Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9908d7be9c72Smrg    AC_MSG_RESULT([$doxygen_version])
9909d7be9c72Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9910d7be9c72Smrg        [if test "x$use_doxygen" = xauto; then
9911d7be9c72Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9912d7be9c72Smrg            have_doxygen=no
9913d7be9c72Smrg        else
9914d7be9c72Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9915d7be9c72Smrg        fi])
9916d7be9c72Smrgfi])
9917493f84f4Smrg
9918493f84f4Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
9919493f84f4Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
9920493f84f4Smrgdnl 	HAVE_DOT = @HAVE_DOT@
9921493f84f4SmrgHAVE_DOT=no
9922493f84f4Smrgif test "x$have_doxygen" = "xyes"; then
9923493f84f4Smrg  AC_PATH_PROG([DOT], [dot])
9924493f84f4Smrg    if test "x$DOT" != "x"; then
9925493f84f4Smrg      HAVE_DOT=yes
9926493f84f4Smrg    fi
9927493f84f4Smrgfi
9928493f84f4Smrg
9929493f84f4SmrgAC_SUBST([HAVE_DOT])
9930493f84f4SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
9931d7be9c72SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9932d7be9c72Smrg]) # XORG_WITH_DOXYGEN
9933d7be9c72Smrg
99340bb88ba4Smrg# XORG_WITH_GROFF([DEFAULT])
9935d7be9c72Smrg# ----------------
9936d7be9c72Smrg# Minimum version: 1.6.0
99370bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9938d7be9c72Smrg#
9939d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
9940d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
9941d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9942d7be9c72Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
99430bb88ba4Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
99440bb88ba4Smrg# --with-groff assumes 'auto'.
9945d7be9c72Smrg#
9946d7be9c72Smrg# Interface to module:
9947d7be9c72Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9948d7be9c72Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
9949d7be9c72Smrg# HAVE_GROFF_MS: the -ms macros package
9950d7be9c72Smrg# GROFF:	 returns the path of the groff program found
9951d7be9c72Smrg#		 returns the path set by the user in the environment
9952d7be9c72Smrg# --with-groff:	 'yes' user instructs the module to use groff
9953d7be9c72Smrg#		 'no' user instructs the module not to use groff
9954d7be9c72Smrg#
9955d7be9c72Smrg# Added in version 1.9.0:
9956d7be9c72Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
9957d7be9c72Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
9958d7be9c72Smrg#		   psselect from the psutils package.
9959d7be9c72Smrg#		   the ghostcript package. Refer to the grohtml man pages
9960d7be9c72Smrg#
9961d7be9c72Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
9962d7be9c72Smrg#
9963d7be9c72Smrg# OS and distros often splits groff in a basic and full package, the former
9964d7be9c72Smrg# having the groff program and the later having devices, fonts and macros
9965d7be9c72Smrg# Checking for the groff executable is not enough.
9966d7be9c72Smrg#
9967d7be9c72Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
9968d7be9c72Smrg# unset HAVE_GROFF or GROFF env variables.
9969d7be9c72Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
9970d7be9c72Smrg#
9971d7be9c72SmrgAC_DEFUN([XORG_WITH_GROFF],[
9972d7be9c72SmrgAC_ARG_VAR([GROFF], [Path to groff command])
99730bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
9974d7be9c72SmrgAC_ARG_WITH(groff,
9975d7be9c72Smrg	AS_HELP_STRING([--with-groff],
99760bb88ba4Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
99770bb88ba4Smrg	   [use_groff=$withval], [use_groff=]_defopt)
99780bb88ba4Smrgm4_undefine([_defopt])
9979d7be9c72Smrg
9980d7be9c72Smrgif test "x$use_groff" = x"auto"; then
9981d7be9c72Smrg   AC_PATH_PROG([GROFF], [groff])
9982d7be9c72Smrg   if test "x$GROFF" = "x"; then
9983d7be9c72Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
9984d7be9c72Smrg	have_groff=no
9985d7be9c72Smrg   else
9986d7be9c72Smrg        have_groff=yes
9987d7be9c72Smrg   fi
9988d7be9c72Smrgelif test "x$use_groff" = x"yes" ; then
9989d7be9c72Smrg   AC_PATH_PROG([GROFF], [groff])
9990d7be9c72Smrg   if test "x$GROFF" = "x"; then
9991d7be9c72Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
9992d7be9c72Smrg   fi
9993d7be9c72Smrg   have_groff=yes
9994d7be9c72Smrgelif test "x$use_groff" = x"no" ; then
9995d7be9c72Smrg   if test "x$GROFF" != "x"; then
9996d7be9c72Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
9997d7be9c72Smrg   fi
9998d7be9c72Smrg   have_groff=no
9999d7be9c72Smrgelse
10000d7be9c72Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10001d7be9c72Smrgfi
10002d7be9c72Smrg
10003d7be9c72Smrg# We have groff, test for the presence of the macro packages
10004d7be9c72Smrgif test "x$have_groff" = x"yes"; then
10005d7be9c72Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10006d7be9c72Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10007d7be9c72Smrg        groff_ms_works=yes
10008d7be9c72Smrg    else
10009d7be9c72Smrg        groff_ms_works=no
10010d7be9c72Smrg    fi
10011d7be9c72Smrg    AC_MSG_RESULT([$groff_ms_works])
10012d7be9c72Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10013d7be9c72Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10014d7be9c72Smrg        groff_mm_works=yes
10015d7be9c72Smrg    else
10016d7be9c72Smrg        groff_mm_works=no
10017d7be9c72Smrg    fi
10018d7be9c72Smrg    AC_MSG_RESULT([$groff_mm_works])
10019d7be9c72Smrgfi
10020d7be9c72Smrg
10021d7be9c72Smrg# We have groff, test for HTML dependencies, one command per package
10022d7be9c72Smrgif test "x$have_groff" = x"yes"; then
10023d7be9c72Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10024d7be9c72Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10025d7be9c72Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10026d7be9c72Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10027d7be9c72Smrg      have_groff_html=yes
10028d7be9c72Smrg   else
10029d7be9c72Smrg      have_groff_html=no
10030d7be9c72Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10031d7be9c72Smrg   fi
10032d7be9c72Smrgfi
10033d7be9c72Smrg
10034d7be9c72Smrg# Set Automake conditionals for Makefiles
10035d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10036d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10037d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10038d7be9c72SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10039d7be9c72Smrg]) # XORG_WITH_GROFF
10040d7be9c72Smrg
100410bb88ba4Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
100420bb88ba4Smrg# ---------------------------------------
10043d7be9c72Smrg# Minimum version: 1.6.0
100440bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
100450bb88ba4Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10046d7be9c72Smrg#
10047d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
10048d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
10049d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10050d7be9c72Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
100510bb88ba4Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
100520bb88ba4Smrg# --with-fop assumes 'auto'.
10053d7be9c72Smrg#
10054d7be9c72Smrg# Interface to module:
10055d7be9c72Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10056d7be9c72Smrg# FOP:	 	returns the path of the fop program found
10057d7be9c72Smrg#		returns the path set by the user in the environment
10058d7be9c72Smrg# --with-fop: 	'yes' user instructs the module to use fop
10059d7be9c72Smrg#		'no' user instructs the module not to use fop
10060d7be9c72Smrg#
10061d7be9c72Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10062d7be9c72Smrg#
10063d7be9c72SmrgAC_DEFUN([XORG_WITH_FOP],[
10064d7be9c72SmrgAC_ARG_VAR([FOP], [Path to fop command])
100650bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
10066d7be9c72SmrgAC_ARG_WITH(fop,
10067d7be9c72Smrg	AS_HELP_STRING([--with-fop],
100680bb88ba4Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
100690bb88ba4Smrg	   [use_fop=$withval], [use_fop=]_defopt)
100700bb88ba4Smrgm4_undefine([_defopt])
10071d7be9c72Smrg
10072d7be9c72Smrgif test "x$use_fop" = x"auto"; then
10073d7be9c72Smrg   AC_PATH_PROG([FOP], [fop])
10074d7be9c72Smrg   if test "x$FOP" = "x"; then
10075d7be9c72Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10076d7be9c72Smrg	have_fop=no
10077d7be9c72Smrg   else
10078d7be9c72Smrg        have_fop=yes
10079d7be9c72Smrg   fi
10080d7be9c72Smrgelif test "x$use_fop" = x"yes" ; then
10081d7be9c72Smrg   AC_PATH_PROG([FOP], [fop])
10082d7be9c72Smrg   if test "x$FOP" = "x"; then
10083d7be9c72Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10084d7be9c72Smrg   fi
10085d7be9c72Smrg   have_fop=yes
10086d7be9c72Smrgelif test "x$use_fop" = x"no" ; then
10087d7be9c72Smrg   if test "x$FOP" != "x"; then
10088d7be9c72Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10089d7be9c72Smrg   fi
10090d7be9c72Smrg   have_fop=no
10091d7be9c72Smrgelse
10092d7be9c72Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10093d7be9c72Smrgfi
100940bb88ba4Smrg
100950bb88ba4Smrg# Test for a minimum version of fop, if provided.
100960bb88ba4Smrgm4_ifval([$1],
100970bb88ba4Smrg[if test "$have_fop" = yes; then
100980bb88ba4Smrg    # scrape the fop version
100990bb88ba4Smrg    AC_MSG_CHECKING([for fop minimum version])
101000bb88ba4Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
101010bb88ba4Smrg    AC_MSG_RESULT([$fop_version])
101020bb88ba4Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
101030bb88ba4Smrg        [if test "x$use_fop" = xauto; then
101040bb88ba4Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
101050bb88ba4Smrg            have_fop=no
101060bb88ba4Smrg        else
101070bb88ba4Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
101080bb88ba4Smrg        fi])
101090bb88ba4Smrgfi])
10110d7be9c72SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10111d7be9c72Smrg]) # XORG_WITH_FOP
10112d7be9c72Smrg
101130bb88ba4Smrg# XORG_WITH_PS2PDF([DEFAULT])
10114d7be9c72Smrg# ----------------
10115d7be9c72Smrg# Minimum version: 1.6.0
101160bb88ba4Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10117d7be9c72Smrg#
10118d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
10119d7be9c72Smrg# not at the appropriate level. This macro enables a module to test for the
10120d7be9c72Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10121d7be9c72Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
101220bb88ba4Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
101230bb88ba4Smrg# --with-ps2pdf assumes 'auto'.
10124d7be9c72Smrg#
10125d7be9c72Smrg# Interface to module:
10126d7be9c72Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10127d7be9c72Smrg# PS2PDF:	returns the path of the ps2pdf program found
10128d7be9c72Smrg#		returns the path set by the user in the environment
10129d7be9c72Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10130d7be9c72Smrg#		 'no' user instructs the module not to use ps2pdf
10131d7be9c72Smrg#
10132d7be9c72Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10133d7be9c72Smrg#
10134d7be9c72SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10135d7be9c72SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
101360bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
10137d7be9c72SmrgAC_ARG_WITH(ps2pdf,
10138d7be9c72Smrg	AS_HELP_STRING([--with-ps2pdf],
101390bb88ba4Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
101400bb88ba4Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
101410bb88ba4Smrgm4_undefine([_defopt])
10142d7be9c72Smrg
10143d7be9c72Smrgif test "x$use_ps2pdf" = x"auto"; then
10144d7be9c72Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10145d7be9c72Smrg   if test "x$PS2PDF" = "x"; then
10146d7be9c72Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10147d7be9c72Smrg	have_ps2pdf=no
10148d7be9c72Smrg   else
10149d7be9c72Smrg        have_ps2pdf=yes
10150d7be9c72Smrg   fi
10151d7be9c72Smrgelif test "x$use_ps2pdf" = x"yes" ; then
10152d7be9c72Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10153d7be9c72Smrg   if test "x$PS2PDF" = "x"; then
10154d7be9c72Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10155d7be9c72Smrg   fi
10156d7be9c72Smrg   have_ps2pdf=yes
10157d7be9c72Smrgelif test "x$use_ps2pdf" = x"no" ; then
10158d7be9c72Smrg   if test "x$PS2PDF" != "x"; then
10159d7be9c72Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10160d7be9c72Smrg   fi
10161d7be9c72Smrg   have_ps2pdf=no
10162d7be9c72Smrgelse
10163d7be9c72Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10164d7be9c72Smrgfi
10165d7be9c72SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10166d7be9c72Smrg]) # XORG_WITH_PS2PDF
10167d7be9c72Smrg
10168d7be9c72Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
10169d7be9c72Smrg# ----------------
10170d7be9c72Smrg# Minimum version: 1.6.0
10171d7be9c72Smrg#
10172d7be9c72Smrg# Documentation tools are not always available on all platforms and sometimes
10173d7be9c72Smrg# not at the appropriate level. This macro enables a builder to skip all
10174d7be9c72Smrg# documentation targets except traditional man pages.
10175d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10176d7be9c72Smrg# maximum flexibilty in controlling documentation building.
10177d7be9c72Smrg# Refer to:
10178d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
10179d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10180d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10181d7be9c72Smrg# XORG_WITH_FOP           --with-fop
10182d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
10183d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10184d7be9c72Smrg#
10185d7be9c72Smrg# Interface to module:
10186d7be9c72Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10187d7be9c72Smrg# --enable-docs: 'yes' user instructs the module to generate docs
10188d7be9c72Smrg#		 'no' user instructs the module not to generate docs
10189d7be9c72Smrg# parm1:	specify the default value, yes or no.
10190d7be9c72Smrg#
10191d7be9c72SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
101920bb88ba4Smrgm4_define([docs_default], m4_default([$1], [yes]))
10193d7be9c72SmrgAC_ARG_ENABLE(docs,
10194d7be9c72Smrg	AS_HELP_STRING([--enable-docs],
101950bb88ba4Smrg	   [Enable building the documentation (default: ]docs_default[)]),
101960bb88ba4Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
101970bb88ba4Smrgm4_undefine([docs_default])
10198d7be9c72SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10199d7be9c72SmrgAC_MSG_CHECKING([whether to build documentation])
10200d7be9c72SmrgAC_MSG_RESULT([$build_docs])
10201d7be9c72Smrg]) # XORG_ENABLE_DOCS
10202d7be9c72Smrg
10203d7be9c72Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10204d7be9c72Smrg# ----------------
10205d7be9c72Smrg# Minimum version: 1.6.0
10206d7be9c72Smrg#
10207d7be9c72Smrg# This macro enables a builder to skip all developer documentation.
10208d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10209d7be9c72Smrg# maximum flexibilty in controlling documentation building.
10210d7be9c72Smrg# Refer to:
10211d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
10212d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10213d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10214d7be9c72Smrg# XORG_WITH_FOP           --with-fop
10215d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
10216d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10217d7be9c72Smrg#
10218d7be9c72Smrg# Interface to module:
10219d7be9c72Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10220d7be9c72Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10221d7be9c72Smrg#			'no' user instructs the module not to generate developer docs
10222d7be9c72Smrg# parm1:		specify the default value, yes or no.
10223d7be9c72Smrg#
10224d7be9c72SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
102250bb88ba4Smrgm4_define([devel_default], m4_default([$1], [yes]))
10226d7be9c72SmrgAC_ARG_ENABLE(devel-docs,
10227d7be9c72Smrg	AS_HELP_STRING([--enable-devel-docs],
102280bb88ba4Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
102290bb88ba4Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
102300bb88ba4Smrgm4_undefine([devel_default])
10231d7be9c72SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10232d7be9c72SmrgAC_MSG_CHECKING([whether to build developer documentation])
10233d7be9c72SmrgAC_MSG_RESULT([$build_devel_docs])
10234d7be9c72Smrg]) # XORG_ENABLE_DEVEL_DOCS
10235d7be9c72Smrg
10236d7be9c72Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
10237d7be9c72Smrg# ----------------
10238d7be9c72Smrg# Minimum version: 1.6.0
10239d7be9c72Smrg#
10240d7be9c72Smrg# This macro enables a builder to skip all functional specification targets.
10241d7be9c72Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10242d7be9c72Smrg# maximum flexibilty in controlling documentation building.
10243d7be9c72Smrg# Refer to:
10244d7be9c72Smrg# XORG_WITH_XMLTO         --with-xmlto
10245d7be9c72Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10246d7be9c72Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10247d7be9c72Smrg# XORG_WITH_FOP           --with-fop
10248d7be9c72Smrg# XORG_WITH_GROFF         --with-groff
10249d7be9c72Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10250d7be9c72Smrg#
10251d7be9c72Smrg# Interface to module:
10252d7be9c72Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10253d7be9c72Smrg# --enable-specs:	'yes' user instructs the module to generate specs
10254d7be9c72Smrg#			'no' user instructs the module not to generate specs
10255d7be9c72Smrg# parm1:		specify the default value, yes or no.
10256d7be9c72Smrg#
10257d7be9c72SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
102580bb88ba4Smrgm4_define([spec_default], m4_default([$1], [yes]))
10259d7be9c72SmrgAC_ARG_ENABLE(specs,
10260d7be9c72Smrg	AS_HELP_STRING([--enable-specs],
102610bb88ba4Smrg	   [Enable building the specs (default: ]spec_default[)]),
102620bb88ba4Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
102630bb88ba4Smrgm4_undefine([spec_default])
10264d7be9c72SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10265d7be9c72SmrgAC_MSG_CHECKING([whether to build functional specifications])
10266d7be9c72SmrgAC_MSG_RESULT([$build_specs])
10267d7be9c72Smrg]) # XORG_ENABLE_SPECS
10268d7be9c72Smrg
102690bb88ba4Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
102700bb88ba4Smrg# ----------------------------------------------
102710bb88ba4Smrg# Minimum version: 1.13.0
102720bb88ba4Smrg#
102730bb88ba4Smrg# This macro enables a builder to enable/disable unit testing
102740bb88ba4Smrg# It makes no assumption about the test cases implementation
102750bb88ba4Smrg# Test cases may or may not use Automake "Support for test suites"
102760bb88ba4Smrg# They may or may not use the software utility library GLib
102770bb88ba4Smrg#
102780bb88ba4Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
102790bb88ba4Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
102800bb88ba4Smrg# The variable enable_unit_tests is used by other macros in this file.
102810bb88ba4Smrg#
102820bb88ba4Smrg# Interface to module:
102830bb88ba4Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
102840bb88ba4Smrg# enable_unit_tests:    used in configure.ac for additional configuration
102850bb88ba4Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
102860bb88ba4Smrg#			'no' user instructs the module not to build tests
102870bb88ba4Smrg# parm1:		specify the default value, yes or no.
102880bb88ba4Smrg#
102890bb88ba4SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
102900bb88ba4SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
102910bb88ba4SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
102920bb88ba4SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
102930bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
102940bb88ba4SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
102950bb88ba4Smrg	[Enable building unit test cases (default: ]_defopt[)]),
102960bb88ba4Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
102970bb88ba4Smrgm4_undefine([_defopt])
102980bb88ba4SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
102990bb88ba4SmrgAC_MSG_CHECKING([whether to build unit test cases])
103000bb88ba4SmrgAC_MSG_RESULT([$enable_unit_tests])
103010bb88ba4Smrg]) # XORG_ENABLE_UNIT_TESTS
103020bb88ba4Smrg
103030bb88ba4Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
103040bb88ba4Smrg# ------------------------------------------------------
103050bb88ba4Smrg# Minimum version: 1.17.0
103060bb88ba4Smrg#
103070bb88ba4Smrg# This macro enables a builder to enable/disable integration testing
103080bb88ba4Smrg# It makes no assumption about the test cases' implementation
103090bb88ba4Smrg# Test cases may or may not use Automake "Support for test suites"
103100bb88ba4Smrg#
103110bb88ba4Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
103120bb88ba4Smrg# usually requires less dependencies and may be built and run under less
103130bb88ba4Smrg# stringent environments than integration tests.
103140bb88ba4Smrg#
103150bb88ba4Smrg# Interface to module:
103160bb88ba4Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
103170bb88ba4Smrg# enable_integration_tests:   used in configure.ac for additional configuration
103180bb88ba4Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
103190bb88ba4Smrg#                             'no' user instructs the module not to build tests
103200bb88ba4Smrg# parm1:                      specify the default value, yes or no.
103210bb88ba4Smrg#
103220bb88ba4SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
103230bb88ba4SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
103240bb88ba4Smrgm4_define([_defopt], m4_default([$1], [auto]))
103250bb88ba4SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
103260bb88ba4Smrg	[Enable building integration test cases (default: ]_defopt[)]),
103270bb88ba4Smrg	[enable_integration_tests=$enableval],
103280bb88ba4Smrg	[enable_integration_tests=]_defopt)
103290bb88ba4Smrgm4_undefine([_defopt])
103300bb88ba4SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
103310bb88ba4Smrg	[test "x$enable_integration_tests" != xno])
103320bb88ba4SmrgAC_MSG_CHECKING([whether to build unit test cases])
103330bb88ba4SmrgAC_MSG_RESULT([$enable_integration_tests])
103340bb88ba4Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
103350bb88ba4Smrg
103360bb88ba4Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
103370bb88ba4Smrg# ----------------------------------------
103380bb88ba4Smrg# Minimum version: 1.13.0
103390bb88ba4Smrg#
103400bb88ba4Smrg# GLib is a library which provides advanced data structures and functions.
103410bb88ba4Smrg# This macro enables a module to test for the presence of Glib.
103420bb88ba4Smrg#
103430bb88ba4Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
103440bb88ba4Smrg# Otherwise the value of $enable_unit_tests is blank.
103450bb88ba4Smrg#
103460bb88ba4Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
103470bb88ba4Smrg# test support usually requires less dependencies and may be built and run under
103480bb88ba4Smrg# less stringent environments than integration tests.
103490bb88ba4Smrg#
103500bb88ba4Smrg# Interface to module:
103510bb88ba4Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
103520bb88ba4Smrg# with_glib: used in configure.ac to know if GLib has been found
103530bb88ba4Smrg# --with-glib:	'yes' user instructs the module to use glib
103540bb88ba4Smrg#		'no' user instructs the module not to use glib
103550bb88ba4Smrg#
103560bb88ba4SmrgAC_DEFUN([XORG_WITH_GLIB],[
103570bb88ba4SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
103580bb88ba4Smrgm4_define([_defopt], m4_default([$2], [auto]))
103590bb88ba4SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
103600bb88ba4Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
103610bb88ba4Smrg	[with_glib=$withval], [with_glib=]_defopt)
103620bb88ba4Smrgm4_undefine([_defopt])
103630bb88ba4Smrg
103640bb88ba4Smrghave_glib=no
103650bb88ba4Smrg# Do not probe GLib if user explicitly disabled unit testing
103660bb88ba4Smrgif test "x$enable_unit_tests" != x"no"; then
103670bb88ba4Smrg  # Do not probe GLib if user explicitly disabled it
103680bb88ba4Smrg  if test "x$with_glib" != x"no"; then
103690bb88ba4Smrg    m4_ifval(
103700bb88ba4Smrg      [$1],
103710bb88ba4Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
103720bb88ba4Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
103730bb88ba4Smrg    )
103740bb88ba4Smrg  fi
103750bb88ba4Smrgfi
103760bb88ba4Smrg
103770bb88ba4Smrg# Not having GLib when unit testing has been explicitly requested is an error
103780bb88ba4Smrgif test "x$enable_unit_tests" = x"yes"; then
103790bb88ba4Smrg  if test "x$have_glib" = x"no"; then
103800bb88ba4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
103810bb88ba4Smrg  fi
103820bb88ba4Smrgfi
103830bb88ba4Smrg
103840bb88ba4Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
103850bb88ba4Smrgif test "x$enable_unit_tests" = x"no"; then
103860bb88ba4Smrg  if test "x$with_glib" = x"yes"; then
103870bb88ba4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
103880bb88ba4Smrg  fi
103890bb88ba4Smrgfi
103900bb88ba4Smrg
103910bb88ba4Smrg# Not having GLib when it has been explicitly requested is an error
103920bb88ba4Smrgif test "x$with_glib" = x"yes"; then
103930bb88ba4Smrg  if test "x$have_glib" = x"no"; then
103940bb88ba4Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
103950bb88ba4Smrg  fi
103960bb88ba4Smrgfi
103970bb88ba4Smrg
103980bb88ba4SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
103990bb88ba4Smrg]) # XORG_WITH_GLIB
104000bb88ba4Smrg
104010bb88ba4Smrg# XORG_LD_WRAP([required|optional])
104020bb88ba4Smrg# ---------------------------------
104030bb88ba4Smrg# Minimum version: 1.13.0
104040bb88ba4Smrg#
104050bb88ba4Smrg# Check if linker supports -wrap, passed via compiler flags
104060bb88ba4Smrg#
104070bb88ba4Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
104080bb88ba4Smrg# Otherwise the value of $enable_unit_tests is blank.
104090bb88ba4Smrg#
104100bb88ba4Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
104110bb88ba4Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
104120bb88ba4Smrg# available, an argument of "optional" allows use when some unit tests require
104130bb88ba4Smrg# ld -wrap and others do not.
104140bb88ba4Smrg#
104150bb88ba4SmrgAC_DEFUN([XORG_LD_WRAP],[
104160bb88ba4SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
104170bb88ba4Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
104180bb88ba4Smrg                      void __wrap_exit(int status) { return; }],
104190bb88ba4Smrg                     [exit(0);])])
104200bb88ba4Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
104210bb88ba4Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
104220bb88ba4Smrg  if test "x$have_ld_wrap" = x"no"; then
104230bb88ba4Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
104240bb88ba4Smrg  fi
104250bb88ba4Smrgfi
104260bb88ba4SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
104270bb88ba4Smrg#
104280bb88ba4Smrg]) # XORG_LD_WRAP
104290bb88ba4Smrg
104300bb88ba4Smrg# XORG_CHECK_LINKER_FLAGS
104310bb88ba4Smrg# -----------------------
104320bb88ba4Smrg# SYNOPSIS
104330bb88ba4Smrg#
104340bb88ba4Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
104350bb88ba4Smrg#
104360bb88ba4Smrg# DESCRIPTION
104370bb88ba4Smrg#
104380bb88ba4Smrg#   Check whether the given linker FLAGS work with the current language's
104390bb88ba4Smrg#   linker, or whether they give an error.
104400bb88ba4Smrg#
104410bb88ba4Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
104420bb88ba4Smrg#   success/failure.
104430bb88ba4Smrg#
104440bb88ba4Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
104450bb88ba4Smrg#
104460bb88ba4Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
104470bb88ba4Smrg#
104480bb88ba4Smrg# LICENSE
104490bb88ba4Smrg#
104500bb88ba4Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
104510bb88ba4Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
104520bb88ba4Smrg#   Copyright (c) 2009 Matteo Frigo
104530bb88ba4Smrg#
104540bb88ba4Smrg#   This program is free software: you can redistribute it and/or modify it
104550bb88ba4Smrg#   under the terms of the GNU General Public License as published by the
104560bb88ba4Smrg#   Free Software Foundation, either version 3 of the License, or (at your
104570bb88ba4Smrg#   option) any later version.
104580bb88ba4Smrg#
104590bb88ba4Smrg#   This program is distributed in the hope that it will be useful, but
104600bb88ba4Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
104610bb88ba4Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
104620bb88ba4Smrg#   Public License for more details.
104630bb88ba4Smrg#
104640bb88ba4Smrg#   You should have received a copy of the GNU General Public License along
104650bb88ba4Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
104660bb88ba4Smrg#
104670bb88ba4Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
104680bb88ba4Smrg#   gives unlimited permission to copy, distribute and modify the configure
104690bb88ba4Smrg#   scripts that are the output of Autoconf when processing the Macro. You
104700bb88ba4Smrg#   need not follow the terms of the GNU General Public License when using
104710bb88ba4Smrg#   or distributing such scripts, even though portions of the text of the
104720bb88ba4Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
104730bb88ba4Smrg#   all other use of the material that constitutes the Autoconf Macro.
104740bb88ba4Smrg#
104750bb88ba4Smrg#   This special exception to the GPL applies to versions of the Autoconf
104760bb88ba4Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
104770bb88ba4Smrg#   modified version of the Autoconf Macro, you may extend this special
104780bb88ba4Smrg#   exception to the GPL to apply to your modified version as well.#
104790bb88ba4SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
104800bb88ba4Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
104810bb88ba4Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
104820bb88ba4SmrgAS_LITERAL_IF([$1],
104830bb88ba4Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
104840bb88ba4Smrg      ax_save_FLAGS=$LDFLAGS
104850bb88ba4Smrg      LDFLAGS="$1"
104860bb88ba4Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
104870bb88ba4Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
104880bb88ba4Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
104890bb88ba4Smrg      LDFLAGS=$ax_save_FLAGS])],
104900bb88ba4Smrg  [ax_save_FLAGS=$LDFLAGS
104910bb88ba4Smrg   LDFLAGS="$1"
104920bb88ba4Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
104930bb88ba4Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
104940bb88ba4Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
104950bb88ba4Smrg   LDFLAGS=$ax_save_FLAGS])
104960bb88ba4Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
104970bb88ba4SmrgAC_MSG_RESULT($xorg_check_linker_flags)
104980bb88ba4Smrgif test "x$xorg_check_linker_flags" = xyes; then
104990bb88ba4Smrg	m4_default([$2], :)
105000bb88ba4Smrgelse
105010bb88ba4Smrg	m4_default([$3], :)
105020bb88ba4Smrgfi
105030bb88ba4Smrg]) # XORG_CHECK_LINKER_FLAGS
105040bb88ba4Smrg
105050bb88ba4Smrg# XORG_MEMORY_CHECK_FLAGS
105060bb88ba4Smrg# -----------------------
105070bb88ba4Smrg# Minimum version: 1.16.0
105080bb88ba4Smrg#
105090bb88ba4Smrg# This macro attempts to find appropriate memory checking functionality
105100bb88ba4Smrg# for various platforms which unit testing code may use to catch various
105110bb88ba4Smrg# forms of memory allocation and access errors in testing.
105120bb88ba4Smrg#
105130bb88ba4Smrg# Interface to module:
105140bb88ba4Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
105150bb88ba4Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
105160bb88ba4Smrg#
105170bb88ba4Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
105180bb88ba4Smrg#
105190bb88ba4SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
105200bb88ba4Smrg
105210bb88ba4SmrgAC_REQUIRE([AC_CANONICAL_HOST])
105220bb88ba4SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
105230bb88ba4Smrg           [Environment variables to enable memory checking in tests])
105240bb88ba4Smrg
105250bb88ba4Smrg# Check for different types of support on different platforms
105260bb88ba4Smrgcase $host_os in
105270bb88ba4Smrg    solaris*)
105280bb88ba4Smrg        AC_CHECK_LIB([umem], [umem_alloc],
105290bb88ba4Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
105300bb88ba4Smrg        ;;
105310bb88ba4Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
105320bb88ba4Smrg        # both directly and inverted, so should not be 0 or 255.
105330bb88ba4Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
105340bb88ba4Smrg        ;;
105350bb88ba4Smrg    darwin*)
105360bb88ba4Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
105370bb88ba4Smrg        ;;
105380bb88ba4Smrg    *bsd*)
105390bb88ba4Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
105400bb88ba4Smrg        ;;
105410bb88ba4Smrgesac
105420bb88ba4Smrg
105430bb88ba4Smrg# User supplied flags override default flags
105440bb88ba4Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
105450bb88ba4Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
105460bb88ba4Smrgfi
105470bb88ba4Smrg
105480bb88ba4SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
105490bb88ba4Smrg]) # XORG_WITH_LINT
105500bb88ba4Smrg
10551fe5e51b7Smrg# XORG_CHECK_MALLOC_ZERO
10552fe5e51b7Smrg# ----------------------
10553fe5e51b7Smrg# Minimum version: 1.0.0
10554fe5e51b7Smrg#
10555fe5e51b7Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10556fe5e51b7Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10557fe5e51b7Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10558fe5e51b7SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10559fe5e51b7SmrgAC_ARG_ENABLE(malloc0returnsnull,
10560a31a186aSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10561fe5e51b7Smrg		       [malloc(0) returns NULL (default: auto)]),
10562fe5e51b7Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10563fe5e51b7Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10564fe5e51b7Smrg
10565fe5e51b7SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10566fe5e51b7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10567493f84f4SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10568493f84f4Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
105690bb88ba4Smrg#include <stdlib.h>
105700bb88ba4Smrg],[
10571fe5e51b7Smrg    char *m0, *r0, *c0, *p;
10572fe5e51b7Smrg    m0 = malloc(0);
10573fe5e51b7Smrg    p = malloc(10);
10574fe5e51b7Smrg    r0 = realloc(p,0);
105750bb88ba4Smrg    c0 = calloc(0,10);
105760bb88ba4Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
105770bb88ba4Smrg])],
10578493f84f4Smrg		[xorg_cv_malloc0_returns_null=yes],
10579493f84f4Smrg		[xorg_cv_malloc0_returns_null=no])])
10580493f84f4SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10581fe5e51b7Smrgfi
10582fe5e51b7SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10583fe5e51b7Smrg
10584fe5e51b7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10585fe5e51b7Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10586fe5e51b7Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10587fe5e51b7Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10588fe5e51b7Smrgelse
10589fe5e51b7Smrg	MALLOC_ZERO_CFLAGS=""
10590fe5e51b7Smrg	XMALLOC_ZERO_CFLAGS=""
10591fe5e51b7Smrg	XTMALLOC_ZERO_CFLAGS=""
10592fe5e51b7Smrgfi
10593fe5e51b7Smrg
10594fe5e51b7SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10595fe5e51b7SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10596fe5e51b7SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10597fe5e51b7Smrg]) # XORG_CHECK_MALLOC_ZERO
10598fe5e51b7Smrg
10599fe5e51b7Smrg# XORG_WITH_LINT()
10600fe5e51b7Smrg# ----------------
10601fe5e51b7Smrg# Minimum version: 1.1.0
10602fe5e51b7Smrg#
10603d7be9c72Smrg# This macro enables the use of a tool that flags some suspicious and
10604d7be9c72Smrg# non-portable constructs (likely to be bugs) in C language source code.
10605d7be9c72Smrg# It will attempt to locate the tool and use appropriate options.
10606d7be9c72Smrg# There are various lint type tools on different platforms.
10607d7be9c72Smrg#
10608d7be9c72Smrg# Interface to module:
10609d7be9c72Smrg# LINT:		returns the path to the tool found on the platform
10610d7be9c72Smrg#		or the value set to LINT on the configure cmd line
10611d7be9c72Smrg#		also an Automake conditional
10612d7be9c72Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
10613d7be9c72Smrg#
10614d7be9c72Smrg# --with-lint:	'yes' user instructs the module to use lint
10615d7be9c72Smrg#		'no' user instructs the module not to use lint (default)
10616d7be9c72Smrg#
10617d7be9c72Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10618d7be9c72Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10619fe5e51b7Smrg#
10620fe5e51b7SmrgAC_DEFUN([XORG_WITH_LINT],[
10621fe5e51b7Smrg
10622d7be9c72SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10623d7be9c72SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10624a31a186aSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10625fe5e51b7Smrg		[Use a lint-style source code checker (default: disabled)])],
10626fe5e51b7Smrg		[use_lint=$withval], [use_lint=no])
10627d7be9c72Smrg
10628d7be9c72Smrg# Obtain platform specific info like program name and options
10629d7be9c72Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10630d7be9c72Smrgcase $host_os in
10631d7be9c72Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10632d7be9c72Smrg	lint_name=splint
10633d7be9c72Smrg	lint_options="-badflag"
10634d7be9c72Smrg	;;
10635d7be9c72Smrg  *freebsd* | *netbsd*)
10636d7be9c72Smrg	lint_name=lint
10637d7be9c72Smrg	lint_options="-u -b"
10638d7be9c72Smrg	;;
10639d7be9c72Smrg  *solaris*)
10640d7be9c72Smrg	lint_name=lint
10641d7be9c72Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10642d7be9c72Smrg	;;
10643d7be9c72Smrgesac
10644d7be9c72Smrg
10645d7be9c72Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10646d7be9c72Smrgif test "x$use_lint" = x"yes" ; then
10647d7be9c72Smrg   AC_PATH_PROG([LINT], [$lint_name])
10648d7be9c72Smrg   if test "x$LINT" = "x"; then
10649d7be9c72Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10650d7be9c72Smrg   fi
10651d7be9c72Smrgelif test "x$use_lint" = x"no" ; then
10652d7be9c72Smrg   if test "x$LINT" != "x"; then
10653d7be9c72Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10654d7be9c72Smrg   fi
10655fe5e51b7Smrgelse
10656d7be9c72Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10657fe5e51b7Smrgfi
10658d7be9c72Smrg
10659d7be9c72Smrg# User supplied flags override default flags
10660d7be9c72Smrgif test "x$LINT_FLAGS" != "x"; then
10661d7be9c72Smrg   lint_options=$LINT_FLAGS
10662fe5e51b7Smrgfi
10663fe5e51b7Smrg
10664d7be9c72SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10665d7be9c72SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10666fe5e51b7Smrg
10667fe5e51b7Smrg]) # XORG_WITH_LINT
10668fe5e51b7Smrg
10669fe5e51b7Smrg# XORG_LINT_LIBRARY(LIBNAME)
10670fe5e51b7Smrg# --------------------------
10671fe5e51b7Smrg# Minimum version: 1.1.0
10672fe5e51b7Smrg#
10673fe5e51b7Smrg# Sets up flags for building lint libraries for checking programs that call
10674fe5e51b7Smrg# functions in the library.
10675fe5e51b7Smrg#
10676d7be9c72Smrg# Interface to module:
10677d7be9c72Smrg# LINTLIB		- Automake variable with the name of lint library file to make
10678d7be9c72Smrg# MAKE_LINT_LIB		- Automake conditional
10679d7be9c72Smrg#
10680d7be9c72Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10681d7be9c72Smrg#			  - 'no' user instructs the module not to create a lint library (default)
10682fe5e51b7Smrg
10683fe5e51b7SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10684fe5e51b7SmrgAC_REQUIRE([XORG_WITH_LINT])
10685a31a186aSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10686fe5e51b7Smrg	[Create lint library (default: disabled)])],
10687fe5e51b7Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10688d7be9c72Smrg
10689d7be9c72Smrgif test "x$make_lint_lib" = x"yes" ; then
10690d7be9c72Smrg   LINTLIB=llib-l$1.ln
10691d7be9c72Smrg   if test "x$LINT" = "x"; then
10692d7be9c72Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10693d7be9c72Smrg   fi
10694d7be9c72Smrgelif test "x$make_lint_lib" != x"no" ; then
10695d7be9c72Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10696fe5e51b7Smrgfi
10697d7be9c72Smrg
10698fe5e51b7SmrgAC_SUBST(LINTLIB)
10699fe5e51b7SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10700fe5e51b7Smrg
10701fe5e51b7Smrg]) # XORG_LINT_LIBRARY
10702fe5e51b7Smrg
107030bb88ba4Smrg# XORG_COMPILER_BRAND
107040bb88ba4Smrg# -------------------
107050bb88ba4Smrg# Minimum version: 1.14.0
107060bb88ba4Smrg#
107070bb88ba4Smrg# Checks for various brands of compilers and sets flags as appropriate:
107080bb88ba4Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
107090bb88ba4Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
107100bb88ba4Smrg#   clang compiler - sets CLANGCC to "yes"
107110bb88ba4Smrg#   Intel compiler - sets INTELCC to "yes"
107120bb88ba4Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
107130bb88ba4Smrg#
107140bb88ba4SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
107150bb88ba4SmrgAC_LANG_CASE(
107160bb88ba4Smrg	[C], [
107170bb88ba4Smrg		AC_REQUIRE([AC_PROG_CC_C99])
107180bb88ba4Smrg	],
107190bb88ba4Smrg	[C++], [
107200bb88ba4Smrg		AC_REQUIRE([AC_PROG_CXX])
107210bb88ba4Smrg	]
107220bb88ba4Smrg)
107230bb88ba4SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
107240bb88ba4SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
107250bb88ba4SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
107260bb88ba4Smrg]) # XORG_COMPILER_BRAND
107270bb88ba4Smrg
107280bb88ba4Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
107290bb88ba4Smrg# ---------------
107300bb88ba4Smrg# Minimum version: 1.16.0
107310bb88ba4Smrg#
107320bb88ba4Smrg# Test if the compiler works when passed the given flag as a command line argument.
107330bb88ba4Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
107340bb88ba4Smrg# next flag in the list until there are no more options.
107350bb88ba4Smrg#
107360bb88ba4Smrg# Note that this does not guarantee that the compiler supports the flag as some
107370bb88ba4Smrg# compilers will simply ignore arguments that they do not understand, but we do
107380bb88ba4Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
107390bb88ba4Smrg# -Werror=unused-command-line-argument
107400bb88ba4Smrg#
107410bb88ba4SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
107420bb88ba4Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
107430bb88ba4Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
107440bb88ba4Smrg
107450bb88ba4SmrgAC_LANG_COMPILER_REQUIRE
107460bb88ba4Smrg
107470bb88ba4SmrgAC_LANG_CASE(
107480bb88ba4Smrg	[C], [
107490bb88ba4Smrg		AC_REQUIRE([AC_PROG_CC_C99])
107500bb88ba4Smrg		define([PREFIX], [C])
107510bb88ba4Smrg		define([CACHE_PREFIX], [cc])
107520bb88ba4Smrg		define([COMPILER], [$CC])
107530bb88ba4Smrg	],
107540bb88ba4Smrg	[C++], [
107550bb88ba4Smrg		define([PREFIX], [CXX])
107560bb88ba4Smrg		define([CACHE_PREFIX], [cxx])
107570bb88ba4Smrg		define([COMPILER], [$CXX])
107580bb88ba4Smrg	]
107590bb88ba4Smrg)
107600bb88ba4Smrg
107610bb88ba4Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
107620bb88ba4Smrg
107630bb88ba4Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
107640bb88ba4Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
107650bb88ba4Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
107660bb88ba4Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
107670bb88ba4Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
107680bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
107690bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
107700bb88ba4Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
107710bb88ba4Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
107720bb88ba4Smrgfi
107730bb88ba4Smrg
107740bb88ba4Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
107750bb88ba4Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
107760bb88ba4Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
107770bb88ba4Smrg	fi
107780bb88ba4Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
107790bb88ba4Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
107800bb88ba4Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
107810bb88ba4Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
107820bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
107830bb88ba4Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
107840bb88ba4Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
107850bb88ba4Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
107860bb88ba4Smrgfi
107870bb88ba4Smrg
107880bb88ba4Smrgfound="no"
107890bb88ba4Smrgm4_foreach([flag], m4_cdr($@), [
107900bb88ba4Smrg	if test $found = "no" ; then
10791493f84f4Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
107920bb88ba4Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
107930bb88ba4Smrg		fi
107940bb88ba4Smrg
10795493f84f4Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
107960bb88ba4Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
107970bb88ba4Smrg		fi
107980bb88ba4Smrg
107990bb88ba4Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
108000bb88ba4Smrg
108010bb88ba4Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10802493f84f4Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
108030bb88ba4Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
108040bb88ba4Smrg		AC_CACHE_VAL($cacheid,
108050bb88ba4Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
108060bb88ba4Smrg					     [eval $cacheid=yes],
108070bb88ba4Smrg					     [eval $cacheid=no])])
108080bb88ba4Smrg
108090bb88ba4Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
108100bb88ba4Smrg
108110bb88ba4Smrg		eval supported=\$$cacheid
108120bb88ba4Smrg		AC_MSG_RESULT([$supported])
108130bb88ba4Smrg		if test "$supported" = "yes" ; then
108140bb88ba4Smrg			$1="$$1 ]flag["
108150bb88ba4Smrg			found="yes"
108160bb88ba4Smrg		fi
108170bb88ba4Smrg	fi
108180bb88ba4Smrg])
108190bb88ba4Smrg]) # XORG_TESTSET_CFLAG
108200bb88ba4Smrg
108210bb88ba4Smrg# XORG_COMPILER_FLAGS
108220bb88ba4Smrg# ---------------
108230bb88ba4Smrg# Minimum version: 1.16.0
108240bb88ba4Smrg#
108250bb88ba4Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
108260bb88ba4Smrg# arguments supported by the selected compiler which do NOT alter the generated
108270bb88ba4Smrg# code.  These arguments will cause the compiler to print various warnings
108280bb88ba4Smrg# during compilation AND turn a conservative set of warnings into errors.
108290bb88ba4Smrg#
108300bb88ba4Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
108310bb88ba4Smrg# future versions of util-macros as options are added to new compilers.
108320bb88ba4Smrg#
108330bb88ba4SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
108340bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
108350bb88ba4Smrg
108360bb88ba4SmrgAC_ARG_ENABLE(selective-werror,
108370bb88ba4Smrg              AS_HELP_STRING([--disable-selective-werror],
108380bb88ba4Smrg                             [Turn off selective compiler errors. (default: enabled)]),
108390bb88ba4Smrg              [SELECTIVE_WERROR=$enableval],
108400bb88ba4Smrg              [SELECTIVE_WERROR=yes])
108410bb88ba4Smrg
108420bb88ba4SmrgAC_LANG_CASE(
108430bb88ba4Smrg        [C], [
108440bb88ba4Smrg                define([PREFIX], [C])
108450bb88ba4Smrg        ],
108460bb88ba4Smrg        [C++], [
108470bb88ba4Smrg                define([PREFIX], [CXX])
108480bb88ba4Smrg        ]
108490bb88ba4Smrg)
108500bb88ba4Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
108510bb88ba4Smrgif test "x$SUNCC" = "xyes"; then
108520bb88ba4Smrg    [BASE_]PREFIX[FLAGS]="-v"
108530bb88ba4Smrgelse
108540bb88ba4Smrg    [BASE_]PREFIX[FLAGS]=""
108550bb88ba4Smrgfi
108560bb88ba4Smrg
108570bb88ba4Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
108580bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
108590bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
108600bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
108610bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
108620bb88ba4Smrg
108630bb88ba4SmrgAC_LANG_CASE(
108640bb88ba4Smrg	[C], [
108650bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
108660bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
108670bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
108680bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10869493f84f4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
108700bb88ba4Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
108710bb88ba4Smrg	]
108720bb88ba4Smrg)
108730bb88ba4Smrg
108740bb88ba4Smrg# This chunk adds additional warnings that could catch undesired effects.
108750bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
108760bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
108770bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
108780bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
108790bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
108800bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
10881493f84f4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
108820bb88ba4Smrg
108830bb88ba4Smrg# These are currently disabled because they are noisy.  They will be enabled
108840bb88ba4Smrg# in the future once the codebase is sufficiently modernized to silence
108850bb88ba4Smrg# them.  For now, I don't want them to drown out the other warnings.
108860bb88ba4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
108870bb88ba4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
10888493f84f4Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
108890bb88ba4Smrg
108900bb88ba4Smrg# Turn some warnings into errors, so we don't accidently get successful builds
108910bb88ba4Smrg# when there are problems that should be fixed.
108920bb88ba4Smrg
108930bb88ba4Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
108940bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
108950bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
108960bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
108970bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
108980bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
108990bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
109000bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
109010bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
109020bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
109030bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
109040bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
109050bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
109060bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
109070bb88ba4Smrgelse
109080bb88ba4SmrgAC_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])
109090bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
109100bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
109110bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
109120bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
109130bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
109140bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
109150bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
109160bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
109170bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
109180bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
109190bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
109200bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
109210bb88ba4SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
109220bb88ba4Smrgfi
109230bb88ba4Smrg
109240bb88ba4SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
109250bb88ba4Smrg]) # XORG_COMPILER_FLAGS
109260bb88ba4Smrg
10927eda3803bSmrg# XORG_CWARNFLAGS
10928eda3803bSmrg# ---------------
10929eda3803bSmrg# Minimum version: 1.2.0
109300bb88ba4Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
10931eda3803bSmrg#
10932eda3803bSmrg# Defines CWARNFLAGS to enable C compiler warnings.
10933eda3803bSmrg#
109340bb88ba4Smrg# This function is deprecated because it defines -fno-strict-aliasing
109350bb88ba4Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
109360bb88ba4Smrg# is needed, then it should be added explicitly in the module when
109370bb88ba4Smrg# it is updated to use BASE_CFLAGS.
109380bb88ba4Smrg#
10939eda3803bSmrgAC_DEFUN([XORG_CWARNFLAGS], [
109400bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
109410bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
109420bb88ba4SmrgAC_LANG_CASE(
109430bb88ba4Smrg	[C], [
109440bb88ba4Smrg		CWARNFLAGS="$BASE_CFLAGS"
109450bb88ba4Smrg		if  test "x$GCC" = xyes ; then
109460bb88ba4Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
109470bb88ba4Smrg		fi
109480bb88ba4Smrg		AC_SUBST(CWARNFLAGS)
109490bb88ba4Smrg	]
109500bb88ba4Smrg)
10951eda3803bSmrg]) # XORG_CWARNFLAGS
10952a31a186aSmrg
10953a31a186aSmrg# XORG_STRICT_OPTION
10954a31a186aSmrg# -----------------------
10955a31a186aSmrg# Minimum version: 1.3.0
10956a31a186aSmrg#
109570bb88ba4Smrg# Add configure option to enable strict compilation flags, such as treating
109580bb88ba4Smrg# warnings as fatal errors.
109590bb88ba4Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
109600bb88ba4Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
109610bb88ba4Smrg#
109620bb88ba4Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
109630bb88ba4Smrg# when strict compilation is unconditionally desired.
10964a31a186aSmrgAC_DEFUN([XORG_STRICT_OPTION], [
10965a31a186aSmrgAC_REQUIRE([XORG_CWARNFLAGS])
109660bb88ba4SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
10967a31a186aSmrg
10968a31a186aSmrgAC_ARG_ENABLE(strict-compilation,
10969a31a186aSmrg			  AS_HELP_STRING([--enable-strict-compilation],
10970a31a186aSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
10971a31a186aSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
109720bb88ba4Smrg
109730bb88ba4SmrgAC_LANG_CASE(
109740bb88ba4Smrg        [C], [
109750bb88ba4Smrg                define([PREFIX], [C])
109760bb88ba4Smrg        ],
109770bb88ba4Smrg        [C++], [
109780bb88ba4Smrg                define([PREFIX], [CXX])
109790bb88ba4Smrg        ]
109800bb88ba4Smrg)
109810bb88ba4Smrg
109820bb88ba4Smrg[STRICT_]PREFIX[FLAGS]=""
109830bb88ba4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
109840bb88ba4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
109850bb88ba4Smrg
109860bb88ba4Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
109870bb88ba4Smrg# activate it with -Werror, so we add it here explicitly.
109880bb88ba4SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
109890bb88ba4Smrg
10990a31a186aSmrgif test "x$STRICT_COMPILE" = "xyes"; then
109910bb88ba4Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
109920bb88ba4Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
10993a31a186aSmrgfi
109940bb88ba4SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
109950bb88ba4SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
109960bb88ba4SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
10997a31a186aSmrg]) # XORG_STRICT_OPTION
10998a31a186aSmrg
10999a31a186aSmrg# XORG_DEFAULT_OPTIONS
11000a31a186aSmrg# --------------------
11001a31a186aSmrg# Minimum version: 1.3.0
11002a31a186aSmrg#
11003a31a186aSmrg# Defines default options for X.Org modules.
11004a31a186aSmrg#
11005a31a186aSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11006d7be9c72SmrgAC_REQUIRE([AC_PROG_INSTALL])
110070bb88ba4SmrgXORG_COMPILER_FLAGS
11008a31a186aSmrgXORG_CWARNFLAGS
11009a31a186aSmrgXORG_STRICT_OPTION
11010a31a186aSmrgXORG_RELEASE_VERSION
11011a31a186aSmrgXORG_CHANGELOG
11012a31a186aSmrgXORG_INSTALL
11013a31a186aSmrgXORG_MANPAGE_SECTIONS
11014d7be9c72Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11015d7be9c72Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11016a31a186aSmrg]) # XORG_DEFAULT_OPTIONS
11017a31a186aSmrg
11018a31a186aSmrg# XORG_INSTALL()
11019a31a186aSmrg# ----------------
11020a31a186aSmrg# Minimum version: 1.4.0
11021a31a186aSmrg#
11022a31a186aSmrg# Defines the variable INSTALL_CMD as the command to copy
11023d7be9c72Smrg# INSTALL from $prefix/share/util-macros.
11024a31a186aSmrg#
11025a31a186aSmrgAC_DEFUN([XORG_INSTALL], [
11026a31a186aSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11027d7be9c72Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11028d7be9c72SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11029a31a186aSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11030a31a186aSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11031d7be9c72Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11032a31a186aSmrgAC_SUBST([INSTALL_CMD])
11033a31a186aSmrg]) # XORG_INSTALL
11034fe5e51b7Smrgdnl Copyright 2005 Red Hat, Inc
11035fe5e51b7Smrgdnl
11036fe5e51b7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11037fe5e51b7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11038fe5e51b7Smrgdnl the above copyright notice appear in all copies and that both that
11039fe5e51b7Smrgdnl copyright notice and this permission notice appear in supporting
11040fe5e51b7Smrgdnl documentation.
11041fe5e51b7Smrgdnl
11042fe5e51b7Smrgdnl The above copyright notice and this permission notice shall be included
11043fe5e51b7Smrgdnl in all copies or substantial portions of the Software.
11044fe5e51b7Smrgdnl
11045fe5e51b7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11046fe5e51b7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11047fe5e51b7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11048fe5e51b7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11049fe5e51b7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11050fe5e51b7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11051fe5e51b7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
11052fe5e51b7Smrgdnl
11053fe5e51b7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
11054fe5e51b7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
11055fe5e51b7Smrgdnl other dealings in this Software without prior written authorization
11056fe5e51b7Smrgdnl from the copyright holders.
11057fe5e51b7Smrgdnl
11058fe5e51b7Smrg
11059fe5e51b7Smrg# XORG_RELEASE_VERSION
11060fe5e51b7Smrg# --------------------
11061d7be9c72Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11062493f84f4Smrg
11063fe5e51b7SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11064fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11065fe5e51b7Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11066fe5e51b7Smrg		[Major version of this package])
11067eda3803bSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11068fe5e51b7Smrg	if test "x$PVM" = "x"; then
11069fe5e51b7Smrg		PVM="0"
11070fe5e51b7Smrg	fi
11071fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11072fe5e51b7Smrg		[$PVM],
11073fe5e51b7Smrg		[Minor version of this package])
11074eda3803bSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11075fe5e51b7Smrg	if test "x$PVP" = "x"; then
11076fe5e51b7Smrg		PVP="0"
11077fe5e51b7Smrg	fi
11078fe5e51b7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11079fe5e51b7Smrg		[$PVP],
11080fe5e51b7Smrg		[Patch version of this package])
11081fe5e51b7Smrg])
11082fe5e51b7Smrg
11083eda3803bSmrg# XORG_CHANGELOG()
11084eda3803bSmrg# ----------------
11085eda3803bSmrg# Minimum version: 1.2.0
11086eda3803bSmrg#
11087eda3803bSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11088eda3803bSmrg# ChangeLog from git.
11089eda3803bSmrg#
11090eda3803bSmrg#
11091eda3803bSmrgAC_DEFUN([XORG_CHANGELOG], [
11092a31a186aSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11093a31a186aSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11094a31a186aSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11095eda3803bSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11096eda3803bSmrgAC_SUBST([CHANGELOG_CMD])
11097eda3803bSmrg]) # XORG_CHANGELOG
11098eda3803bSmrg
11099a31a186aSmrgdnl Copyright 2005 Red Hat, Inc
11100a31a186aSmrgdnl 
11101a31a186aSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11102a31a186aSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11103a31a186aSmrgdnl the above copyright notice appear in all copies and that both that
11104a31a186aSmrgdnl copyright notice and this permission notice appear in supporting
11105a31a186aSmrgdnl documentation.
11106a31a186aSmrgdnl 
11107a31a186aSmrgdnl The above copyright notice and this permission notice shall be included
11108a31a186aSmrgdnl in all copies or substantial portions of the Software.
11109a31a186aSmrgdnl 
11110a31a186aSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11111a31a186aSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11112a31a186aSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11113a31a186aSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11114a31a186aSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11115a31a186aSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11116a31a186aSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11117a31a186aSmrgdnl 
11118a31a186aSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11119a31a186aSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11120a31a186aSmrgdnl other dealings in this Software without prior written authorization
11121a31a186aSmrgdnl from the copyright holders.
11122a31a186aSmrgdnl 
11123a31a186aSmrg
11124493f84f4Smrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
11125a31a186aSmrg# --------------------------
11126493f84f4Smrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11127493f84f4Smrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
11128a31a186aSmrg
11129a31a186aSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
11130d7be9c72Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11131a31a186aSmrg	SAVE_CFLAGS="$CFLAGS"
11132d7be9c72Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
11133a31a186aSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11134a31a186aSmrg#include "xorg-server.h"
11135a31a186aSmrg#if !defined $1
11136a31a186aSmrg#error $1 not defined
11137a31a186aSmrg#endif
11138a31a186aSmrg		]])],
11139a31a186aSmrg		[_EXT_CHECK=yes],
11140a31a186aSmrg		[_EXT_CHECK=no])
11141a31a186aSmrg	CFLAGS="$SAVE_CFLAGS"
11142a31a186aSmrg	AC_MSG_CHECKING([if $1 is defined])
11143a31a186aSmrg	AC_MSG_RESULT([$_EXT_CHECK])
11144a31a186aSmrg	if test "$_EXT_CHECK" != no; then
11145a31a186aSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
11146a31a186aSmrg	fi
11147a31a186aSmrg])
11148a31a186aSmrg
11149493f84f4Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
11150fe5e51b7Smrg#
11151fe5e51b7Smrg# This file is free software; the Free Software Foundation
11152fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11153fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11154fe5e51b7Smrg
11155fe5e51b7Smrg# AM_AUTOMAKE_VERSION(VERSION)
11156fe5e51b7Smrg# ----------------------------
11157fe5e51b7Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11158fe5e51b7Smrg# generated from the m4 files accompanying Automake X.Y.
11159fe5e51b7Smrg# (This private macro should not be called outside this file.)
11160fe5e51b7SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
11161493f84f4Smrg[am__api_version='1.14'
11162fe5e51b7Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11163fe5e51b7Smrgdnl require some minimum version.  Point them to the right macro.
11164493f84f4Smrgm4_if([$1], [1.14.1], [],
11165fe5e51b7Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11166fe5e51b7Smrg])
11167fe5e51b7Smrg
11168fe5e51b7Smrg# _AM_AUTOCONF_VERSION(VERSION)
11169fe5e51b7Smrg# -----------------------------
11170fe5e51b7Smrg# aclocal traces this macro to find the Autoconf version.
11171fe5e51b7Smrg# This is a private macro too.  Using m4_define simplifies
11172fe5e51b7Smrg# the logic in aclocal, which can simply ignore this definition.
11173fe5e51b7Smrgm4_define([_AM_AUTOCONF_VERSION], [])
11174fe5e51b7Smrg
11175fe5e51b7Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11176fe5e51b7Smrg# -------------------------------
11177fe5e51b7Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11178eda3803bSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11179fe5e51b7SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11180493f84f4Smrg[AM_AUTOMAKE_VERSION([1.14.1])dnl
11181eda3803bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
11182eda3803bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11183eda3803bSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11184fe5e51b7Smrg
11185fe5e51b7Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11186fe5e51b7Smrg
11187493f84f4Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11188fe5e51b7Smrg#
11189fe5e51b7Smrg# This file is free software; the Free Software Foundation
11190fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11191fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11192fe5e51b7Smrg
11193fe5e51b7Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11194acd6767fSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11195acd6767fSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
11196fe5e51b7Smrg#
11197fe5e51b7Smrg# Of course, Automake must honor this variable whenever it calls a
11198fe5e51b7Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11199fe5e51b7Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11200fe5e51b7Smrg# depending on how configure is run.  This is pretty annoying, since
11201fe5e51b7Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11202fe5e51b7Smrg# source directory, any form will work fine, but in subdirectories a
11203fe5e51b7Smrg# relative path needs to be adjusted first.
11204fe5e51b7Smrg#
11205fe5e51b7Smrg# $ac_aux_dir/missing
11206fe5e51b7Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11207fe5e51b7Smrg# $top_srcdir/$ac_aux_dir/missing
11208fe5e51b7Smrg#    fails if $ac_aux_dir is absolute,
11209fe5e51b7Smrg#    fails when called from a subdirectory in a VPATH build with
11210fe5e51b7Smrg#          a relative $ac_aux_dir
11211fe5e51b7Smrg#
11212fe5e51b7Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11213fe5e51b7Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
11214acd6767fSmrg# harmless because $srcdir is '.', but things will broke when you
11215fe5e51b7Smrg# start a VPATH build or use an absolute $srcdir.
11216fe5e51b7Smrg#
11217fe5e51b7Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11218fe5e51b7Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11219fe5e51b7Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11220fe5e51b7Smrg# and then we would define $MISSING as
11221fe5e51b7Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11222fe5e51b7Smrg# This will work as long as MISSING is not called from configure, because
11223fe5e51b7Smrg# unfortunately $(top_srcdir) has no meaning in configure.
11224fe5e51b7Smrg# However there are other variables, like CC, which are often used in
11225fe5e51b7Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
11226fe5e51b7Smrg#
11227fe5e51b7Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
11228fe5e51b7Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
11229fe5e51b7Smrg# configured tree to be moved without reconfiguration.
11230fe5e51b7Smrg
11231fe5e51b7SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
11232fe5e51b7Smrg[dnl Rely on autoconf to set up CDPATH properly.
11233fe5e51b7SmrgAC_PREREQ([2.50])dnl
11234fe5e51b7Smrg# expand $ac_aux_dir to an absolute path
11235fe5e51b7Smrgam_aux_dir=`cd $ac_aux_dir && pwd`
11236fe5e51b7Smrg])
11237fe5e51b7Smrg
11238fe5e51b7Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11239fe5e51b7Smrg
11240493f84f4Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
11241fe5e51b7Smrg#
11242fe5e51b7Smrg# This file is free software; the Free Software Foundation
11243fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11244fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11245fe5e51b7Smrg
11246fe5e51b7Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11247fe5e51b7Smrg# -------------------------------------
11248fe5e51b7Smrg# Define a conditional.
11249fe5e51b7SmrgAC_DEFUN([AM_CONDITIONAL],
11250acd6767fSmrg[AC_PREREQ([2.52])dnl
11251acd6767fSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11252acd6767fSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11253fe5e51b7SmrgAC_SUBST([$1_TRUE])dnl
11254fe5e51b7SmrgAC_SUBST([$1_FALSE])dnl
11255fe5e51b7Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11256fe5e51b7Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11257643b027fSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11258fe5e51b7Smrgif $2; then
11259fe5e51b7Smrg  $1_TRUE=
11260fe5e51b7Smrg  $1_FALSE='#'
11261fe5e51b7Smrgelse
11262fe5e51b7Smrg  $1_TRUE='#'
11263fe5e51b7Smrg  $1_FALSE=
11264fe5e51b7Smrgfi
11265fe5e51b7SmrgAC_CONFIG_COMMANDS_PRE(
11266fe5e51b7Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11267fe5e51b7Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11268fe5e51b7SmrgUsually this means the macro was only invoked conditionally.]])
11269fe5e51b7Smrgfi])])
11270fe5e51b7Smrg
11271493f84f4Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
11272fe5e51b7Smrg#
11273fe5e51b7Smrg# This file is free software; the Free Software Foundation
11274fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11275fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11276fe5e51b7Smrg
11277fe5e51b7Smrg
11278acd6767fSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11279fe5e51b7Smrg# written in clear, in which case automake, when reading aclocal.m4,
11280fe5e51b7Smrg# will think it sees a *use*, and therefore will trigger all it's
11281fe5e51b7Smrg# C support machinery.  Also note that it means that autoscan, seeing
11282fe5e51b7Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11283fe5e51b7Smrg
11284fe5e51b7Smrg
11285fe5e51b7Smrg# _AM_DEPENDENCIES(NAME)
11286fe5e51b7Smrg# ----------------------
11287fe5e51b7Smrg# See how the compiler implements dependency checking.
11288acd6767fSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11289fe5e51b7Smrg# We try a few techniques and use that to set a single cache variable.
11290fe5e51b7Smrg#
11291fe5e51b7Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11292fe5e51b7Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11293fe5e51b7Smrg# dependency, and given that the user is not expected to run this macro,
11294fe5e51b7Smrg# just rely on AC_PROG_CC.
11295fe5e51b7SmrgAC_DEFUN([_AM_DEPENDENCIES],
11296fe5e51b7Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11297fe5e51b7SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11298fe5e51b7SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11299fe5e51b7SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11300fe5e51b7Smrg
11301acd6767fSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11302acd6767fSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11303acd6767fSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11304acd6767fSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11305acd6767fSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11306acd6767fSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11307acd6767fSmrg                    [depcc="$$1"   am_compiler_list=])
11308fe5e51b7Smrg
11309fe5e51b7SmrgAC_CACHE_CHECK([dependency style of $depcc],
11310fe5e51b7Smrg               [am_cv_$1_dependencies_compiler_type],
11311fe5e51b7Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11312fe5e51b7Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
11313fe5e51b7Smrg  # making bogus files that we don't know about and never remove.  For
11314fe5e51b7Smrg  # instance it was reported that on HP-UX the gcc test will end up
11315acd6767fSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11316acd6767fSmrg  # in D".
113170bb88ba4Smrg  rm -rf conftest.dir
11318fe5e51b7Smrg  mkdir conftest.dir
11319fe5e51b7Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11320fe5e51b7Smrg  # using a relative directory.
11321fe5e51b7Smrg  cp "$am_depcomp" conftest.dir
11322fe5e51b7Smrg  cd conftest.dir
11323fe5e51b7Smrg  # We will build objects and dependencies in a subdirectory because
11324fe5e51b7Smrg  # it helps to detect inapplicable dependency modes.  For instance
11325fe5e51b7Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11326fe5e51b7Smrg  # side effect of compilation, but ICC will put the dependencies in
11327fe5e51b7Smrg  # the current directory while Tru64 will put them in the object
11328fe5e51b7Smrg  # directory.
11329fe5e51b7Smrg  mkdir sub
11330fe5e51b7Smrg
11331fe5e51b7Smrg  am_cv_$1_dependencies_compiler_type=none
11332fe5e51b7Smrg  if test "$am_compiler_list" = ""; then
11333fe5e51b7Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11334fe5e51b7Smrg  fi
11335643b027fSmrg  am__universal=false
11336643b027fSmrg  m4_case([$1], [CC],
11337643b027fSmrg    [case " $depcc " in #(
11338643b027fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11339643b027fSmrg     esac],
11340643b027fSmrg    [CXX],
11341643b027fSmrg    [case " $depcc " in #(
11342643b027fSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11343643b027fSmrg     esac])
11344643b027fSmrg
11345fe5e51b7Smrg  for depmode in $am_compiler_list; do
11346fe5e51b7Smrg    # Setup a source with many dependencies, because some compilers
11347fe5e51b7Smrg    # like to wrap large dependency lists on column 80 (with \), and
11348fe5e51b7Smrg    # we should not choose a depcomp mode which is confused by this.
11349fe5e51b7Smrg    #
11350fe5e51b7Smrg    # We need to recreate these files for each test, as the compiler may
11351fe5e51b7Smrg    # overwrite some of them when testing with obscure command lines.
11352fe5e51b7Smrg    # This happens at least with the AIX C compiler.
11353fe5e51b7Smrg    : > sub/conftest.c
11354fe5e51b7Smrg    for i in 1 2 3 4 5 6; do
11355fe5e51b7Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11356acd6767fSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11357acd6767fSmrg      # Solaris 10 /bin/sh.
11358acd6767fSmrg      echo '/* dummy */' > sub/conftst$i.h
11359fe5e51b7Smrg    done
11360fe5e51b7Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11361fe5e51b7Smrg
11362acd6767fSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11363643b027fSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11364acd6767fSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11365acd6767fSmrg    # versions had trouble with output in subdirs.
11366643b027fSmrg    am__obj=sub/conftest.${OBJEXT-o}
11367643b027fSmrg    am__minus_obj="-o $am__obj"
11368fe5e51b7Smrg    case $depmode in
11369643b027fSmrg    gcc)
11370643b027fSmrg      # This depmode causes a compiler race in universal mode.
11371643b027fSmrg      test "$am__universal" = false || continue
11372643b027fSmrg      ;;
11373fe5e51b7Smrg    nosideeffect)
11374acd6767fSmrg      # After this tag, mechanisms are not by side-effect, so they'll
11375acd6767fSmrg      # only be used when explicitly requested.
11376fe5e51b7Smrg      if test "x$enable_dependency_tracking" = xyes; then
11377fe5e51b7Smrg	continue
11378fe5e51b7Smrg      else
11379fe5e51b7Smrg	break
11380fe5e51b7Smrg      fi
11381fe5e51b7Smrg      ;;
113820bb88ba4Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11383acd6767fSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
11384643b027fSmrg      # not run yet.  These depmodes are late enough in the game, and
11385643b027fSmrg      # so weak that their functioning should not be impacted.
11386643b027fSmrg      am__obj=conftest.${OBJEXT-o}
11387643b027fSmrg      am__minus_obj=
11388643b027fSmrg      ;;
11389fe5e51b7Smrg    none) break ;;
11390fe5e51b7Smrg    esac
11391fe5e51b7Smrg    if depmode=$depmode \
11392643b027fSmrg       source=sub/conftest.c object=$am__obj \
11393fe5e51b7Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11394643b027fSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11395fe5e51b7Smrg         >/dev/null 2>conftest.err &&
11396fe5e51b7Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11397fe5e51b7Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11398643b027fSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11399fe5e51b7Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11400fe5e51b7Smrg      # icc doesn't choke on unknown options, it will just issue warnings
11401fe5e51b7Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
11402fe5e51b7Smrg      # that says an option was ignored or not supported.
11403fe5e51b7Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11404fe5e51b7Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11405fe5e51b7Smrg      # The diagnosis changed in icc 8.0:
11406fe5e51b7Smrg      #   icc: Command line remark: option '-MP' not supported
11407fe5e51b7Smrg      if (grep 'ignoring option' conftest.err ||
11408fe5e51b7Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11409fe5e51b7Smrg        am_cv_$1_dependencies_compiler_type=$depmode
11410fe5e51b7Smrg        break
11411fe5e51b7Smrg      fi
11412fe5e51b7Smrg    fi
11413fe5e51b7Smrg  done
11414fe5e51b7Smrg
11415fe5e51b7Smrg  cd ..
11416fe5e51b7Smrg  rm -rf conftest.dir
11417fe5e51b7Smrgelse
11418fe5e51b7Smrg  am_cv_$1_dependencies_compiler_type=none
11419fe5e51b7Smrgfi
11420fe5e51b7Smrg])
11421fe5e51b7SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11422fe5e51b7SmrgAM_CONDITIONAL([am__fastdep$1], [
11423fe5e51b7Smrg  test "x$enable_dependency_tracking" != xno \
11424fe5e51b7Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11425fe5e51b7Smrg])
11426fe5e51b7Smrg
11427fe5e51b7Smrg
11428fe5e51b7Smrg# AM_SET_DEPDIR
11429fe5e51b7Smrg# -------------
11430fe5e51b7Smrg# Choose a directory name for dependency files.
11431acd6767fSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11432fe5e51b7SmrgAC_DEFUN([AM_SET_DEPDIR],
11433fe5e51b7Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11434fe5e51b7SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11435fe5e51b7Smrg])
11436fe5e51b7Smrg
11437fe5e51b7Smrg
11438fe5e51b7Smrg# AM_DEP_TRACK
11439fe5e51b7Smrg# ------------
11440fe5e51b7SmrgAC_DEFUN([AM_DEP_TRACK],
11441acd6767fSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11442acd6767fSmrgAS_HELP_STRING(
11443acd6767fSmrg  [--enable-dependency-tracking],
11444acd6767fSmrg  [do not reject slow dependency extractors])
11445acd6767fSmrgAS_HELP_STRING(
11446acd6767fSmrg  [--disable-dependency-tracking],
11447acd6767fSmrg  [speeds up one-time build])])
11448fe5e51b7Smrgif test "x$enable_dependency_tracking" != xno; then
11449fe5e51b7Smrg  am_depcomp="$ac_aux_dir/depcomp"
11450fe5e51b7Smrg  AMDEPBACKSLASH='\'
114510bb88ba4Smrg  am__nodep='_no'
11452fe5e51b7Smrgfi
11453fe5e51b7SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11454fe5e51b7SmrgAC_SUBST([AMDEPBACKSLASH])dnl
11455fe5e51b7Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
114560bb88ba4SmrgAC_SUBST([am__nodep])dnl
114570bb88ba4Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11458fe5e51b7Smrg])
11459fe5e51b7Smrg
11460fe5e51b7Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
11461fe5e51b7Smrg
11462493f84f4Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
11463fe5e51b7Smrg#
11464fe5e51b7Smrg# This file is free software; the Free Software Foundation
11465fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11466fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11467fe5e51b7Smrg
11468fe5e51b7Smrg
11469fe5e51b7Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11470fe5e51b7Smrg# ------------------------------
11471fe5e51b7SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11472643b027fSmrg[{
11473493f84f4Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
11474643b027fSmrg  # are listed without --file.  Let's play safe and only enable the eval
11475643b027fSmrg  # if we detect the quoting.
11476643b027fSmrg  case $CONFIG_FILES in
11477643b027fSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
11478643b027fSmrg  *)   set x $CONFIG_FILES ;;
11479643b027fSmrg  esac
11480643b027fSmrg  shift
11481643b027fSmrg  for mf
11482643b027fSmrg  do
11483643b027fSmrg    # Strip MF so we end up with the name of the file.
11484643b027fSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11485643b027fSmrg    # Check whether this is an Automake generated Makefile or not.
11486acd6767fSmrg    # We used to match only the files named 'Makefile.in', but
11487643b027fSmrg    # some people rename them; so instead we look at the file content.
11488643b027fSmrg    # Grep'ing the first line is not enough: some people post-process
11489643b027fSmrg    # each Makefile.in and add a new line on top of each file to say so.
11490643b027fSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
11491643b027fSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
11492643b027fSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11493643b027fSmrg      dirpart=`AS_DIRNAME("$mf")`
11494643b027fSmrg    else
11495643b027fSmrg      continue
11496643b027fSmrg    fi
11497643b027fSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
11498acd6767fSmrg    # from the Makefile without running 'make'.
11499643b027fSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11500643b027fSmrg    test -z "$DEPDIR" && continue
11501643b027fSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11502493f84f4Smrg    test -z "$am__include" && continue
11503643b027fSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11504643b027fSmrg    # Find all dependency output files, they are included files with
11505643b027fSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11506643b027fSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11507643b027fSmrg    # expansion.
11508643b027fSmrg    for file in `sed -n "
11509643b027fSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11510acd6767fSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11511643b027fSmrg      # Make sure the directory exists.
11512643b027fSmrg      test -f "$dirpart/$file" && continue
11513643b027fSmrg      fdir=`AS_DIRNAME(["$file"])`
11514643b027fSmrg      AS_MKDIR_P([$dirpart/$fdir])
11515643b027fSmrg      # echo "creating $dirpart/$file"
11516643b027fSmrg      echo '# dummy' > "$dirpart/$file"
11517643b027fSmrg    done
11518fe5e51b7Smrg  done
11519643b027fSmrg}
11520fe5e51b7Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11521fe5e51b7Smrg
11522fe5e51b7Smrg
11523fe5e51b7Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11524fe5e51b7Smrg# -----------------------------
11525fe5e51b7Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
11526fe5e51b7Smrg#
11527fe5e51b7Smrg# This code is only required when automatic dependency tracking
11528acd6767fSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
11529fe5e51b7Smrg# need in order to bootstrap the dependency handling code.
11530fe5e51b7SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11531fe5e51b7Smrg[AC_CONFIG_COMMANDS([depfiles],
11532fe5e51b7Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11533fe5e51b7Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11534fe5e51b7Smrg])
11535fe5e51b7Smrg
11536fe5e51b7Smrg# Do all the work for Automake.                             -*- Autoconf -*-
11537fe5e51b7Smrg
11538493f84f4Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
11539fe5e51b7Smrg#
11540fe5e51b7Smrg# This file is free software; the Free Software Foundation
11541fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11542fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11543fe5e51b7Smrg
11544fe5e51b7Smrg# This macro actually does too much.  Some checks are only needed if
11545fe5e51b7Smrg# your package does certain things.  But this isn't really a big deal.
11546fe5e51b7Smrg
11547493f84f4Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11548493f84f4Smrgm4_define([AC_PROG_CC],
11549493f84f4Smrgm4_defn([AC_PROG_CC])
11550493f84f4Smrg[_AM_PROG_CC_C_O
11551493f84f4Smrg])
11552493f84f4Smrg
11553fe5e51b7Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11554fe5e51b7Smrg# AM_INIT_AUTOMAKE([OPTIONS])
11555fe5e51b7Smrg# -----------------------------------------------
11556fe5e51b7Smrg# The call with PACKAGE and VERSION arguments is the old style
11557fe5e51b7Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11558fe5e51b7Smrg# and VERSION should now be passed to AC_INIT and removed from
11559fe5e51b7Smrg# the call to AM_INIT_AUTOMAKE.
11560fe5e51b7Smrg# We support both call styles for the transition.  After
11561fe5e51b7Smrg# the next Automake release, Autoconf can make the AC_INIT
11562fe5e51b7Smrg# arguments mandatory, and then we can depend on a new Autoconf
11563fe5e51b7Smrg# release and drop the old call support.
11564fe5e51b7SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11565493f84f4Smrg[AC_PREREQ([2.65])dnl
11566fe5e51b7Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11567fe5e51b7Smrgdnl the ones we care about.
11568fe5e51b7Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11569fe5e51b7SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11570fe5e51b7SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11571fe5e51b7Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11572fe5e51b7Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11573fe5e51b7Smrg  # is not polluted with repeated "-I."
11574fe5e51b7Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11575fe5e51b7Smrg  # test to see if srcdir already configured
11576fe5e51b7Smrg  if test -f $srcdir/config.status; then
11577fe5e51b7Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11578fe5e51b7Smrg  fi
11579fe5e51b7Smrgfi
11580fe5e51b7Smrg
11581fe5e51b7Smrg# test whether we have cygpath
11582fe5e51b7Smrgif test -z "$CYGPATH_W"; then
11583fe5e51b7Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11584fe5e51b7Smrg    CYGPATH_W='cygpath -w'
11585fe5e51b7Smrg  else
11586fe5e51b7Smrg    CYGPATH_W=echo
11587fe5e51b7Smrg  fi
11588fe5e51b7Smrgfi
11589fe5e51b7SmrgAC_SUBST([CYGPATH_W])
11590fe5e51b7Smrg
11591fe5e51b7Smrg# Define the identity of the package.
11592fe5e51b7Smrgdnl Distinguish between old-style and new-style calls.
11593fe5e51b7Smrgm4_ifval([$2],
11594acd6767fSmrg[AC_DIAGNOSE([obsolete],
11595493f84f4Smrg             [$0: two- and three-arguments forms are deprecated.])
11596acd6767fSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11597fe5e51b7Smrg AC_SUBST([PACKAGE], [$1])dnl
11598fe5e51b7Smrg AC_SUBST([VERSION], [$2])],
11599fe5e51b7Smrg[_AM_SET_OPTIONS([$1])dnl
11600fe5e51b7Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11601acd6767fSmrgm4_if(
11602acd6767fSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11603acd6767fSmrg  [ok:ok],,
11604fe5e51b7Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11605fe5e51b7Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11606fe5e51b7Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11607fe5e51b7Smrg
11608fe5e51b7Smrg_AM_IF_OPTION([no-define],,
11609acd6767fSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11610acd6767fSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11611fe5e51b7Smrg
11612fe5e51b7Smrg# Some tools Automake needs.
11613fe5e51b7SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11614fe5e51b7SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11615acd6767fSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11616acd6767fSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11617acd6767fSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11618acd6767fSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11619acd6767fSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11620643b027fSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11621643b027fSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11622acd6767fSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11623acd6767fSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
11624acd6767fSmrg# dies out for good.  For more background, see:
11625acd6767fSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11626acd6767fSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11627acd6767fSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
11628fe5e51b7Smrg# We need awk for the "check" target.  The system "awk" is bad on
11629fe5e51b7Smrg# some platforms.
11630fe5e51b7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
11631fe5e51b7SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11632fe5e51b7SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11633fe5e51b7Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11634643b027fSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11635643b027fSmrg			     [_AM_PROG_TAR([v7])])])
11636fe5e51b7Smrg_AM_IF_OPTION([no-dependencies],,
11637fe5e51b7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11638acd6767fSmrg		  [_AM_DEPENDENCIES([CC])],
11639acd6767fSmrg		  [m4_define([AC_PROG_CC],
11640acd6767fSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11641fe5e51b7SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11642acd6767fSmrg		  [_AM_DEPENDENCIES([CXX])],
11643acd6767fSmrg		  [m4_define([AC_PROG_CXX],
11644acd6767fSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11645fe5e51b7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11646acd6767fSmrg		  [_AM_DEPENDENCIES([OBJC])],
11647acd6767fSmrg		  [m4_define([AC_PROG_OBJC],
11648acd6767fSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11649493f84f4SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11650acd6767fSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
11651acd6767fSmrg		  [m4_define([AC_PROG_OBJCXX],
11652493f84f4Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11653fe5e51b7Smrg])
11654493f84f4SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11655493f84f4Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
11656493f84f4Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11657493f84f4Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11658643b027fSmrgAC_CONFIG_COMMANDS_PRE(dnl
11659643b027fSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11660643b027fSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11661493f84f4Smrg
11662493f84f4Smrg# POSIX will say in a future version that running "rm -f" with no argument
11663493f84f4Smrg# is OK; and we want to be able to make that assumption in our Makefile
11664493f84f4Smrg# recipes.  So use an aggressive probe to check that the usage we want is
11665493f84f4Smrg# actually supported "in the wild" to an acceptable degree.
11666493f84f4Smrg# See automake bug#10828.
11667493f84f4Smrg# To make any issue more visible, cause the running configure to be aborted
11668493f84f4Smrg# by default if the 'rm' program in use doesn't match our expectations; the
11669493f84f4Smrg# user can still override this though.
11670493f84f4Smrgif rm -f && rm -fr && rm -rf; then : OK; else
11671493f84f4Smrg  cat >&2 <<'END'
11672493f84f4SmrgOops!
11673493f84f4Smrg
11674493f84f4SmrgYour 'rm' program seems unable to run without file operands specified
11675493f84f4Smrgon the command line, even when the '-f' option is present.  This is contrary
11676493f84f4Smrgto the behaviour of most rm programs out there, and not conforming with
11677493f84f4Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11678493f84f4Smrg
11679493f84f4SmrgPlease tell bug-automake@gnu.org about your system, including the value
11680493f84f4Smrgof your $PATH and any error possibly output before this message.  This
11681493f84f4Smrgcan help us improve future automake versions.
11682493f84f4Smrg
11683493f84f4SmrgEND
11684493f84f4Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11685493f84f4Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11686493f84f4Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11687493f84f4Smrg    echo >&2
11688493f84f4Smrg  else
11689493f84f4Smrg    cat >&2 <<'END'
11690493f84f4SmrgAborting the configuration process, to ensure you take notice of the issue.
11691493f84f4Smrg
11692493f84f4SmrgYou can download and install GNU coreutils to get an 'rm' implementation
11693493f84f4Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11694493f84f4Smrg
11695493f84f4SmrgIf you want to complete the configuration process using your problematic
11696493f84f4Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11697493f84f4Smrgto "yes", and re-run configure.
11698493f84f4Smrg
11699493f84f4SmrgEND
11700493f84f4Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11701493f84f4Smrg  fi
11702493f84f4Smrgfi])
11703fe5e51b7Smrg
11704acd6767fSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11705643b027fSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11706643b027fSmrgdnl mangled by Autoconf and run in a shell conditional statement.
11707643b027fSmrgm4_define([_AC_COMPILER_EXEEXT],
11708643b027fSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11709643b027fSmrg
11710fe5e51b7Smrg# When config.status generates a header, we must update the stamp-h file.
11711fe5e51b7Smrg# This file resides in the same directory as the config header
11712fe5e51b7Smrg# that is generated.  The stamp files are numbered to have different names.
11713fe5e51b7Smrg
11714fe5e51b7Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11715fe5e51b7Smrg# loop where config.status creates the headers, so we can generate
11716fe5e51b7Smrg# our stamp files there.
11717fe5e51b7SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11718fe5e51b7Smrg[# Compute $1's index in $config_headers.
11719eda3803bSmrg_am_arg=$1
11720fe5e51b7Smrg_am_stamp_count=1
11721fe5e51b7Smrgfor _am_header in $config_headers :; do
11722fe5e51b7Smrg  case $_am_header in
11723eda3803bSmrg    $_am_arg | $_am_arg:* )
11724fe5e51b7Smrg      break ;;
11725fe5e51b7Smrg    * )
11726fe5e51b7Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11727fe5e51b7Smrg  esac
11728fe5e51b7Smrgdone
11729eda3803bSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11730fe5e51b7Smrg
11731493f84f4Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11732fe5e51b7Smrg#
11733fe5e51b7Smrg# This file is free software; the Free Software Foundation
11734fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11735fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11736fe5e51b7Smrg
11737fe5e51b7Smrg# AM_PROG_INSTALL_SH
11738fe5e51b7Smrg# ------------------
11739fe5e51b7Smrg# Define $install_sh.
11740fe5e51b7SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11741fe5e51b7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11742643b027fSmrgif test x"${install_sh}" != xset; then
11743643b027fSmrg  case $am_aux_dir in
11744643b027fSmrg  *\ * | *\	*)
11745643b027fSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11746643b027fSmrg  *)
11747643b027fSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11748643b027fSmrg  esac
11749643b027fSmrgfi
11750acd6767fSmrgAC_SUBST([install_sh])])
11751fe5e51b7Smrg
11752493f84f4Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
11753fe5e51b7Smrg#
11754fe5e51b7Smrg# This file is free software; the Free Software Foundation
11755fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11756fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11757fe5e51b7Smrg
11758fe5e51b7Smrg# Check whether the underlying file-system supports filenames
11759fe5e51b7Smrg# with a leading dot.  For instance MS-DOS doesn't.
11760fe5e51b7SmrgAC_DEFUN([AM_SET_LEADING_DOT],
11761fe5e51b7Smrg[rm -rf .tst 2>/dev/null
11762fe5e51b7Smrgmkdir .tst 2>/dev/null
11763fe5e51b7Smrgif test -d .tst; then
11764fe5e51b7Smrg  am__leading_dot=.
11765fe5e51b7Smrgelse
11766fe5e51b7Smrg  am__leading_dot=_
11767fe5e51b7Smrgfi
11768fe5e51b7Smrgrmdir .tst 2>/dev/null
11769fe5e51b7SmrgAC_SUBST([am__leading_dot])])
11770fe5e51b7Smrg
11771fe5e51b7Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
11772fe5e51b7Smrg# From Jim Meyering
11773fe5e51b7Smrg
11774493f84f4Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
11775fe5e51b7Smrg#
11776fe5e51b7Smrg# This file is free software; the Free Software Foundation
11777fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11778fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11779fe5e51b7Smrg
11780643b027fSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
11781643b027fSmrg# ----------------------------------
11782643b027fSmrg# Control maintainer-specific portions of Makefiles.
11783acd6767fSmrg# Default is to disable them, unless 'enable' is passed literally.
11784acd6767fSmrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
11785643b027fSmrg# can override the default with the --enable/--disable switch.
11786fe5e51b7SmrgAC_DEFUN([AM_MAINTAINER_MODE],
11787643b027fSmrg[m4_case(m4_default([$1], [disable]),
11788643b027fSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
11789643b027fSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
11790643b027fSmrg       [m4_define([am_maintainer_other], [enable])
11791643b027fSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
117920bb88ba4SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
11793643b027fSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
11794643b027fSmrg  AC_ARG_ENABLE([maintainer-mode],
11795acd6767fSmrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
11796acd6767fSmrg      am_maintainer_other[ make rules and dependencies not useful
11797acd6767fSmrg      (and sometimes confusing) to the casual installer])],
11798acd6767fSmrg    [USE_MAINTAINER_MODE=$enableval],
11799acd6767fSmrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
11800fe5e51b7Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
11801643b027fSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
11802fe5e51b7Smrg  MAINT=$MAINTAINER_MODE_TRUE
11803643b027fSmrg  AC_SUBST([MAINT])dnl
11804fe5e51b7Smrg]
11805fe5e51b7Smrg)
11806fe5e51b7Smrg
11807fe5e51b7Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11808fe5e51b7Smrg
11809493f84f4Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11810fe5e51b7Smrg#
11811fe5e51b7Smrg# This file is free software; the Free Software Foundation
11812fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11813fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11814fe5e51b7Smrg
11815fe5e51b7Smrg# AM_MAKE_INCLUDE()
11816fe5e51b7Smrg# -----------------
11817fe5e51b7Smrg# Check to see how make treats includes.
11818fe5e51b7SmrgAC_DEFUN([AM_MAKE_INCLUDE],
11819fe5e51b7Smrg[am_make=${MAKE-make}
11820fe5e51b7Smrgcat > confinc << 'END'
11821fe5e51b7Smrgam__doit:
11822643b027fSmrg	@echo this is the am__doit target
11823fe5e51b7Smrg.PHONY: am__doit
11824fe5e51b7SmrgEND
11825fe5e51b7Smrg# If we don't find an include directive, just comment out the code.
11826fe5e51b7SmrgAC_MSG_CHECKING([for style of include used by $am_make])
11827fe5e51b7Smrgam__include="#"
11828fe5e51b7Smrgam__quote=
11829fe5e51b7Smrg_am_result=none
11830fe5e51b7Smrg# First try GNU make style include.
11831fe5e51b7Smrgecho "include confinc" > confmf
11832acd6767fSmrg# Ignore all kinds of additional output from 'make'.
11833643b027fSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11834643b027fSmrg*the\ am__doit\ target*)
11835643b027fSmrg  am__include=include
11836643b027fSmrg  am__quote=
11837643b027fSmrg  _am_result=GNU
11838643b027fSmrg  ;;
11839643b027fSmrgesac
11840fe5e51b7Smrg# Now try BSD make style include.
11841fe5e51b7Smrgif test "$am__include" = "#"; then
11842fe5e51b7Smrg   echo '.include "confinc"' > confmf
11843643b027fSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11844643b027fSmrg   *the\ am__doit\ target*)
11845643b027fSmrg     am__include=.include
11846643b027fSmrg     am__quote="\""
11847643b027fSmrg     _am_result=BSD
11848643b027fSmrg     ;;
11849643b027fSmrg   esac
11850fe5e51b7Smrgfi
11851fe5e51b7SmrgAC_SUBST([am__include])
11852fe5e51b7SmrgAC_SUBST([am__quote])
11853fe5e51b7SmrgAC_MSG_RESULT([$_am_result])
11854fe5e51b7Smrgrm -f confinc confmf
11855fe5e51b7Smrg])
11856fe5e51b7Smrg
11857fe5e51b7Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11858fe5e51b7Smrg
11859493f84f4Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
11860fe5e51b7Smrg#
11861fe5e51b7Smrg# This file is free software; the Free Software Foundation
11862fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11863fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11864fe5e51b7Smrg
11865fe5e51b7Smrg# AM_MISSING_PROG(NAME, PROGRAM)
11866fe5e51b7Smrg# ------------------------------
11867fe5e51b7SmrgAC_DEFUN([AM_MISSING_PROG],
11868fe5e51b7Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11869fe5e51b7Smrg$1=${$1-"${am_missing_run}$2"}
11870fe5e51b7SmrgAC_SUBST($1)])
11871fe5e51b7Smrg
11872fe5e51b7Smrg# AM_MISSING_HAS_RUN
11873fe5e51b7Smrg# ------------------
11874493f84f4Smrg# Define MISSING if not defined so far and test if it is modern enough.
11875493f84f4Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
11876fe5e51b7SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11877fe5e51b7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11878fe5e51b7SmrgAC_REQUIRE_AUX_FILE([missing])dnl
11879643b027fSmrgif test x"${MISSING+set}" != xset; then
11880643b027fSmrg  case $am_aux_dir in
11881643b027fSmrg  *\ * | *\	*)
11882643b027fSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11883643b027fSmrg  *)
11884643b027fSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11885643b027fSmrg  esac
11886643b027fSmrgfi
11887fe5e51b7Smrg# Use eval to expand $SHELL
11888493f84f4Smrgif eval "$MISSING --is-lightweight"; then
11889493f84f4Smrg  am_missing_run="$MISSING "
11890fe5e51b7Smrgelse
11891fe5e51b7Smrg  am_missing_run=
11892acd6767fSmrg  AC_MSG_WARN(['missing' script is too old or missing])
11893fe5e51b7Smrgfi
11894fe5e51b7Smrg])
11895fe5e51b7Smrg
11896fe5e51b7Smrg# Helper functions for option handling.                     -*- Autoconf -*-
11897fe5e51b7Smrg
11898493f84f4Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11899fe5e51b7Smrg#
11900fe5e51b7Smrg# This file is free software; the Free Software Foundation
11901fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11902fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11903fe5e51b7Smrg
11904fe5e51b7Smrg# _AM_MANGLE_OPTION(NAME)
11905fe5e51b7Smrg# -----------------------
11906fe5e51b7SmrgAC_DEFUN([_AM_MANGLE_OPTION],
11907fe5e51b7Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11908fe5e51b7Smrg
11909fe5e51b7Smrg# _AM_SET_OPTION(NAME)
119100bb88ba4Smrg# --------------------
11911fe5e51b7Smrg# Set option NAME.  Presently that only means defining a flag for this option.
11912fe5e51b7SmrgAC_DEFUN([_AM_SET_OPTION],
11913acd6767fSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
11914fe5e51b7Smrg
11915fe5e51b7Smrg# _AM_SET_OPTIONS(OPTIONS)
119160bb88ba4Smrg# ------------------------
11917fe5e51b7Smrg# OPTIONS is a space-separated list of Automake options.
11918fe5e51b7SmrgAC_DEFUN([_AM_SET_OPTIONS],
11919eda3803bSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11920fe5e51b7Smrg
11921fe5e51b7Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
11922fe5e51b7Smrg# -------------------------------------------
11923fe5e51b7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11924fe5e51b7SmrgAC_DEFUN([_AM_IF_OPTION],
11925fe5e51b7Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11926fe5e51b7Smrg
11927493f84f4Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
11928493f84f4Smrg#
11929493f84f4Smrg# This file is free software; the Free Software Foundation
11930493f84f4Smrg# gives unlimited permission to copy and/or distribute it,
11931493f84f4Smrg# with or without modifications, as long as this notice is preserved.
11932fe5e51b7Smrg
11933493f84f4Smrg# _AM_PROG_CC_C_O
11934493f84f4Smrg# ---------------
11935493f84f4Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
11936493f84f4Smrg# to automatically call this.
11937493f84f4SmrgAC_DEFUN([_AM_PROG_CC_C_O],
11938493f84f4Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11939493f84f4SmrgAC_REQUIRE_AUX_FILE([compile])dnl
11940493f84f4SmrgAC_LANG_PUSH([C])dnl
11941493f84f4SmrgAC_CACHE_CHECK(
11942493f84f4Smrg  [whether $CC understands -c and -o together],
11943493f84f4Smrg  [am_cv_prog_cc_c_o],
11944493f84f4Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
11945493f84f4Smrg  # Make sure it works both with $CC and with simple cc.
11946493f84f4Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
11947493f84f4Smrg  # compilers refuse to overwrite an existing .o file with -o,
11948493f84f4Smrg  # though they will create one.
11949493f84f4Smrg  am_cv_prog_cc_c_o=yes
11950493f84f4Smrg  for am_i in 1 2; do
11951493f84f4Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
11952493f84f4Smrg         && test -f conftest2.$ac_objext; then
11953493f84f4Smrg      : OK
11954493f84f4Smrg    else
11955493f84f4Smrg      am_cv_prog_cc_c_o=no
11956493f84f4Smrg      break
11957493f84f4Smrg    fi
11958493f84f4Smrg  done
11959493f84f4Smrg  rm -f core conftest*
11960493f84f4Smrg  unset am_i])
11961493f84f4Smrgif test "$am_cv_prog_cc_c_o" != yes; then
11962493f84f4Smrg   # Losing compiler, so override with the script.
11963493f84f4Smrg   # FIXME: It is wrong to rewrite CC.
11964493f84f4Smrg   # But if we don't then we get into trouble of one sort or another.
11965493f84f4Smrg   # A longer-term fix would be to have automake use am__CC in this case,
11966493f84f4Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
11967493f84f4Smrg   CC="$am_aux_dir/compile $CC"
11968493f84f4Smrgfi
11969493f84f4SmrgAC_LANG_POP([C])])
11970493f84f4Smrg
11971493f84f4Smrg# For backward compatibility.
11972493f84f4SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
11973493f84f4Smrg
11974493f84f4Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
11975fe5e51b7Smrg#
11976fe5e51b7Smrg# This file is free software; the Free Software Foundation
11977fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
11978fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
11979fe5e51b7Smrg
11980493f84f4Smrg# AM_RUN_LOG(COMMAND)
11981493f84f4Smrg# -------------------
11982493f84f4Smrg# Run COMMAND, save the exit status in ac_status, and log it.
11983493f84f4Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
11984493f84f4SmrgAC_DEFUN([AM_RUN_LOG],
11985493f84f4Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
11986493f84f4Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
11987493f84f4Smrg   ac_status=$?
11988493f84f4Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
11989493f84f4Smrg   (exit $ac_status); }])
11990493f84f4Smrg
11991493f84f4Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
11992493f84f4Smrg
11993493f84f4Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
11994493f84f4Smrg#
11995493f84f4Smrg# This file is free software; the Free Software Foundation
11996493f84f4Smrg# gives unlimited permission to copy and/or distribute it,
11997493f84f4Smrg# with or without modifications, as long as this notice is preserved.
11998fe5e51b7Smrg
11999fe5e51b7Smrg# AM_SANITY_CHECK
12000fe5e51b7Smrg# ---------------
12001fe5e51b7SmrgAC_DEFUN([AM_SANITY_CHECK],
12002fe5e51b7Smrg[AC_MSG_CHECKING([whether build environment is sane])
12003643b027fSmrg# Reject unsafe characters in $srcdir or the absolute working directory
12004643b027fSmrg# name.  Accept space and tab only in the latter.
12005643b027fSmrgam_lf='
12006643b027fSmrg'
12007643b027fSmrgcase `pwd` in
12008643b027fSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12009643b027fSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12010643b027fSmrgesac
12011643b027fSmrgcase $srcdir in
12012643b027fSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12013acd6767fSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12014643b027fSmrgesac
12015643b027fSmrg
12016acd6767fSmrg# Do 'set' in a subshell so we don't clobber the current shell's
12017fe5e51b7Smrg# arguments.  Must try -L first in case configure is actually a
12018fe5e51b7Smrg# symlink; some systems play weird games with the mod time of symlinks
12019fe5e51b7Smrg# (eg FreeBSD returns the mod time of the symlink's containing
12020fe5e51b7Smrg# directory).
12021fe5e51b7Smrgif (
12022acd6767fSmrg   am_has_slept=no
12023acd6767fSmrg   for am_try in 1 2; do
12024acd6767fSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12025acd6767fSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12026acd6767fSmrg     if test "$[*]" = "X"; then
12027acd6767fSmrg	# -L didn't work.
12028acd6767fSmrg	set X `ls -t "$srcdir/configure" conftest.file`
12029acd6767fSmrg     fi
12030acd6767fSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12031acd6767fSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12032acd6767fSmrg
12033acd6767fSmrg	# If neither matched, then we have a broken ls.  This can happen
12034acd6767fSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12035acd6767fSmrg	# broken ls alias from the environment.  This has actually
12036acd6767fSmrg	# happened.  Such a system could not be considered "sane".
12037acd6767fSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12038acd6767fSmrg  alias in your environment])
12039acd6767fSmrg     fi
12040acd6767fSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12041acd6767fSmrg       break
12042acd6767fSmrg     fi
12043acd6767fSmrg     # Just in case.
12044acd6767fSmrg     sleep 1
12045acd6767fSmrg     am_has_slept=yes
12046acd6767fSmrg   done
12047fe5e51b7Smrg   test "$[2]" = conftest.file
12048fe5e51b7Smrg   )
12049fe5e51b7Smrgthen
12050fe5e51b7Smrg   # Ok.
12051fe5e51b7Smrg   :
12052fe5e51b7Smrgelse
12053fe5e51b7Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
12054fe5e51b7SmrgCheck your system clock])
12055fe5e51b7Smrgfi
12056acd6767fSmrgAC_MSG_RESULT([yes])
12057acd6767fSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12058acd6767fSmrg# generated files are strictly newer.
12059acd6767fSmrgam_sleep_pid=
12060acd6767fSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12061acd6767fSmrg  ( sleep 1 ) &
12062acd6767fSmrg  am_sleep_pid=$!
12063acd6767fSmrgfi
12064acd6767fSmrgAC_CONFIG_COMMANDS_PRE(
12065acd6767fSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12066acd6767fSmrg   if test -n "$am_sleep_pid"; then
12067acd6767fSmrg     # Hide warnings about reused PIDs.
12068acd6767fSmrg     wait $am_sleep_pid 2>/dev/null
12069acd6767fSmrg   fi
12070acd6767fSmrg   AC_MSG_RESULT([done])])
12071acd6767fSmrgrm -f conftest.file
12072acd6767fSmrg])
12073fe5e51b7Smrg
12074493f84f4Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
12075a31a186aSmrg#
12076a31a186aSmrg# This file is free software; the Free Software Foundation
12077a31a186aSmrg# gives unlimited permission to copy and/or distribute it,
12078a31a186aSmrg# with or without modifications, as long as this notice is preserved.
12079a31a186aSmrg
12080a31a186aSmrg# AM_SILENT_RULES([DEFAULT])
12081a31a186aSmrg# --------------------------
12082a31a186aSmrg# Enable less verbose build rules; with the default set to DEFAULT
12083acd6767fSmrg# ("yes" being less verbose, "no" or empty being verbose).
12084a31a186aSmrgAC_DEFUN([AM_SILENT_RULES],
12085acd6767fSmrg[AC_ARG_ENABLE([silent-rules], [dnl
12086acd6767fSmrgAS_HELP_STRING(
12087acd6767fSmrg  [--enable-silent-rules],
12088acd6767fSmrg  [less verbose build output (undo: "make V=1")])
12089acd6767fSmrgAS_HELP_STRING(
12090acd6767fSmrg  [--disable-silent-rules],
12091acd6767fSmrg  [verbose build output (undo: "make V=0")])dnl
12092acd6767fSmrg])
12093acd6767fSmrgcase $enable_silent_rules in @%:@ (((
12094acd6767fSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
12095acd6767fSmrg   no) AM_DEFAULT_VERBOSITY=1;;
12096acd6767fSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12097a31a186aSmrgesac
120980bb88ba4Smrgdnl
12099acd6767fSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
121000bb88ba4Smrgdnl do not support nested variable expansions.
121010bb88ba4Smrgdnl See automake bug#9928 and bug#10237.
121020bb88ba4Smrgam_make=${MAKE-make}
121030bb88ba4SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
121040bb88ba4Smrg   [am_cv_make_support_nested_variables],
121050bb88ba4Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
121060bb88ba4SmrgBAR0=false
121070bb88ba4SmrgBAR1=true
121080bb88ba4SmrgV=1
121090bb88ba4Smrgam__doit:
121100bb88ba4Smrg	@$(TRUE)
121110bb88ba4Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
121120bb88ba4Smrg  am_cv_make_support_nested_variables=yes
121130bb88ba4Smrgelse
121140bb88ba4Smrg  am_cv_make_support_nested_variables=no
121150bb88ba4Smrgfi])
121160bb88ba4Smrgif test $am_cv_make_support_nested_variables = yes; then
12117acd6767fSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
121180bb88ba4Smrg  AM_V='$(V)'
121190bb88ba4Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
121200bb88ba4Smrgelse
121210bb88ba4Smrg  AM_V=$AM_DEFAULT_VERBOSITY
121220bb88ba4Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
121230bb88ba4Smrgfi
121240bb88ba4SmrgAC_SUBST([AM_V])dnl
121250bb88ba4SmrgAM_SUBST_NOTMAKE([AM_V])dnl
121260bb88ba4SmrgAC_SUBST([AM_DEFAULT_V])dnl
121270bb88ba4SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12128a31a186aSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12129a31a186aSmrgAM_BACKSLASH='\'
12130a31a186aSmrgAC_SUBST([AM_BACKSLASH])dnl
12131a31a186aSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12132a31a186aSmrg])
12133a31a186aSmrg
12134493f84f4Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
12135fe5e51b7Smrg#
12136fe5e51b7Smrg# This file is free software; the Free Software Foundation
12137fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
12138fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
12139fe5e51b7Smrg
12140fe5e51b7Smrg# AM_PROG_INSTALL_STRIP
12141fe5e51b7Smrg# ---------------------
12142acd6767fSmrg# One issue with vendor 'install' (even GNU) is that you can't
12143fe5e51b7Smrg# specify the program used to strip binaries.  This is especially
12144fe5e51b7Smrg# annoying in cross-compiling environments, where the build's strip
12145fe5e51b7Smrg# is unlikely to handle the host's binaries.
12146fe5e51b7Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12147acd6767fSmrg# always use install-sh in "make install-strip", and initialize
12148fe5e51b7Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
12149fe5e51b7SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12150fe5e51b7Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12151acd6767fSmrg# Installed binaries are usually stripped using 'strip' when the user
12152acd6767fSmrg# run "make install-strip".  However 'strip' might not be the right
12153fe5e51b7Smrg# tool to use in cross-compilation environments, therefore Automake
12154acd6767fSmrg# will honor the 'STRIP' environment variable to overrule this program.
12155acd6767fSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12156fe5e51b7Smrgif test "$cross_compiling" != no; then
12157fe5e51b7Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
12158fe5e51b7Smrgfi
12159fe5e51b7SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12160fe5e51b7SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
12161fe5e51b7Smrg
12162493f84f4Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
12163fe5e51b7Smrg#
12164fe5e51b7Smrg# This file is free software; the Free Software Foundation
12165fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
12166fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
12167fe5e51b7Smrg
12168fe5e51b7Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
12169fe5e51b7Smrg# ---------------------------
12170eda3803bSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12171fe5e51b7Smrg# This macro is traced by Automake.
12172fe5e51b7SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
12173fe5e51b7Smrg
12174643b027fSmrg# AM_SUBST_NOTMAKE(VARIABLE)
121750bb88ba4Smrg# --------------------------
12176643b027fSmrg# Public sister of _AM_SUBST_NOTMAKE.
12177643b027fSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
12178643b027fSmrg
12179fe5e51b7Smrg# Check how to create a tarball.                            -*- Autoconf -*-
12180fe5e51b7Smrg
12181493f84f4Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
12182fe5e51b7Smrg#
12183fe5e51b7Smrg# This file is free software; the Free Software Foundation
12184fe5e51b7Smrg# gives unlimited permission to copy and/or distribute it,
12185fe5e51b7Smrg# with or without modifications, as long as this notice is preserved.
12186fe5e51b7Smrg
12187fe5e51b7Smrg# _AM_PROG_TAR(FORMAT)
12188fe5e51b7Smrg# --------------------
12189fe5e51b7Smrg# Check how to create a tarball in format FORMAT.
12190acd6767fSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12191fe5e51b7Smrg#
12192fe5e51b7Smrg# Substitute a variable $(am__tar) that is a command
12193fe5e51b7Smrg# writing to stdout a FORMAT-tarball containing the directory
12194fe5e51b7Smrg# $tardir.
12195fe5e51b7Smrg#     tardir=directory && $(am__tar) > result.tar
12196fe5e51b7Smrg#
12197fe5e51b7Smrg# Substitute a variable $(am__untar) that extract such
12198fe5e51b7Smrg# a tarball read from stdin.
12199fe5e51b7Smrg#     $(am__untar) < result.tar
12200493f84f4Smrg#
12201fe5e51b7SmrgAC_DEFUN([_AM_PROG_TAR],
122020bb88ba4Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
122030bb88ba4Smrg# in the wild :-(  We should find a proper way to deprecate it ...
122040bb88ba4SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
12205493f84f4Smrg
12206493f84f4Smrg# We'll loop over all known methods to create a tar archive until one works.
12207fe5e51b7Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12208fe5e51b7Smrg
12209493f84f4Smrgm4_if([$1], [v7],
12210493f84f4Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12211493f84f4Smrg
12212493f84f4Smrg  [m4_case([$1],
12213493f84f4Smrg    [ustar],
12214493f84f4Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12215493f84f4Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12216493f84f4Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12217493f84f4Smrg      # and bug#13588).
12218493f84f4Smrg      am_max_uid=2097151 # 2^21 - 1
12219493f84f4Smrg      am_max_gid=$am_max_uid
12220493f84f4Smrg      # The $UID and $GID variables are not portable, so we need to resort
12221493f84f4Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12222493f84f4Smrg      # below are definitely unexpected, so allow the users to see them
12223493f84f4Smrg      # (that is, avoid stderr redirection).
12224493f84f4Smrg      am_uid=`id -u || echo unknown`
12225493f84f4Smrg      am_gid=`id -g || echo unknown`
12226493f84f4Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12227493f84f4Smrg      if test $am_uid -le $am_max_uid; then
12228493f84f4Smrg         AC_MSG_RESULT([yes])
12229493f84f4Smrg      else
12230493f84f4Smrg         AC_MSG_RESULT([no])
12231493f84f4Smrg         _am_tools=none
12232493f84f4Smrg      fi
12233493f84f4Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12234493f84f4Smrg      if test $am_gid -le $am_max_gid; then
12235493f84f4Smrg         AC_MSG_RESULT([yes])
12236493f84f4Smrg      else
12237493f84f4Smrg        AC_MSG_RESULT([no])
12238493f84f4Smrg        _am_tools=none
12239493f84f4Smrg      fi],
12240fe5e51b7Smrg
12241493f84f4Smrg  [pax],
12242493f84f4Smrg    [],
12243493f84f4Smrg
12244493f84f4Smrg  [m4_fatal([Unknown tar format])])
12245493f84f4Smrg
12246493f84f4Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12247493f84f4Smrg
12248493f84f4Smrg  # Go ahead even if we have the value already cached.  We do so because we
12249493f84f4Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12250493f84f4Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12251493f84f4Smrg
12252493f84f4Smrg  for _am_tool in $_am_tools; do
12253493f84f4Smrg    case $_am_tool in
12254493f84f4Smrg    gnutar)
12255493f84f4Smrg      for _am_tar in tar gnutar gtar; do
12256493f84f4Smrg        AM_RUN_LOG([$_am_tar --version]) && break
12257493f84f4Smrg      done
12258493f84f4Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12259493f84f4Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12260493f84f4Smrg      am__untar="$_am_tar -xf -"
12261493f84f4Smrg      ;;
12262493f84f4Smrg    plaintar)
12263493f84f4Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12264493f84f4Smrg      # ustar tarball either.
12265493f84f4Smrg      (tar --version) >/dev/null 2>&1 && continue
12266493f84f4Smrg      am__tar='tar chf - "$$tardir"'
12267493f84f4Smrg      am__tar_='tar chf - "$tardir"'
12268493f84f4Smrg      am__untar='tar xf -'
12269493f84f4Smrg      ;;
12270493f84f4Smrg    pax)
12271493f84f4Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
12272493f84f4Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
12273493f84f4Smrg      am__untar='pax -r'
12274493f84f4Smrg      ;;
12275493f84f4Smrg    cpio)
12276493f84f4Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12277493f84f4Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12278493f84f4Smrg      am__untar='cpio -i -H $1 -d'
12279493f84f4Smrg      ;;
12280493f84f4Smrg    none)
12281493f84f4Smrg      am__tar=false
12282493f84f4Smrg      am__tar_=false
12283493f84f4Smrg      am__untar=false
12284493f84f4Smrg      ;;
12285493f84f4Smrg    esac
12286493f84f4Smrg
12287493f84f4Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
12288493f84f4Smrg    # and am__untar set.
12289493f84f4Smrg    test -n "${am_cv_prog_tar_$1}" && break
12290493f84f4Smrg
12291493f84f4Smrg    # tar/untar a dummy directory, and stop if the command works.
12292493f84f4Smrg    rm -rf conftest.dir
12293493f84f4Smrg    mkdir conftest.dir
12294493f84f4Smrg    echo GrepMe > conftest.dir/file
12295493f84f4Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12296493f84f4Smrg    rm -rf conftest.dir
12297493f84f4Smrg    if test -s conftest.tar; then
12298493f84f4Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
12299493f84f4Smrg      AM_RUN_LOG([cat conftest.dir/file])
12300493f84f4Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12301493f84f4Smrg    fi
12302493f84f4Smrg  done
12303fe5e51b7Smrg  rm -rf conftest.dir
12304fe5e51b7Smrg
12305493f84f4Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12306493f84f4Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12307493f84f4Smrg
12308fe5e51b7SmrgAC_SUBST([am__tar])
12309fe5e51b7SmrgAC_SUBST([am__untar])
12310fe5e51b7Smrg]) # _AM_PROG_TAR
12311fe5e51b7Smrg
12312