aclocal.m4 revision 300346ae
1300346aeSmrg# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
20a6b08f8Smrg
3300346aeSmrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
4126a8a12Smrg
5126a8a12Smrg# This file is free software; the Free Software Foundation
6126a8a12Smrg# gives unlimited permission to copy and/or distribute it,
7126a8a12Smrg# with or without modifications, as long as this notice is preserved.
8126a8a12Smrg
9126a8a12Smrg# This program is distributed in the hope that it will be useful,
10126a8a12Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11126a8a12Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12126a8a12Smrg# PARTICULAR PURPOSE.
13126a8a12Smrg
140a6b08f8Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15d656433aSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16d656433aSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17300346aeSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18300346aeSmrg[m4_warning([this file was generated for autoconf 2.69.
19d656433aSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20d656433aSmrgIf you have problems, you may need to regenerate the build system entirely.
210a6b08f8SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22126a8a12Smrg
23300346aeSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24d656433aSmrg#
25300346aeSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
26300346aeSmrg#   Written by Gordon Matzigkeit, 1996
27300346aeSmrg#
28300346aeSmrg# This file is free software; the Free Software Foundation gives
29300346aeSmrg# unlimited permission to copy and/or distribute it, with or without
30300346aeSmrg# modifications, as long as this notice is preserved.
31555991fdSmrg
32300346aeSmrgm4_define([_LT_COPYING], [dnl
33300346aeSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
34300346aeSmrg# This is free software; see the source for copying conditions.  There is NO
35300346aeSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
36555991fdSmrg
37300346aeSmrg# GNU Libtool is free software; you can redistribute it and/or modify
38300346aeSmrg# it under the terms of the GNU General Public License as published by
39300346aeSmrg# the Free Software Foundation; either version 2 of of the License, or
40300346aeSmrg# (at your option) any later version.
41300346aeSmrg#
42300346aeSmrg# As a special exception to the GNU General Public License, if you
43300346aeSmrg# distribute this file as part of a program or library that is built
44300346aeSmrg# using GNU Libtool, you may include this file under the  same
45300346aeSmrg# distribution terms that you use for the rest of that program.
46300346aeSmrg#
47300346aeSmrg# GNU Libtool is distributed in the hope that it will be useful, but
48300346aeSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49300346aeSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50300346aeSmrg# GNU General Public License for more details.
51300346aeSmrg#
52300346aeSmrg# You should have received a copy of the GNU General Public License
53300346aeSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54300346aeSmrg])
55555991fdSmrg
56300346aeSmrg# serial 58 LT_INIT
57555991fdSmrg
58555991fdSmrg
59300346aeSmrg# LT_PREREQ(VERSION)
60300346aeSmrg# ------------------
61300346aeSmrg# Complain and exit if this libtool version is less that VERSION.
62300346aeSmrgm4_defun([LT_PREREQ],
63300346aeSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64300346aeSmrg       [m4_default([$3],
65300346aeSmrg		   [m4_fatal([Libtool version $1 or higher is required],
66300346aeSmrg		             63)])],
67300346aeSmrg       [$2])])
68d656433aSmrg
69126a8a12Smrg
70300346aeSmrg# _LT_CHECK_BUILDDIR
71300346aeSmrg# ------------------
72300346aeSmrg# Complain if the absolute build directory name contains unusual characters
73300346aeSmrgm4_defun([_LT_CHECK_BUILDDIR],
74300346aeSmrg[case `pwd` in
75300346aeSmrg  *\ * | *\	*)
76300346aeSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77300346aeSmrgesac
78d656433aSmrg])
79d656433aSmrg
80d656433aSmrg
81300346aeSmrg# LT_INIT([OPTIONS])
82300346aeSmrg# ------------------
83300346aeSmrgAC_DEFUN([LT_INIT],
84300346aeSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85300346aeSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86300346aeSmrgAC_BEFORE([$0], [LT_LANG])dnl
87300346aeSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88300346aeSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89300346aeSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
90126a8a12Smrg
91300346aeSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92300346aeSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93300346aeSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94300346aeSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95300346aeSmrgdnl unless we require an AC_DEFUNed macro:
96300346aeSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97300346aeSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98300346aeSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99300346aeSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100300346aeSmrgm4_require([_LT_PROG_LTMAIN])dnl
101126a8a12Smrg
102300346aeSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103d656433aSmrg
104300346aeSmrgdnl Parse OPTIONS
105300346aeSmrg_LT_SET_OPTIONS([$0], [$1])
106d656433aSmrg
107300346aeSmrg# This can be used to rebuild libtool when needed
108300346aeSmrgLIBTOOL_DEPS=$ltmain
109d656433aSmrg
110300346aeSmrg# Always use our own libtool.
111300346aeSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112300346aeSmrgAC_SUBST(LIBTOOL)dnl
113d656433aSmrg
114300346aeSmrg_LT_SETUP
115d656433aSmrg
116300346aeSmrg# Only expand once:
117300346aeSmrgm4_define([LT_INIT])
118300346aeSmrg])# LT_INIT
119d656433aSmrg
120300346aeSmrg# Old names:
121300346aeSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122300346aeSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123300346aeSmrgdnl aclocal-1.4 backwards compatibility:
124300346aeSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125300346aeSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126126a8a12Smrg
127126a8a12Smrg
128300346aeSmrg# _LT_PREPARE_CC_BASENAME
129300346aeSmrg# -----------------------
130300346aeSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
131300346aeSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
132300346aeSmrgfunc_cc_basename ()
133300346aeSmrg{
134300346aeSmrg    for cc_temp in @S|@*""; do
135300346aeSmrg      case $cc_temp in
136300346aeSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137300346aeSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138300346aeSmrg        \-*) ;;
139300346aeSmrg        *) break;;
140300346aeSmrg      esac
141555991fdSmrg    done
142300346aeSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
143300346aeSmrg}
144300346aeSmrg])# _LT_PREPARE_CC_BASENAME
145126a8a12Smrg
146126a8a12Smrg
147300346aeSmrg# _LT_CC_BASENAME(CC)
148300346aeSmrg# -------------------
149300346aeSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
150300346aeSmrg# but that macro is also expanded into generated libtool script, which
151300346aeSmrg# arranges for $SED and $ECHO to be set by different means.
152300346aeSmrgm4_defun([_LT_CC_BASENAME],
153300346aeSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
154300346aeSmrgAC_REQUIRE([_LT_DECL_SED])dnl
155300346aeSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156300346aeSmrgfunc_cc_basename $1
157300346aeSmrgcc_basename=$func_cc_basename_result
158555991fdSmrg])
159126a8a12Smrg
160126a8a12Smrg
161300346aeSmrg# _LT_FILEUTILS_DEFAULTS
162300346aeSmrg# ----------------------
163300346aeSmrg# It is okay to use these file commands and assume they have been set
164300346aeSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
165300346aeSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
166300346aeSmrg[: ${CP="cp -f"}
167300346aeSmrg: ${MV="mv -f"}
168300346aeSmrg: ${RM="rm -f"}
169300346aeSmrg])# _LT_FILEUTILS_DEFAULTS
170126a8a12Smrg
171126a8a12Smrg
172300346aeSmrg# _LT_SETUP
173300346aeSmrg# ---------
174300346aeSmrgm4_defun([_LT_SETUP],
175300346aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
176300346aeSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177300346aeSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178300346aeSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179300346aeSmrg
180300346aeSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181300346aeSmrgdnl
182300346aeSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
183300346aeSmrg_LT_DECL([], [host], [0])dnl
184300346aeSmrg_LT_DECL([], [host_os], [0])dnl
185300346aeSmrgdnl
186300346aeSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
187300346aeSmrg_LT_DECL([], [build], [0])dnl
188300346aeSmrg_LT_DECL([], [build_os], [0])dnl
189300346aeSmrgdnl
190300346aeSmrgAC_REQUIRE([AC_PROG_CC])dnl
191300346aeSmrgAC_REQUIRE([LT_PATH_LD])dnl
192300346aeSmrgAC_REQUIRE([LT_PATH_NM])dnl
193300346aeSmrgdnl
194300346aeSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
195300346aeSmrgtest -z "$LN_S" && LN_S="ln -s"
196300346aeSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
197300346aeSmrgdnl
198300346aeSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
199300346aeSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
200300346aeSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
201300346aeSmrgdnl
202300346aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
203300346aeSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204300346aeSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
205300346aeSmrgm4_require([_LT_CMD_RELOAD])dnl
206300346aeSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207300346aeSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
208300346aeSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
209300346aeSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210300346aeSmrgm4_require([_LT_WITH_SYSROOT])dnl
211300346aeSmrgm4_require([_LT_CMD_TRUNCATE])dnl
212300346aeSmrg
213300346aeSmrg_LT_CONFIG_LIBTOOL_INIT([
214300346aeSmrg# See if we are running on zsh, and set the options that allow our
215300346aeSmrg# commands through without removal of \ escapes INIT.
216300346aeSmrgif test -n "\${ZSH_VERSION+set}"; then
217300346aeSmrg   setopt NO_GLOB_SUBST
218555991fdSmrgfi
219555991fdSmrg])
220300346aeSmrgif test -n "${ZSH_VERSION+set}"; then
221300346aeSmrg   setopt NO_GLOB_SUBST
222300346aeSmrgfi
223126a8a12Smrg
224300346aeSmrg_LT_CHECK_OBJDIR
225126a8a12Smrg
226300346aeSmrgm4_require([_LT_TAG_COMPILER])dnl
227126a8a12Smrg
228300346aeSmrgcase $host_os in
229300346aeSmrgaix3*)
230300346aeSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
231300346aeSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
232300346aeSmrg  # vanish in a puff of smoke.
233300346aeSmrg  if test set != "${COLLECT_NAMES+set}"; then
234300346aeSmrg    COLLECT_NAMES=
235300346aeSmrg    export COLLECT_NAMES
236300346aeSmrg  fi
237300346aeSmrg  ;;
238300346aeSmrgesac
239d656433aSmrg
240300346aeSmrg# Global variables:
241300346aeSmrgofile=libtool
242300346aeSmrgcan_build_shared=yes
243d656433aSmrg
244300346aeSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
245300346aeSmrg# which needs '.lib').
246300346aeSmrglibext=a
247126a8a12Smrg
248300346aeSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
249d656433aSmrg
250300346aeSmrgold_CC=$CC
251300346aeSmrgold_CFLAGS=$CFLAGS
252d656433aSmrg
253300346aeSmrg# Set sane defaults for various variables
254300346aeSmrgtest -z "$CC" && CC=cc
255300346aeSmrgtest -z "$LTCC" && LTCC=$CC
256300346aeSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
257300346aeSmrgtest -z "$LD" && LD=ld
258300346aeSmrgtest -z "$ac_objext" && ac_objext=o
259126a8a12Smrg
260300346aeSmrg_LT_CC_BASENAME([$compiler])
2610a6b08f8Smrg
262300346aeSmrg# Only perform the check for file, if the check method requires it
263300346aeSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
264300346aeSmrgcase $deplibs_check_method in
265300346aeSmrgfile_magic*)
266300346aeSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
267300346aeSmrg    _LT_PATH_MAGIC
268555991fdSmrg  fi
269300346aeSmrg  ;;
270300346aeSmrgesac
271126a8a12Smrg
272300346aeSmrg# Use C for the default configuration in the libtool script
273300346aeSmrgLT_SUPPORTED_TAG([CC])
274300346aeSmrg_LT_LANG_C_CONFIG
275300346aeSmrg_LT_LANG_DEFAULT_CONFIG
276300346aeSmrg_LT_CONFIG_COMMANDS
277300346aeSmrg])# _LT_SETUP
278126a8a12Smrg
279126a8a12Smrg
280300346aeSmrg# _LT_PREPARE_SED_QUOTE_VARS
281300346aeSmrg# --------------------------
282300346aeSmrg# Define a few sed substitution that help us do robust quoting.
283300346aeSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284300346aeSmrg[# Backslashify metacharacters that are still active within
285300346aeSmrg# double-quoted strings.
286300346aeSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287126a8a12Smrg
288300346aeSmrg# Same as above, but do not quote variable references.
289300346aeSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2900a6b08f8Smrg
291300346aeSmrg# Sed substitution to delay expansion of an escaped shell variable in a
292300346aeSmrg# double_quote_subst'ed string.
293300346aeSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2940a6b08f8Smrg
295300346aeSmrg# Sed substitution to delay expansion of an escaped single quote.
296300346aeSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2970a6b08f8Smrg
298300346aeSmrg# Sed substitution to avoid accidental globbing in evaled expressions
299300346aeSmrgno_glob_subst='s/\*/\\\*/g'
300300346aeSmrg])
3010a6b08f8Smrg
302300346aeSmrg# _LT_PROG_LTMAIN
303300346aeSmrg# ---------------
304300346aeSmrg# Note that this code is called both from 'configure', and 'config.status'
305300346aeSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
306300346aeSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
307300346aeSmrg# so we pass a copy along to make sure it has a sensible value anyway.
308300346aeSmrgm4_defun([_LT_PROG_LTMAIN],
309300346aeSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
310300346aeSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
311300346aeSmrgltmain=$ac_aux_dir/ltmain.sh
312300346aeSmrg])# _LT_PROG_LTMAIN
3130a6b08f8Smrg
3140a6b08f8Smrg
3150a6b08f8Smrg
316300346aeSmrg# So that we can recreate a full libtool script including additional
317300346aeSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
318300346aeSmrg# in macros and then make a single call at the end using the 'libtool'
319300346aeSmrg# label.
320126a8a12Smrg
321126a8a12Smrg
322300346aeSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
323300346aeSmrg# ----------------------------------------
324300346aeSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325300346aeSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
326300346aeSmrg[m4_ifval([$1],
327300346aeSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
328300346aeSmrg                     [$1
329300346aeSmrg])])])
330126a8a12Smrg
331300346aeSmrg# Initialize.
332300346aeSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333126a8a12Smrg
334126a8a12Smrg
335300346aeSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
336300346aeSmrg# ------------------------------
337300346aeSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
338300346aeSmrgm4_define([_LT_CONFIG_LIBTOOL],
339300346aeSmrg[m4_ifval([$1],
340300346aeSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
341300346aeSmrg                     [$1
342300346aeSmrg])])])
343126a8a12Smrg
344300346aeSmrg# Initialize.
345300346aeSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
346126a8a12Smrg
347555991fdSmrg
348300346aeSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
349300346aeSmrg# -----------------------------------------------------
350300346aeSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
351300346aeSmrg[_LT_CONFIG_LIBTOOL([$1])
352300346aeSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
353555991fdSmrg])
354d656433aSmrg
355d656433aSmrg
356300346aeSmrg# _LT_FORMAT_COMMENT([COMMENT])
357300346aeSmrg# -----------------------------
358300346aeSmrg# Add leading comment marks to the start of each line, and a trailing
359300346aeSmrg# full-stop to the whole comment if one is not present already.
360300346aeSmrgm4_define([_LT_FORMAT_COMMENT],
361300346aeSmrg[m4_ifval([$1], [
362300346aeSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
363300346aeSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
364300346aeSmrg)])
365d656433aSmrg
366d656433aSmrg
367300346aeSmrg
368300346aeSmrg
369300346aeSmrg
370300346aeSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
371300346aeSmrg# -------------------------------------------------------------------
372300346aeSmrg# CONFIGNAME is the name given to the value in the libtool script.
373300346aeSmrg# VARNAME is the (base) name used in the configure script.
374300346aeSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
375300346aeSmrg# VARNAME.  Any other value will be used directly.
376300346aeSmrgm4_define([_LT_DECL],
377300346aeSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
378300346aeSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
379300346aeSmrg	[m4_ifval([$1], [$1], [$2])])
380300346aeSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
381300346aeSmrg    m4_ifval([$4],
382300346aeSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
383300346aeSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
384300346aeSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
385555991fdSmrg])
386d656433aSmrg
387126a8a12Smrg
388300346aeSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
389300346aeSmrg# --------------------------------------------------------
390300346aeSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
391d656433aSmrg
392126a8a12Smrg
393300346aeSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
394300346aeSmrg# ------------------------------------------------
395300346aeSmrgm4_define([lt_decl_tag_varnames],
396300346aeSmrg[_lt_decl_filter([tagged?], [yes], $@)])
397126a8a12Smrg
398126a8a12Smrg
399300346aeSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
400300346aeSmrg# ---------------------------------------------------------
401300346aeSmrgm4_define([_lt_decl_filter],
402300346aeSmrg[m4_case([$#],
403300346aeSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
404300346aeSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
405300346aeSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
406300346aeSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
407300346aeSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
408300346aeSmrg])
409126a8a12Smrg
4100a6b08f8Smrg
411300346aeSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
412300346aeSmrg# --------------------------------------------------
413300346aeSmrgm4_define([lt_decl_quote_varnames],
414300346aeSmrg[_lt_decl_filter([value], [1], $@)])
4150a6b08f8Smrg
416126a8a12Smrg
417300346aeSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
418300346aeSmrg# ---------------------------------------------------
419300346aeSmrgm4_define([lt_decl_dquote_varnames],
420300346aeSmrg[_lt_decl_filter([value], [2], $@)])
421126a8a12Smrg
4220a6b08f8Smrg
423300346aeSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
424300346aeSmrg# ---------------------------------------------------
425300346aeSmrgm4_define([lt_decl_varnames_tagged],
426300346aeSmrg[m4_assert([$# <= 2])dnl
427300346aeSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
428300346aeSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
429300346aeSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
430300346aeSmrgm4_define([_lt_decl_varnames_tagged],
431300346aeSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
4320a6b08f8Smrg
433126a8a12Smrg
434300346aeSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
435300346aeSmrg# ------------------------------------------------
436300346aeSmrgm4_define([lt_decl_all_varnames],
437300346aeSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
438300346aeSmrg     m4_if([$2], [],
439300346aeSmrg	   m4_quote(lt_decl_varnames),
440300346aeSmrg	m4_quote(m4_shift($@))))[]dnl
441300346aeSmrg])
442300346aeSmrgm4_define([_lt_decl_all_varnames],
443300346aeSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
444300346aeSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
445300346aeSmrg])
446d656433aSmrg
4470a6b08f8Smrg
448300346aeSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
449300346aeSmrg# ------------------------------------
450300346aeSmrg# Quote a variable value, and forward it to 'config.status' so that its
451300346aeSmrg# declaration there will have the same value as in 'configure'.  VARNAME
452300346aeSmrg# must have a single quote delimited value for this to work.
453300346aeSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454300346aeSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455300346aeSmrg
456d656433aSmrg
457300346aeSmrg# _LT_CONFIG_STATUS_DECLARATIONS
458300346aeSmrg# ------------------------------
459300346aeSmrg# We delimit libtool config variables with single quotes, so when
460300346aeSmrg# we write them to config.status, we have to be sure to quote all
461300346aeSmrg# embedded single quotes properly.  In configure, this macro expands
462300346aeSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
463555991fdSmrg#
464300346aeSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
465300346aeSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
466300346aeSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
467300346aeSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
468d656433aSmrg
469300346aeSmrg
470300346aeSmrg# _LT_LIBTOOL_TAGS
471300346aeSmrg# ----------------
472300346aeSmrg# Output comment and list of tags supported by the script
473300346aeSmrgm4_defun([_LT_LIBTOOL_TAGS],
474300346aeSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
475300346aeSmrgavailable_tags='_LT_TAGS'dnl
476555991fdSmrg])
477126a8a12Smrg
478300346aeSmrg
479300346aeSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
480300346aeSmrg# -----------------------------------
481300346aeSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
482300346aeSmrg# expand to a commented shell variable setting:
483555991fdSmrg#
484300346aeSmrg#    # Some comment about what VAR is for.
485300346aeSmrg#    visible_name=$lt_internal_name
486300346aeSmrgm4_define([_LT_LIBTOOL_DECLARE],
487300346aeSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
488300346aeSmrg					   [description])))[]dnl
489300346aeSmrgm4_pushdef([_libtool_name],
490300346aeSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
491300346aeSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
492300346aeSmrg    [0], [_libtool_name=[$]$1],
493300346aeSmrg    [1], [_libtool_name=$lt_[]$1],
494300346aeSmrg    [2], [_libtool_name=$lt_[]$1],
495300346aeSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
496300346aeSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497300346aeSmrg])
498126a8a12Smrg
499126a8a12Smrg
500300346aeSmrg# _LT_LIBTOOL_CONFIG_VARS
501300346aeSmrg# -----------------------
502300346aeSmrg# Produce commented declarations of non-tagged libtool config variables
503300346aeSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
504300346aeSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
505300346aeSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
506300346aeSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
507300346aeSmrg[m4_foreach([_lt_var],
508300346aeSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
509300346aeSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
510126a8a12Smrg
511126a8a12Smrg
512300346aeSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
513300346aeSmrg# -------------------------
514300346aeSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
515300346aeSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
516300346aeSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517126a8a12Smrg
518126a8a12Smrg
519300346aeSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
520300346aeSmrg# ------------------------------
521300346aeSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522126a8a12Smrg
523d656433aSmrg
524300346aeSmrg# _LT_CONFIG_COMMANDS
525300346aeSmrg# -------------------
526300346aeSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
527300346aeSmrg# variables for single and double quote escaping we saved from calls
528300346aeSmrg# to _LT_DECL, we can put quote escaped variables declarations
529300346aeSmrg# into 'config.status', and then the shell code to quote escape them in
530300346aeSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
531300346aeSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
532300346aeSmrgm4_defun([_LT_CONFIG_COMMANDS],
533300346aeSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
534300346aeSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
535300346aeSmrg	dnl instead of duplicating it all over again into config.status,
536300346aeSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
537300346aeSmrg	dnl needs to know what name is stored there:
538300346aeSmrg        [AC_CONFIG_COMMANDS([libtool],
539300346aeSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
540300346aeSmrg    dnl If the libtool generation code is destined for config.status,
541300346aeSmrg    dnl expand the accumulated commands and init code now:
542300346aeSmrg    [AC_CONFIG_COMMANDS([libtool],
543300346aeSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
544300346aeSmrg])#_LT_CONFIG_COMMANDS
545d656433aSmrg
5460a6b08f8Smrg
547300346aeSmrg# Initialize.
548300346aeSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
549300346aeSmrg[
550d656433aSmrg
551300346aeSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
552300346aeSmrg# if CDPATH is set.
553300346aeSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554126a8a12Smrg
555300346aeSmrgsed_quote_subst='$sed_quote_subst'
556300346aeSmrgdouble_quote_subst='$double_quote_subst'
557300346aeSmrgdelay_variable_subst='$delay_variable_subst'
558300346aeSmrg_LT_CONFIG_STATUS_DECLARATIONS
559300346aeSmrgLTCC='$LTCC'
560300346aeSmrgLTCFLAGS='$LTCFLAGS'
561300346aeSmrgcompiler='$compiler_DEFAULT'
562126a8a12Smrg
563300346aeSmrg# A function that is used when there is no print builtin or printf.
564300346aeSmrgfunc_fallback_echo ()
565300346aeSmrg{
566300346aeSmrg  eval 'cat <<_LTECHO_EOF
567300346aeSmrg\$[]1
568300346aeSmrg_LTECHO_EOF'
569300346aeSmrg}
570126a8a12Smrg
571300346aeSmrg# Quote evaled strings.
572300346aeSmrgfor var in lt_decl_all_varnames([[ \
573300346aeSmrg]], lt_decl_quote_varnames); do
574300346aeSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575300346aeSmrg    *[[\\\\\\\`\\"\\\$]]*)
576300346aeSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5770a6b08f8Smrg      ;;
578300346aeSmrg    *)
579300346aeSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5800a6b08f8Smrg      ;;
581300346aeSmrg    esac
582300346aeSmrgdone
583300346aeSmrg
584300346aeSmrg# Double-quote double-evaled strings.
585300346aeSmrgfor var in lt_decl_all_varnames([[ \
586300346aeSmrg]], lt_decl_dquote_varnames); do
587300346aeSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
588300346aeSmrg    *[[\\\\\\\`\\"\\\$]]*)
589300346aeSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
5900a6b08f8Smrg      ;;
591300346aeSmrg    *)
592300346aeSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
5930a6b08f8Smrg      ;;
5940a6b08f8Smrg    esac
595300346aeSmrgdone
596126a8a12Smrg
597300346aeSmrg_LT_OUTPUT_LIBTOOL_INIT
598300346aeSmrg])
5993c15da26Smrg
600300346aeSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601300346aeSmrg# ------------------------------------
602300346aeSmrg# Generate a child script FILE with all initialization necessary to
603300346aeSmrg# reuse the environment learned by the parent script, and make the
604300346aeSmrg# file executable.  If COMMENT is supplied, it is inserted after the
605300346aeSmrg# '#!' sequence but before initialization text begins.  After this
606300346aeSmrg# macro, additional text can be appended to FILE to form the body of
607300346aeSmrg# the child script.  The macro ends with non-zero status if the
608300346aeSmrg# file could not be fully written (such as if the disk is full).
609300346aeSmrgm4_ifdef([AS_INIT_GENERATED],
610300346aeSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611300346aeSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
612300346aeSmrg[m4_require([AS_PREPARE])]dnl
613300346aeSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614300346aeSmrg[lt_write_fail=0
615300346aeSmrgcat >$1 <<_ASEOF || lt_write_fail=1
616300346aeSmrg#! $SHELL
617300346aeSmrg# Generated by $as_me.
618300346aeSmrg$2
619300346aeSmrgSHELL=\${CONFIG_SHELL-$SHELL}
620300346aeSmrgexport SHELL
621300346aeSmrg_ASEOF
622300346aeSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623300346aeSmrgAS_SHELL_SANITIZE
624300346aeSmrg_AS_PREPARE
625300346aeSmrgexec AS_MESSAGE_FD>&1
626300346aeSmrg_ASEOF
627300346aeSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628300346aeSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
6293c15da26Smrg
630300346aeSmrg# LT_OUTPUT
631300346aeSmrg# ---------
632300346aeSmrg# This macro allows early generation of the libtool script (before
633300346aeSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
634300346aeSmrg# tests.
635300346aeSmrgAC_DEFUN([LT_OUTPUT],
636300346aeSmrg[: ${CONFIG_LT=./config.lt}
637300346aeSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638300346aeSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639300346aeSmrg[# Run this file to recreate a libtool stub with the current configuration.])
640126a8a12Smrg
641300346aeSmrgcat >>"$CONFIG_LT" <<\_LTEOF
642300346aeSmrglt_cl_silent=false
643300346aeSmrgexec AS_MESSAGE_LOG_FD>>config.log
644300346aeSmrg{
645300346aeSmrg  echo
646300346aeSmrg  AS_BOX([Running $as_me.])
647300346aeSmrg} >&AS_MESSAGE_LOG_FD
648126a8a12Smrg
649300346aeSmrglt_cl_help="\
650300346aeSmrg'$as_me' creates a local libtool stub from the current configuration,
651300346aeSmrgfor use in further configure time tests before the real libtool is
652300346aeSmrggenerated.
653126a8a12Smrg
654300346aeSmrgUsage: $[0] [[OPTIONS]]
655126a8a12Smrg
656300346aeSmrg  -h, --help      print this help, then exit
657300346aeSmrg  -V, --version   print version number, then exit
658300346aeSmrg  -q, --quiet     do not print progress messages
659300346aeSmrg  -d, --debug     don't remove temporary files
660126a8a12Smrg
661300346aeSmrgReport bugs to <bug-libtool@gnu.org>."
662d656433aSmrg
663300346aeSmrglt_cl_version="\
664300346aeSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
665300346aeSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
666300346aeSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
667126a8a12Smrg
668300346aeSmrgCopyright (C) 2011 Free Software Foundation, Inc.
669300346aeSmrgThis config.lt script is free software; the Free Software Foundation
670300346aeSmrggives unlimited permision to copy, distribute and modify it."
671126a8a12Smrg
672300346aeSmrgwhile test 0 != $[#]
673300346aeSmrgdo
674300346aeSmrg  case $[1] in
675300346aeSmrg    --version | --v* | -V )
676300346aeSmrg      echo "$lt_cl_version"; exit 0 ;;
677300346aeSmrg    --help | --h* | -h )
678300346aeSmrg      echo "$lt_cl_help"; exit 0 ;;
679300346aeSmrg    --debug | --d* | -d )
680300346aeSmrg      debug=: ;;
681300346aeSmrg    --quiet | --q* | --silent | --s* | -q )
682300346aeSmrg      lt_cl_silent=: ;;
683126a8a12Smrg
684300346aeSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
685300346aeSmrgTry '$[0] --help' for more information.]) ;;
686555991fdSmrg
687300346aeSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
688300346aeSmrgTry '$[0] --help' for more information.]) ;;
689300346aeSmrg  esac
690300346aeSmrg  shift
691300346aeSmrgdone
692126a8a12Smrg
693300346aeSmrgif $lt_cl_silent; then
694300346aeSmrg  exec AS_MESSAGE_FD>/dev/null
695300346aeSmrgfi
696300346aeSmrg_LTEOF
697126a8a12Smrg
698300346aeSmrgcat >>"$CONFIG_LT" <<_LTEOF
699300346aeSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
700300346aeSmrg_LTEOF
701555991fdSmrg
702300346aeSmrgcat >>"$CONFIG_LT" <<\_LTEOF
703300346aeSmrgAC_MSG_NOTICE([creating $ofile])
704300346aeSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
705300346aeSmrgAS_EXIT(0)
706300346aeSmrg_LTEOF
707300346aeSmrgchmod +x "$CONFIG_LT"
708555991fdSmrg
709300346aeSmrg# configure is writing to config.log, but config.lt does its own redirection,
710300346aeSmrg# appending to config.log, which fails on DOS, as config.log is still kept
711300346aeSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
712300346aeSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713300346aeSmrglt_cl_success=:
714300346aeSmrgtest yes = "$silent" &&
715300346aeSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716300346aeSmrgexec AS_MESSAGE_LOG_FD>/dev/null
717300346aeSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718300346aeSmrgexec AS_MESSAGE_LOG_FD>>config.log
719300346aeSmrg$lt_cl_success || AS_EXIT(1)
720300346aeSmrg])# LT_OUTPUT
721126a8a12Smrg
722126a8a12Smrg
723300346aeSmrg# _LT_CONFIG(TAG)
724300346aeSmrg# ---------------
725300346aeSmrg# If TAG is the built-in tag, create an initial libtool script with a
726300346aeSmrg# default configuration from the untagged config vars.  Otherwise add code
727300346aeSmrg# to config.status for appending the configuration named by TAG from the
728300346aeSmrg# matching tagged config vars.
729300346aeSmrgm4_defun([_LT_CONFIG],
730300346aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
731300346aeSmrg_LT_CONFIG_SAVE_COMMANDS([
732300346aeSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
733300346aeSmrg  m4_if(_LT_TAG, [C], [
734300346aeSmrg    # See if we are running on zsh, and set the options that allow our
735300346aeSmrg    # commands through without removal of \ escapes.
736300346aeSmrg    if test -n "${ZSH_VERSION+set}"; then
737300346aeSmrg      setopt NO_GLOB_SUBST
738300346aeSmrg    fi
739d656433aSmrg
740300346aeSmrg    cfgfile=${ofile}T
741300346aeSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
742300346aeSmrg    $RM "$cfgfile"
743126a8a12Smrg
744300346aeSmrg    cat <<_LT_EOF >> "$cfgfile"
745300346aeSmrg#! $SHELL
746300346aeSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
747300346aeSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
748126a8a12Smrg
749300346aeSmrg# Provide generalized library-building support services.
750300346aeSmrg# Written by Gordon Matzigkeit, 1996
751126a8a12Smrg
752300346aeSmrg_LT_COPYING
753300346aeSmrg_LT_LIBTOOL_TAGS
754126a8a12Smrg
755300346aeSmrg# Configured defaults for sys_lib_dlsearch_path munging.
756300346aeSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
757126a8a12Smrg
758300346aeSmrg# ### BEGIN LIBTOOL CONFIG
759300346aeSmrg_LT_LIBTOOL_CONFIG_VARS
760300346aeSmrg_LT_LIBTOOL_TAG_VARS
761300346aeSmrg# ### END LIBTOOL CONFIG
762126a8a12Smrg
763300346aeSmrg_LT_EOF
764555991fdSmrg
765300346aeSmrg    cat <<'_LT_EOF' >> "$cfgfile"
7663c15da26Smrg
767300346aeSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
768126a8a12Smrg
769300346aeSmrg_LT_PREPARE_MUNGE_PATH_LIST
770300346aeSmrg_LT_PREPARE_CC_BASENAME
771126a8a12Smrg
772300346aeSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
773555991fdSmrg
774300346aeSmrg_LT_EOF
775555991fdSmrg
776300346aeSmrg  case $host_os in
777300346aeSmrg  aix3*)
778300346aeSmrg    cat <<\_LT_EOF >> "$cfgfile"
779300346aeSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
780300346aeSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
781300346aeSmrg# vanish in a puff of smoke.
782300346aeSmrgif test set != "${COLLECT_NAMES+set}"; then
783300346aeSmrg  COLLECT_NAMES=
784300346aeSmrg  export COLLECT_NAMES
785300346aeSmrgfi
786300346aeSmrg_LT_EOF
787300346aeSmrg    ;;
788300346aeSmrg  esac
789126a8a12Smrg
790300346aeSmrg  _LT_PROG_LTMAIN
791555991fdSmrg
792300346aeSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
793300346aeSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
794300346aeSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
795300346aeSmrg  # is reportedly fixed, but why not run on old versions too?
796300346aeSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
797300346aeSmrg     || (rm -f "$cfgfile"; exit 1)
798555991fdSmrg
799300346aeSmrg   mv -f "$cfgfile" "$ofile" ||
800300346aeSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
801300346aeSmrg  chmod +x "$ofile"
802300346aeSmrg],
803300346aeSmrg[cat <<_LT_EOF >> "$ofile"
804d656433aSmrg
805300346aeSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
806300346aeSmrgdnl in a comment (ie after a #).
807300346aeSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
808300346aeSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
809300346aeSmrg# ### END LIBTOOL TAG CONFIG: $1
810300346aeSmrg_LT_EOF
811300346aeSmrg])dnl /m4_if
812300346aeSmrg],
813300346aeSmrg[m4_if([$1], [], [
814300346aeSmrg    PACKAGE='$PACKAGE'
815300346aeSmrg    VERSION='$VERSION'
816300346aeSmrg    RM='$RM'
817300346aeSmrg    ofile='$ofile'], [])
818300346aeSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
819300346aeSmrg])# _LT_CONFIG
820126a8a12Smrg
821126a8a12Smrg
822300346aeSmrg# LT_SUPPORTED_TAG(TAG)
823300346aeSmrg# ---------------------
824300346aeSmrg# Trace this macro to discover what tags are supported by the libtool
825300346aeSmrg# --tag option, using:
826300346aeSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
827300346aeSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
828126a8a12Smrg
829555991fdSmrg
830300346aeSmrg# C support is built-in for now
831300346aeSmrgm4_define([_LT_LANG_C_enabled], [])
832300346aeSmrgm4_define([_LT_TAGS], [])
833126a8a12Smrg
834555991fdSmrg
835300346aeSmrg# LT_LANG(LANG)
836300346aeSmrg# -------------
837300346aeSmrg# Enable libtool support for the given language if not already enabled.
838300346aeSmrgAC_DEFUN([LT_LANG],
839300346aeSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
840300346aeSmrgm4_case([$1],
841300346aeSmrg  [C],			[_LT_LANG(C)],
842300346aeSmrg  [C++],		[_LT_LANG(CXX)],
843300346aeSmrg  [Go],			[_LT_LANG(GO)],
844300346aeSmrg  [Java],		[_LT_LANG(GCJ)],
845300346aeSmrg  [Fortran 77],		[_LT_LANG(F77)],
846300346aeSmrg  [Fortran],		[_LT_LANG(FC)],
847300346aeSmrg  [Windows Resource],	[_LT_LANG(RC)],
848300346aeSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
849300346aeSmrg    [_LT_LANG($1)],
850300346aeSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
851300346aeSmrg])# LT_LANG
852126a8a12Smrg
853555991fdSmrg
854300346aeSmrg# _LT_LANG(LANGNAME)
855300346aeSmrg# ------------------
856300346aeSmrgm4_defun([_LT_LANG],
857300346aeSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
858300346aeSmrg  [LT_SUPPORTED_TAG([$1])dnl
859300346aeSmrg  m4_append([_LT_TAGS], [$1 ])dnl
860300346aeSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
861300346aeSmrg  _LT_LANG_$1_CONFIG($1)])dnl
862300346aeSmrg])# _LT_LANG
863555991fdSmrg
864d656433aSmrg
865300346aeSmrgm4_ifndef([AC_PROG_GO], [
866300346aeSmrg# NOTE: This macro has been submitted for inclusion into   #
867300346aeSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
868300346aeSmrg#  a released version of Autoconf we should remove this    #
869300346aeSmrg#  macro and use it instead.                               #
870300346aeSmrgm4_defun([AC_PROG_GO],
871300346aeSmrg[AC_LANG_PUSH(Go)dnl
872300346aeSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
873300346aeSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
874300346aeSmrg_AC_ARG_VAR_LDFLAGS()dnl
875300346aeSmrgAC_CHECK_TOOL(GOC, gccgo)
876300346aeSmrgif test -z "$GOC"; then
877300346aeSmrg  if test -n "$ac_tool_prefix"; then
878300346aeSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
879300346aeSmrg  fi
880300346aeSmrgfi
881300346aeSmrgif test -z "$GOC"; then
882300346aeSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
883300346aeSmrgfi
884300346aeSmrg])#m4_defun
885300346aeSmrg])#m4_ifndef
886d656433aSmrg
887d656433aSmrg
888300346aeSmrg# _LT_LANG_DEFAULT_CONFIG
889300346aeSmrg# -----------------------
890300346aeSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
891300346aeSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
892300346aeSmrg  [LT_LANG(CXX)],
893300346aeSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
894d656433aSmrg
895300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
896300346aeSmrg  [LT_LANG(F77)],
897300346aeSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
898d656433aSmrg
899300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
900300346aeSmrg  [LT_LANG(FC)],
901300346aeSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
902126a8a12Smrg
903300346aeSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
904300346aeSmrgdnl pulling things in needlessly.
905300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
906300346aeSmrg  [LT_LANG(GCJ)],
907300346aeSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
908300346aeSmrg    [LT_LANG(GCJ)],
909300346aeSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
910300346aeSmrg      [LT_LANG(GCJ)],
911300346aeSmrg      [m4_ifdef([AC_PROG_GCJ],
912300346aeSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
913300346aeSmrg       m4_ifdef([A][M_PROG_GCJ],
914300346aeSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
915300346aeSmrg       m4_ifdef([LT_PROG_GCJ],
916300346aeSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
917126a8a12Smrg
918300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
919300346aeSmrg  [LT_LANG(GO)],
920300346aeSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
921126a8a12Smrg
922300346aeSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
923300346aeSmrg  [LT_LANG(RC)],
924300346aeSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
925300346aeSmrg])# _LT_LANG_DEFAULT_CONFIG
926126a8a12Smrg
927300346aeSmrg# Obsolete macros:
928300346aeSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
929300346aeSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
930300346aeSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
931300346aeSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
932300346aeSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
933300346aeSmrgdnl aclocal-1.4 backwards compatibility:
934300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
935300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
936300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
937300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
938300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
939126a8a12Smrg
940555991fdSmrg
941300346aeSmrg# _LT_TAG_COMPILER
942300346aeSmrg# ----------------
943300346aeSmrgm4_defun([_LT_TAG_COMPILER],
944300346aeSmrg[AC_REQUIRE([AC_PROG_CC])dnl
945126a8a12Smrg
946300346aeSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
947300346aeSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
948300346aeSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
949300346aeSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
950555991fdSmrg
951300346aeSmrg# If no C compiler was specified, use CC.
952300346aeSmrgLTCC=${LTCC-"$CC"}
953126a8a12Smrg
954300346aeSmrg# If no C compiler flags were specified, use CFLAGS.
955300346aeSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
9563c15da26Smrg
957300346aeSmrg# Allow CC to be a program name with arguments.
958300346aeSmrgcompiler=$CC
959300346aeSmrg])# _LT_TAG_COMPILER
9603c15da26Smrg
9613c15da26Smrg
962300346aeSmrg# _LT_COMPILER_BOILERPLATE
963300346aeSmrg# ------------------------
964300346aeSmrg# Check for compiler boilerplate output or warnings with
965300346aeSmrg# the simple compiler test code.
966300346aeSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
967300346aeSmrg[m4_require([_LT_DECL_SED])dnl
968300346aeSmrgac_outfile=conftest.$ac_objext
969300346aeSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
970300346aeSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
971300346aeSmrg_lt_compiler_boilerplate=`cat conftest.err`
972300346aeSmrg$RM conftest*
973300346aeSmrg])# _LT_COMPILER_BOILERPLATE
974126a8a12Smrg
975126a8a12Smrg
976300346aeSmrg# _LT_LINKER_BOILERPLATE
977300346aeSmrg# ----------------------
978300346aeSmrg# Check for linker boilerplate output or warnings with
979300346aeSmrg# the simple link test code.
980300346aeSmrgm4_defun([_LT_LINKER_BOILERPLATE],
981300346aeSmrg[m4_require([_LT_DECL_SED])dnl
982300346aeSmrgac_outfile=conftest.$ac_objext
983300346aeSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
984300346aeSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
985300346aeSmrg_lt_linker_boilerplate=`cat conftest.err`
986300346aeSmrg$RM -r conftest*
987300346aeSmrg])# _LT_LINKER_BOILERPLATE
988126a8a12Smrg
989300346aeSmrg# _LT_REQUIRED_DARWIN_CHECKS
990300346aeSmrg# -------------------------
991300346aeSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
992300346aeSmrg  case $host_os in
993300346aeSmrg    rhapsody* | darwin*)
994300346aeSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
995300346aeSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
996300346aeSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
997300346aeSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
998300346aeSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
999300346aeSmrg    _LT_DECL([], [DSYMUTIL], [1],
1000300346aeSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1001300346aeSmrg    _LT_DECL([], [NMEDIT], [1],
1002300346aeSmrg      [Tool to change global to local symbols on Mac OS X])
1003300346aeSmrg    _LT_DECL([], [LIPO], [1],
1004300346aeSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
1005300346aeSmrg    _LT_DECL([], [OTOOL], [1],
1006300346aeSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1007300346aeSmrg    _LT_DECL([], [OTOOL64], [1],
1008300346aeSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1009126a8a12Smrg
1010300346aeSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1011300346aeSmrg      [lt_cv_apple_cc_single_mod=no
1012300346aeSmrg      if test -z "$LT_MULTI_MODULE"; then
1013300346aeSmrg	# By default we will add the -single_module flag. You can override
1014300346aeSmrg	# by either setting the environment variable LT_MULTI_MODULE
1015300346aeSmrg	# non-empty at configure time, or by adding -multi_module to the
1016300346aeSmrg	# link flags.
1017300346aeSmrg	rm -rf libconftest.dylib*
1018300346aeSmrg	echo "int foo(void){return 1;}" > conftest.c
1019300346aeSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1020300346aeSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1021300346aeSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1022300346aeSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1023300346aeSmrg        _lt_result=$?
1024300346aeSmrg	# If there is a non-empty error log, and "single_module"
1025300346aeSmrg	# appears in it, assume the flag caused a linker warning
1026300346aeSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
1027300346aeSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1028300346aeSmrg	# Otherwise, if the output was created with a 0 exit code from
1029300346aeSmrg	# the compiler, it worked.
1030300346aeSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1031300346aeSmrg	  lt_cv_apple_cc_single_mod=yes
1032300346aeSmrg	else
1033300346aeSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1034300346aeSmrg	fi
1035300346aeSmrg	rm -rf libconftest.dylib*
1036300346aeSmrg	rm -f conftest.*
1037300346aeSmrg      fi])
1038126a8a12Smrg
1039300346aeSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1040300346aeSmrg      [lt_cv_ld_exported_symbols_list],
1041300346aeSmrg      [lt_cv_ld_exported_symbols_list=no
1042300346aeSmrg      save_LDFLAGS=$LDFLAGS
1043300346aeSmrg      echo "_main" > conftest.sym
1044300346aeSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1045300346aeSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1046300346aeSmrg	[lt_cv_ld_exported_symbols_list=yes],
1047300346aeSmrg	[lt_cv_ld_exported_symbols_list=no])
1048300346aeSmrg	LDFLAGS=$save_LDFLAGS
1049300346aeSmrg    ])
1050d656433aSmrg
1051300346aeSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1052300346aeSmrg      [lt_cv_ld_force_load=no
1053300346aeSmrg      cat > conftest.c << _LT_EOF
1054300346aeSmrgint forced_loaded() { return 2;}
1055300346aeSmrg_LT_EOF
1056300346aeSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1057300346aeSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1058300346aeSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1059300346aeSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1060300346aeSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1061300346aeSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1062300346aeSmrg      cat > conftest.c << _LT_EOF
1063300346aeSmrgint main() { return 0;}
1064300346aeSmrg_LT_EOF
1065300346aeSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1066300346aeSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1067300346aeSmrg      _lt_result=$?
1068300346aeSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
1069300346aeSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1070300346aeSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1071300346aeSmrg	lt_cv_ld_force_load=yes
1072300346aeSmrg      else
1073300346aeSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1074300346aeSmrg      fi
1075300346aeSmrg        rm -f conftest.err libconftest.a conftest conftest.c
1076300346aeSmrg        rm -rf conftest.dSYM
1077300346aeSmrg    ])
1078300346aeSmrg    case $host_os in
1079300346aeSmrg    rhapsody* | darwin1.[[012]])
1080300346aeSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1081300346aeSmrg    darwin1.*)
1082300346aeSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1083300346aeSmrg    darwin*) # darwin 5.x on
1084300346aeSmrg      # if running on 10.5 or later, the deployment target defaults
1085300346aeSmrg      # to the OS version, if on x86, and 10.4, the deployment
1086300346aeSmrg      # target defaults to 10.4. Don't you love it?
1087300346aeSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1088300346aeSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1089300346aeSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1090300346aeSmrg	10.[[012]][[,.]]*)
1091300346aeSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1092300346aeSmrg	10.*)
1093300346aeSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1094300346aeSmrg      esac
1095300346aeSmrg    ;;
1096300346aeSmrg  esac
1097300346aeSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1098300346aeSmrg      _lt_dar_single_mod='$single_module'
1099300346aeSmrg    fi
1100300346aeSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1101300346aeSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1102300346aeSmrg    else
1103300346aeSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1104300346aeSmrg    fi
1105300346aeSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1106300346aeSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1107300346aeSmrg    else
1108300346aeSmrg      _lt_dsymutil=
1109300346aeSmrg    fi
1110300346aeSmrg    ;;
1111300346aeSmrg  esac
11123c15da26Smrg])
1113126a8a12Smrg
1114126a8a12Smrg
1115300346aeSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1116300346aeSmrg# ---------------------------------
1117300346aeSmrg# Checks for linker and compiler features on darwin
1118300346aeSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1119300346aeSmrg[
1120300346aeSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1121300346aeSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1122300346aeSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1123300346aeSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1124300346aeSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1125300346aeSmrg  if test yes = "$lt_cv_ld_force_load"; then
1126300346aeSmrg    _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\"`'
1127300346aeSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1128300346aeSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1129300346aeSmrg  else
1130300346aeSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1131300346aeSmrg  fi
1132300346aeSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1133300346aeSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1134300346aeSmrg  case $cc_basename in
1135300346aeSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1136300346aeSmrg     *) _lt_dar_can_shared=$GCC ;;
1137300346aeSmrg  esac
1138300346aeSmrg  if test yes = "$_lt_dar_can_shared"; then
1139300346aeSmrg    output_verbose_link_cmd=func_echo_all
1140300346aeSmrg    _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"
1141300346aeSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1142300346aeSmrg    _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"
1143300346aeSmrg    _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"
1144300346aeSmrg    m4_if([$1], [CXX],
1145300346aeSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1146300346aeSmrg      _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"
1147300346aeSmrg      _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"
1148300346aeSmrg    fi
1149300346aeSmrg],[])
1150300346aeSmrg  else
1151300346aeSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1152300346aeSmrg  fi
1153300346aeSmrg])
1154126a8a12Smrg
1155300346aeSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1156300346aeSmrg# ----------------------------------
1157300346aeSmrg# Links a minimal program and checks the executable
1158300346aeSmrg# for the system default hardcoded library path. In most cases,
1159300346aeSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
1160300346aeSmrg# the location of the communication and MPI libs are included too.
1161300346aeSmrg# If we don't find anything, use the default library path according
1162300346aeSmrg# to the aix ld manual.
1163300346aeSmrg# Store the results from the different compilers for each TAGNAME.
1164300346aeSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
1165300346aeSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1166300346aeSmrg[m4_require([_LT_DECL_SED])dnl
1167300346aeSmrgif test set = "${lt_cv_aix_libpath+set}"; then
1168300346aeSmrg  aix_libpath=$lt_cv_aix_libpath
1169300346aeSmrgelse
1170300346aeSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1171300346aeSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1172300346aeSmrg  lt_aix_libpath_sed='[
1173300346aeSmrg      /Import File Strings/,/^$/ {
1174300346aeSmrg	  /^0/ {
1175300346aeSmrg	      s/^0  *\([^ ]*\) *$/\1/
1176300346aeSmrg	      p
1177300346aeSmrg	  }
1178300346aeSmrg      }]'
1179300346aeSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1180300346aeSmrg  # Check for a 64-bit object if we didn't find anything.
1181300346aeSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1182300346aeSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1183300346aeSmrg  fi],[])
1184300346aeSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1185300346aeSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1186300346aeSmrg  fi
1187300346aeSmrg  ])
1188300346aeSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1189300346aeSmrgfi
1190300346aeSmrg])# _LT_SYS_MODULE_PATH_AIX
1191126a8a12Smrg
1192126a8a12Smrg
1193300346aeSmrg# _LT_SHELL_INIT(ARG)
1194300346aeSmrg# -------------------
1195300346aeSmrgm4_define([_LT_SHELL_INIT],
1196300346aeSmrg[m4_divert_text([M4SH-INIT], [$1
1197300346aeSmrg])])# _LT_SHELL_INIT
1198126a8a12Smrg
1199126a8a12Smrg
1200126a8a12Smrg
1201300346aeSmrg# _LT_PROG_ECHO_BACKSLASH
12023c15da26Smrg# -----------------------
1203300346aeSmrg# Find how we can fake an echo command that does not interpret backslash.
1204300346aeSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
1205300346aeSmrg# of the generated configure script that will find a shell with a builtin
1206300346aeSmrg# printf (that we can use as an echo command).
1207300346aeSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1208300346aeSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1209300346aeSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1210300346aeSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1211126a8a12Smrg
1212300346aeSmrgAC_MSG_CHECKING([how to print strings])
1213300346aeSmrg# Test print first, because it will be a builtin if present.
1214300346aeSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1215300346aeSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1216300346aeSmrg  ECHO='print -r --'
1217300346aeSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1218300346aeSmrg  ECHO='printf %s\n'
1219300346aeSmrgelse
1220300346aeSmrg  # Use this function as a fallback that always works.
1221300346aeSmrg  func_fallback_echo ()
1222300346aeSmrg  {
1223300346aeSmrg    eval 'cat <<_LTECHO_EOF
1224300346aeSmrg$[]1
1225300346aeSmrg_LTECHO_EOF'
1226300346aeSmrg  }
1227300346aeSmrg  ECHO='func_fallback_echo'
1228300346aeSmrgfi
1229126a8a12Smrg
1230300346aeSmrg# func_echo_all arg...
1231300346aeSmrg# Invoke $ECHO with all args, space-separated.
1232300346aeSmrgfunc_echo_all ()
1233300346aeSmrg{
1234300346aeSmrg    $ECHO "$*"
1235300346aeSmrg}
1236126a8a12Smrg
1237300346aeSmrgcase $ECHO in
1238300346aeSmrg  printf*) AC_MSG_RESULT([printf]) ;;
1239300346aeSmrg  print*) AC_MSG_RESULT([print -r]) ;;
1240300346aeSmrg  *) AC_MSG_RESULT([cat]) ;;
1241300346aeSmrgesac
1242126a8a12Smrg
1243300346aeSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
1244300346aeSmrg[_AS_DETECT_SUGGESTED([
1245300346aeSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1246300346aeSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1247300346aeSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1248300346aeSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1249300346aeSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
1250300346aeSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1251300346aeSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1252126a8a12Smrg
1253300346aeSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1254300346aeSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1255300346aeSmrg])# _LT_PROG_ECHO_BACKSLASH
1256126a8a12Smrg
1257555991fdSmrg
1258300346aeSmrg# _LT_WITH_SYSROOT
1259300346aeSmrg# ----------------
1260300346aeSmrgAC_DEFUN([_LT_WITH_SYSROOT],
1261300346aeSmrg[AC_MSG_CHECKING([for sysroot])
1262300346aeSmrgAC_ARG_WITH([sysroot],
1263300346aeSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1264300346aeSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1265300346aeSmrg   if not specified).])],
1266300346aeSmrg[], [with_sysroot=no])
1267555991fdSmrg
1268300346aeSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1269300346aeSmrgdnl in case the user passed a directory name.
1270300346aeSmrglt_sysroot=
1271300346aeSmrgcase $with_sysroot in #(
1272300346aeSmrg yes)
1273300346aeSmrg   if test yes = "$GCC"; then
1274300346aeSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1275300346aeSmrg   fi
1276300346aeSmrg   ;; #(
1277300346aeSmrg /*)
1278300346aeSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1279300346aeSmrg   ;; #(
1280300346aeSmrg no|'')
1281300346aeSmrg   ;; #(
1282300346aeSmrg *)
1283300346aeSmrg   AC_MSG_RESULT([$with_sysroot])
1284300346aeSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1285300346aeSmrg   ;;
1286300346aeSmrgesac
1287555991fdSmrg
1288300346aeSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
1289300346aeSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1290300346aeSmrg[dependent libraries, and where our libraries should be installed.])])
1291126a8a12Smrg
1292300346aeSmrg# _LT_ENABLE_LOCK
1293300346aeSmrg# ---------------
1294300346aeSmrgm4_defun([_LT_ENABLE_LOCK],
1295300346aeSmrg[AC_ARG_ENABLE([libtool-lock],
1296300346aeSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1297300346aeSmrg    [avoid locking (might break parallel builds)])])
1298300346aeSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1299126a8a12Smrg
1300300346aeSmrg# Some flags need to be propagated to the compiler or linker for good
1301300346aeSmrg# libtool support.
1302300346aeSmrgcase $host in
1303300346aeSmrgia64-*-hpux*)
1304300346aeSmrg  # Find out what ABI is being produced by ac_compile, and set mode
1305300346aeSmrg  # options accordingly.
1306300346aeSmrg  echo 'int i;' > conftest.$ac_ext
1307300346aeSmrg  if AC_TRY_EVAL(ac_compile); then
1308300346aeSmrg    case `/usr/bin/file conftest.$ac_objext` in
1309300346aeSmrg      *ELF-32*)
1310300346aeSmrg	HPUX_IA64_MODE=32
1311300346aeSmrg	;;
1312300346aeSmrg      *ELF-64*)
1313300346aeSmrg	HPUX_IA64_MODE=64
1314300346aeSmrg	;;
1315300346aeSmrg    esac
1316300346aeSmrg  fi
1317300346aeSmrg  rm -rf conftest*
1318300346aeSmrg  ;;
1319300346aeSmrg*-*-irix6*)
1320300346aeSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1321300346aeSmrg  # options accordingly.
1322300346aeSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1323300346aeSmrg  if AC_TRY_EVAL(ac_compile); then
1324300346aeSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1325300346aeSmrg      case `/usr/bin/file conftest.$ac_objext` in
1326300346aeSmrg	*32-bit*)
1327300346aeSmrg	  LD="${LD-ld} -melf32bsmip"
1328300346aeSmrg	  ;;
1329300346aeSmrg	*N32*)
1330300346aeSmrg	  LD="${LD-ld} -melf32bmipn32"
1331300346aeSmrg	  ;;
1332300346aeSmrg	*64-bit*)
1333300346aeSmrg	  LD="${LD-ld} -melf64bmip"
1334300346aeSmrg	;;
1335300346aeSmrg      esac
1336300346aeSmrg    else
1337300346aeSmrg      case `/usr/bin/file conftest.$ac_objext` in
1338300346aeSmrg	*32-bit*)
1339300346aeSmrg	  LD="${LD-ld} -32"
1340300346aeSmrg	  ;;
1341300346aeSmrg	*N32*)
1342300346aeSmrg	  LD="${LD-ld} -n32"
1343300346aeSmrg	  ;;
1344300346aeSmrg	*64-bit*)
1345300346aeSmrg	  LD="${LD-ld} -64"
1346300346aeSmrg	  ;;
1347300346aeSmrg      esac
1348300346aeSmrg    fi
1349300346aeSmrg  fi
1350300346aeSmrg  rm -rf conftest*
1351300346aeSmrg  ;;
1352126a8a12Smrg
1353300346aeSmrgmips64*-*linux*)
1354300346aeSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1355300346aeSmrg  # options accordingly.
1356300346aeSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1357300346aeSmrg  if AC_TRY_EVAL(ac_compile); then
1358300346aeSmrg    emul=elf
1359300346aeSmrg    case `/usr/bin/file conftest.$ac_objext` in
1360300346aeSmrg      *32-bit*)
1361300346aeSmrg	emul="${emul}32"
1362300346aeSmrg	;;
1363300346aeSmrg      *64-bit*)
1364300346aeSmrg	emul="${emul}64"
1365300346aeSmrg	;;
13663c15da26Smrg    esac
1367300346aeSmrg    case `/usr/bin/file conftest.$ac_objext` in
1368300346aeSmrg      *MSB*)
1369300346aeSmrg	emul="${emul}btsmip"
1370300346aeSmrg	;;
1371300346aeSmrg      *LSB*)
1372300346aeSmrg	emul="${emul}ltsmip"
1373300346aeSmrg	;;
1374300346aeSmrg    esac
1375300346aeSmrg    case `/usr/bin/file conftest.$ac_objext` in
1376300346aeSmrg      *N32*)
1377300346aeSmrg	emul="${emul}n32"
1378300346aeSmrg	;;
1379300346aeSmrg    esac
1380300346aeSmrg    LD="${LD-ld} -m $emul"
1381300346aeSmrg  fi
1382300346aeSmrg  rm -rf conftest*
1383300346aeSmrg  ;;
1384126a8a12Smrg
1385300346aeSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1386300346aeSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1387300346aeSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1388300346aeSmrg  # options accordingly.  Note that the listed cases only cover the
1389300346aeSmrg  # situations where additional linker options are needed (such as when
1390300346aeSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1391300346aeSmrg  # vice versa); the common cases where no linker options are needed do
1392300346aeSmrg  # not appear in the list.
1393300346aeSmrg  echo 'int i;' > conftest.$ac_ext
1394300346aeSmrg  if AC_TRY_EVAL(ac_compile); then
1395300346aeSmrg    case `/usr/bin/file conftest.o` in
1396300346aeSmrg      *32-bit*)
1397300346aeSmrg	case $host in
1398300346aeSmrg	  x86_64-*kfreebsd*-gnu)
1399300346aeSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1400300346aeSmrg	    ;;
1401300346aeSmrg	  x86_64-*linux*)
1402300346aeSmrg	    case `/usr/bin/file conftest.o` in
1403300346aeSmrg	      *x86-64*)
1404300346aeSmrg		LD="${LD-ld} -m elf32_x86_64"
1405300346aeSmrg		;;
1406300346aeSmrg	      *)
1407300346aeSmrg		LD="${LD-ld} -m elf_i386"
1408300346aeSmrg		;;
1409300346aeSmrg	    esac
1410300346aeSmrg	    ;;
1411300346aeSmrg	  powerpc64le-*linux*)
1412300346aeSmrg	    LD="${LD-ld} -m elf32lppclinux"
1413300346aeSmrg	    ;;
1414300346aeSmrg	  powerpc64-*linux*)
1415300346aeSmrg	    LD="${LD-ld} -m elf32ppclinux"
1416300346aeSmrg	    ;;
1417300346aeSmrg	  s390x-*linux*)
1418300346aeSmrg	    LD="${LD-ld} -m elf_s390"
1419300346aeSmrg	    ;;
1420300346aeSmrg	  sparc64-*linux*)
1421300346aeSmrg	    LD="${LD-ld} -m elf32_sparc"
1422300346aeSmrg	    ;;
1423300346aeSmrg	esac
1424300346aeSmrg	;;
1425300346aeSmrg      *64-bit*)
1426300346aeSmrg	case $host in
1427300346aeSmrg	  x86_64-*kfreebsd*-gnu)
1428300346aeSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1429300346aeSmrg	    ;;
1430300346aeSmrg	  x86_64-*linux*)
1431300346aeSmrg	    LD="${LD-ld} -m elf_x86_64"
1432300346aeSmrg	    ;;
1433300346aeSmrg	  powerpcle-*linux*)
1434300346aeSmrg	    LD="${LD-ld} -m elf64lppc"
1435300346aeSmrg	    ;;
1436300346aeSmrg	  powerpc-*linux*)
1437300346aeSmrg	    LD="${LD-ld} -m elf64ppc"
1438300346aeSmrg	    ;;
1439300346aeSmrg	  s390*-*linux*|s390*-*tpf*)
1440300346aeSmrg	    LD="${LD-ld} -m elf64_s390"
1441300346aeSmrg	    ;;
1442300346aeSmrg	  sparc*-*linux*)
1443300346aeSmrg	    LD="${LD-ld} -m elf64_sparc"
1444300346aeSmrg	    ;;
1445300346aeSmrg	esac
1446300346aeSmrg	;;
1447300346aeSmrg    esac
1448300346aeSmrg  fi
1449300346aeSmrg  rm -rf conftest*
1450300346aeSmrg  ;;
1451300346aeSmrg
1452300346aeSmrg*-*-sco3.2v5*)
1453300346aeSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1454300346aeSmrg  SAVE_CFLAGS=$CFLAGS
1455300346aeSmrg  CFLAGS="$CFLAGS -belf"
1456300346aeSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1457300346aeSmrg    [AC_LANG_PUSH(C)
1458300346aeSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1459300346aeSmrg     AC_LANG_POP])
1460300346aeSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
1461300346aeSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1462300346aeSmrg    CFLAGS=$SAVE_CFLAGS
1463300346aeSmrg  fi
1464300346aeSmrg  ;;
1465300346aeSmrg*-*solaris*)
1466300346aeSmrg  # Find out what ABI is being produced by ac_compile, and set linker
1467300346aeSmrg  # options accordingly.
1468300346aeSmrg  echo 'int i;' > conftest.$ac_ext
1469300346aeSmrg  if AC_TRY_EVAL(ac_compile); then
1470300346aeSmrg    case `/usr/bin/file conftest.o` in
1471300346aeSmrg    *64-bit*)
1472300346aeSmrg      case $lt_cv_prog_gnu_ld in
1473300346aeSmrg      yes*)
1474300346aeSmrg        case $host in
1475300346aeSmrg        i?86-*-solaris*|x86_64-*-solaris*)
1476300346aeSmrg          LD="${LD-ld} -m elf_x86_64"
1477300346aeSmrg          ;;
1478300346aeSmrg        sparc*-*-solaris*)
1479300346aeSmrg          LD="${LD-ld} -m elf64_sparc"
1480300346aeSmrg          ;;
1481300346aeSmrg        esac
1482300346aeSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1483300346aeSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1484300346aeSmrg          LD=${LD-ld}_sol2
1485300346aeSmrg        fi
1486300346aeSmrg        ;;
1487300346aeSmrg      *)
1488300346aeSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1489300346aeSmrg	  LD="${LD-ld} -64"
1490300346aeSmrg	fi
1491300346aeSmrg	;;
1492300346aeSmrg      esac
14933c15da26Smrg      ;;
14943c15da26Smrg    esac
1495300346aeSmrg  fi
1496300346aeSmrg  rm -rf conftest*
1497300346aeSmrg  ;;
1498300346aeSmrgesac
1499126a8a12Smrg
1500300346aeSmrgneed_locks=$enable_libtool_lock
1501300346aeSmrg])# _LT_ENABLE_LOCK
1502126a8a12Smrg
1503126a8a12Smrg
1504300346aeSmrg# _LT_PROG_AR
1505300346aeSmrg# -----------
1506300346aeSmrgm4_defun([_LT_PROG_AR],
1507300346aeSmrg[AC_CHECK_TOOLS(AR, [ar], false)
1508300346aeSmrg: ${AR=ar}
1509300346aeSmrg: ${AR_FLAGS=cru}
1510300346aeSmrg_LT_DECL([], [AR], [1], [The archiver])
1511300346aeSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1512126a8a12Smrg
1513300346aeSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1514300346aeSmrg  [lt_cv_ar_at_file=no
1515300346aeSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1516300346aeSmrg     [echo conftest.$ac_objext > conftest.lst
1517300346aeSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1518300346aeSmrg      AC_TRY_EVAL([lt_ar_try])
1519300346aeSmrg      if test 0 -eq "$ac_status"; then
1520300346aeSmrg	# Ensure the archiver fails upon bogus file names.
1521300346aeSmrg	rm -f conftest.$ac_objext libconftest.a
1522300346aeSmrg	AC_TRY_EVAL([lt_ar_try])
1523300346aeSmrg	if test 0 -ne "$ac_status"; then
1524300346aeSmrg          lt_cv_ar_at_file=@
1525300346aeSmrg        fi
1526300346aeSmrg      fi
1527300346aeSmrg      rm -f conftest.* libconftest.a
1528300346aeSmrg     ])
1529300346aeSmrg  ])
1530126a8a12Smrg
1531300346aeSmrgif test no = "$lt_cv_ar_at_file"; then
1532300346aeSmrg  archiver_list_spec=
1533300346aeSmrgelse
1534300346aeSmrg  archiver_list_spec=$lt_cv_ar_at_file
1535300346aeSmrgfi
1536300346aeSmrg_LT_DECL([], [archiver_list_spec], [1],
1537300346aeSmrg  [How to feed a file listing to the archiver])
1538300346aeSmrg])# _LT_PROG_AR
1539126a8a12Smrg
1540126a8a12Smrg
1541300346aeSmrg# _LT_CMD_OLD_ARCHIVE
1542300346aeSmrg# -------------------
1543300346aeSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1544300346aeSmrg[_LT_PROG_AR
1545555991fdSmrg
1546300346aeSmrgAC_CHECK_TOOL(STRIP, strip, :)
1547300346aeSmrgtest -z "$STRIP" && STRIP=:
1548300346aeSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1549555991fdSmrg
1550300346aeSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1551300346aeSmrgtest -z "$RANLIB" && RANLIB=:
1552300346aeSmrg_LT_DECL([], [RANLIB], [1],
1553300346aeSmrg    [Commands used to install an old-style archive])
1554555991fdSmrg
1555300346aeSmrg# Determine commands to create old-style static archives.
1556300346aeSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1557300346aeSmrgold_postinstall_cmds='chmod 644 $oldlib'
1558300346aeSmrgold_postuninstall_cmds=
1559555991fdSmrg
1560300346aeSmrgif test -n "$RANLIB"; then
1561300346aeSmrg  case $host_os in
1562300346aeSmrg  bitrig* | openbsd*)
1563300346aeSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1564300346aeSmrg    ;;
1565300346aeSmrg  *)
1566300346aeSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1567300346aeSmrg    ;;
1568d656433aSmrg  esac
1569300346aeSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1570555991fdSmrgfi
1571126a8a12Smrg
1572300346aeSmrgcase $host_os in
1573300346aeSmrg  darwin*)
1574300346aeSmrg    lock_old_archive_extraction=yes ;;
1575300346aeSmrg  *)
1576300346aeSmrg    lock_old_archive_extraction=no ;;
1577300346aeSmrgesac
1578300346aeSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1579300346aeSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1580300346aeSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1581300346aeSmrg    [Commands used to build an old-style archive])
1582300346aeSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
1583300346aeSmrg    [Whether to use a lock for old archive extraction])
1584300346aeSmrg])# _LT_CMD_OLD_ARCHIVE
1585126a8a12Smrg
1586126a8a12Smrg
1587300346aeSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1588300346aeSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1589300346aeSmrg# ----------------------------------------------------------------
1590300346aeSmrg# Check whether the given compiler option works
1591300346aeSmrgAC_DEFUN([_LT_COMPILER_OPTION],
15923c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1593300346aeSmrgm4_require([_LT_DECL_SED])dnl
1594300346aeSmrgAC_CACHE_CHECK([$1], [$2],
1595300346aeSmrg  [$2=no
1596300346aeSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1597300346aeSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1598300346aeSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1599300346aeSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1600300346aeSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1601300346aeSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1602300346aeSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1603300346aeSmrg   # The option is referenced via a variable to avoid confusing sed.
1604300346aeSmrg   lt_compile=`echo "$ac_compile" | $SED \
1605300346aeSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1606300346aeSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1607300346aeSmrg   -e 's:$: $lt_compiler_flag:'`
1608300346aeSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1609300346aeSmrg   (eval "$lt_compile" 2>conftest.err)
1610300346aeSmrg   ac_status=$?
1611300346aeSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1612300346aeSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1613300346aeSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1614300346aeSmrg     # The compiler can only warn and ignore the option if not recognized
1615300346aeSmrg     # So say no if there are warnings other than the usual output.
1616300346aeSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1617300346aeSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1618300346aeSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1619300346aeSmrg       $2=yes
1620300346aeSmrg     fi
1621300346aeSmrg   fi
1622300346aeSmrg   $RM conftest*
1623300346aeSmrg])
1624126a8a12Smrg
1625300346aeSmrgif test yes = "[$]$2"; then
1626300346aeSmrg    m4_if([$5], , :, [$5])
1627300346aeSmrgelse
1628300346aeSmrg    m4_if([$6], , :, [$6])
1629300346aeSmrgfi
1630300346aeSmrg])# _LT_COMPILER_OPTION
1631d656433aSmrg
1632300346aeSmrg# Old name:
1633300346aeSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1634300346aeSmrgdnl aclocal-1.4 backwards compatibility:
1635300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1636d656433aSmrg
1637126a8a12Smrg
1638300346aeSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1639300346aeSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1640300346aeSmrg# ----------------------------------------------------
1641300346aeSmrg# Check whether the given linker option works
1642300346aeSmrgAC_DEFUN([_LT_LINKER_OPTION],
1643300346aeSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1644300346aeSmrgm4_require([_LT_DECL_SED])dnl
1645300346aeSmrgAC_CACHE_CHECK([$1], [$2],
1646300346aeSmrg  [$2=no
1647300346aeSmrg   save_LDFLAGS=$LDFLAGS
1648300346aeSmrg   LDFLAGS="$LDFLAGS $3"
1649300346aeSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1650300346aeSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1651300346aeSmrg     # The linker can only warn and ignore the option if not recognized
1652300346aeSmrg     # So say no if there are warnings
1653300346aeSmrg     if test -s conftest.err; then
1654300346aeSmrg       # Append any errors to the config.log.
1655300346aeSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1656300346aeSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1657300346aeSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1658300346aeSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
1659300346aeSmrg         $2=yes
1660300346aeSmrg       fi
1661300346aeSmrg     else
1662300346aeSmrg       $2=yes
1663300346aeSmrg     fi
1664300346aeSmrg   fi
1665300346aeSmrg   $RM -r conftest*
1666300346aeSmrg   LDFLAGS=$save_LDFLAGS
1667300346aeSmrg])
1668126a8a12Smrg
1669300346aeSmrgif test yes = "[$]$2"; then
1670300346aeSmrg    m4_if([$4], , :, [$4])
1671300346aeSmrgelse
1672300346aeSmrg    m4_if([$5], , :, [$5])
16733c15da26Smrgfi
1674300346aeSmrg])# _LT_LINKER_OPTION
1675126a8a12Smrg
1676300346aeSmrg# Old name:
1677300346aeSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1678300346aeSmrgdnl aclocal-1.4 backwards compatibility:
1679300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1680126a8a12Smrg
1681126a8a12Smrg
1682300346aeSmrg# LT_CMD_MAX_LEN
1683300346aeSmrg#---------------
1684300346aeSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1685300346aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1686300346aeSmrg# find the maximum length of command line arguments
1687300346aeSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1688300346aeSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1689300346aeSmrg  i=0
1690300346aeSmrg  teststring=ABCD
1691126a8a12Smrg
1692300346aeSmrg  case $build_os in
1693300346aeSmrg  msdosdjgpp*)
1694300346aeSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1695300346aeSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1696300346aeSmrg    # during glob expansion).  Even if it were fixed, the result of this
1697300346aeSmrg    # check would be larger than it should be.
1698300346aeSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1699300346aeSmrg    ;;
1700d656433aSmrg
1701300346aeSmrg  gnu*)
1702300346aeSmrg    # Under GNU Hurd, this test is not required because there is
1703300346aeSmrg    # no limit to the length of command line arguments.
1704300346aeSmrg    # Libtool will interpret -1 as no limit whatsoever
1705300346aeSmrg    lt_cv_sys_max_cmd_len=-1;
1706300346aeSmrg    ;;
1707126a8a12Smrg
1708300346aeSmrg  cygwin* | mingw* | cegcc*)
1709300346aeSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1710300346aeSmrg    # about 5 minutes as the teststring grows exponentially.
1711300346aeSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1712300346aeSmrg    # you end up with a "frozen" computer, even though with patience
1713300346aeSmrg    # the test eventually succeeds (with a max line length of 256k).
1714300346aeSmrg    # Instead, let's just punt: use the minimum linelength reported by
1715300346aeSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1716300346aeSmrg    lt_cv_sys_max_cmd_len=8192;
1717300346aeSmrg    ;;
1718d656433aSmrg
1719300346aeSmrg  mint*)
1720300346aeSmrg    # On MiNT this can take a long time and run out of memory.
1721300346aeSmrg    lt_cv_sys_max_cmd_len=8192;
1722300346aeSmrg    ;;
1723d656433aSmrg
1724300346aeSmrg  amigaos*)
1725300346aeSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
1726300346aeSmrg    # So we just punt and use a minimum line length of 8192.
1727300346aeSmrg    lt_cv_sys_max_cmd_len=8192;
1728300346aeSmrg    ;;
1729d656433aSmrg
1730300346aeSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1731300346aeSmrg    # This has been around since 386BSD, at least.  Likely further.
1732300346aeSmrg    if test -x /sbin/sysctl; then
1733300346aeSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1734300346aeSmrg    elif test -x /usr/sbin/sysctl; then
1735300346aeSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1736300346aeSmrg    else
1737300346aeSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1738300346aeSmrg    fi
1739300346aeSmrg    # And add a safety zone
1740300346aeSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1741300346aeSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1742300346aeSmrg    ;;
1743d656433aSmrg
1744300346aeSmrg  interix*)
1745300346aeSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1746300346aeSmrg    lt_cv_sys_max_cmd_len=196608
1747300346aeSmrg    ;;
1748126a8a12Smrg
1749300346aeSmrg  os2*)
1750300346aeSmrg    # The test takes a long time on OS/2.
1751300346aeSmrg    lt_cv_sys_max_cmd_len=8192
1752300346aeSmrg    ;;
1753126a8a12Smrg
1754300346aeSmrg  osf*)
1755300346aeSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1756300346aeSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1757300346aeSmrg    # nice to cause kernel panics so lets avoid the loop below.
1758300346aeSmrg    # First set a reasonable default.
1759300346aeSmrg    lt_cv_sys_max_cmd_len=16384
1760300346aeSmrg    #
1761300346aeSmrg    if test -x /sbin/sysconfig; then
1762300346aeSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1763300346aeSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1764300346aeSmrg      esac
1765300346aeSmrg    fi
1766300346aeSmrg    ;;
1767300346aeSmrg  sco3.2v5*)
1768300346aeSmrg    lt_cv_sys_max_cmd_len=102400
1769300346aeSmrg    ;;
1770300346aeSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
1771300346aeSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1772300346aeSmrg    if test -n "$kargmax"; then
1773300346aeSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1774300346aeSmrg    else
1775300346aeSmrg      lt_cv_sys_max_cmd_len=32768
1776300346aeSmrg    fi
1777300346aeSmrg    ;;
1778300346aeSmrg  *)
1779300346aeSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1780300346aeSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1781300346aeSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1782300346aeSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1783300346aeSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1784300346aeSmrg    else
1785300346aeSmrg      # Make teststring a little bigger before we do anything with it.
1786300346aeSmrg      # a 1K string should be a reasonable start.
1787300346aeSmrg      for i in 1 2 3 4 5 6 7 8; do
1788300346aeSmrg        teststring=$teststring$teststring
1789300346aeSmrg      done
1790300346aeSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1791300346aeSmrg      # If test is not a shell built-in, we'll probably end up computing a
1792300346aeSmrg      # maximum length that is only half of the actual maximum length, but
1793300346aeSmrg      # we can't tell.
1794300346aeSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1795300346aeSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1796300346aeSmrg	      test 17 != "$i" # 1/2 MB should be enough
1797300346aeSmrg      do
1798300346aeSmrg        i=`expr $i + 1`
1799300346aeSmrg        teststring=$teststring$teststring
1800300346aeSmrg      done
1801300346aeSmrg      # Only check the string length outside the loop.
1802300346aeSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1803300346aeSmrg      teststring=
1804300346aeSmrg      # Add a significant safety factor because C++ compilers can tack on
1805300346aeSmrg      # massive amounts of additional arguments before passing them to the
1806300346aeSmrg      # linker.  It appears as though 1/2 is a usable value.
1807300346aeSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1808300346aeSmrg    fi
1809300346aeSmrg    ;;
1810300346aeSmrg  esac
1811300346aeSmrg])
1812300346aeSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
1813300346aeSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1814300346aeSmrgelse
1815300346aeSmrg  AC_MSG_RESULT(none)
18160a6b08f8Smrgfi
1817300346aeSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1818300346aeSmrg_LT_DECL([], [max_cmd_len], [0],
1819300346aeSmrg    [What is the maximum length of a command?])
1820300346aeSmrg])# LT_CMD_MAX_LEN
18210a6b08f8Smrg
1822300346aeSmrg# Old name:
1823300346aeSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1824300346aeSmrgdnl aclocal-1.4 backwards compatibility:
1825300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
18260a6b08f8Smrg
1827126a8a12Smrg
1828300346aeSmrg# _LT_HEADER_DLFCN
1829300346aeSmrg# ----------------
1830300346aeSmrgm4_defun([_LT_HEADER_DLFCN],
1831300346aeSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1832300346aeSmrg])# _LT_HEADER_DLFCN
1833d656433aSmrg
1834d656433aSmrg
1835300346aeSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1836300346aeSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1837300346aeSmrg# ----------------------------------------------------------------
1838300346aeSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1839300346aeSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1840300346aeSmrgif test yes = "$cross_compiling"; then :
1841300346aeSmrg  [$4]
1842300346aeSmrgelse
1843300346aeSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1844300346aeSmrg  lt_status=$lt_dlunknown
1845300346aeSmrg  cat > conftest.$ac_ext <<_LT_EOF
1846300346aeSmrg[#line $LINENO "configure"
1847300346aeSmrg#include "confdefs.h"
1848126a8a12Smrg
1849300346aeSmrg#if HAVE_DLFCN_H
1850300346aeSmrg#include <dlfcn.h>
1851300346aeSmrg#endif
18520a6b08f8Smrg
1853300346aeSmrg#include <stdio.h>
1854126a8a12Smrg
1855300346aeSmrg#ifdef RTLD_GLOBAL
1856300346aeSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1857300346aeSmrg#else
1858300346aeSmrg#  ifdef DL_GLOBAL
1859300346aeSmrg#    define LT_DLGLOBAL		DL_GLOBAL
1860300346aeSmrg#  else
1861300346aeSmrg#    define LT_DLGLOBAL		0
1862300346aeSmrg#  endif
1863300346aeSmrg#endif
1864126a8a12Smrg
1865300346aeSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1866300346aeSmrg   find out it does not work in some platform. */
1867300346aeSmrg#ifndef LT_DLLAZY_OR_NOW
1868300346aeSmrg#  ifdef RTLD_LAZY
1869300346aeSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1870300346aeSmrg#  else
1871300346aeSmrg#    ifdef DL_LAZY
1872300346aeSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1873300346aeSmrg#    else
1874300346aeSmrg#      ifdef RTLD_NOW
1875300346aeSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1876300346aeSmrg#      else
1877300346aeSmrg#        ifdef DL_NOW
1878300346aeSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1879300346aeSmrg#        else
1880300346aeSmrg#          define LT_DLLAZY_OR_NOW	0
1881300346aeSmrg#        endif
1882300346aeSmrg#      endif
1883300346aeSmrg#    endif
1884300346aeSmrg#  endif
1885300346aeSmrg#endif
1886126a8a12Smrg
1887300346aeSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
1888300346aeSmrg   correspondingly for the symbols needed.  */
1889300346aeSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1890300346aeSmrgint fnord () __attribute__((visibility("default")));
1891300346aeSmrg#endif
1892126a8a12Smrg
1893300346aeSmrgint fnord () { return 42; }
1894300346aeSmrgint main ()
1895300346aeSmrg{
1896300346aeSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1897300346aeSmrg  int status = $lt_dlunknown;
1898126a8a12Smrg
1899300346aeSmrg  if (self)
1900300346aeSmrg    {
1901300346aeSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1902300346aeSmrg      else
1903300346aeSmrg        {
1904300346aeSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1905300346aeSmrg          else puts (dlerror ());
1906300346aeSmrg	}
1907300346aeSmrg      /* dlclose (self); */
1908300346aeSmrg    }
1909300346aeSmrg  else
1910300346aeSmrg    puts (dlerror ());
1911126a8a12Smrg
1912300346aeSmrg  return status;
1913300346aeSmrg}]
1914300346aeSmrg_LT_EOF
1915300346aeSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1916300346aeSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1917300346aeSmrg    lt_status=$?
1918300346aeSmrg    case x$lt_status in
1919300346aeSmrg      x$lt_dlno_uscore) $1 ;;
1920300346aeSmrg      x$lt_dlneed_uscore) $2 ;;
1921300346aeSmrg      x$lt_dlunknown|x*) $3 ;;
1922300346aeSmrg    esac
1923300346aeSmrg  else :
1924300346aeSmrg    # compilation failed
1925300346aeSmrg    $3
1926300346aeSmrg  fi
1927300346aeSmrgfi
1928300346aeSmrgrm -fr conftest*
1929300346aeSmrg])# _LT_TRY_DLOPEN_SELF
1930126a8a12Smrg
1931126a8a12Smrg
1932300346aeSmrg# LT_SYS_DLOPEN_SELF
1933300346aeSmrg# ------------------
1934300346aeSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1935300346aeSmrg[m4_require([_LT_HEADER_DLFCN])dnl
1936300346aeSmrgif test yes != "$enable_dlopen"; then
1937300346aeSmrg  enable_dlopen=unknown
1938300346aeSmrg  enable_dlopen_self=unknown
1939300346aeSmrg  enable_dlopen_self_static=unknown
1940300346aeSmrgelse
1941300346aeSmrg  lt_cv_dlopen=no
1942300346aeSmrg  lt_cv_dlopen_libs=
1943126a8a12Smrg
19443c15da26Smrg  case $host_os in
1945300346aeSmrg  beos*)
1946300346aeSmrg    lt_cv_dlopen=load_add_on
1947300346aeSmrg    lt_cv_dlopen_libs=
1948300346aeSmrg    lt_cv_dlopen_self=yes
1949300346aeSmrg    ;;
1950126a8a12Smrg
1951300346aeSmrg  mingw* | pw32* | cegcc*)
1952300346aeSmrg    lt_cv_dlopen=LoadLibrary
1953300346aeSmrg    lt_cv_dlopen_libs=
1954300346aeSmrg    ;;
19550a6b08f8Smrg
1956300346aeSmrg  cygwin*)
1957300346aeSmrg    lt_cv_dlopen=dlopen
1958300346aeSmrg    lt_cv_dlopen_libs=
1959300346aeSmrg    ;;
19600a6b08f8Smrg
1961300346aeSmrg  darwin*)
1962300346aeSmrg    # if libdl is installed we need to link against it
1963300346aeSmrg    AC_CHECK_LIB([dl], [dlopen],
1964300346aeSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1965300346aeSmrg    lt_cv_dlopen=dyld
1966300346aeSmrg    lt_cv_dlopen_libs=
1967300346aeSmrg    lt_cv_dlopen_self=yes
19683c15da26Smrg    ])
19693c15da26Smrg    ;;
1970126a8a12Smrg
1971300346aeSmrg  tpf*)
1972300346aeSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
1973300346aeSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1974300346aeSmrg    lt_cv_dlopen=dlopen
1975300346aeSmrg    lt_cv_dlopen_libs=
1976300346aeSmrg    lt_cv_dlopen_self=no
1977300346aeSmrg    ;;
1978126a8a12Smrg
1979300346aeSmrg  *)
1980300346aeSmrg    AC_CHECK_FUNC([shl_load],
1981300346aeSmrg	  [lt_cv_dlopen=shl_load],
1982300346aeSmrg      [AC_CHECK_LIB([dld], [shl_load],
1983300346aeSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1984300346aeSmrg	[AC_CHECK_FUNC([dlopen],
1985300346aeSmrg	      [lt_cv_dlopen=dlopen],
1986300346aeSmrg	  [AC_CHECK_LIB([dl], [dlopen],
1987300346aeSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1988300346aeSmrg	    [AC_CHECK_LIB([svld], [dlopen],
1989300346aeSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1990300346aeSmrg	      [AC_CHECK_LIB([dld], [dld_link],
1991300346aeSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1992300346aeSmrg	      ])
1993300346aeSmrg	    ])
1994300346aeSmrg	  ])
1995300346aeSmrg	])
1996300346aeSmrg      ])
1997300346aeSmrg    ;;
19983c15da26Smrg  esac
1999126a8a12Smrg
2000300346aeSmrg  if test no = "$lt_cv_dlopen"; then
2001300346aeSmrg    enable_dlopen=no
2002300346aeSmrg  else
2003300346aeSmrg    enable_dlopen=yes
20043c15da26Smrg  fi
2005126a8a12Smrg
2006300346aeSmrg  case $lt_cv_dlopen in
2007300346aeSmrg  dlopen)
2008300346aeSmrg    save_CPPFLAGS=$CPPFLAGS
2009300346aeSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2010126a8a12Smrg
2011300346aeSmrg    save_LDFLAGS=$LDFLAGS
2012300346aeSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2013126a8a12Smrg
2014300346aeSmrg    save_LIBS=$LIBS
2015300346aeSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2016126a8a12Smrg
2017300346aeSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2018300346aeSmrg	  lt_cv_dlopen_self, [dnl
2019300346aeSmrg	  _LT_TRY_DLOPEN_SELF(
2020300346aeSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2021300346aeSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2022300346aeSmrg    ])
2023555991fdSmrg
2024300346aeSmrg    if test yes = "$lt_cv_dlopen_self"; then
2025300346aeSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2026300346aeSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2027300346aeSmrg	  lt_cv_dlopen_self_static, [dnl
2028300346aeSmrg	  _LT_TRY_DLOPEN_SELF(
2029300346aeSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2030300346aeSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2031300346aeSmrg      ])
2032300346aeSmrg    fi
2033555991fdSmrg
2034300346aeSmrg    CPPFLAGS=$save_CPPFLAGS
2035300346aeSmrg    LDFLAGS=$save_LDFLAGS
2036300346aeSmrg    LIBS=$save_LIBS
2037300346aeSmrg    ;;
2038300346aeSmrg  esac
2039555991fdSmrg
2040300346aeSmrg  case $lt_cv_dlopen_self in
2041300346aeSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2042300346aeSmrg  *) enable_dlopen_self=unknown ;;
2043300346aeSmrg  esac
2044126a8a12Smrg
2045300346aeSmrg  case $lt_cv_dlopen_self_static in
2046300346aeSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2047300346aeSmrg  *) enable_dlopen_self_static=unknown ;;
2048300346aeSmrg  esac
2049300346aeSmrgfi
2050300346aeSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2051300346aeSmrg	 [Whether dlopen is supported])
2052300346aeSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2053300346aeSmrg	 [Whether dlopen of programs is supported])
2054300346aeSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2055300346aeSmrg	 [Whether dlopen of statically linked programs is supported])
2056300346aeSmrg])# LT_SYS_DLOPEN_SELF
2057126a8a12Smrg
2058300346aeSmrg# Old name:
2059300346aeSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2060300346aeSmrgdnl aclocal-1.4 backwards compatibility:
2061300346aeSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2062126a8a12Smrg
2063126a8a12Smrg
2064300346aeSmrg# _LT_COMPILER_C_O([TAGNAME])
2065300346aeSmrg# ---------------------------
2066300346aeSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
2067300346aeSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2068300346aeSmrgm4_defun([_LT_COMPILER_C_O],
2069300346aeSmrg[m4_require([_LT_DECL_SED])dnl
2070300346aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2071300346aeSmrgm4_require([_LT_TAG_COMPILER])dnl
2072300346aeSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2073300346aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2074300346aeSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2075300346aeSmrg   $RM -r conftest 2>/dev/null
2076300346aeSmrg   mkdir conftest
2077300346aeSmrg   cd conftest
2078300346aeSmrg   mkdir out
2079300346aeSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
20803c15da26Smrg
2081300346aeSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2082300346aeSmrg   # Insert the option either (1) after the last *FLAGS variable, or
2083300346aeSmrg   # (2) before a word containing "conftest.", or (3) at the end.
2084300346aeSmrg   # Note that $ac_compile itself does not contain backslashes and begins
2085300346aeSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2086300346aeSmrg   lt_compile=`echo "$ac_compile" | $SED \
2087300346aeSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2088300346aeSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2089300346aeSmrg   -e 's:$: $lt_compiler_flag:'`
2090300346aeSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2091300346aeSmrg   (eval "$lt_compile" 2>out/conftest.err)
2092300346aeSmrg   ac_status=$?
2093300346aeSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2094300346aeSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2095300346aeSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2096300346aeSmrg   then
2097300346aeSmrg     # The compiler can only warn and ignore the option if not recognized
2098300346aeSmrg     # So say no if there are warnings
2099300346aeSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2100300346aeSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2101300346aeSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2102300346aeSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2103300346aeSmrg     fi
21043c15da26Smrg   fi
2105300346aeSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2106300346aeSmrg   $RM conftest*
2107300346aeSmrg   # SGI C++ compiler will create directory out/ii_files/ for
2108300346aeSmrg   # template instantiation
2109300346aeSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2110300346aeSmrg   $RM out/* && rmdir out
2111300346aeSmrg   cd ..
2112300346aeSmrg   $RM -r conftest
2113300346aeSmrg   $RM conftest*
2114300346aeSmrg])
2115300346aeSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2116300346aeSmrg	[Does compiler simultaneously support -c and -o options?])
2117300346aeSmrg])# _LT_COMPILER_C_O
2118126a8a12Smrg
2119126a8a12Smrg
2120300346aeSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2121300346aeSmrg# ----------------------------------
2122300346aeSmrg# Check to see if we can do hard links to lock some files if needed
2123300346aeSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2124300346aeSmrg[m4_require([_LT_ENABLE_LOCK])dnl
2125300346aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2126300346aeSmrg_LT_COMPILER_C_O([$1])
2127126a8a12Smrg
2128300346aeSmrghard_links=nottested
2129300346aeSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2130300346aeSmrg  # do not overwrite the value of need_locks provided by the user
2131300346aeSmrg  AC_MSG_CHECKING([if we can lock with hard links])
2132300346aeSmrg  hard_links=yes
2133300346aeSmrg  $RM conftest*
2134300346aeSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2135300346aeSmrg  touch conftest.a
2136300346aeSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2137300346aeSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2138300346aeSmrg  AC_MSG_RESULT([$hard_links])
2139300346aeSmrg  if test no = "$hard_links"; then
2140300346aeSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2141300346aeSmrg    need_locks=warn
21423c15da26Smrg  fi
2143300346aeSmrgelse
2144300346aeSmrg  need_locks=no
2145300346aeSmrgfi
2146300346aeSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2147300346aeSmrg])# _LT_COMPILER_FILE_LOCKS
21483c15da26Smrg
2149126a8a12Smrg
2150300346aeSmrg# _LT_CHECK_OBJDIR
2151300346aeSmrg# ----------------
2152300346aeSmrgm4_defun([_LT_CHECK_OBJDIR],
2153300346aeSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2154300346aeSmrg[rm -f .libs 2>/dev/null
2155300346aeSmrgmkdir .libs 2>/dev/null
2156300346aeSmrgif test -d .libs; then
2157300346aeSmrg  lt_cv_objdir=.libs
21583c15da26Smrgelse
2159300346aeSmrg  # MS-DOS does not allow filenames that begin with a dot.
2160300346aeSmrg  lt_cv_objdir=_libs
2161555991fdSmrgfi
2162300346aeSmrgrmdir .libs 2>/dev/null])
2163300346aeSmrgobjdir=$lt_cv_objdir
2164300346aeSmrg_LT_DECL([], [objdir], [0],
2165300346aeSmrg         [The name of the directory that contains temporary libtool files])dnl
2166300346aeSmrgm4_pattern_allow([LT_OBJDIR])dnl
2167300346aeSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2168300346aeSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2169300346aeSmrg])# _LT_CHECK_OBJDIR
2170126a8a12Smrg
2171126a8a12Smrg
2172300346aeSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2173300346aeSmrg# --------------------------------------
2174300346aeSmrg# Check hardcoding attributes.
2175300346aeSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2176300346aeSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2177300346aeSmrg_LT_TAGVAR(hardcode_action, $1)=
2178300346aeSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2179300346aeSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2180300346aeSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2181126a8a12Smrg
2182300346aeSmrg  # We can hardcode non-existent directories.
2183300346aeSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2184300346aeSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2185300346aeSmrg     # have to relink, otherwise we might link with an installed library
2186300346aeSmrg     # when we should be linking with a yet-to-be-installed one
2187300346aeSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2188300346aeSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2189300346aeSmrg    # Linking always hardcodes the temporary library directory.
2190300346aeSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2191300346aeSmrg  else
2192300346aeSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2193300346aeSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2194300346aeSmrg  fi
2195300346aeSmrgelse
2196300346aeSmrg  # We cannot hardcode anything, or else we can only hardcode existing
2197300346aeSmrg  # directories.
2198300346aeSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2199300346aeSmrgfi
2200300346aeSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2201126a8a12Smrg
2202300346aeSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2203300346aeSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2204300346aeSmrg  # Fast installation is not supported
2205300346aeSmrg  enable_fast_install=no
2206300346aeSmrgelif test yes = "$shlibpath_overrides_runpath" ||
2207300346aeSmrg     test no = "$enable_shared"; then
2208300346aeSmrg  # Fast installation is not necessary
2209300346aeSmrg  enable_fast_install=needless
2210300346aeSmrgfi
2211300346aeSmrg_LT_TAGDECL([], [hardcode_action], [0],
2212300346aeSmrg    [How to hardcode a shared library path into an executable])
2213300346aeSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2214126a8a12Smrg
2215126a8a12Smrg
2216300346aeSmrg# _LT_CMD_STRIPLIB
2217300346aeSmrg# ----------------
2218300346aeSmrgm4_defun([_LT_CMD_STRIPLIB],
2219300346aeSmrg[m4_require([_LT_DECL_EGREP])
2220300346aeSmrgstriplib=
2221300346aeSmrgold_striplib=
2222300346aeSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2223300346aeSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2224300346aeSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2225300346aeSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2226300346aeSmrg  AC_MSG_RESULT([yes])
2227300346aeSmrgelse
2228300346aeSmrg# FIXME - insert some real tests, host_os isn't really good enough
2229555991fdSmrg  case $host_os in
2230300346aeSmrg  darwin*)
2231300346aeSmrg    if test -n "$STRIP"; then
2232300346aeSmrg      striplib="$STRIP -x"
2233300346aeSmrg      old_striplib="$STRIP -S"
2234300346aeSmrg      AC_MSG_RESULT([yes])
2235300346aeSmrg    else
2236300346aeSmrg      AC_MSG_RESULT([no])
2237300346aeSmrg    fi
2238300346aeSmrg    ;;
2239300346aeSmrg  *)
2240300346aeSmrg    AC_MSG_RESULT([no])
2241555991fdSmrg    ;;
2242555991fdSmrg  esac
22433c15da26Smrgfi
2244300346aeSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2245300346aeSmrg_LT_DECL([], [striplib], [1])
2246300346aeSmrg])# _LT_CMD_STRIPLIB
2247126a8a12Smrg
2248126a8a12Smrg
2249300346aeSmrg# _LT_PREPARE_MUNGE_PATH_LIST
2250300346aeSmrg# ---------------------------
2251300346aeSmrg# Make sure func_munge_path_list() is defined correctly.
2252300346aeSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2253300346aeSmrg[[# func_munge_path_list VARIABLE PATH
2254300346aeSmrg# -----------------------------------
2255300346aeSmrg# VARIABLE is name of variable containing _space_ separated list of
2256300346aeSmrg# directories to be munged by the contents of PATH, which is string
2257300346aeSmrg# having a format:
2258300346aeSmrg# "DIR[:DIR]:"
2259300346aeSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
2260300346aeSmrg# ":DIR[:DIR]"
2261300346aeSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
2262300346aeSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
2263300346aeSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2264300346aeSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
2265300346aeSmrg# "DIR[:DIR]"
2266300346aeSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
2267300346aeSmrgfunc_munge_path_list ()
2268300346aeSmrg{
2269300346aeSmrg    case x@S|@2 in
2270300346aeSmrg    x)
2271300346aeSmrg        ;;
2272300346aeSmrg    *:)
2273300346aeSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2274300346aeSmrg        ;;
2275300346aeSmrg    x:*)
2276300346aeSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2277300346aeSmrg        ;;
2278300346aeSmrg    *::*)
2279300346aeSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2280300346aeSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2281300346aeSmrg        ;;
2282300346aeSmrg    *)
2283300346aeSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2284300346aeSmrg        ;;
2285300346aeSmrg    esac
2286300346aeSmrg}
2287300346aeSmrg]])# _LT_PREPARE_PATH_LIST
2288126a8a12Smrg
2289126a8a12Smrg
2290300346aeSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2291300346aeSmrg# -----------------------------
2292300346aeSmrg# PORTME Fill in your ld.so characteristics
2293300346aeSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2294300346aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2295300346aeSmrgm4_require([_LT_DECL_EGREP])dnl
2296300346aeSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2297300346aeSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2298300346aeSmrgm4_require([_LT_DECL_SED])dnl
2299300346aeSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2300300346aeSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2301300346aeSmrgAC_MSG_CHECKING([dynamic linker characteristics])
2302300346aeSmrgm4_if([$1],
2303300346aeSmrg	[], [
2304300346aeSmrgif test yes = "$GCC"; then
2305300346aeSmrg  case $host_os in
2306300346aeSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2307300346aeSmrg    *) lt_awk_arg='/^libraries:/' ;;
2308300346aeSmrg  esac
2309300346aeSmrg  case $host_os in
2310300346aeSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2311300346aeSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2312300346aeSmrg  esac
2313300346aeSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2314300346aeSmrg  case $lt_search_path_spec in
2315300346aeSmrg  *\;*)
2316300346aeSmrg    # if the path contains ";" then we assume it to be the separator
2317300346aeSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
2318300346aeSmrg    # assumed that no part of a normal pathname contains ";" but that should
2319300346aeSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
2320300346aeSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2321300346aeSmrg    ;;
2322300346aeSmrg  *)
2323300346aeSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2324300346aeSmrg    ;;
2325300346aeSmrg  esac
2326300346aeSmrg  # Ok, now we have the path, separated by spaces, we can step through it
2327300346aeSmrg  # and add multilib dir if necessary...
2328300346aeSmrg  lt_tmp_lt_search_path_spec=
2329300346aeSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2330300346aeSmrg  # ...but if some path component already ends with the multilib dir we assume
2331300346aeSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2332300346aeSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2333300346aeSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2334300346aeSmrg    lt_multi_os_dir=
2335300346aeSmrg    ;;
2336300346aeSmrg  esac
2337300346aeSmrg  for lt_sys_path in $lt_search_path_spec; do
2338300346aeSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2339300346aeSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2340300346aeSmrg    elif test -n "$lt_multi_os_dir"; then
2341300346aeSmrg      test -d "$lt_sys_path" && \
2342300346aeSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2343300346aeSmrg    fi
2344300346aeSmrg  done
2345300346aeSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2346300346aeSmrgBEGIN {RS = " "; FS = "/|\n";} {
2347300346aeSmrg  lt_foo = "";
2348300346aeSmrg  lt_count = 0;
2349300346aeSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2350300346aeSmrg    if ($lt_i != "" && $lt_i != ".") {
2351300346aeSmrg      if ($lt_i == "..") {
2352300346aeSmrg        lt_count++;
2353300346aeSmrg      } else {
2354300346aeSmrg        if (lt_count == 0) {
2355300346aeSmrg          lt_foo = "/" $lt_i lt_foo;
2356300346aeSmrg        } else {
2357300346aeSmrg          lt_count--;
2358300346aeSmrg        }
2359300346aeSmrg      }
2360300346aeSmrg    }
2361300346aeSmrg  }
2362300346aeSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2363300346aeSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2364300346aeSmrg}'`
2365300346aeSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2366300346aeSmrg  # for these hosts.
2367300346aeSmrg  case $host_os in
2368300346aeSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2369300346aeSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2370300346aeSmrg  esac
2371300346aeSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
23723c15da26Smrgelse
2373300346aeSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2374300346aeSmrgfi])
2375300346aeSmrglibrary_names_spec=
2376300346aeSmrglibname_spec='lib$name'
2377300346aeSmrgsoname_spec=
2378300346aeSmrgshrext_cmds=.so
2379300346aeSmrgpostinstall_cmds=
2380300346aeSmrgpostuninstall_cmds=
2381300346aeSmrgfinish_cmds=
2382300346aeSmrgfinish_eval=
2383300346aeSmrgshlibpath_var=
2384300346aeSmrgshlibpath_overrides_runpath=unknown
2385300346aeSmrgversion_type=none
2386300346aeSmrgdynamic_linker="$host_os ld.so"
2387300346aeSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2388300346aeSmrgneed_lib_prefix=unknown
2389300346aeSmrghardcode_into_libs=no
2390126a8a12Smrg
2391300346aeSmrg# when you set need_version to no, make sure it does not cause -set_version
2392300346aeSmrg# flags to be left without arguments
2393300346aeSmrgneed_version=unknown
2394126a8a12Smrg
2395300346aeSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2396300346aeSmrg[User-defined run-time library search path.])
2397126a8a12Smrg
2398300346aeSmrgcase $host_os in
2399300346aeSmrgaix3*)
2400300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2401300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2402300346aeSmrg  shlibpath_var=LIBPATH
2403126a8a12Smrg
2404300346aeSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
2405300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2406300346aeSmrg  ;;
2407126a8a12Smrg
2408300346aeSmrgaix[[4-9]]*)
2409300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2410300346aeSmrg  need_lib_prefix=no
2411300346aeSmrg  need_version=no
2412300346aeSmrg  hardcode_into_libs=yes
2413300346aeSmrg  if test ia64 = "$host_cpu"; then
2414300346aeSmrg    # AIX 5 supports IA64
2415300346aeSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2416300346aeSmrg    shlibpath_var=LD_LIBRARY_PATH
2417300346aeSmrg  else
2418300346aeSmrg    # With GCC up to 2.95.x, collect2 would create an import file
2419300346aeSmrg    # for dependence libraries.  The import file would start with
2420300346aeSmrg    # the line '#! .'.  This would cause the generated library to
2421300346aeSmrg    # depend on '.', always an invalid library.  This was fixed in
2422300346aeSmrg    # development snapshots of GCC prior to 3.0.
2423300346aeSmrg    case $host_os in
2424300346aeSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2425300346aeSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2426300346aeSmrg	   echo ' yes '
2427300346aeSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2428300346aeSmrg	:
2429300346aeSmrg      else
2430300346aeSmrg	can_build_shared=no
2431300346aeSmrg      fi
2432300346aeSmrg      ;;
2433300346aeSmrg    esac
2434300346aeSmrg    # Using Import Files as archive members, it is possible to support
2435300346aeSmrg    # filename-based versioning of shared library archives on AIX. While
2436300346aeSmrg    # this would work for both with and without runtime linking, it will
2437300346aeSmrg    # prevent static linking of such archives. So we do filename-based
2438300346aeSmrg    # shared library versioning with .so extension only, which is used
2439300346aeSmrg    # when both runtime linking and shared linking is enabled.
2440300346aeSmrg    # Unfortunately, runtime linking may impact performance, so we do
2441300346aeSmrg    # not want this to be the default eventually. Also, we use the
2442300346aeSmrg    # versioned .so libs for executables only if there is the -brtl
2443300346aeSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2444300346aeSmrg    # To allow for filename-based versioning support, we need to create
2445300346aeSmrg    # libNAME.so.V as an archive file, containing:
2446300346aeSmrg    # *) an Import File, referring to the versioned filename of the
2447300346aeSmrg    #    archive as well as the shared archive member, telling the
2448300346aeSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
2449300346aeSmrg    #    list of exported symbols of that shared object, eventually
2450300346aeSmrg    #    decorated with the 'weak' keyword
2451300346aeSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2452300346aeSmrg    #    it being seen by the linker.
2453300346aeSmrg    # At run time we better use the real file rather than another symlink,
2454300346aeSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2455300346aeSmrg
2456300346aeSmrg    case $with_aix_soname,$aix_use_runtimelinking in
2457300346aeSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2458300346aeSmrg    # soname into executable. Probably we can add versioning support to
2459300346aeSmrg    # collect2, so additional links can be useful in future.
2460300346aeSmrg    aix,yes) # traditional libtool
2461300346aeSmrg      dynamic_linker='AIX unversionable lib.so'
2462300346aeSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2463300346aeSmrg      # instead of lib<name>.a to let people know that these are not
2464300346aeSmrg      # typical AIX shared libraries.
2465300346aeSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2466300346aeSmrg      ;;
2467300346aeSmrg    aix,no) # traditional AIX only
2468300346aeSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2469300346aeSmrg      # We preserve .a as extension for shared libraries through AIX4.2
2470300346aeSmrg      # and later when we are not doing run time linking.
2471300346aeSmrg      library_names_spec='$libname$release.a $libname.a'
2472300346aeSmrg      soname_spec='$libname$release$shared_ext$major'
2473300346aeSmrg      ;;
2474300346aeSmrg    svr4,*) # full svr4 only
2475300346aeSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2476300346aeSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2477300346aeSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2478300346aeSmrg      shlibpath_overrides_runpath=yes
2479300346aeSmrg      ;;
2480300346aeSmrg    *,yes) # both, prefer svr4
2481300346aeSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2482300346aeSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2483300346aeSmrg      # unpreferred sharedlib libNAME.a needs extra handling
2484300346aeSmrg      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"'
2485300346aeSmrg      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"'
2486300346aeSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
2487300346aeSmrg      shlibpath_overrides_runpath=yes
2488300346aeSmrg      ;;
2489300346aeSmrg    *,no) # both, prefer aix
2490300346aeSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2491300346aeSmrg      library_names_spec='$libname$release.a $libname.a'
2492300346aeSmrg      soname_spec='$libname$release$shared_ext$major'
2493300346aeSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2494300346aeSmrg      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)'
2495300346aeSmrg      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"'
2496300346aeSmrg      ;;
2497300346aeSmrg    esac
2498300346aeSmrg    shlibpath_var=LIBPATH
2499300346aeSmrg  fi
2500300346aeSmrg  ;;
2501126a8a12Smrg
2502300346aeSmrgamigaos*)
2503300346aeSmrg  case $host_cpu in
2504300346aeSmrg  powerpc)
2505300346aeSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2506300346aeSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2507300346aeSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2508300346aeSmrg    ;;
2509300346aeSmrg  m68k)
2510300346aeSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2511300346aeSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2512300346aeSmrg    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'
2513300346aeSmrg    ;;
2514300346aeSmrg  esac
2515300346aeSmrg  ;;
2516126a8a12Smrg
2517300346aeSmrgbeos*)
2518300346aeSmrg  library_names_spec='$libname$shared_ext'
2519300346aeSmrg  dynamic_linker="$host_os ld.so"
2520300346aeSmrg  shlibpath_var=LIBRARY_PATH
2521300346aeSmrg  ;;
2522126a8a12Smrg
2523300346aeSmrgbsdi[[45]]*)
2524300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2525300346aeSmrg  need_version=no
2526300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2527300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2528300346aeSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2529300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2530300346aeSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2531300346aeSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2532300346aeSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
2533300346aeSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2534300346aeSmrg  # libtool to hard-code these into programs
2535300346aeSmrg  ;;
2536126a8a12Smrg
2537300346aeSmrgcygwin* | mingw* | pw32* | cegcc*)
2538300346aeSmrg  version_type=windows
2539300346aeSmrg  shrext_cmds=.dll
2540300346aeSmrg  need_version=no
2541300346aeSmrg  need_lib_prefix=no
2542126a8a12Smrg
2543300346aeSmrg  case $GCC,$cc_basename in
2544300346aeSmrg  yes,*)
2545300346aeSmrg    # gcc
2546300346aeSmrg    library_names_spec='$libname.dll.a'
2547300346aeSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2548300346aeSmrg    postinstall_cmds='base_file=`basename \$file`~
2549300346aeSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2550300346aeSmrg      dldir=$destdir/`dirname \$dlpath`~
2551300346aeSmrg      test -d \$dldir || mkdir -p \$dldir~
2552300346aeSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
2553300346aeSmrg      chmod a+x \$dldir/$dlname~
2554300346aeSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2555300346aeSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2556300346aeSmrg      fi'
2557300346aeSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2558300346aeSmrg      dlpath=$dir/\$dldll~
2559300346aeSmrg       $RM \$dlpath'
2560300346aeSmrg    shlibpath_overrides_runpath=yes
2561126a8a12Smrg
2562300346aeSmrg    case $host_os in
2563300346aeSmrg    cygwin*)
2564300346aeSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2565300346aeSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2566300346aeSmrgm4_if([$1], [],[
2567300346aeSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2568300346aeSmrg      ;;
2569300346aeSmrg    mingw* | cegcc*)
2570300346aeSmrg      # MinGW DLLs use traditional 'lib' prefix
2571300346aeSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2572300346aeSmrg      ;;
2573300346aeSmrg    pw32*)
2574300346aeSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2575300346aeSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2576300346aeSmrg      ;;
2577300346aeSmrg    esac
2578300346aeSmrg    dynamic_linker='Win32 ld.exe'
25793c15da26Smrg    ;;
2580126a8a12Smrg
2581300346aeSmrg  *,cl*)
2582300346aeSmrg    # Native MSVC
2583300346aeSmrg    libname_spec='$name'
2584300346aeSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2585300346aeSmrg    library_names_spec='$libname.dll.lib'
2586126a8a12Smrg
2587300346aeSmrg    case $build_os in
2588300346aeSmrg    mingw*)
2589300346aeSmrg      sys_lib_search_path_spec=
2590300346aeSmrg      lt_save_ifs=$IFS
2591300346aeSmrg      IFS=';'
2592300346aeSmrg      for lt_path in $LIB
2593300346aeSmrg      do
2594300346aeSmrg        IFS=$lt_save_ifs
2595300346aeSmrg        # Let DOS variable expansion print the short 8.3 style file name.
2596300346aeSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2597300346aeSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2598300346aeSmrg      done
2599300346aeSmrg      IFS=$lt_save_ifs
2600300346aeSmrg      # Convert to MSYS style.
2601300346aeSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2602300346aeSmrg      ;;
2603300346aeSmrg    cygwin*)
2604300346aeSmrg      # Convert to unix form, then to dos form, then back to unix form
2605300346aeSmrg      # but this time dos style (no spaces!) so that the unix form looks
2606300346aeSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2607300346aeSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2608300346aeSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2609300346aeSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2610300346aeSmrg      ;;
2611300346aeSmrg    *)
2612300346aeSmrg      sys_lib_search_path_spec=$LIB
2613300346aeSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2614300346aeSmrg        # It is most probably a Windows format PATH.
2615300346aeSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2616300346aeSmrg      else
2617300346aeSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2618300346aeSmrg      fi
2619300346aeSmrg      # FIXME: find the short name or the path components, as spaces are
2620300346aeSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2621300346aeSmrg      ;;
2622300346aeSmrg    esac
2623126a8a12Smrg
2624300346aeSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2625300346aeSmrg    postinstall_cmds='base_file=`basename \$file`~
2626300346aeSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2627300346aeSmrg      dldir=$destdir/`dirname \$dlpath`~
2628300346aeSmrg      test -d \$dldir || mkdir -p \$dldir~
2629300346aeSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
2630300346aeSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2631300346aeSmrg      dlpath=$dir/\$dldll~
2632300346aeSmrg       $RM \$dlpath'
2633300346aeSmrg    shlibpath_overrides_runpath=yes
2634300346aeSmrg    dynamic_linker='Win32 link.exe'
26350a6b08f8Smrg    ;;
26360a6b08f8Smrg
26373c15da26Smrg  *)
2638300346aeSmrg    # Assume MSVC wrapper
2639300346aeSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2640300346aeSmrg    dynamic_linker='Win32 ld.exe'
26413c15da26Smrg    ;;
26423c15da26Smrg  esac
2643300346aeSmrg  # FIXME: first we should search . and the directory the executable is in
2644300346aeSmrg  shlibpath_var=PATH
2645300346aeSmrg  ;;
2646126a8a12Smrg
2647300346aeSmrgdarwin* | rhapsody*)
2648300346aeSmrg  dynamic_linker="$host_os dyld"
2649300346aeSmrg  version_type=darwin
2650300346aeSmrg  need_lib_prefix=no
2651300346aeSmrg  need_version=no
2652300346aeSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2653300346aeSmrg  soname_spec='$libname$release$major$shared_ext'
2654300346aeSmrg  shlibpath_overrides_runpath=yes
2655300346aeSmrg  shlibpath_var=DYLD_LIBRARY_PATH
2656300346aeSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2657300346aeSmrgm4_if([$1], [],[
2658300346aeSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2659300346aeSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2660300346aeSmrg  ;;
2661555991fdSmrg
2662300346aeSmrgdgux*)
2663300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2664300346aeSmrg  need_lib_prefix=no
2665300346aeSmrg  need_version=no
2666300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2667300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2668300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2669300346aeSmrg  ;;
2670555991fdSmrg
2671300346aeSmrgfreebsd* | dragonfly*)
2672300346aeSmrg  # DragonFly does not have aout.  When/if they implement a new
2673300346aeSmrg  # versioning mechanism, adjust this.
2674300346aeSmrg  if test -x /usr/bin/objformat; then
2675300346aeSmrg    objformat=`/usr/bin/objformat`
2676555991fdSmrg  else
2677300346aeSmrg    case $host_os in
2678300346aeSmrg    freebsd[[23]].*) objformat=aout ;;
2679300346aeSmrg    *) objformat=elf ;;
26803c15da26Smrg    esac
2681555991fdSmrg  fi
2682300346aeSmrg  version_type=freebsd-$objformat
2683300346aeSmrg  case $version_type in
2684300346aeSmrg    freebsd-elf*)
2685300346aeSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2686300346aeSmrg      soname_spec='$libname$release$shared_ext$major'
2687300346aeSmrg      need_version=no
2688300346aeSmrg      need_lib_prefix=no
2689300346aeSmrg      ;;
2690300346aeSmrg    freebsd-*)
2691300346aeSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2692300346aeSmrg      need_version=yes
2693300346aeSmrg      ;;
2694300346aeSmrg  esac
2695300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
26963c15da26Smrg  case $host_os in
2697300346aeSmrg  freebsd2.*)
2698300346aeSmrg    shlibpath_overrides_runpath=yes
26993c15da26Smrg    ;;
2700300346aeSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2701300346aeSmrg    shlibpath_overrides_runpath=yes
2702300346aeSmrg    hardcode_into_libs=yes
27033c15da26Smrg    ;;
2704300346aeSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2705300346aeSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2706300346aeSmrg    shlibpath_overrides_runpath=no
2707300346aeSmrg    hardcode_into_libs=yes
27083c15da26Smrg    ;;
2709300346aeSmrg  *) # from 4.6 on, and DragonFly
2710300346aeSmrg    shlibpath_overrides_runpath=yes
2711300346aeSmrg    hardcode_into_libs=yes
27123c15da26Smrg    ;;
27133c15da26Smrg  esac
2714300346aeSmrg  ;;
2715555991fdSmrg
2716300346aeSmrghaiku*)
2717300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2718300346aeSmrg  need_lib_prefix=no
2719300346aeSmrg  need_version=no
2720300346aeSmrg  dynamic_linker="$host_os runtime_loader"
2721300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2722300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2723300346aeSmrg  shlibpath_var=LIBRARY_PATH
2724300346aeSmrg  shlibpath_overrides_runpath=no
2725300346aeSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2726300346aeSmrg  hardcode_into_libs=yes
2727300346aeSmrg  ;;
2728555991fdSmrg
2729300346aeSmrghpux9* | hpux10* | hpux11*)
2730300346aeSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2731300346aeSmrg  # link against other versions.
2732300346aeSmrg  version_type=sunos
2733300346aeSmrg  need_lib_prefix=no
2734300346aeSmrg  need_version=no
2735300346aeSmrg  case $host_cpu in
2736300346aeSmrg  ia64*)
2737300346aeSmrg    shrext_cmds='.so'
2738300346aeSmrg    hardcode_into_libs=yes
2739300346aeSmrg    dynamic_linker="$host_os dld.so"
2740300346aeSmrg    shlibpath_var=LD_LIBRARY_PATH
2741300346aeSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2742300346aeSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2743300346aeSmrg    soname_spec='$libname$release$shared_ext$major'
2744300346aeSmrg    if test 32 = "$HPUX_IA64_MODE"; then
2745300346aeSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2746300346aeSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2747300346aeSmrg    else
2748300346aeSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2749300346aeSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2750555991fdSmrg    fi
2751300346aeSmrg    ;;
2752300346aeSmrg  hppa*64*)
2753300346aeSmrg    shrext_cmds='.sl'
2754300346aeSmrg    hardcode_into_libs=yes
2755300346aeSmrg    dynamic_linker="$host_os dld.sl"
2756300346aeSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2757300346aeSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2758300346aeSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2759300346aeSmrg    soname_spec='$libname$release$shared_ext$major'
2760300346aeSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2761300346aeSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2762300346aeSmrg    ;;
2763300346aeSmrg  *)
2764300346aeSmrg    shrext_cmds='.sl'
2765300346aeSmrg    dynamic_linker="$host_os dld.sl"
2766300346aeSmrg    shlibpath_var=SHLIB_PATH
2767300346aeSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2768300346aeSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2769300346aeSmrg    soname_spec='$libname$release$shared_ext$major'
27703c15da26Smrg    ;;
27713c15da26Smrg  esac
2772300346aeSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2773300346aeSmrg  postinstall_cmds='chmod 555 $lib'
2774300346aeSmrg  # or fails outright, so override atomically:
2775300346aeSmrg  install_override_mode=555
2776300346aeSmrg  ;;
2777555991fdSmrg
2778300346aeSmrginterix[[3-9]]*)
2779300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2780300346aeSmrg  need_lib_prefix=no
2781300346aeSmrg  need_version=no
2782300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2783300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2784300346aeSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2785300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2786300346aeSmrg  shlibpath_overrides_runpath=no
2787300346aeSmrg  hardcode_into_libs=yes
2788300346aeSmrg  ;;
2789126a8a12Smrg
2790300346aeSmrgirix5* | irix6* | nonstopux*)
2791300346aeSmrg  case $host_os in
2792300346aeSmrg    nonstopux*) version_type=nonstopux ;;
2793300346aeSmrg    *)
2794300346aeSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2795300346aeSmrg		version_type=linux # correct to gnu/linux during the next big refactor
2796300346aeSmrg	else
2797300346aeSmrg		version_type=irix
2798300346aeSmrg	fi ;;
27993c15da26Smrg  esac
2800300346aeSmrg  need_lib_prefix=no
2801300346aeSmrg  need_version=no
2802300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2803300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2804300346aeSmrg  case $host_os in
2805300346aeSmrg  irix5* | nonstopux*)
2806300346aeSmrg    libsuff= shlibsuff=
2807300346aeSmrg    ;;
2808300346aeSmrg  *)
2809300346aeSmrg    case $LD in # libtool.m4 will add one of these switches to LD
2810300346aeSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2811300346aeSmrg      libsuff= shlibsuff= libmagic=32-bit;;
2812300346aeSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2813300346aeSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2814300346aeSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2815300346aeSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2816300346aeSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
2817300346aeSmrg    esac
2818300346aeSmrg    ;;
2819300346aeSmrg  esac
2820300346aeSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2821300346aeSmrg  shlibpath_overrides_runpath=no
2822300346aeSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2823300346aeSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2824300346aeSmrg  hardcode_into_libs=yes
2825300346aeSmrg  ;;
2826126a8a12Smrg
2827300346aeSmrg# No shared lib support for Linux oldld, aout, or coff.
2828300346aeSmrglinux*oldld* | linux*aout* | linux*coff*)
2829300346aeSmrg  dynamic_linker=no
2830300346aeSmrg  ;;
2831126a8a12Smrg
2832300346aeSmrglinux*android*)
2833300346aeSmrg  version_type=none # Android doesn't support versioned libraries.
2834300346aeSmrg  need_lib_prefix=no
2835300346aeSmrg  need_version=no
2836300346aeSmrg  library_names_spec='$libname$release$shared_ext'
2837300346aeSmrg  soname_spec='$libname$release$shared_ext'
2838300346aeSmrg  finish_cmds=
2839300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2840300346aeSmrg  shlibpath_overrides_runpath=yes
2841126a8a12Smrg
2842300346aeSmrg  # This implies no fast_install, which is unacceptable.
2843300346aeSmrg  # Some rework will be needed to allow for fast_install
2844300346aeSmrg  # before this can be enabled.
2845300346aeSmrg  hardcode_into_libs=yes
28463c15da26Smrg
2847300346aeSmrg  dynamic_linker='Android linker'
2848300346aeSmrg  # Don't embed -rpath directories since the linker doesn't support them.
2849300346aeSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2850300346aeSmrg  ;;
2851126a8a12Smrg
2852300346aeSmrg# This must be glibc/ELF.
2853300346aeSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2854300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2855300346aeSmrg  need_lib_prefix=no
2856300346aeSmrg  need_version=no
2857300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2858300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2859300346aeSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2860300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2861300346aeSmrg  shlibpath_overrides_runpath=no
2862126a8a12Smrg
2863300346aeSmrg  # Some binutils ld are patched to set DT_RUNPATH
2864300346aeSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2865300346aeSmrg    [lt_cv_shlibpath_overrides_runpath=no
2866300346aeSmrg    save_LDFLAGS=$LDFLAGS
2867300346aeSmrg    save_libdir=$libdir
2868300346aeSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2869300346aeSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2870300346aeSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2871300346aeSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2872300346aeSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2873300346aeSmrg    LDFLAGS=$save_LDFLAGS
2874300346aeSmrg    libdir=$save_libdir
2875300346aeSmrg    ])
2876300346aeSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2877126a8a12Smrg
2878300346aeSmrg  # This implies no fast_install, which is unacceptable.
2879300346aeSmrg  # Some rework will be needed to allow for fast_install
2880300346aeSmrg  # before this can be enabled.
2881300346aeSmrg  hardcode_into_libs=yes
2882300346aeSmrg
2883300346aeSmrg  # Ideally, we could use ldconfig to report *all* directores which are
2884300346aeSmrg  # searched for libraries, however this is still not possible.  Aside from not
2885300346aeSmrg  # being certain /sbin/ldconfig is available, command
2886300346aeSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2887300346aeSmrg  # even though it is searched at run-time.  Try to do the best guess by
2888300346aeSmrg  # appending ld.so.conf contents (and includes) to the search path.
2889300346aeSmrg  if test -f /etc/ld.so.conf; then
2890300346aeSmrg    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' ' '`
2891300346aeSmrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
28923c15da26Smrg  fi
2893126a8a12Smrg
2894300346aeSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2895300346aeSmrg  # powerpc, because MkLinux only supported shared libraries with the
2896300346aeSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2897300346aeSmrg  # most powerpc-linux boxes support dynamic linking these days and
2898300346aeSmrg  # people can always --disable-shared, the test was removed, and we
2899300346aeSmrg  # assume the GNU/Linux dynamic linker is in use.
2900300346aeSmrg  dynamic_linker='GNU/Linux ld.so'
2901300346aeSmrg  ;;
2902126a8a12Smrg
2903300346aeSmrgnetbsdelf*-gnu)
2904300346aeSmrg  version_type=linux
2905300346aeSmrg  need_lib_prefix=no
2906300346aeSmrg  need_version=no
2907300346aeSmrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2908300346aeSmrg  soname_spec='${libname}${release}${shared_ext}$major'
2909300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2910300346aeSmrg  shlibpath_overrides_runpath=no
2911300346aeSmrg  hardcode_into_libs=yes
2912300346aeSmrg  dynamic_linker='NetBSD ld.elf_so'
2913300346aeSmrg  ;;
2914126a8a12Smrg
2915300346aeSmrgnetbsd*)
2916300346aeSmrg  version_type=sunos
2917300346aeSmrg  need_lib_prefix=no
2918300346aeSmrg  need_version=no
2919300346aeSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2920300346aeSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2921300346aeSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2922300346aeSmrg    dynamic_linker='NetBSD (a.out) ld.so'
2923300346aeSmrg  else
2924300346aeSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2925300346aeSmrg    soname_spec='$libname$release$shared_ext$major'
2926300346aeSmrg    dynamic_linker='NetBSD ld.elf_so'
2927300346aeSmrg  fi
2928300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2929300346aeSmrg  shlibpath_overrides_runpath=yes
2930300346aeSmrg  hardcode_into_libs=yes
2931300346aeSmrg  ;;
2932126a8a12Smrg
2933300346aeSmrgnewsos6)
2934300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2935300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2936300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2937300346aeSmrg  shlibpath_overrides_runpath=yes
2938300346aeSmrg  ;;
2939126a8a12Smrg
2940300346aeSmrg*nto* | *qnx*)
2941300346aeSmrg  version_type=qnx
2942300346aeSmrg  need_lib_prefix=no
2943300346aeSmrg  need_version=no
2944300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2945300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
2946300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2947300346aeSmrg  shlibpath_overrides_runpath=no
2948300346aeSmrg  hardcode_into_libs=yes
2949300346aeSmrg  dynamic_linker='ldqnx.so'
2950300346aeSmrg  ;;
2951300346aeSmrg
2952300346aeSmrgopenbsd* | bitrig*)
2953300346aeSmrg  version_type=sunos
2954300346aeSmrg  sys_lib_dlsearch_path_spec=/usr/lib
2955300346aeSmrg  need_lib_prefix=no
2956300346aeSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2957300346aeSmrg    need_version=no
29583c15da26Smrg  else
2959300346aeSmrg    need_version=yes
29603c15da26Smrg  fi
2961300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2962300346aeSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2963300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
2964300346aeSmrg  shlibpath_overrides_runpath=yes
2965300346aeSmrg  ;;
2966126a8a12Smrg
2967300346aeSmrgos2*)
2968300346aeSmrg  libname_spec='$name'
2969300346aeSmrg  version_type=windows
2970300346aeSmrg  shrext_cmds=.dll
2971300346aeSmrg  need_version=no
2972300346aeSmrg  need_lib_prefix=no
2973300346aeSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2974300346aeSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2975300346aeSmrg    v=$($ECHO $release$versuffix | tr -d .-);
2976300346aeSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2977300346aeSmrg    $ECHO $n$v`$shared_ext'
2978300346aeSmrg  library_names_spec='${libname}_dll.$libext'
2979300346aeSmrg  dynamic_linker='OS/2 ld.exe'
2980300346aeSmrg  shlibpath_var=BEGINLIBPATH
2981300346aeSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2982300346aeSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2983300346aeSmrg  postinstall_cmds='base_file=`basename \$file`~
2984300346aeSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2985300346aeSmrg    dldir=$destdir/`dirname \$dlpath`~
2986300346aeSmrg    test -d \$dldir || mkdir -p \$dldir~
2987300346aeSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
2988300346aeSmrg    chmod a+x \$dldir/$dlname~
2989300346aeSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2990300346aeSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2991300346aeSmrg    fi'
2992300346aeSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2993300346aeSmrg    dlpath=$dir/\$dldll~
2994300346aeSmrg    $RM \$dlpath'
2995300346aeSmrg  ;;
2996126a8a12Smrg
2997300346aeSmrgosf3* | osf4* | osf5*)
2998300346aeSmrg  version_type=osf
2999300346aeSmrg  need_lib_prefix=no
3000300346aeSmrg  need_version=no
3001300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
3002300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3003300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3004300346aeSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3005300346aeSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3006300346aeSmrg  ;;
3007d656433aSmrg
3008300346aeSmrgrdos*)
3009300346aeSmrg  dynamic_linker=no
3010300346aeSmrg  ;;
30113c15da26Smrg
3012300346aeSmrgsolaris*)
3013300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3014300346aeSmrg  need_lib_prefix=no
3015300346aeSmrg  need_version=no
3016300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3017300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
3018300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3019300346aeSmrg  shlibpath_overrides_runpath=yes
3020300346aeSmrg  hardcode_into_libs=yes
3021300346aeSmrg  # ldd complains unless libraries are executable
3022300346aeSmrg  postinstall_cmds='chmod +x $lib'
3023300346aeSmrg  ;;
3024126a8a12Smrg
3025300346aeSmrgsunos4*)
3026300346aeSmrg  version_type=sunos
3027300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3028300346aeSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3029300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3030300346aeSmrg  shlibpath_overrides_runpath=yes
3031300346aeSmrg  if test yes = "$with_gnu_ld"; then
3032300346aeSmrg    need_lib_prefix=no
3033300346aeSmrg  fi
3034300346aeSmrg  need_version=yes
3035300346aeSmrg  ;;
3036126a8a12Smrg
3037300346aeSmrgsysv4 | sysv4.3*)
30380a6b08f8Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3039300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3040300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
3041300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3042300346aeSmrg  case $host_vendor in
3043300346aeSmrg    sni)
3044300346aeSmrg      shlibpath_overrides_runpath=no
3045300346aeSmrg      need_lib_prefix=no
3046300346aeSmrg      runpath_var=LD_RUN_PATH
3047300346aeSmrg      ;;
3048300346aeSmrg    siemens)
3049300346aeSmrg      need_lib_prefix=no
3050300346aeSmrg      ;;
3051300346aeSmrg    motorola)
3052300346aeSmrg      need_lib_prefix=no
3053300346aeSmrg      need_version=no
3054300346aeSmrg      shlibpath_overrides_runpath=no
3055300346aeSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3056300346aeSmrg      ;;
3057300346aeSmrg  esac
3058300346aeSmrg  ;;
3059126a8a12Smrg
3060300346aeSmrgsysv4*MP*)
3061300346aeSmrg  if test -d /usr/nec; then
3062300346aeSmrg    version_type=linux # correct to gnu/linux during the next big refactor
3063300346aeSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3064300346aeSmrg    soname_spec='$libname$shared_ext.$major'
3065300346aeSmrg    shlibpath_var=LD_LIBRARY_PATH
3066300346aeSmrg  fi
30673c15da26Smrg  ;;
3068126a8a12Smrg
3069300346aeSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3070300346aeSmrg  version_type=sco
30713c15da26Smrg  need_lib_prefix=no
30723c15da26Smrg  need_version=no
3073300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3074300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
3075300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3076300346aeSmrg  shlibpath_overrides_runpath=yes
30773c15da26Smrg  hardcode_into_libs=yes
3078300346aeSmrg  if test yes = "$with_gnu_ld"; then
3079300346aeSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3080555991fdSmrg  else
3081300346aeSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
30823c15da26Smrg    case $host_os in
3083300346aeSmrg      sco3.2v5*)
3084300346aeSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3085300346aeSmrg	;;
3086555991fdSmrg    esac
3087555991fdSmrg  fi
3088300346aeSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
30893c15da26Smrg  ;;
3090126a8a12Smrg
3091300346aeSmrgtpf*)
3092300346aeSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
30930a6b08f8Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3094300346aeSmrg  need_lib_prefix=no
30953c15da26Smrg  need_version=no
3096300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
30973c15da26Smrg  shlibpath_var=LD_LIBRARY_PATH
3098300346aeSmrg  shlibpath_overrides_runpath=no
3099300346aeSmrg  hardcode_into_libs=yes
31003c15da26Smrg  ;;
3101126a8a12Smrg
3102300346aeSmrguts4*)
3103300346aeSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3104300346aeSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3105300346aeSmrg  soname_spec='$libname$release$shared_ext$major'
3106300346aeSmrg  shlibpath_var=LD_LIBRARY_PATH
3107300346aeSmrg  ;;
3108126a8a12Smrg
3109300346aeSmrg*)
3110300346aeSmrg  dynamic_linker=no
3111300346aeSmrg  ;;
3112300346aeSmrgesac
3113300346aeSmrgAC_MSG_RESULT([$dynamic_linker])
3114300346aeSmrgtest no = "$dynamic_linker" && can_build_shared=no
31153c15da26Smrg
3116300346aeSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3117300346aeSmrgif test yes = "$GCC"; then
3118300346aeSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3119300346aeSmrgfi
3120126a8a12Smrg
3121300346aeSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3122300346aeSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3123300346aeSmrgfi
31243c15da26Smrg
3125300346aeSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3126300346aeSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3127300346aeSmrgfi
31283c15da26Smrg
3129300346aeSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3130300346aeSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
3131126a8a12Smrg
3132300346aeSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3133300346aeSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
3134126a8a12Smrg
3135300346aeSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3136300346aeSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
3137300346aeSmrg
3138300346aeSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3139300346aeSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3140300346aeSmrg    restored at link time])
3141300346aeSmrg_LT_DECL([], [need_lib_prefix], [0],
3142300346aeSmrg    [Do we need the "lib" prefix for modules?])
3143300346aeSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3144300346aeSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3145300346aeSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3146300346aeSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3147300346aeSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3148300346aeSmrg    [Is shlibpath searched before the hard-coded library search path?])
3149300346aeSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3150300346aeSmrg_LT_DECL([], [library_names_spec], [1],
3151300346aeSmrg    [[List of archive names.  First name is the real one, the rest are links.
3152300346aeSmrg    The last name is the one that the linker finds with -lNAME]])
3153300346aeSmrg_LT_DECL([], [soname_spec], [1],
3154300346aeSmrg    [[The coded name of the library, if different from the real name]])
3155300346aeSmrg_LT_DECL([], [install_override_mode], [1],
3156300346aeSmrg    [Permission mode override for installation of shared libraries])
3157300346aeSmrg_LT_DECL([], [postinstall_cmds], [2],
3158300346aeSmrg    [Command to use after installation of a shared archive])
3159300346aeSmrg_LT_DECL([], [postuninstall_cmds], [2],
3160300346aeSmrg    [Command to use after uninstallation of a shared archive])
3161300346aeSmrg_LT_DECL([], [finish_cmds], [2],
3162300346aeSmrg    [Commands used to finish a libtool library installation in a directory])
3163300346aeSmrg_LT_DECL([], [finish_eval], [1],
3164300346aeSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3165300346aeSmrg    not shown]])
3166300346aeSmrg_LT_DECL([], [hardcode_into_libs], [0],
3167300346aeSmrg    [Whether we should hardcode library paths into libraries])
3168300346aeSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3169300346aeSmrg    [Compile-time system search path for libraries])
3170300346aeSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3171300346aeSmrg    [Detected run-time system search path for libraries])
3172300346aeSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3173300346aeSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3174300346aeSmrg])# _LT_SYS_DYNAMIC_LINKER
3175300346aeSmrg
3176300346aeSmrg
3177300346aeSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3178300346aeSmrg# --------------------------
3179300346aeSmrg# find a file program that can recognize shared library
3180300346aeSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3181300346aeSmrg[m4_require([_LT_DECL_EGREP])dnl
3182300346aeSmrgAC_MSG_CHECKING([for $1])
3183300346aeSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3184300346aeSmrg[case $MAGIC_CMD in
3185300346aeSmrg[[\\/*] |  ?:[\\/]*])
3186300346aeSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
31873c15da26Smrg  ;;
3188300346aeSmrg*)
3189300346aeSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3190300346aeSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3191300346aeSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3192300346aeSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3193300346aeSmrgdnl not every word.  This closes a longstanding sh security hole.
3194300346aeSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3195300346aeSmrg  for ac_dir in $ac_dummy; do
3196300346aeSmrg    IFS=$lt_save_ifs
3197300346aeSmrg    test -z "$ac_dir" && ac_dir=.
3198300346aeSmrg    if test -f "$ac_dir/$1"; then
3199300346aeSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3200300346aeSmrg      if test -n "$file_magic_test_file"; then
3201300346aeSmrg	case $deplibs_check_method in
3202300346aeSmrg	"file_magic "*)
3203300346aeSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3204300346aeSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3205300346aeSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3206300346aeSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3207300346aeSmrg	    :
3208300346aeSmrg	  else
3209300346aeSmrg	    cat <<_LT_EOF 1>&2
3210126a8a12Smrg
3211300346aeSmrg*** Warning: the command libtool uses to detect shared libraries,
3212300346aeSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3213300346aeSmrg*** The result is that libtool may fail to recognize shared libraries
3214300346aeSmrg*** as such.  This will affect the creation of libtool libraries that
3215300346aeSmrg*** depend on shared libraries, but programs linked with such libtool
3216300346aeSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3217300346aeSmrg*** may want to report the problem to your system manager and/or to
3218300346aeSmrg*** bug-libtool@gnu.org
3219300346aeSmrg
3220300346aeSmrg_LT_EOF
3221300346aeSmrg	  fi ;;
3222300346aeSmrg	esac
3223300346aeSmrg      fi
3224300346aeSmrg      break
3225300346aeSmrg    fi
3226300346aeSmrg  done
3227300346aeSmrg  IFS=$lt_save_ifs
3228300346aeSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
32293c15da26Smrg  ;;
3230300346aeSmrgesac])
3231300346aeSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3232300346aeSmrgif test -n "$MAGIC_CMD"; then
3233300346aeSmrg  AC_MSG_RESULT($MAGIC_CMD)
3234300346aeSmrgelse
3235300346aeSmrg  AC_MSG_RESULT(no)
3236300346aeSmrgfi
3237300346aeSmrg_LT_DECL([], [MAGIC_CMD], [0],
3238300346aeSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3239300346aeSmrg])# _LT_PATH_TOOL_PREFIX
3240126a8a12Smrg
3241300346aeSmrg# Old name:
3242300346aeSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3243300346aeSmrgdnl aclocal-1.4 backwards compatibility:
3244300346aeSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3245300346aeSmrg
3246300346aeSmrg
3247300346aeSmrg# _LT_PATH_MAGIC
3248300346aeSmrg# --------------
3249300346aeSmrg# find a file program that can recognize a shared library
3250300346aeSmrgm4_defun([_LT_PATH_MAGIC],
3251300346aeSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3252300346aeSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3253300346aeSmrg  if test -n "$ac_tool_prefix"; then
3254300346aeSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
32553c15da26Smrg  else
3256300346aeSmrg    MAGIC_CMD=:
32573c15da26Smrg  fi
3258300346aeSmrgfi
3259300346aeSmrg])# _LT_PATH_MAGIC
3260126a8a12Smrg
3261126a8a12Smrg
3262300346aeSmrg# LT_PATH_LD
3263300346aeSmrg# ----------
3264300346aeSmrg# find the pathname to the GNU or non-GNU linker
3265300346aeSmrgAC_DEFUN([LT_PATH_LD],
3266300346aeSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3267300346aeSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3268300346aeSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3269300346aeSmrgm4_require([_LT_DECL_SED])dnl
3270300346aeSmrgm4_require([_LT_DECL_EGREP])dnl
3271300346aeSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3272126a8a12Smrg
3273300346aeSmrgAC_ARG_WITH([gnu-ld],
3274300346aeSmrg    [AS_HELP_STRING([--with-gnu-ld],
3275300346aeSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3276300346aeSmrg    [test no = "$withval" || with_gnu_ld=yes],
3277300346aeSmrg    [with_gnu_ld=no])dnl
3278126a8a12Smrg
3279300346aeSmrgac_prog=ld
3280300346aeSmrgif test yes = "$GCC"; then
3281300346aeSmrg  # Check if gcc -print-prog-name=ld gives a path.
3282300346aeSmrg  AC_MSG_CHECKING([for ld used by $CC])
3283300346aeSmrg  case $host in
3284300346aeSmrg  *-*-mingw*)
3285300346aeSmrg    # gcc leaves a trailing carriage return, which upsets mingw
3286300346aeSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3287300346aeSmrg  *)
3288300346aeSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3289555991fdSmrg  esac
3290300346aeSmrg  case $ac_prog in
3291300346aeSmrg    # Accept absolute paths.
3292300346aeSmrg    [[\\/]]* | ?:[[\\/]]*)
3293300346aeSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3294300346aeSmrg      # Canonicalize the pathname of ld
3295300346aeSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3296300346aeSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3297300346aeSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3298300346aeSmrg      done
3299300346aeSmrg      test -z "$LD" && LD=$ac_prog
3300300346aeSmrg      ;;
3301300346aeSmrg  "")
3302300346aeSmrg    # If it fails, then pretend we aren't using GCC.
3303300346aeSmrg    ac_prog=ld
33043c15da26Smrg    ;;
33053c15da26Smrg  *)
3306300346aeSmrg    # If it is relative, then search for the first ld in PATH.
3307300346aeSmrg    with_gnu_ld=unknown
33083c15da26Smrg    ;;
33093c15da26Smrg  esac
3310300346aeSmrgelif test yes = "$with_gnu_ld"; then
3311300346aeSmrg  AC_MSG_CHECKING([for GNU ld])
3312300346aeSmrgelse
3313300346aeSmrg  AC_MSG_CHECKING([for non-GNU ld])
3314300346aeSmrgfi
3315300346aeSmrgAC_CACHE_VAL(lt_cv_path_LD,
3316300346aeSmrg[if test -z "$LD"; then
3317300346aeSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3318300346aeSmrg  for ac_dir in $PATH; do
3319300346aeSmrg    IFS=$lt_save_ifs
3320300346aeSmrg    test -z "$ac_dir" && ac_dir=.
3321300346aeSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3322300346aeSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
3323300346aeSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3324300346aeSmrg      # but apparently some variants of GNU ld only accept -v.
3325300346aeSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3326300346aeSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3327300346aeSmrg      *GNU* | *'with BFD'*)
3328300346aeSmrg	test no != "$with_gnu_ld" && break
3329300346aeSmrg	;;
3330300346aeSmrg      *)
3331300346aeSmrg	test yes != "$with_gnu_ld" && break
3332300346aeSmrg	;;
3333300346aeSmrg      esac
3334300346aeSmrg    fi
3335300346aeSmrg  done
3336300346aeSmrg  IFS=$lt_save_ifs
3337300346aeSmrgelse
3338300346aeSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3339300346aeSmrgfi])
3340300346aeSmrgLD=$lt_cv_path_LD
3341300346aeSmrgif test -n "$LD"; then
3342300346aeSmrg  AC_MSG_RESULT($LD)
3343300346aeSmrgelse
3344300346aeSmrg  AC_MSG_RESULT(no)
3345300346aeSmrgfi
3346300346aeSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3347300346aeSmrg_LT_PATH_LD_GNU
3348300346aeSmrgAC_SUBST([LD])
3349126a8a12Smrg
3350300346aeSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3351300346aeSmrg])# LT_PATH_LD
3352126a8a12Smrg
3353300346aeSmrg# Old names:
3354300346aeSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3355300346aeSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3356300346aeSmrgdnl aclocal-1.4 backwards compatibility:
3357300346aeSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3358300346aeSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3359126a8a12Smrg
3360126a8a12Smrg
3361300346aeSmrg# _LT_PATH_LD_GNU
3362300346aeSmrg#- --------------
3363300346aeSmrgm4_defun([_LT_PATH_LD_GNU],
3364300346aeSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3365300346aeSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3366300346aeSmrgcase `$LD -v 2>&1 </dev/null` in
3367300346aeSmrg*GNU* | *'with BFD'*)
3368300346aeSmrg  lt_cv_prog_gnu_ld=yes
3369300346aeSmrg  ;;
3370300346aeSmrg*)
3371300346aeSmrg  lt_cv_prog_gnu_ld=no
3372300346aeSmrg  ;;
3373300346aeSmrgesac])
3374300346aeSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3375300346aeSmrg])# _LT_PATH_LD_GNU
3376126a8a12Smrg
3377126a8a12Smrg
3378300346aeSmrg# _LT_CMD_RELOAD
3379300346aeSmrg# --------------
3380300346aeSmrg# find reload flag for linker
3381300346aeSmrg#   -- PORTME Some linkers may need a different reload flag.
3382300346aeSmrgm4_defun([_LT_CMD_RELOAD],
3383300346aeSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3384300346aeSmrg  lt_cv_ld_reload_flag,
3385300346aeSmrg  [lt_cv_ld_reload_flag='-r'])
3386300346aeSmrgreload_flag=$lt_cv_ld_reload_flag
3387300346aeSmrgcase $reload_flag in
3388300346aeSmrg"" | " "*) ;;
3389300346aeSmrg*) reload_flag=" $reload_flag" ;;
3390300346aeSmrgesac
3391300346aeSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3392300346aeSmrgcase $host_os in
3393300346aeSmrg  cygwin* | mingw* | pw32* | cegcc*)
3394300346aeSmrg    if test yes != "$GCC"; then
3395300346aeSmrg      reload_cmds=false
3396300346aeSmrg    fi
3397300346aeSmrg    ;;
3398300346aeSmrg  darwin*)
3399300346aeSmrg    if test yes = "$GCC"; then
3400300346aeSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3401300346aeSmrg    else
3402300346aeSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3403300346aeSmrg    fi
3404300346aeSmrg    ;;
3405300346aeSmrgesac
3406300346aeSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3407300346aeSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3408300346aeSmrg])# _LT_CMD_RELOAD
3409126a8a12Smrg
3410126a8a12Smrg
3411300346aeSmrg# _LT_PATH_DD
3412300346aeSmrg# -----------
3413300346aeSmrg# find a working dd
3414300346aeSmrgm4_defun([_LT_PATH_DD],
3415300346aeSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3416300346aeSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3417300346aeSmrgcat conftest.i conftest.i >conftest2.i
3418300346aeSmrg: ${lt_DD:=$DD}
3419300346aeSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3420300346aeSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3421300346aeSmrg  cmp -s conftest.i conftest.out \
3422300346aeSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3423300346aeSmrgfi])
3424300346aeSmrgrm -f conftest.i conftest2.i conftest.out])
3425300346aeSmrg])# _LT_PATH_DD
3426126a8a12Smrg
3427300346aeSmrg
3428300346aeSmrg# _LT_CMD_TRUNCATE
3429300346aeSmrg# ----------------
3430300346aeSmrg# find command to truncate a binary pipe
3431300346aeSmrgm4_defun([_LT_CMD_TRUNCATE],
3432300346aeSmrg[m4_require([_LT_PATH_DD])
3433300346aeSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3434300346aeSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3435300346aeSmrgcat conftest.i conftest.i >conftest2.i
3436300346aeSmrglt_cv_truncate_bin=
3437300346aeSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3438300346aeSmrg  cmp -s conftest.i conftest.out \
3439300346aeSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3440300346aeSmrgfi
3441300346aeSmrgrm -f conftest.i conftest2.i conftest.out
3442300346aeSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3443300346aeSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3444300346aeSmrg  [Command to truncate a binary pipe])
3445300346aeSmrg])# _LT_CMD_TRUNCATE
3446300346aeSmrg
3447300346aeSmrg
3448300346aeSmrg# _LT_CHECK_MAGIC_METHOD
3449300346aeSmrg# ----------------------
3450300346aeSmrg# how to check for library dependencies
3451300346aeSmrg#  -- PORTME fill in with the dynamic library characteristics
3452300346aeSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3453300346aeSmrg[m4_require([_LT_DECL_EGREP])
3454300346aeSmrgm4_require([_LT_DECL_OBJDUMP])
3455300346aeSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3456300346aeSmrglt_cv_deplibs_check_method,
3457300346aeSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3458300346aeSmrglt_cv_file_magic_test_file=
3459300346aeSmrglt_cv_deplibs_check_method='unknown'
3460300346aeSmrg# Need to set the preceding variable on all platforms that support
3461300346aeSmrg# interlibrary dependencies.
3462300346aeSmrg# 'none' -- dependencies not supported.
3463300346aeSmrg# 'unknown' -- same as none, but documents that we really don't know.
3464300346aeSmrg# 'pass_all' -- all dependencies passed with no checks.
3465300346aeSmrg# 'test_compile' -- check by making test program.
3466300346aeSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
3467300346aeSmrg# that responds to the $file_magic_cmd with a given extended regex.
3468300346aeSmrg# If you have 'file' or equivalent on your system and you're not sure
3469300346aeSmrg# whether 'pass_all' will *always* work, you probably want this one.
3470300346aeSmrg
3471300346aeSmrgcase $host_os in
3472300346aeSmrgaix[[4-9]]*)
3473300346aeSmrg  lt_cv_deplibs_check_method=pass_all
34743c15da26Smrg  ;;
3475126a8a12Smrg
3476300346aeSmrgbeos*)
3477300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3478300346aeSmrg  ;;
3479300346aeSmrg
3480300346aeSmrgbsdi[[45]]*)
3481300346aeSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3482300346aeSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3483300346aeSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3484300346aeSmrg  ;;
3485300346aeSmrg
3486300346aeSmrgcygwin*)
3487300346aeSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3488300346aeSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3489300346aeSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3490300346aeSmrg  ;;
3491300346aeSmrg
3492300346aeSmrgmingw* | pw32*)
3493300346aeSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3494300346aeSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3495300346aeSmrg  # unless we find 'file', for example because we are cross-compiling.
3496300346aeSmrg  if ( file / ) >/dev/null 2>&1; then
3497300346aeSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3498300346aeSmrg    lt_cv_file_magic_cmd='func_win32_libid'
34993c15da26Smrg  else
3500300346aeSmrg    # Keep this pattern in sync with the one in func_win32_libid.
3501300346aeSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3502300346aeSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
35033c15da26Smrg  fi
35043c15da26Smrg  ;;
3505555991fdSmrg
3506300346aeSmrgcegcc*)
3507300346aeSmrg  # use the weaker test based on 'objdump'. See mingw*.
3508300346aeSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3509300346aeSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
35103c15da26Smrg  ;;
3511555991fdSmrg
3512300346aeSmrgdarwin* | rhapsody*)
3513300346aeSmrg  lt_cv_deplibs_check_method=pass_all
35143c15da26Smrg  ;;
3515555991fdSmrg
3516300346aeSmrgfreebsd* | dragonfly*)
3517300346aeSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3518300346aeSmrg    case $host_cpu in
3519300346aeSmrg    i*86 )
3520300346aeSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3521300346aeSmrg      # Let's accept both of them until this is cleared up.
3522300346aeSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3523300346aeSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3524300346aeSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3525300346aeSmrg      ;;
3526300346aeSmrg    esac
3527300346aeSmrg  else
3528300346aeSmrg    lt_cv_deplibs_check_method=pass_all
3529300346aeSmrg  fi
35303c15da26Smrg  ;;
3531555991fdSmrg
3532300346aeSmrghaiku*)
3533300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3534555991fdSmrg  ;;
3535555991fdSmrg
3536300346aeSmrghpux10.20* | hpux11*)
3537300346aeSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3538300346aeSmrg  case $host_cpu in
3539300346aeSmrg  ia64*)
3540300346aeSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3541300346aeSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3542300346aeSmrg    ;;
3543300346aeSmrg  hppa*64*)
3544300346aeSmrg    [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]']
3545300346aeSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3546300346aeSmrg    ;;
3547300346aeSmrg  *)
3548300346aeSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3549300346aeSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3550300346aeSmrg    ;;
3551300346aeSmrg  esac
35523c15da26Smrg  ;;
35533c15da26Smrg
3554300346aeSmrginterix[[3-9]]*)
3555300346aeSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3556300346aeSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3557300346aeSmrg  ;;
3558300346aeSmrg
3559300346aeSmrgirix5* | irix6* | nonstopux*)
3560300346aeSmrg  case $LD in
3561300346aeSmrg  *-32|*"-32 ") libmagic=32-bit;;
3562300346aeSmrg  *-n32|*"-n32 ") libmagic=N32;;
3563300346aeSmrg  *-64|*"-64 ") libmagic=64-bit;;
3564300346aeSmrg  *) libmagic=never-match;;
35653c15da26Smrg  esac
3566300346aeSmrg  lt_cv_deplibs_check_method=pass_all
35673c15da26Smrg  ;;
35683c15da26Smrg
3569300346aeSmrg# This must be glibc/ELF.
3570300346aeSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3571300346aeSmrg  lt_cv_deplibs_check_method=pass_all
35723c15da26Smrg  ;;
35733c15da26Smrg
3574300346aeSmrgnetbsd* | netbsdelf*-gnu)
3575300346aeSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3576300346aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3577555991fdSmrg  else
3578300346aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3579555991fdSmrg  fi
3580555991fdSmrg  ;;
3581555991fdSmrg
3582300346aeSmrgnewos6*)
3583300346aeSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3584300346aeSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3585300346aeSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3586555991fdSmrg  ;;
3587555991fdSmrg
3588300346aeSmrg*nto* | *qnx*)
3589300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3590555991fdSmrg  ;;
3591555991fdSmrg
3592300346aeSmrgopenbsd* | bitrig*)
3593300346aeSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3594300346aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3595300346aeSmrg  else
3596300346aeSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3597300346aeSmrg  fi
35983c15da26Smrg  ;;
3599555991fdSmrg
3600300346aeSmrgosf3* | osf4* | osf5*)
3601300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3602300346aeSmrg  ;;
3603555991fdSmrg
3604300346aeSmrgrdos*)
3605300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3606300346aeSmrg  ;;
3607555991fdSmrg
3608300346aeSmrgsolaris*)
3609300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3610300346aeSmrg  ;;
3611555991fdSmrg
3612300346aeSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3613300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3614300346aeSmrg  ;;
3615555991fdSmrg
3616300346aeSmrgsysv4 | sysv4.3*)
3617300346aeSmrg  case $host_vendor in
3618300346aeSmrg  motorola)
3619300346aeSmrg    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]]'
3620300346aeSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3621300346aeSmrg    ;;
3622300346aeSmrg  ncr)
3623300346aeSmrg    lt_cv_deplibs_check_method=pass_all
3624300346aeSmrg    ;;
3625300346aeSmrg  sequent)
3626300346aeSmrg    lt_cv_file_magic_cmd='/bin/file'
3627300346aeSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3628300346aeSmrg    ;;
3629300346aeSmrg  sni)
3630300346aeSmrg    lt_cv_file_magic_cmd='/bin/file'
3631300346aeSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3632300346aeSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3633300346aeSmrg    ;;
3634300346aeSmrg  siemens)
3635300346aeSmrg    lt_cv_deplibs_check_method=pass_all
3636300346aeSmrg    ;;
3637300346aeSmrg  pc)
3638300346aeSmrg    lt_cv_deplibs_check_method=pass_all
3639300346aeSmrg    ;;
3640300346aeSmrg  esac
3641555991fdSmrg  ;;
3642555991fdSmrg
3643300346aeSmrgtpf*)
3644300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3645300346aeSmrg  ;;
3646300346aeSmrgos2*)
3647300346aeSmrg  lt_cv_deplibs_check_method=pass_all
3648300346aeSmrg  ;;
3649300346aeSmrgesac
3650300346aeSmrg])
36513c15da26Smrg
3652300346aeSmrgfile_magic_glob=
3653300346aeSmrgwant_nocaseglob=no
3654300346aeSmrgif test "$build" = "$host"; then
3655300346aeSmrg  case $host_os in
3656300346aeSmrg  mingw* | pw32*)
3657300346aeSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3658300346aeSmrg      want_nocaseglob=yes
3659300346aeSmrg    else
3660300346aeSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
36613c15da26Smrg    fi
3662300346aeSmrg    ;;
3663300346aeSmrg  esac
36643c15da26Smrgfi
36653c15da26Smrg
3666300346aeSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3667300346aeSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3668300346aeSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
36693c15da26Smrg
3670300346aeSmrg_LT_DECL([], [deplibs_check_method], [1],
3671300346aeSmrg    [Method to check whether dependent libraries are shared objects])
3672300346aeSmrg_LT_DECL([], [file_magic_cmd], [1],
3673300346aeSmrg    [Command to use when deplibs_check_method = "file_magic"])
3674300346aeSmrg_LT_DECL([], [file_magic_glob], [1],
3675300346aeSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
3676300346aeSmrg_LT_DECL([], [want_nocaseglob], [1],
3677300346aeSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3678300346aeSmrg])# _LT_CHECK_MAGIC_METHOD
3679555991fdSmrg
3680555991fdSmrg
3681300346aeSmrg# LT_PATH_NM
36823c15da26Smrg# ----------
3683300346aeSmrg# find the pathname to a BSD- or MS-compatible name lister
3684300346aeSmrgAC_DEFUN([LT_PATH_NM],
36853c15da26Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3686300346aeSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3687300346aeSmrg[if test -n "$NM"; then
3688300346aeSmrg  # Let the user override the test.
3689300346aeSmrg  lt_cv_path_NM=$NM
36903c15da26Smrgelse
3691300346aeSmrg  lt_nm_to_check=${ac_tool_prefix}nm
3692300346aeSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3693300346aeSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3694300346aeSmrg  fi
3695300346aeSmrg  for lt_tmp_nm in $lt_nm_to_check; do
3696300346aeSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3697300346aeSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3698300346aeSmrg      IFS=$lt_save_ifs
3699300346aeSmrg      test -z "$ac_dir" && ac_dir=.
3700300346aeSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
3701300346aeSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3702300346aeSmrg	# Check to see if the nm accepts a BSD-compat flag.
3703300346aeSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3704300346aeSmrg	#   nm: unknown option "B" ignored
3705300346aeSmrg	# Tru64's nm complains that /dev/null is an invalid object file
3706300346aeSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3707300346aeSmrg	case $build_os in
3708300346aeSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3709300346aeSmrg	*) lt_bad_file=/dev/null ;;
3710300346aeSmrg	esac
3711300346aeSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3712300346aeSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
3713300346aeSmrg	  lt_cv_path_NM="$tmp_nm -B"
3714300346aeSmrg	  break 2
3715300346aeSmrg	  ;;
3716300346aeSmrg	*)
3717300346aeSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3718300346aeSmrg	  */dev/null*)
3719300346aeSmrg	    lt_cv_path_NM="$tmp_nm -p"
3720300346aeSmrg	    break 2
3721300346aeSmrg	    ;;
3722300346aeSmrg	  *)
3723300346aeSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3724300346aeSmrg	    continue # so that we can try to find one that supports BSD flags
3725300346aeSmrg	    ;;
3726300346aeSmrg	  esac
3727300346aeSmrg	  ;;
3728300346aeSmrg	esac
3729300346aeSmrg      fi
3730300346aeSmrg    done
3731300346aeSmrg    IFS=$lt_save_ifs
37323c15da26Smrg  done
3733300346aeSmrg  : ${lt_cv_path_NM=no}
37343c15da26Smrgfi])
3735300346aeSmrgif test no != "$lt_cv_path_NM"; then
3736300346aeSmrg  NM=$lt_cv_path_NM
37373c15da26Smrgelse
3738300346aeSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3739300346aeSmrg  if test -n "$DUMPBIN"; then :
3740300346aeSmrg    # Let the user override the test.
3741300346aeSmrg  else
3742300346aeSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3743300346aeSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3744300346aeSmrg    *COFF*)
3745300346aeSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3746300346aeSmrg      ;;
3747300346aeSmrg    *)
3748300346aeSmrg      DUMPBIN=:
3749300346aeSmrg      ;;
3750300346aeSmrg    esac
3751300346aeSmrg  fi
3752300346aeSmrg  AC_SUBST([DUMPBIN])
3753300346aeSmrg  if test : != "$DUMPBIN"; then
3754300346aeSmrg    NM=$DUMPBIN
3755300346aeSmrg  fi
37563c15da26Smrgfi
3757300346aeSmrgtest -z "$NM" && NM=nm
3758300346aeSmrgAC_SUBST([NM])
3759300346aeSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3760126a8a12Smrg
3761300346aeSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3762300346aeSmrg  [lt_cv_nm_interface="BSD nm"
3763300346aeSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
3764300346aeSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3765300346aeSmrg  (eval "$ac_compile" 2>conftest.err)
3766300346aeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3767300346aeSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3768300346aeSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3769300346aeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3770300346aeSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3771300346aeSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3772300346aeSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3773300346aeSmrg    lt_cv_nm_interface="MS dumpbin"
3774300346aeSmrg  fi
3775300346aeSmrg  rm -f conftest*])
3776300346aeSmrg])# LT_PATH_NM
3777126a8a12Smrg
37783c15da26Smrg# Old names:
3779300346aeSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3780300346aeSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
37813c15da26Smrgdnl aclocal-1.4 backwards compatibility:
3782300346aeSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3783300346aeSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3784126a8a12Smrg
3785300346aeSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3786300346aeSmrg# --------------------------------
3787300346aeSmrg# how to determine the name of the shared library
3788300346aeSmrg# associated with a specific link library.
3789300346aeSmrg#  -- PORTME fill in with the dynamic library characteristics
3790300346aeSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3791300346aeSmrg[m4_require([_LT_DECL_EGREP])
3792300346aeSmrgm4_require([_LT_DECL_OBJDUMP])
3793300346aeSmrgm4_require([_LT_DECL_DLLTOOL])
3794300346aeSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3795300346aeSmrglt_cv_sharedlib_from_linklib_cmd,
3796300346aeSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3797126a8a12Smrg
37983c15da26Smrgcase $host_os in
3799300346aeSmrgcygwin* | mingw* | pw32* | cegcc*)
3800300346aeSmrg  # two different shell functions defined in ltmain.sh;
3801300346aeSmrg  # decide which one to use based on capabilities of $DLLTOOL
3802300346aeSmrg  case `$DLLTOOL --help 2>&1` in
3803300346aeSmrg  *--identify-strict*)
3804300346aeSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
38053c15da26Smrg    ;;
3806300346aeSmrg  *)
3807300346aeSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
38083c15da26Smrg    ;;
3809300346aeSmrg  esac
3810300346aeSmrg  ;;
3811300346aeSmrg*)
3812300346aeSmrg  # fallback: assume linklib IS sharedlib
3813300346aeSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3814300346aeSmrg  ;;
38153c15da26Smrgesac
3816300346aeSmrg])
3817300346aeSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3818300346aeSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3819300346aeSmrg
3820300346aeSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3821300346aeSmrg    [Command to associate shared and link libraries])
3822300346aeSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3823126a8a12Smrg
3824126a8a12Smrg
3825300346aeSmrg# _LT_PATH_MANIFEST_TOOL
38263c15da26Smrg# ----------------------
3827300346aeSmrg# locate the manifest tool
3828300346aeSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3829300346aeSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3830300346aeSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3831300346aeSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3832300346aeSmrg  [lt_cv_path_mainfest_tool=no
3833300346aeSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3834300346aeSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3835300346aeSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3836300346aeSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3837300346aeSmrg    lt_cv_path_mainfest_tool=yes
3838300346aeSmrg  fi
3839300346aeSmrg  rm -f conftest*])
3840300346aeSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
3841300346aeSmrg  MANIFEST_TOOL=:
3842300346aeSmrgfi
3843300346aeSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3844300346aeSmrg])# _LT_PATH_MANIFEST_TOOL
38453c15da26Smrg
3846126a8a12Smrg
3847300346aeSmrg# _LT_DLL_DEF_P([FILE])
3848300346aeSmrg# ---------------------
3849300346aeSmrg# True iff FILE is a Windows DLL '.def' file.
3850300346aeSmrg# Keep in sync with func_dll_def_p in the libtool script
3851300346aeSmrgAC_DEFUN([_LT_DLL_DEF_P],
3852300346aeSmrg[dnl
3853300346aeSmrg  test DEF = "`$SED -n dnl
3854300346aeSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3855300346aeSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3856300346aeSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3857300346aeSmrg    -e q dnl                          Only consider the first "real" line
3858300346aeSmrg    $1`" dnl
3859300346aeSmrg])# _LT_DLL_DEF_P
3860555991fdSmrg
3861555991fdSmrg
3862300346aeSmrg# LT_LIB_M
3863300346aeSmrg# --------
3864300346aeSmrg# check for math library
3865300346aeSmrgAC_DEFUN([LT_LIB_M],
3866300346aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3867300346aeSmrgLIBM=
3868300346aeSmrgcase $host in
3869300346aeSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3870300346aeSmrg  # These system don't have libm, or don't need it
3871555991fdSmrg  ;;
3872300346aeSmrg*-ncr-sysv4.3*)
3873300346aeSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3874300346aeSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3875555991fdSmrg  ;;
3876300346aeSmrg*)
3877300346aeSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
3878555991fdSmrg  ;;
3879300346aeSmrgesac
3880300346aeSmrgAC_SUBST([LIBM])
3881300346aeSmrg])# LT_LIB_M
3882126a8a12Smrg
3883300346aeSmrg# Old name:
3884300346aeSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3885300346aeSmrgdnl aclocal-1.4 backwards compatibility:
3886300346aeSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3887126a8a12Smrg
3888126a8a12Smrg
3889300346aeSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3890300346aeSmrg# -------------------------------
3891300346aeSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3892300346aeSmrg[m4_require([_LT_TAG_COMPILER])dnl
3893126a8a12Smrg
3894300346aeSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3895126a8a12Smrg
3896300346aeSmrgif test yes = "$GCC"; then
3897300346aeSmrg  case $cc_basename in
3898300346aeSmrg  nvcc*)
3899300346aeSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
39003c15da26Smrg  *)
3901300346aeSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
39023c15da26Smrg  esac
3903126a8a12Smrg
3904300346aeSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3905300346aeSmrg    lt_cv_prog_compiler_rtti_exceptions,
3906300346aeSmrg    [-fno-rtti -fno-exceptions], [],
3907300346aeSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3908300346aeSmrgfi
3909300346aeSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3910300346aeSmrg	[Compiler flag to turn off builtin functions])
3911300346aeSmrg])# _LT_COMPILER_NO_RTTI
3912126a8a12Smrg
3913126a8a12Smrg
3914300346aeSmrg# _LT_CMD_GLOBAL_SYMBOLS
3915300346aeSmrg# ----------------------
3916300346aeSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3917300346aeSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3918300346aeSmrgAC_REQUIRE([AC_PROG_CC])dnl
3919300346aeSmrgAC_REQUIRE([AC_PROG_AWK])dnl
3920300346aeSmrgAC_REQUIRE([LT_PATH_NM])dnl
3921300346aeSmrgAC_REQUIRE([LT_PATH_LD])dnl
3922300346aeSmrgm4_require([_LT_DECL_SED])dnl
3923300346aeSmrgm4_require([_LT_DECL_EGREP])dnl
3924300346aeSmrgm4_require([_LT_TAG_COMPILER])dnl
3925555991fdSmrg
3926300346aeSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3927300346aeSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3928300346aeSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3929300346aeSmrg[
3930300346aeSmrg# These are sane defaults that work on at least a few old systems.
3931300346aeSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3932126a8a12Smrg
3933300346aeSmrg# Character class describing NM global symbol codes.
3934300346aeSmrgsymcode='[[BCDEGRST]]'
3935126a8a12Smrg
3936300346aeSmrg# Regexp to match symbols that can be accessed directly from C.
3937300346aeSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3938126a8a12Smrg
3939300346aeSmrg# Define system-specific variables.
3940300346aeSmrgcase $host_os in
3941300346aeSmrgaix*)
3942300346aeSmrg  symcode='[[BCDT]]'
3943300346aeSmrg  ;;
3944300346aeSmrgcygwin* | mingw* | pw32* | cegcc*)
3945300346aeSmrg  symcode='[[ABCDGISTW]]'
3946300346aeSmrg  ;;
3947300346aeSmrghpux*)
3948300346aeSmrg  if test ia64 = "$host_cpu"; then
3949300346aeSmrg    symcode='[[ABCDEGRST]]'
3950d656433aSmrg  fi
39513c15da26Smrg  ;;
3952300346aeSmrgirix* | nonstopux*)
3953300346aeSmrg  symcode='[[BCDEGRST]]'
39543c15da26Smrg  ;;
3955300346aeSmrgosf*)
3956300346aeSmrg  symcode='[[BCDEGQRST]]'
39573c15da26Smrg  ;;
39583c15da26Smrgsolaris*)
3959300346aeSmrg  symcode='[[BDRT]]'
39603c15da26Smrg  ;;
3961300346aeSmrgsco3.2v5*)
3962300346aeSmrg  symcode='[[DT]]'
39633c15da26Smrg  ;;
3964300346aeSmrgsysv4.2uw2*)
3965300346aeSmrg  symcode='[[DT]]'
39663c15da26Smrg  ;;
3967300346aeSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3968300346aeSmrg  symcode='[[ABDT]]'
3969300346aeSmrg  ;;
3970300346aeSmrgsysv4)
3971300346aeSmrg  symcode='[[DFNSTU]]'
39723c15da26Smrg  ;;
39733c15da26Smrgesac
39743c15da26Smrg
3975300346aeSmrg# If we're using GNU nm, then use its standard symbol codes.
3976300346aeSmrgcase `$NM -V 2>&1` in
3977300346aeSmrg*GNU* | *'with BFD'*)
3978300346aeSmrg  symcode='[[ABCDGIRSTW]]' ;;
3979300346aeSmrgesac
39803c15da26Smrg
3981300346aeSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3982300346aeSmrg  # Gets list of data symbols to import.
3983300346aeSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3984300346aeSmrg  # Adjust the below global symbol transforms to fixup imported variables.
3985300346aeSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3986300346aeSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3987300346aeSmrg  lt_c_name_lib_hook="\
3988300346aeSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3989300346aeSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3990555991fdSmrgelse
3991300346aeSmrg  # Disable hooks by default.
3992300346aeSmrg  lt_cv_sys_global_symbol_to_import=
3993300346aeSmrg  lt_cdecl_hook=
3994300346aeSmrg  lt_c_name_hook=
3995300346aeSmrg  lt_c_name_lib_hook=
3996555991fdSmrgfi
3997d656433aSmrg
3998300346aeSmrg# Transform an extracted symbol line into a proper C declaration.
3999300346aeSmrg# Some systems (esp. on ia64) link data and code symbols differently,
4000300346aeSmrg# so use this general approach.
4001300346aeSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
4002300346aeSmrg$lt_cdecl_hook\
4003300346aeSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
4004300346aeSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
4005126a8a12Smrg
4006300346aeSmrg# Transform an extracted symbol line into symbol name and symbol address
4007300346aeSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4008300346aeSmrg$lt_c_name_hook\
4009300346aeSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4010300346aeSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4011300346aeSmrg
4012300346aeSmrg# Transform an extracted symbol line into symbol name with lib prefix and
4013300346aeSmrg# symbol address.
4014300346aeSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4015300346aeSmrg$lt_c_name_lib_hook\
4016300346aeSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4017300346aeSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4018300346aeSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4019126a8a12Smrg
4020300346aeSmrg# Handle CRLF in mingw tool chain
4021300346aeSmrgopt_cr=
4022300346aeSmrgcase $build_os in
4023300346aeSmrgmingw*)
4024300346aeSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4025555991fdSmrg  ;;
4026555991fdSmrgesac
4027d656433aSmrg
40283c15da26Smrg# Try without a prefix underscore, then with it.
40293c15da26Smrgfor ac_symprfx in "" "_"; do
4030d656433aSmrg
40313c15da26Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
40323c15da26Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4033d656433aSmrg
40343c15da26Smrg  # Write the raw and C identifiers.
40353c15da26Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4036300346aeSmrg    # Fake it for dumpbin and say T for any non-static function,
4037300346aeSmrg    # D for any global variable and I for any imported variable.
40383c15da26Smrg    # Also find C++ and __fastcall symbols from MSVC++,
40393c15da26Smrg    # which start with @ or ?.
40403c15da26Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
40413c15da26Smrg"     {last_section=section; section=\$ 3};"\
40420a6b08f8Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
40433c15da26Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4044300346aeSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4045300346aeSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4046300346aeSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
40473c15da26Smrg"     \$ 0!~/External *\|/{next};"\
40483c15da26Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
40493c15da26Smrg"     {if(hide[section]) next};"\
4050300346aeSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4051300346aeSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4052300346aeSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4053300346aeSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
40543c15da26Smrg"     ' prfx=^$ac_symprfx]"
40553c15da26Smrg  else
40563c15da26Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4057555991fdSmrg  fi
40583c15da26Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4059d656433aSmrg
4060555991fdSmrg  # Check to see that the pipe works correctly.
4061555991fdSmrg  pipe_works=no
4062d656433aSmrg
4063555991fdSmrg  rm -f conftest*
4064555991fdSmrg  cat > conftest.$ac_ext <<_LT_EOF
4065555991fdSmrg#ifdef __cplusplus
4066555991fdSmrgextern "C" {
4067555991fdSmrg#endif
4068555991fdSmrgchar nm_test_var;
4069555991fdSmrgvoid nm_test_func(void);
4070555991fdSmrgvoid nm_test_func(void){}
4071555991fdSmrg#ifdef __cplusplus
4072555991fdSmrg}
4073555991fdSmrg#endif
4074555991fdSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4075555991fdSmrg_LT_EOF
4076d656433aSmrg
4077555991fdSmrg  if AC_TRY_EVAL(ac_compile); then
4078555991fdSmrg    # Now try to grab the symbols.
4079555991fdSmrg    nlist=conftest.nm
4080555991fdSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4081555991fdSmrg      # Try sorting and uniquifying the output.
4082555991fdSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4083555991fdSmrg	mv -f "$nlist"T "$nlist"
4084555991fdSmrg      else
4085555991fdSmrg	rm -f "$nlist"T
4086555991fdSmrg      fi
4087d656433aSmrg
4088555991fdSmrg      # Make sure that we snagged all the symbols we need.
4089555991fdSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4090555991fdSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4091555991fdSmrg	  cat <<_LT_EOF > conftest.$ac_ext
40923c15da26Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4093300346aeSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4094300346aeSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
40953c15da26Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
40963c15da26Smrg# define LT@&t@_DLSYM_CONST
4097300346aeSmrg#elif defined __osf__
40983c15da26Smrg/* This system does not cope well with relocations in const data.  */
40993c15da26Smrg# define LT@&t@_DLSYM_CONST
41003c15da26Smrg#else
41013c15da26Smrg# define LT@&t@_DLSYM_CONST const
41023c15da26Smrg#endif
41033c15da26Smrg
4104555991fdSmrg#ifdef __cplusplus
4105555991fdSmrgextern "C" {
4106555991fdSmrg#endif
4107d656433aSmrg
4108555991fdSmrg_LT_EOF
4109555991fdSmrg	  # Now generate the symbol file.
4110555991fdSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4111d656433aSmrg
4112555991fdSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4113d656433aSmrg
4114555991fdSmrg/* The mapping between symbol names and symbols.  */
41153c15da26SmrgLT@&t@_DLSYM_CONST struct {
4116555991fdSmrg  const char *name;
4117555991fdSmrg  void       *address;
4118555991fdSmrg}
4119555991fdSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4120555991fdSmrg{
4121555991fdSmrg  { "@PROGRAM@", (void *) 0 },
4122555991fdSmrg_LT_EOF
4123300346aeSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4124555991fdSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4125555991fdSmrg  {0, (void *) 0}
4126555991fdSmrg};
4127d656433aSmrg
4128555991fdSmrg/* This works around a problem in FreeBSD linker */
4129555991fdSmrg#ifdef FREEBSD_WORKAROUND
4130555991fdSmrgstatic const void *lt_preloaded_setup() {
4131555991fdSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4132555991fdSmrg}
4133555991fdSmrg#endif
4134d656433aSmrg
4135555991fdSmrg#ifdef __cplusplus
4136555991fdSmrg}
4137555991fdSmrg#endif
4138555991fdSmrg_LT_EOF
4139555991fdSmrg	  # Now try linking the two files.
4140555991fdSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
41413c15da26Smrg	  lt_globsym_save_LIBS=$LIBS
41423c15da26Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4143300346aeSmrg	  LIBS=conftstm.$ac_objext
4144555991fdSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4145300346aeSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4146555991fdSmrg	    pipe_works=yes
4147555991fdSmrg	  fi
41483c15da26Smrg	  LIBS=$lt_globsym_save_LIBS
41493c15da26Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
4150555991fdSmrg	else
4151555991fdSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4152555991fdSmrg	fi
4153555991fdSmrg      else
4154555991fdSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4155555991fdSmrg      fi
4156555991fdSmrg    else
4157555991fdSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4158555991fdSmrg    fi
4159555991fdSmrg  else
4160555991fdSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4161555991fdSmrg    cat conftest.$ac_ext >&5
4162555991fdSmrg  fi
4163555991fdSmrg  rm -rf conftest* conftst*
4164d656433aSmrg
4165555991fdSmrg  # Do not use the global_symbol_pipe unless it works.
4166300346aeSmrg  if test yes = "$pipe_works"; then
4167555991fdSmrg    break
4168555991fdSmrg  else
4169555991fdSmrg    lt_cv_sys_global_symbol_pipe=
4170555991fdSmrg  fi
4171555991fdSmrgdone
4172555991fdSmrg])
4173555991fdSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4174555991fdSmrg  lt_cv_sys_global_symbol_to_cdecl=
4175555991fdSmrgfi
4176555991fdSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4177555991fdSmrg  AC_MSG_RESULT(failed)
4178555991fdSmrgelse
4179555991fdSmrg  AC_MSG_RESULT(ok)
4180555991fdSmrgfi
4181d656433aSmrg
41823c15da26Smrg# Response file support.
41833c15da26Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
41843c15da26Smrg  nm_file_list_spec='@'
41853c15da26Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
41863c15da26Smrg  nm_file_list_spec='@'
41873c15da26Smrgfi
41883c15da26Smrg
4189555991fdSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4190555991fdSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4191555991fdSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4192555991fdSmrg    [Transform the output of nm in a proper C declaration])
4193300346aeSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4194300346aeSmrg    [Transform the output of nm into a list of symbols to manually relocate])
4195555991fdSmrg_LT_DECL([global_symbol_to_c_name_address],
4196555991fdSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4197555991fdSmrg    [Transform the output of nm in a C name address pair])
4198555991fdSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4199555991fdSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4200555991fdSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4201300346aeSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4202300346aeSmrg    [The name lister interface])
42033c15da26Smrg_LT_DECL([], [nm_file_list_spec], [1],
42043c15da26Smrg    [Specify filename containing input files for $NM])
4205555991fdSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4206d656433aSmrg
4207d656433aSmrg
4208555991fdSmrg# _LT_COMPILER_PIC([TAGNAME])
4209555991fdSmrg# ---------------------------
4210555991fdSmrgm4_defun([_LT_COMPILER_PIC],
4211555991fdSmrg[m4_require([_LT_TAG_COMPILER])dnl
4212555991fdSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4213555991fdSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4214555991fdSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4215555991fdSmrg
4216555991fdSmrgm4_if([$1], [CXX], [
4217555991fdSmrg  # C++ specific cases for pic, static, wl, etc.
4218300346aeSmrg  if test yes = "$GXX"; then
4219555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4220555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4221555991fdSmrg
4222555991fdSmrg    case $host_os in
4223555991fdSmrg    aix*)
4224555991fdSmrg      # All AIX code is PIC.
4225300346aeSmrg      if test ia64 = "$host_cpu"; then
4226555991fdSmrg	# AIX 5 now supports IA64 processor
4227555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4228555991fdSmrg      fi
4229300346aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4230555991fdSmrg      ;;
4231d656433aSmrg
4232555991fdSmrg    amigaos*)
4233555991fdSmrg      case $host_cpu in
4234555991fdSmrg      powerpc)
4235555991fdSmrg            # see comment about AmigaOS4 .so support
4236555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4237555991fdSmrg        ;;
4238555991fdSmrg      m68k)
4239555991fdSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4240300346aeSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4241300346aeSmrg            # like '-m68040'.
4242555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4243d656433aSmrg        ;;
4244555991fdSmrg      esac
4245555991fdSmrg      ;;
4246d656433aSmrg
4247555991fdSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4248555991fdSmrg      # PIC is the default for these OSes.
4249555991fdSmrg      ;;
4250555991fdSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4251555991fdSmrg      # This hack is so that the source file can tell whether it is being
4252555991fdSmrg      # built for inclusion in a dll (and should export symbols for example).
4253555991fdSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4254555991fdSmrg      # (--disable-auto-import) libraries
4255555991fdSmrg      m4_if([$1], [GCJ], [],
4256555991fdSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4257300346aeSmrg      case $host_os in
4258300346aeSmrg      os2*)
4259300346aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4260300346aeSmrg	;;
4261300346aeSmrg      esac
4262555991fdSmrg      ;;
4263555991fdSmrg    darwin* | rhapsody*)
4264555991fdSmrg      # PIC is the default on this platform
4265555991fdSmrg      # Common symbols not allowed in MH_DYLIB files
4266555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4267555991fdSmrg      ;;
4268555991fdSmrg    *djgpp*)
4269555991fdSmrg      # DJGPP does not support shared libraries at all
4270555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4271555991fdSmrg      ;;
4272555991fdSmrg    haiku*)
4273555991fdSmrg      # PIC is the default for Haiku.
4274555991fdSmrg      # The "-static" flag exists, but is broken.
4275555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4276555991fdSmrg      ;;
4277555991fdSmrg    interix[[3-9]]*)
4278555991fdSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4279555991fdSmrg      # Instead, we relocate shared libraries at runtime.
4280555991fdSmrg      ;;
4281555991fdSmrg    sysv4*MP*)
4282555991fdSmrg      if test -d /usr/nec; then
4283555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4284555991fdSmrg      fi
4285555991fdSmrg      ;;
4286555991fdSmrg    hpux*)
4287555991fdSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4288555991fdSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4289555991fdSmrg      # sets the default TLS model and affects inlining.
4290555991fdSmrg      case $host_cpu in
4291555991fdSmrg      hppa*64*)
4292126a8a12Smrg	;;
4293555991fdSmrg      *)
4294555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4295555991fdSmrg	;;
4296555991fdSmrg      esac
4297555991fdSmrg      ;;
4298555991fdSmrg    *qnx* | *nto*)
4299555991fdSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4300555991fdSmrg      # it will coredump.
4301555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4302555991fdSmrg      ;;
4303555991fdSmrg    *)
4304555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4305555991fdSmrg      ;;
4306555991fdSmrg    esac
4307555991fdSmrg  else
4308555991fdSmrg    case $host_os in
4309555991fdSmrg      aix[[4-9]]*)
4310555991fdSmrg	# All AIX code is PIC.
4311300346aeSmrg	if test ia64 = "$host_cpu"; then
4312555991fdSmrg	  # AIX 5 now supports IA64 processor
4313555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4314555991fdSmrg	else
4315555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4316555991fdSmrg	fi
4317555991fdSmrg	;;
4318555991fdSmrg      chorus*)
4319555991fdSmrg	case $cc_basename in
4320555991fdSmrg	cxch68*)
4321555991fdSmrg	  # Green Hills C++ Compiler
4322555991fdSmrg	  # _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"
4323555991fdSmrg	  ;;
4324555991fdSmrg	esac
4325555991fdSmrg	;;
43263c15da26Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
43273c15da26Smrg	# This hack is so that the source file can tell whether it is being
43283c15da26Smrg	# built for inclusion in a dll (and should export symbols for example).
43293c15da26Smrg	m4_if([$1], [GCJ], [],
43303c15da26Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
43313c15da26Smrg	;;
4332555991fdSmrg      dgux*)
4333555991fdSmrg	case $cc_basename in
4334555991fdSmrg	  ec++*)
4335555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4336126a8a12Smrg	    ;;
4337555991fdSmrg	  ghcx*)
4338555991fdSmrg	    # Green Hills C++ Compiler
4339555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4340126a8a12Smrg	    ;;
4341555991fdSmrg	  *)
4342126a8a12Smrg	    ;;
4343555991fdSmrg	esac
4344555991fdSmrg	;;
4345555991fdSmrg      freebsd* | dragonfly*)
4346555991fdSmrg	# FreeBSD uses GNU C++
4347555991fdSmrg	;;
4348555991fdSmrg      hpux9* | hpux10* | hpux11*)
4349555991fdSmrg	case $cc_basename in
4350555991fdSmrg	  CC*)
4351555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4352300346aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4353300346aeSmrg	    if test ia64 != "$host_cpu"; then
4354555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4355555991fdSmrg	    fi
4356126a8a12Smrg	    ;;
4357555991fdSmrg	  aCC*)
4358555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4359300346aeSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4360555991fdSmrg	    case $host_cpu in
4361555991fdSmrg	    hppa*64*|ia64*)
4362555991fdSmrg	      # +Z the default
4363d656433aSmrg	      ;;
4364555991fdSmrg	    *)
4365555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4366d656433aSmrg	      ;;
4367d656433aSmrg	    esac
4368126a8a12Smrg	    ;;
4369126a8a12Smrg	  *)
4370126a8a12Smrg	    ;;
4371126a8a12Smrg	esac
4372126a8a12Smrg	;;
4373555991fdSmrg      interix*)
4374555991fdSmrg	# This is c89, which is MS Visual C++ (no shared libs)
4375555991fdSmrg	# Anyone wants to do a port?
4376126a8a12Smrg	;;
4377555991fdSmrg      irix5* | irix6* | nonstopux*)
4378555991fdSmrg	case $cc_basename in
4379555991fdSmrg	  CC*)
4380555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4381555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4382555991fdSmrg	    # CC pic flag -KPIC is the default.
4383126a8a12Smrg	    ;;
4384126a8a12Smrg	  *)
4385126a8a12Smrg	    ;;
4386126a8a12Smrg	esac
4387126a8a12Smrg	;;
4388300346aeSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4389555991fdSmrg	case $cc_basename in
4390555991fdSmrg	  KCC*)
4391555991fdSmrg	    # KAI C++ Compiler
4392555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4393555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4394126a8a12Smrg	    ;;
4395555991fdSmrg	  ecpc* )
4396300346aeSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
4397555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4398555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4399555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4400126a8a12Smrg	    ;;
4401555991fdSmrg	  icpc* )
4402555991fdSmrg	    # Intel C++, used to be incompatible with GCC.
4403555991fdSmrg	    # ICC 10 doesn't accept -KPIC any more.
4404555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4405555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4406555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4407555991fdSmrg	    ;;
4408555991fdSmrg	  pgCC* | pgcpp*)
4409555991fdSmrg	    # Portland Group C++ compiler
4410555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4411555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4412555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4413555991fdSmrg	    ;;
4414555991fdSmrg	  cxx*)
4415555991fdSmrg	    # Compaq C++
4416555991fdSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4417555991fdSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4418555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4419555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4420555991fdSmrg	    ;;
4421555991fdSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4422555991fdSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4423555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4424555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4425555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4426126a8a12Smrg	    ;;
4427126a8a12Smrg	  *)
4428555991fdSmrg	    case `$CC -V 2>&1 | sed 5q` in
4429555991fdSmrg	    *Sun\ C*)
4430555991fdSmrg	      # Sun C++ 5.9
4431555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4432555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4433555991fdSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4434555991fdSmrg	      ;;
4435555991fdSmrg	    esac
4436126a8a12Smrg	    ;;
4437555991fdSmrg	esac
4438555991fdSmrg	;;
4439555991fdSmrg      lynxos*)
4440555991fdSmrg	;;
4441555991fdSmrg      m88k*)
4442555991fdSmrg	;;
4443555991fdSmrg      mvs*)
4444555991fdSmrg	case $cc_basename in
4445555991fdSmrg	  cxx*)
4446555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4447555991fdSmrg	    ;;
4448555991fdSmrg	  *)
4449555991fdSmrg	    ;;
4450555991fdSmrg	esac
4451555991fdSmrg	;;
4452300346aeSmrg      netbsd* | netbsdelf*-gnu)
4453555991fdSmrg	;;
4454555991fdSmrg      *qnx* | *nto*)
4455555991fdSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4456555991fdSmrg        # it will coredump.
4457555991fdSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4458d656433aSmrg        ;;
4459555991fdSmrg      osf3* | osf4* | osf5*)
4460555991fdSmrg	case $cc_basename in
4461555991fdSmrg	  KCC*)
4462555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4463126a8a12Smrg	    ;;
4464555991fdSmrg	  RCC*)
4465555991fdSmrg	    # Rational C++ 2.4.1
4466555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4467126a8a12Smrg	    ;;
4468555991fdSmrg	  cxx*)
4469555991fdSmrg	    # Digital/Compaq C++
4470555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4471555991fdSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4472555991fdSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4473555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4474555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4475d656433aSmrg	    ;;
4476555991fdSmrg	  *)
4477555991fdSmrg	    ;;
4478555991fdSmrg	esac
4479555991fdSmrg	;;
4480555991fdSmrg      psos*)
4481555991fdSmrg	;;
4482d656433aSmrg      solaris*)
4483555991fdSmrg	case $cc_basename in
4484555991fdSmrg	  CC* | sunCC*)
4485d656433aSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
4486555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4487555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4488555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4489d656433aSmrg	    ;;
4490555991fdSmrg	  gcx*)
4491d656433aSmrg	    # Green Hills C++ Compiler
4492555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4493d656433aSmrg	    ;;
4494555991fdSmrg	  *)
4495d656433aSmrg	    ;;
4496555991fdSmrg	esac
4497555991fdSmrg	;;
4498555991fdSmrg      sunos4*)
4499d656433aSmrg	case $cc_basename in
4500555991fdSmrg	  CC*)
4501555991fdSmrg	    # Sun C++ 4.x
4502555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4503555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4504555991fdSmrg	    ;;
4505555991fdSmrg	  lcc*)
4506555991fdSmrg	    # Lucid
4507555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4508d656433aSmrg	    ;;
4509d656433aSmrg	  *)
4510d656433aSmrg	    ;;
4511d656433aSmrg	esac
4512555991fdSmrg	;;
4513555991fdSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4514555991fdSmrg	case $cc_basename in
4515555991fdSmrg	  CC*)
4516555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4517555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4518555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4519555991fdSmrg	    ;;
4520555991fdSmrg	esac
4521555991fdSmrg	;;
4522d656433aSmrg      tandem*)
4523555991fdSmrg	case $cc_basename in
4524555991fdSmrg	  NCC*)
4525d656433aSmrg	    # NonStop-UX NCC 3.20
4526555991fdSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4527d656433aSmrg	    ;;
4528555991fdSmrg	  *)
4529d656433aSmrg	    ;;
4530555991fdSmrg	esac
4531555991fdSmrg	;;
4532555991fdSmrg      vxworks*)
4533555991fdSmrg	;;
4534555991fdSmrg      *)
4535555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4536555991fdSmrg	;;
4537555991fdSmrg    esac
4538555991fdSmrg  fi
4539555991fdSmrg],
4540555991fdSmrg[
4541300346aeSmrg  if test yes = "$GCC"; then
4542555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4543555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4544555991fdSmrg
4545555991fdSmrg    case $host_os in
4546555991fdSmrg      aix*)
4547555991fdSmrg      # All AIX code is PIC.
4548300346aeSmrg      if test ia64 = "$host_cpu"; then
4549555991fdSmrg	# AIX 5 now supports IA64 processor
4550555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4551555991fdSmrg      fi
4552300346aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4553555991fdSmrg      ;;
4554555991fdSmrg
4555555991fdSmrg    amigaos*)
4556555991fdSmrg      case $host_cpu in
4557555991fdSmrg      powerpc)
4558555991fdSmrg            # see comment about AmigaOS4 .so support
4559555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4560555991fdSmrg        ;;
4561555991fdSmrg      m68k)
4562555991fdSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
4563300346aeSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
4564300346aeSmrg            # like '-m68040'.
4565555991fdSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4566d656433aSmrg        ;;
4567555991fdSmrg      esac
4568555991fdSmrg      ;;
4569555991fdSmrg
4570555991fdSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4571555991fdSmrg      # PIC is the default for these OSes.
4572555991fdSmrg      ;;
4573126a8a12Smrg
4574555991fdSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4575555991fdSmrg      # This hack is so that the source file can tell whether it is being
4576555991fdSmrg      # built for inclusion in a dll (and should export symbols for example).
4577555991fdSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4578555991fdSmrg      # (--disable-auto-import) libraries
4579555991fdSmrg      m4_if([$1], [GCJ], [],
4580555991fdSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4581300346aeSmrg      case $host_os in
4582300346aeSmrg      os2*)
4583300346aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4584300346aeSmrg	;;
4585300346aeSmrg      esac
4586555991fdSmrg      ;;
4587126a8a12Smrg
4588555991fdSmrg    darwin* | rhapsody*)
4589555991fdSmrg      # PIC is the default on this platform
4590555991fdSmrg      # Common symbols not allowed in MH_DYLIB files
4591555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4592555991fdSmrg      ;;
4593126a8a12Smrg
4594555991fdSmrg    haiku*)
4595555991fdSmrg      # PIC is the default for Haiku.
4596555991fdSmrg      # The "-static" flag exists, but is broken.
4597555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4598555991fdSmrg      ;;
4599d656433aSmrg
4600555991fdSmrg    hpux*)
4601555991fdSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4602555991fdSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4603555991fdSmrg      # sets the default TLS model and affects inlining.
4604555991fdSmrg      case $host_cpu in
4605555991fdSmrg      hppa*64*)
4606555991fdSmrg	# +Z the default
4607555991fdSmrg	;;
4608555991fdSmrg      *)
4609555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4610555991fdSmrg	;;
4611555991fdSmrg      esac
4612555991fdSmrg      ;;
4613d656433aSmrg
4614555991fdSmrg    interix[[3-9]]*)
4615555991fdSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4616555991fdSmrg      # Instead, we relocate shared libraries at runtime.
4617555991fdSmrg      ;;
4618d656433aSmrg
4619555991fdSmrg    msdosdjgpp*)
4620555991fdSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4621555991fdSmrg      # on systems that don't support them.
4622555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4623555991fdSmrg      enable_shared=no
4624555991fdSmrg      ;;
4625d656433aSmrg
4626555991fdSmrg    *nto* | *qnx*)
4627555991fdSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4628555991fdSmrg      # it will coredump.
4629555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4630555991fdSmrg      ;;
4631126a8a12Smrg
4632555991fdSmrg    sysv4*MP*)
4633555991fdSmrg      if test -d /usr/nec; then
4634555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4635555991fdSmrg      fi
4636555991fdSmrg      ;;
4637126a8a12Smrg
4638555991fdSmrg    *)
4639555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4640555991fdSmrg      ;;
4641555991fdSmrg    esac
4642126a8a12Smrg
4643555991fdSmrg    case $cc_basename in
4644555991fdSmrg    nvcc*) # Cuda Compiler Driver 2.2
4645555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
46460a6b08f8Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
46470a6b08f8Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
46480a6b08f8Smrg      fi
4649555991fdSmrg      ;;
4650555991fdSmrg    esac
4651555991fdSmrg  else
4652555991fdSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
4653555991fdSmrg    case $host_os in
4654555991fdSmrg    aix*)
4655555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4656300346aeSmrg      if test ia64 = "$host_cpu"; then
4657555991fdSmrg	# AIX 5 now supports IA64 processor
4658555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4659555991fdSmrg      else
4660555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4661555991fdSmrg      fi
4662555991fdSmrg      ;;
4663126a8a12Smrg
4664300346aeSmrg    darwin* | rhapsody*)
4665300346aeSmrg      # PIC is the default on this platform
4666300346aeSmrg      # Common symbols not allowed in MH_DYLIB files
4667300346aeSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4668300346aeSmrg      case $cc_basename in
4669300346aeSmrg      nagfor*)
4670300346aeSmrg        # NAG Fortran compiler
4671300346aeSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4672300346aeSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4673300346aeSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4674300346aeSmrg        ;;
4675300346aeSmrg      esac
4676300346aeSmrg      ;;
4677300346aeSmrg
4678555991fdSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4679555991fdSmrg      # This hack is so that the source file can tell whether it is being
4680555991fdSmrg      # built for inclusion in a dll (and should export symbols for example).
4681555991fdSmrg      m4_if([$1], [GCJ], [],
4682555991fdSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4683300346aeSmrg      case $host_os in
4684300346aeSmrg      os2*)
4685300346aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4686300346aeSmrg	;;
4687300346aeSmrg      esac
4688555991fdSmrg      ;;
4689126a8a12Smrg
4690555991fdSmrg    hpux9* | hpux10* | hpux11*)
4691555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4692555991fdSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4693555991fdSmrg      # not for PA HP-UX.
4694555991fdSmrg      case $host_cpu in
4695555991fdSmrg      hppa*64*|ia64*)
4696555991fdSmrg	# +Z the default
4697555991fdSmrg	;;
4698555991fdSmrg      *)
4699555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4700555991fdSmrg	;;
4701555991fdSmrg      esac
4702555991fdSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4703300346aeSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4704555991fdSmrg      ;;
4705126a8a12Smrg
4706555991fdSmrg    irix5* | irix6* | nonstopux*)
4707555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4708555991fdSmrg      # PIC (with -KPIC) is the default.
4709555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4710555991fdSmrg      ;;
4711126a8a12Smrg
4712300346aeSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4713555991fdSmrg      case $cc_basename in
4714300346aeSmrg      # old Intel for x86_64, which still supported -KPIC.
4715555991fdSmrg      ecc*)
4716555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4717555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4718555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4719555991fdSmrg        ;;
4720555991fdSmrg      # icc used to be incompatible with GCC.
4721555991fdSmrg      # ICC 10 doesn't accept -KPIC any more.
4722555991fdSmrg      icc* | ifort*)
4723555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4724555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4725555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4726555991fdSmrg        ;;
4727555991fdSmrg      # Lahey Fortran 8.1.
4728555991fdSmrg      lf95*)
4729555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4730555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4731555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4732555991fdSmrg	;;
47333c15da26Smrg      nagfor*)
47343c15da26Smrg	# NAG Fortran compiler
47353c15da26Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
47363c15da26Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
47373c15da26Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47383c15da26Smrg	;;
4739300346aeSmrg      tcc*)
4740300346aeSmrg	# Fabrice Bellard et al's Tiny C Compiler
4741300346aeSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4742300346aeSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4743300346aeSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4744300346aeSmrg	;;
4745555991fdSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4746555991fdSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4747555991fdSmrg	# which looks to be a dead project)
4748555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4749555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4750555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4751555991fdSmrg        ;;
4752555991fdSmrg      ccc*)
4753555991fdSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4754555991fdSmrg        # All Alpha code is PIC.
4755555991fdSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4756555991fdSmrg        ;;
4757555991fdSmrg      xl* | bgxl* | bgf* | mpixl*)
4758555991fdSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4759555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4760555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4761555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4762555991fdSmrg	;;
4763555991fdSmrg      *)
4764555991fdSmrg	case `$CC -V 2>&1 | sed 5q` in
47650a6b08f8Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4766555991fdSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4767555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4768555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4769555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4770555991fdSmrg	  ;;
47710a6b08f8Smrg	*Sun\ F* | *Sun*Fortran*)
47720a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
47730a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47740a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
47750a6b08f8Smrg	  ;;
4776555991fdSmrg	*Sun\ C*)
4777555991fdSmrg	  # Sun C 5.9
4778555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4779555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4780555991fdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4781555991fdSmrg	  ;;
47820a6b08f8Smrg        *Intel*\ [[CF]]*Compiler*)
47830a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47840a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
47850a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
47860a6b08f8Smrg	  ;;
47870a6b08f8Smrg	*Portland\ Group*)
47880a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
47890a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
47900a6b08f8Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
47910a6b08f8Smrg	  ;;
4792555991fdSmrg	esac
4793555991fdSmrg	;;
4794555991fdSmrg      esac
4795555991fdSmrg      ;;
4796126a8a12Smrg
4797555991fdSmrg    newsos6)
4798555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4799555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4800555991fdSmrg      ;;
4801126a8a12Smrg
4802555991fdSmrg    *nto* | *qnx*)
4803555991fdSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4804555991fdSmrg      # it will coredump.
4805555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4806555991fdSmrg      ;;
4807126a8a12Smrg
4808555991fdSmrg    osf3* | osf4* | osf5*)
4809555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4810555991fdSmrg      # All OSF/1 code is PIC.
4811555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4812555991fdSmrg      ;;
4813126a8a12Smrg
4814555991fdSmrg    rdos*)
4815555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4816555991fdSmrg      ;;
4817126a8a12Smrg
4818555991fdSmrg    solaris*)
4819555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4820555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4821555991fdSmrg      case $cc_basename in
4822555991fdSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4823555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4824555991fdSmrg      *)
4825555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4826555991fdSmrg      esac
4827555991fdSmrg      ;;
4828126a8a12Smrg
4829555991fdSmrg    sunos4*)
4830555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4831555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4832555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4833555991fdSmrg      ;;
4834126a8a12Smrg
4835555991fdSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4836555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4837555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4838555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4839555991fdSmrg      ;;
4840126a8a12Smrg
4841555991fdSmrg    sysv4*MP*)
4842300346aeSmrg      if test -d /usr/nec; then
4843555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4844555991fdSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4845555991fdSmrg      fi
4846555991fdSmrg      ;;
4847126a8a12Smrg
4848555991fdSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4849555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4850555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4851555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4852555991fdSmrg      ;;
4853d656433aSmrg
4854555991fdSmrg    unicos*)
4855555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4856555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4857126a8a12Smrg      ;;
4858126a8a12Smrg
4859555991fdSmrg    uts4*)
4860555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4861555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4862555991fdSmrg      ;;
4863126a8a12Smrg
4864555991fdSmrg    *)
4865555991fdSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4866d656433aSmrg      ;;
4867d656433aSmrg    esac
4868555991fdSmrg  fi
4869d656433aSmrg])
4870555991fdSmrgcase $host_os in
4871300346aeSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
4872555991fdSmrg  *djgpp*)
4873555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4874555991fdSmrg    ;;
4875555991fdSmrg  *)
4876555991fdSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4877555991fdSmrg    ;;
4878d656433aSmrgesac
48793c15da26Smrg
48803c15da26SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
48813c15da26Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
48823c15da26Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
48833c15da26Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4884d656433aSmrg
4885555991fdSmrg#
4886555991fdSmrg# Check to make sure the PIC flag actually works.
4887555991fdSmrg#
4888555991fdSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4889555991fdSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4890555991fdSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4891555991fdSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4892555991fdSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4893555991fdSmrg     "" | " "*) ;;
4894555991fdSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4895555991fdSmrg     esac],
4896555991fdSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4897555991fdSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4898555991fdSmrgfi
4899555991fdSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4900555991fdSmrg	[Additional compiler flags for building library objects])
4901126a8a12Smrg
49023c15da26Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
49033c15da26Smrg	[How to pass a linker flag through the compiler])
4904555991fdSmrg#
4905555991fdSmrg# Check to make sure the static flag actually works.
4906555991fdSmrg#
4907555991fdSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4908555991fdSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4909555991fdSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4910555991fdSmrg  $lt_tmp_static_flag,
4911555991fdSmrg  [],
4912555991fdSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4913555991fdSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4914555991fdSmrg	[Compiler flag to prevent dynamic linking])
4915555991fdSmrg])# _LT_COMPILER_PIC
4916126a8a12Smrg
4917126a8a12Smrg
4918555991fdSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4919555991fdSmrg# ----------------------------
4920555991fdSmrg# See if the linker supports building shared libraries.
4921555991fdSmrgm4_defun([_LT_LINKER_SHLIBS],
4922555991fdSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4923555991fdSmrgAC_REQUIRE([LT_PATH_NM])dnl
49243c15da26Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4925555991fdSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4926555991fdSmrgm4_require([_LT_DECL_EGREP])dnl
4927555991fdSmrgm4_require([_LT_DECL_SED])dnl
4928555991fdSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4929555991fdSmrgm4_require([_LT_TAG_COMPILER])dnl
4930555991fdSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4931555991fdSmrgm4_if([$1], [CXX], [
4932555991fdSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49333c15da26Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4934555991fdSmrg  case $host_os in
4935555991fdSmrg  aix[[4-9]]*)
4936555991fdSmrg    # If we're using GNU nm, then we don't want the "-C" option.
4937300346aeSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4938300346aeSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4939300346aeSmrg    # weak defined symbols like other global defined symbols, whereas
4940300346aeSmrg    # GNU nm marks them as "W".
4941300346aeSmrg    # While the 'weak' keyword is ignored in the Export File, we need
4942300346aeSmrg    # it in the Import File for the 'aix-soname' feature, so we have
4943300346aeSmrg    # to replace the "-B" option with "-P" for AIX nm.
4944555991fdSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4945300346aeSmrg      _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'
4946555991fdSmrg    else
4947300346aeSmrg      _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'
4948555991fdSmrg    fi
4949555991fdSmrg    ;;
4950555991fdSmrg  pw32*)
4951300346aeSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
49523c15da26Smrg    ;;
4953555991fdSmrg  cygwin* | mingw* | cegcc*)
49543c15da26Smrg    case $cc_basename in
49550a6b08f8Smrg    cl*)
49560a6b08f8Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
49570a6b08f8Smrg      ;;
49583c15da26Smrg    *)
49593c15da26Smrg      _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'
49603c15da26Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
49613c15da26Smrg      ;;
49623c15da26Smrg    esac
49633c15da26Smrg    ;;
4964300346aeSmrg  linux* | k*bsd*-gnu | gnu*)
4965300346aeSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4966300346aeSmrg    ;;
49673c15da26Smrg  *)
49683c15da26Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
49693c15da26Smrg    ;;
49703c15da26Smrg  esac
4971555991fdSmrg], [
4972555991fdSmrg  runpath_var=
4973555991fdSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4974555991fdSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4975555991fdSmrg  _LT_TAGVAR(archive_cmds, $1)=
4976555991fdSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4977555991fdSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4978555991fdSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4979555991fdSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4980555991fdSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4981555991fdSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4982555991fdSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4983555991fdSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4984555991fdSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4985555991fdSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4986555991fdSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4987555991fdSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4988555991fdSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4989555991fdSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4990555991fdSmrg  _LT_TAGVAR(module_cmds, $1)=
4991555991fdSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4992555991fdSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4993555991fdSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4994555991fdSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4995555991fdSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4996555991fdSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4997555991fdSmrg  # included in the symbol list
4998555991fdSmrg  _LT_TAGVAR(include_expsyms, $1)=
4999555991fdSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
5000300346aeSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
5001300346aeSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
5002300346aeSmrg  # as well as any symbol that contains 'd'.
5003555991fdSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5004555991fdSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5005555991fdSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5006555991fdSmrg  # the symbol is explicitly referenced.  Since portable code cannot
5007555991fdSmrg  # rely on this symbol name, it's probably fine to never include it in
5008555991fdSmrg  # preloaded symbol tables.
5009555991fdSmrg  # Exclude shared library initialization/finalization symbols.
5010555991fdSmrgdnl Note also adjust exclude_expsyms for C++ above.
5011555991fdSmrg  extract_expsyms_cmds=
5012126a8a12Smrg
5013555991fdSmrg  case $host_os in
5014555991fdSmrg  cygwin* | mingw* | pw32* | cegcc*)
5015555991fdSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5016555991fdSmrg    # When not using gcc, we currently assume that we are using
5017555991fdSmrg    # Microsoft Visual C++.
5018300346aeSmrg    if test yes != "$GCC"; then
5019555991fdSmrg      with_gnu_ld=no
5020555991fdSmrg    fi
5021555991fdSmrg    ;;
5022555991fdSmrg  interix*)
5023555991fdSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5024555991fdSmrg    with_gnu_ld=yes
5025555991fdSmrg    ;;
5026300346aeSmrg  openbsd* | bitrig*)
5027555991fdSmrg    with_gnu_ld=no
5028555991fdSmrg    ;;
5029300346aeSmrg  linux* | k*bsd*-gnu | gnu*)
5030300346aeSmrg    _LT_TAGVAR(link_all_deplibs, $1)=no
5031300346aeSmrg    ;;
5032555991fdSmrg  esac
5033126a8a12Smrg
5034555991fdSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5035126a8a12Smrg
5036555991fdSmrg  # On some targets, GNU ld is compatible enough with the native linker
5037555991fdSmrg  # that we're better off using the native interface for both.
5038555991fdSmrg  lt_use_gnu_ld_interface=no
5039300346aeSmrg  if test yes = "$with_gnu_ld"; then
5040d656433aSmrg    case $host_os in
5041555991fdSmrg      aix*)
5042555991fdSmrg	# The AIX port of GNU ld has always aspired to compatibility
5043555991fdSmrg	# with the native linker.  However, as the warning in the GNU ld
5044555991fdSmrg	# block says, versions before 2.19.5* couldn't really create working
5045555991fdSmrg	# shared libraries, regardless of the interface used.
5046555991fdSmrg	case `$LD -v 2>&1` in
5047555991fdSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5048555991fdSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5049555991fdSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5050555991fdSmrg	  *)
5051555991fdSmrg	    lt_use_gnu_ld_interface=yes
5052555991fdSmrg	    ;;
5053555991fdSmrg	esac
5054555991fdSmrg	;;
5055555991fdSmrg      *)
5056555991fdSmrg	lt_use_gnu_ld_interface=yes
5057555991fdSmrg	;;
5058d656433aSmrg    esac
5059555991fdSmrg  fi
5060d656433aSmrg
5061300346aeSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
5062555991fdSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5063300346aeSmrg    wlarc='$wl'
5064126a8a12Smrg
5065555991fdSmrg    # Set some defaults for GNU ld with shared library support. These
5066555991fdSmrg    # are reset later if shared libraries are not supported. Putting them
5067555991fdSmrg    # here allows them to be overridden if necessary.
5068555991fdSmrg    runpath_var=LD_RUN_PATH
5069300346aeSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5070300346aeSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5071555991fdSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5072555991fdSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5073300346aeSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5074555991fdSmrg    else
5075555991fdSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5076555991fdSmrg    fi
5077555991fdSmrg    supports_anon_versioning=no
5078300346aeSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5079555991fdSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5080555991fdSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5081555991fdSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5082555991fdSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5083555991fdSmrg      *\ 2.11.*) ;; # other 2.11 versions
5084555991fdSmrg      *) supports_anon_versioning=yes ;;
5085555991fdSmrg    esac
5086126a8a12Smrg
5087555991fdSmrg    # See if GNU ld supports shared libraries.
5088555991fdSmrg    case $host_os in
5089555991fdSmrg    aix[[3-9]]*)
5090555991fdSmrg      # On AIX/PPC, the GNU linker is very broken
5091300346aeSmrg      if test ia64 != "$host_cpu"; then
5092555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5093555991fdSmrg	cat <<_LT_EOF 1>&2
5094126a8a12Smrg
5095555991fdSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5096555991fdSmrg*** to be unable to reliably create shared libraries on AIX.
5097555991fdSmrg*** Therefore, libtool is disabling shared libraries support.  If you
5098555991fdSmrg*** really care for shared libraries, you may want to install binutils
5099555991fdSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5100555991fdSmrg*** You will then need to restart the configuration process.
5101126a8a12Smrg
5102555991fdSmrg_LT_EOF
5103555991fdSmrg      fi
5104555991fdSmrg      ;;
5105126a8a12Smrg
5106555991fdSmrg    amigaos*)
5107555991fdSmrg      case $host_cpu in
5108555991fdSmrg      powerpc)
5109555991fdSmrg            # see comment about AmigaOS4 .so support
5110300346aeSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5111555991fdSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5112555991fdSmrg        ;;
5113555991fdSmrg      m68k)
5114555991fdSmrg            _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)'
5115555991fdSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5116555991fdSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5117555991fdSmrg        ;;
5118555991fdSmrg      esac
5119555991fdSmrg      ;;
5120126a8a12Smrg
5121555991fdSmrg    beos*)
5122555991fdSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5123555991fdSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5124555991fdSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5125555991fdSmrg	# support --undefined.  This deserves some investigation.  FIXME
5126300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5127555991fdSmrg      else
5128555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5129555991fdSmrg      fi
5130555991fdSmrg      ;;
5131d656433aSmrg
5132555991fdSmrg    cygwin* | mingw* | pw32* | cegcc*)
5133555991fdSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5134555991fdSmrg      # as there is no search path for DLLs.
5135555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5136300346aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5137555991fdSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5138555991fdSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5139555991fdSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
51403c15da26Smrg      _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'
51413c15da26Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5142d656433aSmrg
5143555991fdSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5144300346aeSmrg        _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'
5145300346aeSmrg	# If the export-symbols file already is a .def file, use it as
5146300346aeSmrg	# is; otherwise, prepend EXPORTS...
5147300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5148300346aeSmrg          cp $export_symbols $output_objdir/$soname.def;
5149300346aeSmrg        else
5150300346aeSmrg          echo EXPORTS > $output_objdir/$soname.def;
5151300346aeSmrg          cat $export_symbols >> $output_objdir/$soname.def;
5152300346aeSmrg        fi~
5153300346aeSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5154555991fdSmrg      else
5155555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5156555991fdSmrg      fi
5157555991fdSmrg      ;;
5158d656433aSmrg
5159555991fdSmrg    haiku*)
5160300346aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5161555991fdSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5162555991fdSmrg      ;;
5163d656433aSmrg
5164300346aeSmrg    os2*)
5165300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5166300346aeSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5167300346aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5168300346aeSmrg      shrext_cmds=.dll
5169300346aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5170300346aeSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5171300346aeSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5172300346aeSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5173300346aeSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5174300346aeSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5175300346aeSmrg	emximp -o $lib $output_objdir/$libname.def'
5176300346aeSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5177300346aeSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5178300346aeSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5179300346aeSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5180300346aeSmrg	prefix_cmds="$SED"~
5181300346aeSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5182300346aeSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5183300346aeSmrg	fi~
5184300346aeSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5185300346aeSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5186300346aeSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5187300346aeSmrg	emximp -o $lib $output_objdir/$libname.def'
5188300346aeSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5189300346aeSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5190300346aeSmrg      ;;
5191300346aeSmrg
5192555991fdSmrg    interix[[3-9]]*)
5193555991fdSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5194555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5195300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5196300346aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5197555991fdSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5198555991fdSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5199555991fdSmrg      # default) and relocated if they conflict, which is a slow very memory
5200555991fdSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5201555991fdSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5202555991fdSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5203300346aeSmrg      _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'
5204300346aeSmrg      _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'
5205555991fdSmrg      ;;
5206126a8a12Smrg
5207555991fdSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5208555991fdSmrg      tmp_diet=no
5209300346aeSmrg      if test linux-dietlibc = "$host_os"; then
5210555991fdSmrg	case $cc_basename in
5211555991fdSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5212555991fdSmrg	esac
5213555991fdSmrg      fi
5214555991fdSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5215300346aeSmrg	 && test no = "$tmp_diet"
5216555991fdSmrg      then
52173c15da26Smrg	tmp_addflag=' $pic_flag'
5218555991fdSmrg	tmp_sharedflag='-shared'
5219555991fdSmrg	case $cc_basename,$host_cpu in
5220555991fdSmrg        pgcc*)				# Portland Group C compiler
5221300346aeSmrg	  _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'
5222555991fdSmrg	  tmp_addflag=' $pic_flag'
5223555991fdSmrg	  ;;
5224555991fdSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5225555991fdSmrg					# Portland Group f77 and f90 compilers
5226300346aeSmrg	  _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'
5227555991fdSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5228555991fdSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5229555991fdSmrg	  tmp_addflag=' -i_dynamic' ;;
5230555991fdSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5231555991fdSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5232555991fdSmrg	ifc* | ifort*)			# Intel Fortran compiler
5233555991fdSmrg	  tmp_addflag=' -nofor_main' ;;
5234555991fdSmrg	lf95*)				# Lahey Fortran 8.1
5235555991fdSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5236555991fdSmrg	  tmp_sharedflag='--shared' ;;
5237300346aeSmrg        nagfor*)                        # NAGFOR 5.3
5238300346aeSmrg          tmp_sharedflag='-Wl,-shared' ;;
5239555991fdSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5240555991fdSmrg	  tmp_sharedflag='-qmkshrobj'
5241555991fdSmrg	  tmp_addflag= ;;
5242555991fdSmrg	nvcc*)	# Cuda Compiler Driver 2.2
5243300346aeSmrg	  _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'
5244555991fdSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5245555991fdSmrg	  ;;
5246555991fdSmrg	esac
5247555991fdSmrg	case `$CC -V 2>&1 | sed 5q` in
5248555991fdSmrg	*Sun\ C*)			# Sun C 5.9
5249300346aeSmrg	  _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'
5250555991fdSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5251555991fdSmrg	  tmp_sharedflag='-G' ;;
5252555991fdSmrg	*Sun\ F*)			# Sun Fortran 8.3
5253555991fdSmrg	  tmp_sharedflag='-G' ;;
5254555991fdSmrg	esac
5255300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5256126a8a12Smrg
5257300346aeSmrg        if test yes = "$supports_anon_versioning"; then
5258555991fdSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5259300346aeSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5260300346aeSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5261300346aeSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5262555991fdSmrg        fi
5263126a8a12Smrg
5264555991fdSmrg	case $cc_basename in
5265300346aeSmrg	tcc*)
5266300346aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5267300346aeSmrg	  ;;
5268555991fdSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5269555991fdSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5270555991fdSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5271300346aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5272555991fdSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5273300346aeSmrg	  if test yes = "$supports_anon_versioning"; then
5274555991fdSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5275300346aeSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5276300346aeSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5277300346aeSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5278555991fdSmrg	  fi
5279555991fdSmrg	  ;;
5280555991fdSmrg	esac
5281555991fdSmrg      else
5282555991fdSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5283555991fdSmrg      fi
5284555991fdSmrg      ;;
5285126a8a12Smrg
5286300346aeSmrg    netbsd* | netbsdelf*-gnu)
5287555991fdSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5288555991fdSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5289555991fdSmrg	wlarc=
5290555991fdSmrg      else
5291300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5292300346aeSmrg	_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'
5293555991fdSmrg      fi
5294555991fdSmrg      ;;
5295126a8a12Smrg
5296555991fdSmrg    solaris*)
5297555991fdSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5298555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5299555991fdSmrg	cat <<_LT_EOF 1>&2
5300126a8a12Smrg
5301555991fdSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5302555991fdSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5303555991fdSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5304555991fdSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5305555991fdSmrg*** your PATH or compiler configuration so that the native linker is
5306555991fdSmrg*** used, and then restart.
5307126a8a12Smrg
5308555991fdSmrg_LT_EOF
5309555991fdSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5310300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5311300346aeSmrg	_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'
5312555991fdSmrg      else
5313555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5314555991fdSmrg      fi
5315555991fdSmrg      ;;
5316126a8a12Smrg
5317555991fdSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5318555991fdSmrg      case `$LD -v 2>&1` in
5319555991fdSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5320555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5321555991fdSmrg	cat <<_LT_EOF 1>&2
5322d656433aSmrg
5323300346aeSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5324555991fdSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5325555991fdSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5326555991fdSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5327555991fdSmrg*** your PATH or compiler configuration so that the native linker is
5328555991fdSmrg*** used, and then restart.
5329d656433aSmrg
5330555991fdSmrg_LT_EOF
5331555991fdSmrg	;;
5332555991fdSmrg	*)
5333555991fdSmrg	  # For security reasons, it is highly recommended that you always
5334555991fdSmrg	  # use absolute paths for naming shared libraries, and exclude the
5335555991fdSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5336555991fdSmrg	  # requires that you compile everything twice, which is a pain.
5337555991fdSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5338300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5339300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5340300346aeSmrg	    _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'
5341555991fdSmrg	  else
5342555991fdSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5343555991fdSmrg	  fi
5344555991fdSmrg	;;
5345555991fdSmrg      esac
5346555991fdSmrg      ;;
5347d656433aSmrg
5348555991fdSmrg    sunos4*)
5349555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5350555991fdSmrg      wlarc=
5351555991fdSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5352555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5353555991fdSmrg      ;;
5354555991fdSmrg
5355555991fdSmrg    *)
5356555991fdSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5357300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5358300346aeSmrg	_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'
5359555991fdSmrg      else
5360555991fdSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5361555991fdSmrg      fi
5362555991fdSmrg      ;;
5363555991fdSmrg    esac
5364d656433aSmrg
5365300346aeSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5366555991fdSmrg      runpath_var=
5367555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5368555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5369555991fdSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5370555991fdSmrg    fi
5371555991fdSmrg  else
5372555991fdSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5373555991fdSmrg    case $host_os in
5374555991fdSmrg    aix3*)
5375555991fdSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5376555991fdSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5377555991fdSmrg      _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'
5378555991fdSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5379555991fdSmrg      # are no directories specified by -L.
5380555991fdSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5381300346aeSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5382555991fdSmrg	# Neither direct hardcoding nor static linking is supported with a
5383555991fdSmrg	# broken collect2.
5384555991fdSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5385555991fdSmrg      fi
5386555991fdSmrg      ;;
5387d656433aSmrg
5388555991fdSmrg    aix[[4-9]]*)
5389300346aeSmrg      if test ia64 = "$host_cpu"; then
5390555991fdSmrg	# On IA64, the linker does run time linking by default, so we don't
5391555991fdSmrg	# have to do anything special.
5392555991fdSmrg	aix_use_runtimelinking=no
5393555991fdSmrg	exp_sym_flag='-Bexport'
5394300346aeSmrg	no_entry_flag=
5395555991fdSmrg      else
5396555991fdSmrg	# If we're using GNU nm, then we don't want the "-C" option.
5397300346aeSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5398300346aeSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5399300346aeSmrg	# weak defined symbols like other global defined symbols, whereas
5400300346aeSmrg	# GNU nm marks them as "W".
5401300346aeSmrg	# While the 'weak' keyword is ignored in the Export File, we need
5402300346aeSmrg	# it in the Import File for the 'aix-soname' feature, so we have
5403300346aeSmrg	# to replace the "-B" option with "-P" for AIX nm.
5404555991fdSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5405300346aeSmrg	  _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'
5406555991fdSmrg	else
5407300346aeSmrg	  _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'
5408555991fdSmrg	fi
5409555991fdSmrg	aix_use_runtimelinking=no
5410126a8a12Smrg
5411555991fdSmrg	# Test if we are trying to use run time linking or normal
5412555991fdSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5413300346aeSmrg	# have runtime linking enabled, and use it for executables.
5414300346aeSmrg	# For shared libraries, we enable/disable runtime linking
5415300346aeSmrg	# depending on the kind of the shared library created -
5416300346aeSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5417300346aeSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5418300346aeSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5419300346aeSmrg	#            lib.a           static archive
5420300346aeSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5421300346aeSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5422300346aeSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5423300346aeSmrg	#            lib.a(lib.so.V) shared, rtl:no
5424300346aeSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5425300346aeSmrg	#            lib.a           static archive
5426555991fdSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5427555991fdSmrg	  for ld_flag in $LDFLAGS; do
5428300346aeSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5429555991fdSmrg	    aix_use_runtimelinking=yes
5430555991fdSmrg	    break
5431555991fdSmrg	  fi
5432555991fdSmrg	  done
5433300346aeSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5434300346aeSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5435300346aeSmrg	    # so we don't have lib.a shared libs to link our executables.
5436300346aeSmrg	    # We have to force runtime linking in this case.
5437300346aeSmrg	    aix_use_runtimelinking=yes
5438300346aeSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5439300346aeSmrg	  fi
5440555991fdSmrg	  ;;
5441555991fdSmrg	esac
5442126a8a12Smrg
5443555991fdSmrg	exp_sym_flag='-bexport'
5444555991fdSmrg	no_entry_flag='-bnoentry'
5445555991fdSmrg      fi
5446126a8a12Smrg
5447555991fdSmrg      # When large executables or shared objects are built, AIX ld can
5448555991fdSmrg      # have problems creating the table of contents.  If linking a library
5449555991fdSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
5450555991fdSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5451555991fdSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5452126a8a12Smrg
5453555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)=''
5454555991fdSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5455555991fdSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5456555991fdSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5457555991fdSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5458300346aeSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5459300346aeSmrg      case $with_aix_soname,$aix_use_runtimelinking in
5460300346aeSmrg      aix,*) ;; # traditional, no import file
5461300346aeSmrg      svr4,* | *,yes) # use import file
5462300346aeSmrg	# The Import File defines what to hardcode.
5463300346aeSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
5464300346aeSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5465300346aeSmrg	;;
5466300346aeSmrg      esac
5467126a8a12Smrg
5468300346aeSmrg      if test yes = "$GCC"; then
5469555991fdSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5470555991fdSmrg	# We only want to do this on AIX 4.2 and lower, the check
5471555991fdSmrg	# below for broken collect2 doesn't work under 4.3+
5472300346aeSmrg	  collect2name=`$CC -print-prog-name=collect2`
5473555991fdSmrg	  if test -f "$collect2name" &&
5474555991fdSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5475555991fdSmrg	  then
5476555991fdSmrg	  # We have reworked collect2
5477555991fdSmrg	  :
5478555991fdSmrg	  else
5479555991fdSmrg	  # We have old collect2
5480555991fdSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5481555991fdSmrg	  # It fails to find uninstalled libraries when the uninstalled
5482555991fdSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5483555991fdSmrg	  # to unsupported forces relinking
5484555991fdSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5485555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5486555991fdSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5487555991fdSmrg	  fi
5488555991fdSmrg	  ;;
5489555991fdSmrg	esac
5490555991fdSmrg	shared_flag='-shared'
5491300346aeSmrg	if test yes = "$aix_use_runtimelinking"; then
5492300346aeSmrg	  shared_flag="$shared_flag "'$wl-G'
5493555991fdSmrg	fi
5494300346aeSmrg	# Need to ensure runtime linking is disabled for the traditional
5495300346aeSmrg	# shared library, or the linker may eventually find shared libraries
5496300346aeSmrg	# /with/ Import File - we do not want to mix them.
5497300346aeSmrg	shared_flag_aix='-shared'
5498300346aeSmrg	shared_flag_svr4='-shared $wl-G'
5499555991fdSmrg      else
5500555991fdSmrg	# not using gcc
5501300346aeSmrg	if test ia64 = "$host_cpu"; then
5502555991fdSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5503555991fdSmrg	# chokes on -Wl,-G. The following line is correct:
5504555991fdSmrg	  shared_flag='-G'
5505555991fdSmrg	else
5506300346aeSmrg	  if test yes = "$aix_use_runtimelinking"; then
5507300346aeSmrg	    shared_flag='$wl-G'
5508555991fdSmrg	  else
5509300346aeSmrg	    shared_flag='$wl-bM:SRE'
5510555991fdSmrg	  fi
5511300346aeSmrg	  shared_flag_aix='$wl-bM:SRE'
5512300346aeSmrg	  shared_flag_svr4='$wl-G'
5513555991fdSmrg	fi
5514555991fdSmrg      fi
5515126a8a12Smrg
5516300346aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5517555991fdSmrg      # It seems that -bexpall does not export symbols beginning with
5518555991fdSmrg      # underscore (_), so it is better to generate a list of symbols to export.
5519555991fdSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5520300346aeSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5521555991fdSmrg	# Warning - without using the other runtime loading flags (-brtl),
5522555991fdSmrg	# -berok will link without error, but may produce a broken library.
5523555991fdSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5524555991fdSmrg        # Determine the default libpath from the value encoded in an
5525555991fdSmrg        # empty executable.
55263c15da26Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5527300346aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5528300346aeSmrg        _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
5529555991fdSmrg      else
5530300346aeSmrg	if test ia64 = "$host_cpu"; then
5531300346aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5532555991fdSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5533300346aeSmrg	  _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"
5534555991fdSmrg	else
5535555991fdSmrg	 # Determine the default libpath from the value encoded in an
5536555991fdSmrg	 # empty executable.
55373c15da26Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5538300346aeSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5539555991fdSmrg	  # Warning - without using the other run time loading flags,
5540555991fdSmrg	  # -berok will link without error, but may produce a broken library.
5541300346aeSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5542300346aeSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5543300346aeSmrg	  if test yes = "$with_gnu_ld"; then
5544555991fdSmrg	    # We only use this code for GNU lds that support --whole-archive.
5545300346aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5546555991fdSmrg	  else
5547555991fdSmrg	    # Exported symbols can be pulled into shared objects from archives
5548555991fdSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5549555991fdSmrg	  fi
5550555991fdSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5551300346aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5552300346aeSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5553300346aeSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5554300346aeSmrg	  if test svr4 != "$with_aix_soname"; then
5555300346aeSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
5556300346aeSmrg	    _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'
5557300346aeSmrg	  fi
5558300346aeSmrg	  if test aix != "$with_aix_soname"; then
5559300346aeSmrg	    _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'
5560300346aeSmrg	  else
5561300346aeSmrg	    # used by -dlpreopen to get the symbols
5562300346aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5563300346aeSmrg	  fi
5564300346aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5565555991fdSmrg	fi
5566555991fdSmrg      fi
5567555991fdSmrg      ;;
5568126a8a12Smrg
5569555991fdSmrg    amigaos*)
5570555991fdSmrg      case $host_cpu in
5571555991fdSmrg      powerpc)
5572555991fdSmrg            # see comment about AmigaOS4 .so support
5573300346aeSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5574555991fdSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5575555991fdSmrg        ;;
5576555991fdSmrg      m68k)
5577555991fdSmrg            _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)'
5578555991fdSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5579555991fdSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5580555991fdSmrg        ;;
5581555991fdSmrg      esac
5582555991fdSmrg      ;;
5583126a8a12Smrg
5584555991fdSmrg    bsdi[[45]]*)
5585555991fdSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5586555991fdSmrg      ;;
5587126a8a12Smrg
5588555991fdSmrg    cygwin* | mingw* | pw32* | cegcc*)
5589555991fdSmrg      # When not using gcc, we currently assume that we are using
5590555991fdSmrg      # Microsoft Visual C++.
5591555991fdSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5592555991fdSmrg      # no search path for DLLs.
55933c15da26Smrg      case $cc_basename in
55943c15da26Smrg      cl*)
55953c15da26Smrg	# Native MSVC
55963c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
55973c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
55983c15da26Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
55993c15da26Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
56003c15da26Smrg	# Tell ltmain to make .lib files, not .a files.
56013c15da26Smrg	libext=lib
56023c15da26Smrg	# Tell ltmain to make .dll files, not .so files.
5603300346aeSmrg	shrext_cmds=.dll
56043c15da26Smrg	# FIXME: Setting linknames here is a bad hack.
5605300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5606300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5607300346aeSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
5608300346aeSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5609300346aeSmrg          else
5610300346aeSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5611300346aeSmrg          fi~
5612300346aeSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5613300346aeSmrg          linknames='
56143c15da26Smrg	# The linker will not automatically build a static lib if we build a DLL.
56153c15da26Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56163c15da26Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56170a6b08f8Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
56183c15da26Smrg	_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'
56193c15da26Smrg	# Don't use ranlib
56203c15da26Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
56213c15da26Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5622300346aeSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5623300346aeSmrg          case $lt_outputfile in
5624300346aeSmrg            *.exe|*.EXE) ;;
5625300346aeSmrg            *)
5626300346aeSmrg              lt_outputfile=$lt_outputfile.exe
5627300346aeSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5628300346aeSmrg              ;;
5629300346aeSmrg          esac~
5630300346aeSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5631300346aeSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5632300346aeSmrg            $RM "$lt_outputfile.manifest";
5633300346aeSmrg          fi'
56343c15da26Smrg	;;
56353c15da26Smrg      *)
56363c15da26Smrg	# Assume MSVC wrapper
56373c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
56383c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
56393c15da26Smrg	# Tell ltmain to make .lib files, not .a files.
56403c15da26Smrg	libext=lib
56413c15da26Smrg	# Tell ltmain to make .dll files, not .so files.
5642300346aeSmrg	shrext_cmds=.dll
56433c15da26Smrg	# FIXME: Setting linknames here is a bad hack.
56443c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
56453c15da26Smrg	# The linker will automatically build a .lib file if we build a DLL.
56463c15da26Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
56473c15da26Smrg	# FIXME: Should let the user specify the lib program.
56483c15da26Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
56493c15da26Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56503c15da26Smrg	;;
56513c15da26Smrg      esac
5652555991fdSmrg      ;;
5653126a8a12Smrg
5654555991fdSmrg    darwin* | rhapsody*)
5655555991fdSmrg      _LT_DARWIN_LINKER_FEATURES($1)
5656555991fdSmrg      ;;
5657126a8a12Smrg
5658555991fdSmrg    dgux*)
5659555991fdSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5660555991fdSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5661555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5662555991fdSmrg      ;;
5663126a8a12Smrg
56643c15da26Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
56653c15da26Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
56663c15da26Smrg    # does not break anything, and helps significantly (at the cost of a little
56673c15da26Smrg    # extra space).
56683c15da26Smrg    freebsd2.2*)
56693c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
56703c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56713c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56723c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56733c15da26Smrg      ;;
56743c15da26Smrg
56753c15da26Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
56760a6b08f8Smrg    freebsd2.*)
56773c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
56783c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56793c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
56803c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56813c15da26Smrg      ;;
56823c15da26Smrg
56833c15da26Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
56843c15da26Smrg    freebsd* | dragonfly*)
56853c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
56863c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
56873c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56883c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
56893c15da26Smrg      ;;
56903c15da26Smrg
56913c15da26Smrg    hpux9*)
5692300346aeSmrg      if test yes = "$GCC"; then
5693300346aeSmrg	_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'
56943c15da26Smrg      else
5695300346aeSmrg	_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'
56963c15da26Smrg      fi
5697300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
56983c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
56993c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
57003c15da26Smrg
57013c15da26Smrg      # hardcode_minus_L: Not really in the search PATH,
57023c15da26Smrg      # but as the default location of the library.
57033c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5704300346aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57053c15da26Smrg      ;;
57063c15da26Smrg
57073c15da26Smrg    hpux10*)
5708300346aeSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5709300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57103c15da26Smrg      else
57113c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
57123c15da26Smrg      fi
5713300346aeSmrg      if test no = "$with_gnu_ld"; then
5714300346aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57153c15da26Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57163c15da26Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
57173c15da26Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5718300346aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57193c15da26Smrg	# hardcode_minus_L: Not really in the search PATH,
57203c15da26Smrg	# but as the default location of the library.
57213c15da26Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
57223c15da26Smrg      fi
57233c15da26Smrg      ;;
57243c15da26Smrg
57253c15da26Smrg    hpux11*)
5726300346aeSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
57273c15da26Smrg	case $host_cpu in
57283c15da26Smrg	hppa*64*)
5729300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57303c15da26Smrg	  ;;
57313c15da26Smrg	ia64*)
5732300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57333c15da26Smrg	  ;;
57343c15da26Smrg	*)
5735300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
57363c15da26Smrg	  ;;
57373c15da26Smrg	esac
57383c15da26Smrg      else
57393c15da26Smrg	case $host_cpu in
57403c15da26Smrg	hppa*64*)
5741300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
57423c15da26Smrg	  ;;
57433c15da26Smrg	ia64*)
5744300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
57453c15da26Smrg	  ;;
57463c15da26Smrg	*)
57473c15da26Smrg	m4_if($1, [], [
57483c15da26Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
57493c15da26Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
57503c15da26Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
57513c15da26Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5752300346aeSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
57533c15da26Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5754300346aeSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
57553c15da26Smrg	  ;;
57563c15da26Smrg	esac
57573c15da26Smrg      fi
5758300346aeSmrg      if test no = "$with_gnu_ld"; then
5759300346aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
57603c15da26Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
57613c15da26Smrg
57623c15da26Smrg	case $host_cpu in
57633c15da26Smrg	hppa*64*|ia64*)
57643c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
57653c15da26Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
57663c15da26Smrg	  ;;
57673c15da26Smrg	*)
57683c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
57693c15da26Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5770300346aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57713c15da26Smrg
57723c15da26Smrg	  # hardcode_minus_L: Not really in the search PATH,
57733c15da26Smrg	  # but as the default location of the library.
57743c15da26Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
57753c15da26Smrg	  ;;
57763c15da26Smrg	esac
57773c15da26Smrg      fi
57783c15da26Smrg      ;;
57793c15da26Smrg
57803c15da26Smrg    irix5* | irix6* | nonstopux*)
5781300346aeSmrg      if test yes = "$GCC"; then
5782300346aeSmrg	_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'
57833c15da26Smrg	# Try to use the -exported_symbol ld option, if it does not
57843c15da26Smrg	# work, assume that -exports_file does not work either and
57853c15da26Smrg	# implicitly export all symbols.
57863c15da26Smrg	# This should be the same for all languages, so no per-tag cache variable.
57873c15da26Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
57883c15da26Smrg	  [lt_cv_irix_exported_symbol],
5789300346aeSmrg	  [save_LDFLAGS=$LDFLAGS
5790300346aeSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
57913c15da26Smrg	   AC_LINK_IFELSE(
57923c15da26Smrg	     [AC_LANG_SOURCE(
57933c15da26Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
57943c15da26Smrg			      [C++], [[int foo (void) { return 0; }]],
57953c15da26Smrg			      [Fortran 77], [[
57963c15da26Smrg      subroutine foo
57973c15da26Smrg      end]],
57983c15da26Smrg			      [Fortran], [[
57993c15da26Smrg      subroutine foo
58003c15da26Smrg      end]])])],
58013c15da26Smrg	      [lt_cv_irix_exported_symbol=yes],
58023c15da26Smrg	      [lt_cv_irix_exported_symbol=no])
5803300346aeSmrg           LDFLAGS=$save_LDFLAGS])
5804300346aeSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5805300346aeSmrg          _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'
58063c15da26Smrg	fi
5807300346aeSmrg	_LT_TAGVAR(link_all_deplibs, $1)=no
58083c15da26Smrg      else
5809300346aeSmrg	_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'
5810300346aeSmrg	_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'
58113c15da26Smrg      fi
58123c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5813300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58143c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58153c15da26Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
58163c15da26Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
58173c15da26Smrg      ;;
58183c15da26Smrg
5819300346aeSmrg    linux*)
5820300346aeSmrg      case $cc_basename in
5821300346aeSmrg      tcc*)
5822300346aeSmrg	# Fabrice Bellard et al's Tiny C Compiler
5823300346aeSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5824300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5825300346aeSmrg	;;
5826300346aeSmrg      esac
5827300346aeSmrg      ;;
5828300346aeSmrg
5829300346aeSmrg    netbsd* | netbsdelf*-gnu)
58303c15da26Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
58313c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
58323c15da26Smrg      else
58333c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
58343c15da26Smrg      fi
58353c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
58363c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
58373c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58383c15da26Smrg      ;;
58393c15da26Smrg
58403c15da26Smrg    newsos6)
58413c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
58423c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5843300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
58443c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
58453c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58463c15da26Smrg      ;;
58473c15da26Smrg
58483c15da26Smrg    *nto* | *qnx*)
58493c15da26Smrg      ;;
58503c15da26Smrg
5851300346aeSmrg    openbsd* | bitrig*)
58523c15da26Smrg      if test -f /usr/libexec/ld.so; then
58533c15da26Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
58543c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
58553c15da26Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5856300346aeSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
58573c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5858300346aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5859300346aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5860300346aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
58613c15da26Smrg	else
5862300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5863300346aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
58643c15da26Smrg	fi
58653c15da26Smrg      else
58663c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
58673c15da26Smrg      fi
58683c15da26Smrg      ;;
58693c15da26Smrg
58703c15da26Smrg    os2*)
58713c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
58723c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
58733c15da26Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5874300346aeSmrg      shrext_cmds=.dll
5875300346aeSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5876300346aeSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5877300346aeSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5878300346aeSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5879300346aeSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5880300346aeSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5881300346aeSmrg	emximp -o $lib $output_objdir/$libname.def'
5882300346aeSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5883300346aeSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5884300346aeSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5885300346aeSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5886300346aeSmrg	prefix_cmds="$SED"~
5887300346aeSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5888300346aeSmrg	  prefix_cmds="$prefix_cmds -e 1d";
5889300346aeSmrg	fi~
5890300346aeSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5891300346aeSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5892300346aeSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5893300346aeSmrg	emximp -o $lib $output_objdir/$libname.def'
5894300346aeSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5895300346aeSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
58963c15da26Smrg      ;;
58973c15da26Smrg
58983c15da26Smrg    osf3*)
5899300346aeSmrg      if test yes = "$GCC"; then
5900300346aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5901300346aeSmrg	_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'
59023c15da26Smrg      else
59033c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5904300346aeSmrg	_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'
59053c15da26Smrg      fi
59063c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5907300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
59083c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59093c15da26Smrg      ;;
59103c15da26Smrg
59113c15da26Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5912300346aeSmrg      if test yes = "$GCC"; then
5913300346aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5914300346aeSmrg	_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'
5915300346aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
59163c15da26Smrg      else
59173c15da26Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5918300346aeSmrg	_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'
59193c15da26Smrg	_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~
5920300346aeSmrg          $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'
59213c15da26Smrg
59223c15da26Smrg	# Both c and cxx compiler support -rpath directly
59233c15da26Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
59243c15da26Smrg      fi
59253c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
59263c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
59273c15da26Smrg      ;;
59283c15da26Smrg
59293c15da26Smrg    solaris*)
59303c15da26Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5931300346aeSmrg      if test yes = "$GCC"; then
5932300346aeSmrg	wlarc='$wl'
5933300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
59343c15da26Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5935300346aeSmrg          $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'
59363c15da26Smrg      else
59373c15da26Smrg	case `$CC -V 2>&1` in
59383c15da26Smrg	*"Compilers 5.0"*)
59393c15da26Smrg	  wlarc=''
5940300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
59413c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5942300346aeSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
59433c15da26Smrg	  ;;
59443c15da26Smrg	*)
5945300346aeSmrg	  wlarc='$wl'
5946300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
59473c15da26Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5948300346aeSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
59493c15da26Smrg	  ;;
59503c15da26Smrg	esac
59513c15da26Smrg      fi
59523c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
59533c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59543c15da26Smrg      case $host_os in
59553c15da26Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
59563c15da26Smrg      *)
59573c15da26Smrg	# The compiler driver will combine and reorder linker options,
5958300346aeSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
59593c15da26Smrg	# but is careful enough not to reorder.
59603c15da26Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5961300346aeSmrg	if test yes = "$GCC"; then
5962300346aeSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
59633c15da26Smrg	else
59643c15da26Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
59653c15da26Smrg	fi
59663c15da26Smrg	;;
59673c15da26Smrg      esac
59683c15da26Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
59693c15da26Smrg      ;;
59703c15da26Smrg
59713c15da26Smrg    sunos4*)
5972300346aeSmrg      if test sequent = "$host_vendor"; then
59733c15da26Smrg	# Use $CC to link under sequent, because it throws in some extra .o
59743c15da26Smrg	# files that make .init and .fini sections work.
5975300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
59763c15da26Smrg      else
59773c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
59783c15da26Smrg      fi
59793c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
59803c15da26Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
59813c15da26Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
59823c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
59833c15da26Smrg      ;;
59843c15da26Smrg
59853c15da26Smrg    sysv4)
59863c15da26Smrg      case $host_vendor in
59873c15da26Smrg	sni)
59883c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
59893c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
59903c15da26Smrg	;;
59913c15da26Smrg	siemens)
59923c15da26Smrg	  ## LD is ld it makes a PLAMLIB
59933c15da26Smrg	  ## CC just makes a GrossModule.
59943c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
59953c15da26Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
59963c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
59973c15da26Smrg        ;;
59983c15da26Smrg	motorola)
59993c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60003c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
60013c15da26Smrg	;;
60023c15da26Smrg      esac
60033c15da26Smrg      runpath_var='LD_RUN_PATH'
60043c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60053c15da26Smrg      ;;
60063c15da26Smrg
60073c15da26Smrg    sysv4.3*)
60083c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60093c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60103c15da26Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
60113c15da26Smrg      ;;
60123c15da26Smrg
60133c15da26Smrg    sysv4*MP*)
60143c15da26Smrg      if test -d /usr/nec; then
60153c15da26Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60163c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60173c15da26Smrg	runpath_var=LD_RUN_PATH
60183c15da26Smrg	hardcode_runpath_var=yes
60193c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
60203c15da26Smrg      fi
60213c15da26Smrg      ;;
60223c15da26Smrg
60233c15da26Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6024300346aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60253c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60263c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60273c15da26Smrg      runpath_var='LD_RUN_PATH'
60283c15da26Smrg
6029300346aeSmrg      if test yes = "$GCC"; then
6030300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6031300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60323c15da26Smrg      else
6033300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6034300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60353c15da26Smrg      fi
60363c15da26Smrg      ;;
60373c15da26Smrg
60383c15da26Smrg    sysv5* | sco3.2v5* | sco5v6*)
6039300346aeSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
60403c15da26Smrg      # link with -lc, and that would cause any symbols used from libc to
60413c15da26Smrg      # always be unresolved, which means just about no library would
60423c15da26Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
60433c15da26Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
60443c15da26Smrg      # as -z defs.
6045300346aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6046300346aeSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
60473c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60483c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6049300346aeSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
60503c15da26Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
60513c15da26Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6052300346aeSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
60533c15da26Smrg      runpath_var='LD_RUN_PATH'
60543c15da26Smrg
6055300346aeSmrg      if test yes = "$GCC"; then
6056300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6057300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60583c15da26Smrg      else
6059300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6060300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
60613c15da26Smrg      fi
60623c15da26Smrg      ;;
60633c15da26Smrg
60643c15da26Smrg    uts4*)
60653c15da26Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
60663c15da26Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
60673c15da26Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60683c15da26Smrg      ;;
60693c15da26Smrg
60703c15da26Smrg    *)
60713c15da26Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
60723c15da26Smrg      ;;
60733c15da26Smrg    esac
60743c15da26Smrg
6075300346aeSmrg    if test sni = "$host_vendor"; then
60763c15da26Smrg      case $host in
60773c15da26Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6078300346aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
60793c15da26Smrg	;;
60803c15da26Smrg      esac
60813c15da26Smrg    fi
60823c15da26Smrg  fi
60833c15da26Smrg])
60843c15da26SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6085300346aeSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
60863c15da26Smrg
60873c15da26Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
60883c15da26Smrg
60893c15da26Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
60903c15da26Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
60913c15da26Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
60923c15da26Smrg    [The commands to extract the exported symbol list from a shared archive])
60933c15da26Smrg
60943c15da26Smrg#
60953c15da26Smrg# Do we need to explicitly link libc?
60963c15da26Smrg#
60973c15da26Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
60983c15da26Smrgx|xyes)
60993c15da26Smrg  # Assume -lc should be added
61003c15da26Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61013c15da26Smrg
6102300346aeSmrg  if test yes,yes = "$GCC,$enable_shared"; then
61033c15da26Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
61043c15da26Smrg    *'~'*)
61053c15da26Smrg      # FIXME: we may have to deal with multi-command sequences.
61063c15da26Smrg      ;;
61073c15da26Smrg    '$CC '*)
61083c15da26Smrg      # Test whether the compiler implicitly links with -lc since on some
61093c15da26Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
61103c15da26Smrg      # to ld, don't add -lc before -lgcc.
61113c15da26Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
61123c15da26Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
61133c15da26Smrg	[$RM conftest*
61143c15da26Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
61153c15da26Smrg
61163c15da26Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
61173c15da26Smrg	  soname=conftest
61183c15da26Smrg	  lib=conftest
61193c15da26Smrg	  libobjs=conftest.$ac_objext
61203c15da26Smrg	  deplibs=
61213c15da26Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
61223c15da26Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
61233c15da26Smrg	  compiler_flags=-v
61243c15da26Smrg	  linker_flags=-v
61253c15da26Smrg	  verstring=
61263c15da26Smrg	  output_objdir=.
61273c15da26Smrg	  libname=conftest
61283c15da26Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
61293c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
61303c15da26Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
61313c15da26Smrg	  then
61323c15da26Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
61333c15da26Smrg	  else
61343c15da26Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
61353c15da26Smrg	  fi
61363c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
61373c15da26Smrg	else
61383c15da26Smrg	  cat conftest.err 1>&5
61393c15da26Smrg	fi
61403c15da26Smrg	$RM conftest*
61413c15da26Smrg	])
61423c15da26Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
61433c15da26Smrg      ;;
61443c15da26Smrg    esac
61453c15da26Smrg  fi
61463c15da26Smrg  ;;
61473c15da26Smrgesac
61483c15da26Smrg
61493c15da26Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
61503c15da26Smrg    [Whether or not to add -lc for building shared libraries])
61513c15da26Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
61523c15da26Smrg    [enable_shared_with_static_runtimes], [0],
61533c15da26Smrg    [Whether or not to disallow shared libs when runtime libs are static])
61543c15da26Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
61553c15da26Smrg    [Compiler flag to allow reflexive dlopens])
61563c15da26Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
61573c15da26Smrg    [Compiler flag to generate shared objects directly from archives])
61583c15da26Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
61593c15da26Smrg    [Whether the compiler copes with passing no objects directly])
61603c15da26Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
61613c15da26Smrg    [Create an old-style archive from a shared archive])
61623c15da26Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
61633c15da26Smrg    [Create a temporary old-style archive to link instead of a shared archive])
61643c15da26Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
61653c15da26Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
61663c15da26Smrg_LT_TAGDECL([], [module_cmds], [2],
61673c15da26Smrg    [Commands used to build a loadable module if different from building
61683c15da26Smrg    a shared archive.])
61693c15da26Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
61703c15da26Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
61713c15da26Smrg    [Whether we are building with GNU ld or not])
61723c15da26Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
61733c15da26Smrg    [Flag that allows shared libraries with undefined symbols to be built])
61743c15da26Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
61753c15da26Smrg    [Flag that enforces no undefined symbols])
61763c15da26Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
61773c15da26Smrg    [Flag to hardcode $libdir into a binary during linking.
61783c15da26Smrg    This must work even if $libdir does not exist])
61793c15da26Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
61803c15da26Smrg    [Whether we need a single "-rpath" flag with a separated argument])
61813c15da26Smrg_LT_TAGDECL([], [hardcode_direct], [0],
6182300346aeSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61833c15da26Smrg    DIR into the resulting binary])
61843c15da26Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6185300346aeSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
61863c15da26Smrg    DIR into the resulting binary and the resulting library dependency is
6187300346aeSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
61883c15da26Smrg    library is relocated])
61893c15da26Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
61903c15da26Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
61913c15da26Smrg    into the resulting binary])
61923c15da26Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
61933c15da26Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
61943c15da26Smrg    into the resulting binary])
61953c15da26Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
61963c15da26Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
61973c15da26Smrg    into the library and all subsequent libraries and executables linked
61983c15da26Smrg    against it])
61993c15da26Smrg_LT_TAGDECL([], [inherit_rpath], [0],
62003c15da26Smrg    [Set to yes if linker adds runtime paths of dependent libraries
62013c15da26Smrg    to runtime path list])
62023c15da26Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
62033c15da26Smrg    [Whether libtool must link a program against all its dependency libraries])
62043c15da26Smrg_LT_TAGDECL([], [always_export_symbols], [0],
62053c15da26Smrg    [Set to "yes" if exported symbols are required])
62063c15da26Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
62073c15da26Smrg    [The commands to list exported symbols])
62083c15da26Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
62093c15da26Smrg    [Symbols that should not be listed in the preloaded symbols])
62103c15da26Smrg_LT_TAGDECL([], [include_expsyms], [1],
62113c15da26Smrg    [Symbols that must always be exported])
62123c15da26Smrg_LT_TAGDECL([], [prelink_cmds], [2],
62133c15da26Smrg    [Commands necessary for linking programs (against libraries) with templates])
62143c15da26Smrg_LT_TAGDECL([], [postlink_cmds], [2],
62153c15da26Smrg    [Commands necessary for finishing linking programs])
62163c15da26Smrg_LT_TAGDECL([], [file_list_spec], [1],
62173c15da26Smrg    [Specify filename containing input files])
62183c15da26Smrgdnl FIXME: Not yet implemented
62193c15da26Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
62203c15da26Smrgdnl    [Compiler flag to generate thread safe objects])
62213c15da26Smrg])# _LT_LINKER_SHLIBS
62223c15da26Smrg
62233c15da26Smrg
62243c15da26Smrg# _LT_LANG_C_CONFIG([TAG])
62253c15da26Smrg# ------------------------
62263c15da26Smrg# Ensure that the configuration variables for a C compiler are suitably
62273c15da26Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6228300346aeSmrg# the compiler configuration to 'libtool'.
62293c15da26Smrgm4_defun([_LT_LANG_C_CONFIG],
62303c15da26Smrg[m4_require([_LT_DECL_EGREP])dnl
6231300346aeSmrglt_save_CC=$CC
62323c15da26SmrgAC_LANG_PUSH(C)
62333c15da26Smrg
62343c15da26Smrg# Source file extension for C test sources.
62353c15da26Smrgac_ext=c
62363c15da26Smrg
62373c15da26Smrg# Object file extension for compiled C test sources.
62383c15da26Smrgobjext=o
62393c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
62403c15da26Smrg
62413c15da26Smrg# Code to be used in simple compile tests
62423c15da26Smrglt_simple_compile_test_code="int some_variable = 0;"
62433c15da26Smrg
62443c15da26Smrg# Code to be used in simple link tests
62453c15da26Smrglt_simple_link_test_code='int main(){return(0);}'
62463c15da26Smrg
62473c15da26Smrg_LT_TAG_COMPILER
62483c15da26Smrg# Save the default compiler, since it gets overwritten when the other
62493c15da26Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
62503c15da26Smrgcompiler_DEFAULT=$CC
62513c15da26Smrg
62523c15da26Smrg# save warnings/boilerplate of simple test code
62533c15da26Smrg_LT_COMPILER_BOILERPLATE
62543c15da26Smrg_LT_LINKER_BOILERPLATE
62553c15da26Smrg
62563c15da26Smrgif test -n "$compiler"; then
62573c15da26Smrg  _LT_COMPILER_NO_RTTI($1)
62583c15da26Smrg  _LT_COMPILER_PIC($1)
62593c15da26Smrg  _LT_COMPILER_C_O($1)
62603c15da26Smrg  _LT_COMPILER_FILE_LOCKS($1)
62613c15da26Smrg  _LT_LINKER_SHLIBS($1)
62623c15da26Smrg  _LT_SYS_DYNAMIC_LINKER($1)
62633c15da26Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
62643c15da26Smrg  LT_SYS_DLOPEN_SELF
62653c15da26Smrg  _LT_CMD_STRIPLIB
62663c15da26Smrg
6267300346aeSmrg  # Report what library types will actually be built
62683c15da26Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
62693c15da26Smrg  AC_MSG_RESULT([$can_build_shared])
62703c15da26Smrg
62713c15da26Smrg  AC_MSG_CHECKING([whether to build shared libraries])
6272300346aeSmrg  test no = "$can_build_shared" && enable_shared=no
62733c15da26Smrg
62743c15da26Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
62753c15da26Smrg  # are all built from PIC.
62763c15da26Smrg  case $host_os in
62773c15da26Smrg  aix3*)
6278300346aeSmrg    test yes = "$enable_shared" && enable_static=no
62793c15da26Smrg    if test -n "$RANLIB"; then
62803c15da26Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
62813c15da26Smrg      postinstall_cmds='$RANLIB $lib'
62823c15da26Smrg    fi
62833c15da26Smrg    ;;
62843c15da26Smrg
62853c15da26Smrg  aix[[4-9]]*)
6286300346aeSmrg    if test ia64 != "$host_cpu"; then
6287300346aeSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6288300346aeSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
6289300346aeSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6290300346aeSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6291300346aeSmrg      esac
62923c15da26Smrg    fi
62933c15da26Smrg    ;;
62943c15da26Smrg  esac
62953c15da26Smrg  AC_MSG_RESULT([$enable_shared])
62963c15da26Smrg
62973c15da26Smrg  AC_MSG_CHECKING([whether to build static libraries])
62983c15da26Smrg  # Make sure either enable_shared or enable_static is yes.
6299300346aeSmrg  test yes = "$enable_shared" || enable_static=yes
63003c15da26Smrg  AC_MSG_RESULT([$enable_static])
63013c15da26Smrg
63023c15da26Smrg  _LT_CONFIG($1)
63033c15da26Smrgfi
63043c15da26SmrgAC_LANG_POP
6305300346aeSmrgCC=$lt_save_CC
63063c15da26Smrg])# _LT_LANG_C_CONFIG
63073c15da26Smrg
63083c15da26Smrg
63093c15da26Smrg# _LT_LANG_CXX_CONFIG([TAG])
63103c15da26Smrg# --------------------------
63113c15da26Smrg# Ensure that the configuration variables for a C++ compiler are suitably
63123c15da26Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6313300346aeSmrg# the compiler configuration to 'libtool'.
63143c15da26Smrgm4_defun([_LT_LANG_CXX_CONFIG],
63153c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
63163c15da26Smrgm4_require([_LT_DECL_EGREP])dnl
63173c15da26Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6318300346aeSmrgif test -n "$CXX" && ( test no != "$CXX" &&
6319300346aeSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6320300346aeSmrg    (test g++ != "$CXX"))); then
63213c15da26Smrg  AC_PROG_CXXCPP
63223c15da26Smrgelse
63233c15da26Smrg  _lt_caught_CXX_error=yes
63243c15da26Smrgfi
63253c15da26Smrg
63263c15da26SmrgAC_LANG_PUSH(C++)
63273c15da26Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
63283c15da26Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
63293c15da26Smrg_LT_TAGVAR(always_export_symbols, $1)=no
63303c15da26Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
63313c15da26Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
63323c15da26Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
63333c15da26Smrg_LT_TAGVAR(hardcode_direct, $1)=no
63343c15da26Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
63353c15da26Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
63363c15da26Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
63373c15da26Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
63383c15da26Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
63393c15da26Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
63403c15da26Smrg_LT_TAGVAR(inherit_rpath, $1)=no
63413c15da26Smrg_LT_TAGVAR(module_cmds, $1)=
63423c15da26Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
63433c15da26Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
63443c15da26Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
63453c15da26Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
63463c15da26Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
63473c15da26Smrg_LT_TAGVAR(no_undefined_flag, $1)=
63483c15da26Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
63493c15da26Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
63503c15da26Smrg
63513c15da26Smrg# Source file extension for C++ test sources.
63523c15da26Smrgac_ext=cpp
63533c15da26Smrg
63543c15da26Smrg# Object file extension for compiled C++ test sources.
63553c15da26Smrgobjext=o
63563c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
63573c15da26Smrg
63583c15da26Smrg# No sense in running all these tests if we already determined that
63593c15da26Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
63603c15da26Smrg# are currently assumed to apply to all compilers on this platform,
63613c15da26Smrg# and will be corrupted by setting them based on a non-working compiler.
6362300346aeSmrgif test yes != "$_lt_caught_CXX_error"; then
63633c15da26Smrg  # Code to be used in simple compile tests
63643c15da26Smrg  lt_simple_compile_test_code="int some_variable = 0;"
63653c15da26Smrg
63663c15da26Smrg  # Code to be used in simple link tests
63673c15da26Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
63683c15da26Smrg
63693c15da26Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
63703c15da26Smrg  _LT_TAG_COMPILER
63713c15da26Smrg
63723c15da26Smrg  # save warnings/boilerplate of simple test code
63733c15da26Smrg  _LT_COMPILER_BOILERPLATE
63743c15da26Smrg  _LT_LINKER_BOILERPLATE
63753c15da26Smrg
63763c15da26Smrg  # Allow CC to be a program name with arguments.
63773c15da26Smrg  lt_save_CC=$CC
63783c15da26Smrg  lt_save_CFLAGS=$CFLAGS
63793c15da26Smrg  lt_save_LD=$LD
63803c15da26Smrg  lt_save_GCC=$GCC
63813c15da26Smrg  GCC=$GXX
63823c15da26Smrg  lt_save_with_gnu_ld=$with_gnu_ld
63833c15da26Smrg  lt_save_path_LD=$lt_cv_path_LD
63843c15da26Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
63853c15da26Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
63863c15da26Smrg  else
63873c15da26Smrg    $as_unset lt_cv_prog_gnu_ld
63883c15da26Smrg  fi
63893c15da26Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
63903c15da26Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
63913c15da26Smrg  else
63923c15da26Smrg    $as_unset lt_cv_path_LD
63933c15da26Smrg  fi
63943c15da26Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
63953c15da26Smrg  CC=${CXX-"c++"}
63963c15da26Smrg  CFLAGS=$CXXFLAGS
63973c15da26Smrg  compiler=$CC
63983c15da26Smrg  _LT_TAGVAR(compiler, $1)=$CC
63993c15da26Smrg  _LT_CC_BASENAME([$compiler])
64003c15da26Smrg
64013c15da26Smrg  if test -n "$compiler"; then
64023c15da26Smrg    # We don't want -fno-exception when compiling C++ code, so set the
64033c15da26Smrg    # no_builtin_flag separately
6404300346aeSmrg    if test yes = "$GXX"; then
64053c15da26Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
64063c15da26Smrg    else
64073c15da26Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
64083c15da26Smrg    fi
64093c15da26Smrg
6410300346aeSmrg    if test yes = "$GXX"; then
64113c15da26Smrg      # Set up default GNU C++ configuration
64123c15da26Smrg
64133c15da26Smrg      LT_PATH_LD
64143c15da26Smrg
64153c15da26Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
64163c15da26Smrg      # archiving commands below assume that GNU ld is being used.
6417300346aeSmrg      if test yes = "$with_gnu_ld"; then
6418300346aeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6419300346aeSmrg        _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'
64203c15da26Smrg
6421300346aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6422300346aeSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
64233c15da26Smrg
64243c15da26Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
64253c15da26Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
64263c15da26Smrg        #     investigate it a little bit more. (MM)
6427300346aeSmrg        wlarc='$wl'
64283c15da26Smrg
64293c15da26Smrg        # ancient GNU ld didn't support --whole-archive et. al.
64303c15da26Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
64313c15da26Smrg	  $GREP 'no-whole-archive' > /dev/null; then
6432300346aeSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
64333c15da26Smrg        else
64343c15da26Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
64353c15da26Smrg        fi
64363c15da26Smrg      else
64373c15da26Smrg        with_gnu_ld=no
64383c15da26Smrg        wlarc=
64393c15da26Smrg
64403c15da26Smrg        # A generic and very simple default shared library creation
64413c15da26Smrg        # command for GNU C++ for the case where it uses the native
64423c15da26Smrg        # linker, instead of GNU ld.  If possible, this setting should
64433c15da26Smrg        # overridden to take advantage of the native linker features on
64443c15da26Smrg        # the platform it is being used on.
64453c15da26Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
64463c15da26Smrg      fi
64473c15da26Smrg
64483c15da26Smrg      # Commands to make compiler produce verbose output that lists
64493c15da26Smrg      # what "hidden" libraries, object files and flags are used when
64503c15da26Smrg      # linking a shared library.
64513c15da26Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
64523c15da26Smrg
64533c15da26Smrg    else
64543c15da26Smrg      GXX=no
64553c15da26Smrg      with_gnu_ld=no
64563c15da26Smrg      wlarc=
64573c15da26Smrg    fi
64583c15da26Smrg
64593c15da26Smrg    # PORTME: fill in a description of your system's C++ link characteristics
64603c15da26Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
64613c15da26Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
64623c15da26Smrg    case $host_os in
64633c15da26Smrg      aix3*)
64643c15da26Smrg        # FIXME: insert proper C++ library support
64653c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
64663c15da26Smrg        ;;
64673c15da26Smrg      aix[[4-9]]*)
6468300346aeSmrg        if test ia64 = "$host_cpu"; then
64693c15da26Smrg          # On IA64, the linker does run time linking by default, so we don't
64703c15da26Smrg          # have to do anything special.
64713c15da26Smrg          aix_use_runtimelinking=no
64723c15da26Smrg          exp_sym_flag='-Bexport'
6473300346aeSmrg          no_entry_flag=
64743c15da26Smrg        else
64753c15da26Smrg          aix_use_runtimelinking=no
64763c15da26Smrg
64773c15da26Smrg          # Test if we are trying to use run time linking or normal
64783c15da26Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6479300346aeSmrg          # have runtime linking enabled, and use it for executables.
6480300346aeSmrg          # For shared libraries, we enable/disable runtime linking
6481300346aeSmrg          # depending on the kind of the shared library created -
6482300346aeSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6483300346aeSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6484300346aeSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6485300346aeSmrg          #            lib.a           static archive
6486300346aeSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6487300346aeSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6488300346aeSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6489300346aeSmrg          #            lib.a(lib.so.V) shared, rtl:no
6490300346aeSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6491300346aeSmrg          #            lib.a           static archive
64923c15da26Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
64933c15da26Smrg	    for ld_flag in $LDFLAGS; do
64943c15da26Smrg	      case $ld_flag in
64953c15da26Smrg	      *-brtl*)
64963c15da26Smrg	        aix_use_runtimelinking=yes
64973c15da26Smrg	        break
64983c15da26Smrg	        ;;
64993c15da26Smrg	      esac
65003c15da26Smrg	    done
6501300346aeSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6502300346aeSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6503300346aeSmrg	      # so we don't have lib.a shared libs to link our executables.
6504300346aeSmrg	      # We have to force runtime linking in this case.
6505300346aeSmrg	      aix_use_runtimelinking=yes
6506300346aeSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6507300346aeSmrg	    fi
65083c15da26Smrg	    ;;
65093c15da26Smrg          esac
65103c15da26Smrg
65113c15da26Smrg          exp_sym_flag='-bexport'
65123c15da26Smrg          no_entry_flag='-bnoentry'
65133c15da26Smrg        fi
65143c15da26Smrg
65153c15da26Smrg        # When large executables or shared objects are built, AIX ld can
65163c15da26Smrg        # have problems creating the table of contents.  If linking a library
65173c15da26Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
65183c15da26Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
65193c15da26Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
65203c15da26Smrg
65213c15da26Smrg        _LT_TAGVAR(archive_cmds, $1)=''
65223c15da26Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
65233c15da26Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
65243c15da26Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
65253c15da26Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6526300346aeSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6527300346aeSmrg        case $with_aix_soname,$aix_use_runtimelinking in
6528300346aeSmrg        aix,*) ;;	# no import file
6529300346aeSmrg        svr4,* | *,yes) # use import file
6530300346aeSmrg          # The Import File defines what to hardcode.
6531300346aeSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
6532300346aeSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6533300346aeSmrg          ;;
6534300346aeSmrg        esac
65353c15da26Smrg
6536300346aeSmrg        if test yes = "$GXX"; then
65373c15da26Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
65383c15da26Smrg          # We only want to do this on AIX 4.2 and lower, the check
65393c15da26Smrg          # below for broken collect2 doesn't work under 4.3+
6540300346aeSmrg	  collect2name=`$CC -print-prog-name=collect2`
65413c15da26Smrg	  if test -f "$collect2name" &&
65423c15da26Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
65433c15da26Smrg	  then
65443c15da26Smrg	    # We have reworked collect2
65453c15da26Smrg	    :
65463c15da26Smrg	  else
65473c15da26Smrg	    # We have old collect2
65483c15da26Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
65493c15da26Smrg	    # It fails to find uninstalled libraries when the uninstalled
65503c15da26Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
65513c15da26Smrg	    # to unsupported forces relinking
65523c15da26Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
65533c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
65543c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
65553c15da26Smrg	  fi
65563c15da26Smrg          esac
65573c15da26Smrg          shared_flag='-shared'
6558300346aeSmrg	  if test yes = "$aix_use_runtimelinking"; then
6559300346aeSmrg	    shared_flag=$shared_flag' $wl-G'
65603c15da26Smrg	  fi
6561300346aeSmrg	  # Need to ensure runtime linking is disabled for the traditional
6562300346aeSmrg	  # shared library, or the linker may eventually find shared libraries
6563300346aeSmrg	  # /with/ Import File - we do not want to mix them.
6564300346aeSmrg	  shared_flag_aix='-shared'
6565300346aeSmrg	  shared_flag_svr4='-shared $wl-G'
65663c15da26Smrg        else
65673c15da26Smrg          # not using gcc
6568300346aeSmrg          if test ia64 = "$host_cpu"; then
65693c15da26Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
65703c15da26Smrg	  # chokes on -Wl,-G. The following line is correct:
65713c15da26Smrg	  shared_flag='-G'
65723c15da26Smrg          else
6573300346aeSmrg	    if test yes = "$aix_use_runtimelinking"; then
6574300346aeSmrg	      shared_flag='$wl-G'
65753c15da26Smrg	    else
6576300346aeSmrg	      shared_flag='$wl-bM:SRE'
65773c15da26Smrg	    fi
6578300346aeSmrg	    shared_flag_aix='$wl-bM:SRE'
6579300346aeSmrg	    shared_flag_svr4='$wl-G'
65803c15da26Smrg          fi
65813c15da26Smrg        fi
65823c15da26Smrg
6583300346aeSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
65843c15da26Smrg        # It seems that -bexpall does not export symbols beginning with
65853c15da26Smrg        # underscore (_), so it is better to generate a list of symbols to
65863c15da26Smrg	# export.
65873c15da26Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6588300346aeSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
65893c15da26Smrg          # Warning - without using the other runtime loading flags (-brtl),
65903c15da26Smrg          # -berok will link without error, but may produce a broken library.
6591300346aeSmrg          # The "-G" linker flag allows undefined symbols.
6592300346aeSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
65933c15da26Smrg          # Determine the default libpath from the value encoded in an empty
65943c15da26Smrg          # executable.
65953c15da26Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6596300346aeSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65973c15da26Smrg
6598300346aeSmrg          _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
65993c15da26Smrg        else
6600300346aeSmrg          if test ia64 = "$host_cpu"; then
6601300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
66023c15da26Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6603300346aeSmrg	    _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"
66043c15da26Smrg          else
66053c15da26Smrg	    # Determine the default libpath from the value encoded in an
66063c15da26Smrg	    # empty executable.
66073c15da26Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6608300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
66093c15da26Smrg	    # Warning - without using the other run time loading flags,
66103c15da26Smrg	    # -berok will link without error, but may produce a broken library.
6611300346aeSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6612300346aeSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6613300346aeSmrg	    if test yes = "$with_gnu_ld"; then
66143c15da26Smrg	      # We only use this code for GNU lds that support --whole-archive.
6615300346aeSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
66163c15da26Smrg	    else
66173c15da26Smrg	      # Exported symbols can be pulled into shared objects from archives
66183c15da26Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
66193c15da26Smrg	    fi
66203c15da26Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6621300346aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6622300346aeSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6623300346aeSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6624300346aeSmrg	    if test svr4 != "$with_aix_soname"; then
6625300346aeSmrg	      # This is similar to how AIX traditionally builds its shared
6626300346aeSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6627300346aeSmrg	      _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'
6628300346aeSmrg	    fi
6629300346aeSmrg	    if test aix != "$with_aix_soname"; then
6630300346aeSmrg	      _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'
6631300346aeSmrg	    else
6632300346aeSmrg	      # used by -dlpreopen to get the symbols
6633300346aeSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6634300346aeSmrg	    fi
6635300346aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
66363c15da26Smrg          fi
66373c15da26Smrg        fi
66383c15da26Smrg        ;;
66393c15da26Smrg
66403c15da26Smrg      beos*)
66413c15da26Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
66423c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66433c15da26Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
66443c15da26Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6645300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
66463c15da26Smrg	else
66473c15da26Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66483c15da26Smrg	fi
66493c15da26Smrg	;;
66503c15da26Smrg
66513c15da26Smrg      chorus*)
66523c15da26Smrg        case $cc_basename in
66533c15da26Smrg          *)
66543c15da26Smrg	  # FIXME: insert proper C++ library support
66553c15da26Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
66563c15da26Smrg	  ;;
66573c15da26Smrg        esac
66583c15da26Smrg        ;;
66593c15da26Smrg
66603c15da26Smrg      cygwin* | mingw* | pw32* | cegcc*)
66613c15da26Smrg	case $GXX,$cc_basename in
66623c15da26Smrg	,cl* | no,cl*)
66633c15da26Smrg	  # Native MSVC
66643c15da26Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
66653c15da26Smrg	  # no search path for DLLs.
66663c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
66673c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
66683c15da26Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
66693c15da26Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
66703c15da26Smrg	  # Tell ltmain to make .lib files, not .a files.
66713c15da26Smrg	  libext=lib
66723c15da26Smrg	  # Tell ltmain to make .dll files, not .so files.
6673300346aeSmrg	  shrext_cmds=.dll
66743c15da26Smrg	  # FIXME: Setting linknames here is a bad hack.
6675300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6676300346aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6677300346aeSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
6678300346aeSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6679300346aeSmrg            else
6680300346aeSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6681300346aeSmrg            fi~
6682300346aeSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6683300346aeSmrg            linknames='
66843c15da26Smrg	  # The linker will not automatically build a static lib if we build a DLL.
66853c15da26Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
66863c15da26Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
66873c15da26Smrg	  # Don't use ranlib
66883c15da26Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
66893c15da26Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6690300346aeSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6691300346aeSmrg            case $lt_outputfile in
6692300346aeSmrg              *.exe|*.EXE) ;;
6693300346aeSmrg              *)
6694300346aeSmrg                lt_outputfile=$lt_outputfile.exe
6695300346aeSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6696300346aeSmrg                ;;
6697300346aeSmrg            esac~
6698300346aeSmrg            func_to_tool_file "$lt_outputfile"~
6699300346aeSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6700300346aeSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6701300346aeSmrg              $RM "$lt_outputfile.manifest";
6702300346aeSmrg            fi'
67033c15da26Smrg	  ;;
67043c15da26Smrg	*)
67053c15da26Smrg	  # g++
67063c15da26Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
67073c15da26Smrg	  # as there is no search path for DLLs.
67083c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6709300346aeSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
67103c15da26Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
67113c15da26Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
67123c15da26Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
67133c15da26Smrg
67143c15da26Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6715300346aeSmrg	    _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'
6716300346aeSmrg	    # If the export-symbols file already is a .def file, use it as
6717300346aeSmrg	    # is; otherwise, prepend EXPORTS...
6718300346aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6719300346aeSmrg              cp $export_symbols $output_objdir/$soname.def;
6720300346aeSmrg            else
6721300346aeSmrg              echo EXPORTS > $output_objdir/$soname.def;
6722300346aeSmrg              cat $export_symbols >> $output_objdir/$soname.def;
6723300346aeSmrg            fi~
6724300346aeSmrg            $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'
67253c15da26Smrg	  else
67263c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67273c15da26Smrg	  fi
67283c15da26Smrg	  ;;
67293c15da26Smrg	esac
67303c15da26Smrg	;;
67313c15da26Smrg      darwin* | rhapsody*)
67323c15da26Smrg        _LT_DARWIN_LINKER_FEATURES($1)
67333c15da26Smrg	;;
67343c15da26Smrg
6735300346aeSmrg      os2*)
6736300346aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6737300346aeSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6738300346aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6739300346aeSmrg	shrext_cmds=.dll
6740300346aeSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6741300346aeSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6742300346aeSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6743300346aeSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6744300346aeSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6745300346aeSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6746300346aeSmrg	  emximp -o $lib $output_objdir/$libname.def'
6747300346aeSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6748300346aeSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6749300346aeSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6750300346aeSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6751300346aeSmrg	  prefix_cmds="$SED"~
6752300346aeSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6753300346aeSmrg	    prefix_cmds="$prefix_cmds -e 1d";
6754300346aeSmrg	  fi~
6755300346aeSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6756300346aeSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6757300346aeSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6758300346aeSmrg	  emximp -o $lib $output_objdir/$libname.def'
6759300346aeSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6760300346aeSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6761300346aeSmrg	;;
6762300346aeSmrg
67633c15da26Smrg      dgux*)
67643c15da26Smrg        case $cc_basename in
67653c15da26Smrg          ec++*)
67663c15da26Smrg	    # FIXME: insert proper C++ library support
67673c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67683c15da26Smrg	    ;;
67693c15da26Smrg          ghcx*)
67703c15da26Smrg	    # Green Hills C++ Compiler
67713c15da26Smrg	    # FIXME: insert proper C++ library support
67723c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67733c15da26Smrg	    ;;
67743c15da26Smrg          *)
67753c15da26Smrg	    # FIXME: insert proper C++ library support
67763c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
67773c15da26Smrg	    ;;
67783c15da26Smrg        esac
67793c15da26Smrg        ;;
67803c15da26Smrg
67810a6b08f8Smrg      freebsd2.*)
67823c15da26Smrg        # C++ shared libraries reported to be fairly broken before
67833c15da26Smrg	# switch to ELF
67843c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
67853c15da26Smrg        ;;
67863c15da26Smrg
67873c15da26Smrg      freebsd-elf*)
67883c15da26Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
67893c15da26Smrg        ;;
67903c15da26Smrg
67913c15da26Smrg      freebsd* | dragonfly*)
67923c15da26Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
67933c15da26Smrg        # conventions
67943c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
67953c15da26Smrg        ;;
67963c15da26Smrg
67973c15da26Smrg      haiku*)
6798300346aeSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
67993c15da26Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
68003c15da26Smrg        ;;
68013c15da26Smrg
68023c15da26Smrg      hpux9*)
6803300346aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
68043c15da26Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6805300346aeSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68063c15da26Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
68073c15da26Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68083c15da26Smrg				             # but as the default
68093c15da26Smrg				             # location of the library.
68103c15da26Smrg
68113c15da26Smrg        case $cc_basename in
68123c15da26Smrg          CC*)
68133c15da26Smrg            # FIXME: insert proper C++ library support
68143c15da26Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
68153c15da26Smrg            ;;
68163c15da26Smrg          aCC*)
6817300346aeSmrg            _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'
68183c15da26Smrg            # Commands to make compiler produce verbose output that lists
68193c15da26Smrg            # what "hidden" libraries, object files and flags are used when
68203c15da26Smrg            # linking a shared library.
68213c15da26Smrg            #
68223c15da26Smrg            # There doesn't appear to be a way to prevent this compiler from
68233c15da26Smrg            # explicitly linking system object files so we need to strip them
68243c15da26Smrg            # from the output so that they don't get included in the library
68253c15da26Smrg            # dependencies.
6826300346aeSmrg            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"'
68273c15da26Smrg            ;;
68283c15da26Smrg          *)
6829300346aeSmrg            if test yes = "$GXX"; then
6830300346aeSmrg              _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'
68313c15da26Smrg            else
68323c15da26Smrg              # FIXME: insert proper C++ library support
68333c15da26Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
68343c15da26Smrg            fi
68353c15da26Smrg            ;;
68363c15da26Smrg        esac
68373c15da26Smrg        ;;
68383c15da26Smrg
68393c15da26Smrg      hpux10*|hpux11*)
6840300346aeSmrg        if test no = "$with_gnu_ld"; then
6841300346aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
68423c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
68433c15da26Smrg
68443c15da26Smrg          case $host_cpu in
68453c15da26Smrg            hppa*64*|ia64*)
68463c15da26Smrg              ;;
68473c15da26Smrg            *)
6848300346aeSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
68493c15da26Smrg              ;;
68503c15da26Smrg          esac
68513c15da26Smrg        fi
68523c15da26Smrg        case $host_cpu in
68533c15da26Smrg          hppa*64*|ia64*)
68543c15da26Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
68553c15da26Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
68563c15da26Smrg            ;;
68573c15da26Smrg          *)
68583c15da26Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
68593c15da26Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
68603c15da26Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
68613c15da26Smrg					         # but as the default
68623c15da26Smrg					         # location of the library.
68633c15da26Smrg            ;;
68643c15da26Smrg        esac
68653c15da26Smrg
68663c15da26Smrg        case $cc_basename in
68673c15da26Smrg          CC*)
68683c15da26Smrg	    # FIXME: insert proper C++ library support
68693c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
68703c15da26Smrg	    ;;
68713c15da26Smrg          aCC*)
68723c15da26Smrg	    case $host_cpu in
68733c15da26Smrg	      hppa*64*)
6874300346aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68753c15da26Smrg	        ;;
68763c15da26Smrg	      ia64*)
6877300346aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68783c15da26Smrg	        ;;
68793c15da26Smrg	      *)
6880300346aeSmrg	        _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'
68813c15da26Smrg	        ;;
68823c15da26Smrg	    esac
68833c15da26Smrg	    # Commands to make compiler produce verbose output that lists
68843c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
68853c15da26Smrg	    # linking a shared library.
68863c15da26Smrg	    #
68873c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
68883c15da26Smrg	    # explicitly linking system object files so we need to strip them
68893c15da26Smrg	    # from the output so that they don't get included in the library
68903c15da26Smrg	    # dependencies.
6891300346aeSmrg	    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"'
68923c15da26Smrg	    ;;
68933c15da26Smrg          *)
6894300346aeSmrg	    if test yes = "$GXX"; then
6895300346aeSmrg	      if test no = "$with_gnu_ld"; then
68963c15da26Smrg	        case $host_cpu in
68973c15da26Smrg	          hppa*64*)
6898300346aeSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
68993c15da26Smrg	            ;;
69003c15da26Smrg	          ia64*)
6901300346aeSmrg	            _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'
69023c15da26Smrg	            ;;
69033c15da26Smrg	          *)
6904300346aeSmrg	            _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'
69053c15da26Smrg	            ;;
69063c15da26Smrg	        esac
69073c15da26Smrg	      fi
69083c15da26Smrg	    else
69093c15da26Smrg	      # FIXME: insert proper C++ library support
69103c15da26Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
69113c15da26Smrg	    fi
69123c15da26Smrg	    ;;
69133c15da26Smrg        esac
69143c15da26Smrg        ;;
69153c15da26Smrg
69163c15da26Smrg      interix[[3-9]]*)
69173c15da26Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
69183c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6919300346aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6920300346aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
69213c15da26Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
69223c15da26Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
69233c15da26Smrg	# default) and relocated if they conflict, which is a slow very memory
69243c15da26Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
69253c15da26Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
69263c15da26Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6927300346aeSmrg	_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'
6928300346aeSmrg	_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'
69293c15da26Smrg	;;
69303c15da26Smrg      irix5* | irix6*)
69313c15da26Smrg        case $cc_basename in
69323c15da26Smrg          CC*)
69333c15da26Smrg	    # SGI C++
6934300346aeSmrg	    _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'
69353c15da26Smrg
69363c15da26Smrg	    # Archives containing C++ object files must be created using
69373c15da26Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
69383c15da26Smrg	    # necessary to make sure instantiated templates are included
69393c15da26Smrg	    # in the archive.
69403c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
69413c15da26Smrg	    ;;
69423c15da26Smrg          *)
6943300346aeSmrg	    if test yes = "$GXX"; then
6944300346aeSmrg	      if test no = "$with_gnu_ld"; then
6945300346aeSmrg	        _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'
69463c15da26Smrg	      else
6947300346aeSmrg	        _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'
69483c15da26Smrg	      fi
69493c15da26Smrg	    fi
69503c15da26Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
69513c15da26Smrg	    ;;
69523c15da26Smrg        esac
6953300346aeSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
69543c15da26Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
69553c15da26Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
69563c15da26Smrg        ;;
69573c15da26Smrg
6958300346aeSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
69593c15da26Smrg        case $cc_basename in
69603c15da26Smrg          KCC*)
69613c15da26Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
69623c15da26Smrg
69633c15da26Smrg	    # KCC will only create a shared library if the output file
69643c15da26Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
69653c15da26Smrg	    # to its proper name (with version) after linking.
6966300346aeSmrg	    _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'
6967300346aeSmrg	    _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'
69683c15da26Smrg	    # Commands to make compiler produce verbose output that lists
69693c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
69703c15da26Smrg	    # linking a shared library.
69713c15da26Smrg	    #
69723c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
69733c15da26Smrg	    # explicitly linking system object files so we need to strip them
69743c15da26Smrg	    # from the output so that they don't get included in the library
69753c15da26Smrg	    # dependencies.
6976300346aeSmrg	    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"'
69773c15da26Smrg
6978300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6979300346aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
69803c15da26Smrg
69813c15da26Smrg	    # Archives containing C++ object files must be created using
69823c15da26Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
69833c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
69843c15da26Smrg	    ;;
69853c15da26Smrg	  icpc* | ecpc* )
69863c15da26Smrg	    # Intel C++
69873c15da26Smrg	    with_gnu_ld=yes
69883c15da26Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
69893c15da26Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
69903c15da26Smrg	    # earlier do not add the objects themselves.
69913c15da26Smrg	    case `$CC -V 2>&1` in
69923c15da26Smrg	      *"Version 7."*)
6993300346aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6994300346aeSmrg		_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'
69953c15da26Smrg		;;
69963c15da26Smrg	      *)  # Version 8.0 or newer
69973c15da26Smrg	        tmp_idyn=
69983c15da26Smrg	        case $host_cpu in
69993c15da26Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
70003c15da26Smrg		esac
7001300346aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7002300346aeSmrg		_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'
70033c15da26Smrg		;;
70043c15da26Smrg	    esac
70053c15da26Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7006300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7007300346aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7008300346aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
70093c15da26Smrg	    ;;
70103c15da26Smrg          pgCC* | pgcpp*)
70113c15da26Smrg            # Portland Group C++ compiler
70123c15da26Smrg	    case `$CC -V` in
70133c15da26Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
70143c15da26Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7015300346aeSmrg               rm -rf $tpldir~
7016300346aeSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7017300346aeSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
70183c15da26Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7019300346aeSmrg                rm -rf $tpldir~
7020300346aeSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7021300346aeSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7022300346aeSmrg                $RANLIB $oldlib'
70233c15da26Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7024300346aeSmrg                rm -rf $tpldir~
7025300346aeSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7026300346aeSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
70273c15da26Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7028300346aeSmrg                rm -rf $tpldir~
7029300346aeSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7030300346aeSmrg                $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'
70313c15da26Smrg	      ;;
70323c15da26Smrg	    *) # Version 6 and above use weak symbols
7033300346aeSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7034300346aeSmrg	      _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'
70353c15da26Smrg	      ;;
70363c15da26Smrg	    esac
70373c15da26Smrg
7038300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7039300346aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7040300346aeSmrg	    _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'
70413c15da26Smrg            ;;
70423c15da26Smrg	  cxx*)
70433c15da26Smrg	    # Compaq C++
7044300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7045300346aeSmrg	    _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'
70463c15da26Smrg
70473c15da26Smrg	    runpath_var=LD_RUN_PATH
70483c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
70493c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
70503c15da26Smrg
70513c15da26Smrg	    # Commands to make compiler produce verbose output that lists
70523c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
70533c15da26Smrg	    # linking a shared library.
70543c15da26Smrg	    #
70553c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
70563c15da26Smrg	    # explicitly linking system object files so we need to strip them
70573c15da26Smrg	    # from the output so that they don't get included in the library
70583c15da26Smrg	    # dependencies.
7059300346aeSmrg	    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'
70603c15da26Smrg	    ;;
70613c15da26Smrg	  xl* | mpixl* | bgxl*)
70623c15da26Smrg	    # IBM XL 8.0 on PPC, with GNU ld
7063300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7064300346aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7065300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7066300346aeSmrg	    if test yes = "$supports_anon_versioning"; then
70673c15da26Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7068300346aeSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7069300346aeSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7070300346aeSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
70713c15da26Smrg	    fi
70723c15da26Smrg	    ;;
70733c15da26Smrg	  *)
70743c15da26Smrg	    case `$CC -V 2>&1 | sed 5q` in
70753c15da26Smrg	    *Sun\ C*)
70763c15da26Smrg	      # Sun C++ 5.9
70773c15da26Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7078300346aeSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7079300346aeSmrg	      _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'
70803c15da26Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7081300346aeSmrg	      _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'
70823c15da26Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
70833c15da26Smrg
70843c15da26Smrg	      # Not sure whether something based on
70853c15da26Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
70863c15da26Smrg	      # would be better.
70873c15da26Smrg	      output_verbose_link_cmd='func_echo_all'
7088126a8a12Smrg
70893c15da26Smrg	      # Archives containing C++ object files must be created using
70903c15da26Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
70913c15da26Smrg	      # necessary to make sure instantiated templates are included
70923c15da26Smrg	      # in the archive.
70933c15da26Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
70943c15da26Smrg	      ;;
70953c15da26Smrg	    esac
70963c15da26Smrg	    ;;
70973c15da26Smrg	esac
70983c15da26Smrg	;;
7099555991fdSmrg
71003c15da26Smrg      lynxos*)
71013c15da26Smrg        # FIXME: insert proper C++ library support
71023c15da26Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
71033c15da26Smrg	;;
7104126a8a12Smrg
71053c15da26Smrg      m88k*)
71063c15da26Smrg        # FIXME: insert proper C++ library support
71073c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
71083c15da26Smrg	;;
7109126a8a12Smrg
71103c15da26Smrg      mvs*)
71113c15da26Smrg        case $cc_basename in
71123c15da26Smrg          cxx*)
71133c15da26Smrg	    # FIXME: insert proper C++ library support
71143c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71153c15da26Smrg	    ;;
71163c15da26Smrg	  *)
71173c15da26Smrg	    # FIXME: insert proper C++ library support
71183c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71193c15da26Smrg	    ;;
71203c15da26Smrg	esac
71213c15da26Smrg	;;
7122126a8a12Smrg
71233c15da26Smrg      netbsd*)
71243c15da26Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
71253c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
71263c15da26Smrg	  wlarc=
71273c15da26Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
71283c15da26Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71293c15da26Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
71303c15da26Smrg	fi
71313c15da26Smrg	# Workaround some broken pre-1.5 toolchains
71323c15da26Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
71333c15da26Smrg	;;
7134126a8a12Smrg
71353c15da26Smrg      *nto* | *qnx*)
71363c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
71373c15da26Smrg	;;
7138126a8a12Smrg
7139300346aeSmrg      openbsd* | bitrig*)
71403c15da26Smrg	if test -f /usr/libexec/ld.so; then
7141555991fdSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
71423c15da26Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7143555991fdSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
71443c15da26Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7145300346aeSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7146300346aeSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7147300346aeSmrg	    _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'
7148300346aeSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7149300346aeSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
71503c15da26Smrg	  fi
71513c15da26Smrg	  output_verbose_link_cmd=func_echo_all
71523c15da26Smrg	else
71533c15da26Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
71543c15da26Smrg	fi
71553c15da26Smrg	;;
7156126a8a12Smrg
71573c15da26Smrg      osf3* | osf4* | osf5*)
71583c15da26Smrg        case $cc_basename in
71593c15da26Smrg          KCC*)
71603c15da26Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7161126a8a12Smrg
71623c15da26Smrg	    # KCC will only create a shared library if the output file
71633c15da26Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
71643c15da26Smrg	    # to its proper name (with version) after linking.
7165300346aeSmrg	    _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'
7166126a8a12Smrg
7167300346aeSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
71683c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71693c15da26Smrg
71703c15da26Smrg	    # Archives containing C++ object files must be created using
71713c15da26Smrg	    # the KAI C++ compiler.
71723c15da26Smrg	    case $host in
71733c15da26Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
71743c15da26Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
71753c15da26Smrg	    esac
71763c15da26Smrg	    ;;
71773c15da26Smrg          RCC*)
71783c15da26Smrg	    # Rational C++ 2.4.1
71793c15da26Smrg	    # FIXME: insert proper C++ library support
71803c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
71813c15da26Smrg	    ;;
71823c15da26Smrg          cxx*)
71833c15da26Smrg	    case $host in
71843c15da26Smrg	      osf3*)
7185300346aeSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7186300346aeSmrg	        _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'
7187300346aeSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
71883c15da26Smrg		;;
71893c15da26Smrg	      *)
71903c15da26Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7191300346aeSmrg	        _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'
71923c15da26Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7193300346aeSmrg                  echo "-hidden">> $lib.exp~
7194300346aeSmrg                  $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~
7195300346aeSmrg                  $RM $lib.exp'
71963c15da26Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
71973c15da26Smrg		;;
71983c15da26Smrg	    esac
71993c15da26Smrg
72003c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72013c15da26Smrg
72023c15da26Smrg	    # Commands to make compiler produce verbose output that lists
72033c15da26Smrg	    # what "hidden" libraries, object files and flags are used when
72043c15da26Smrg	    # linking a shared library.
72053c15da26Smrg	    #
72063c15da26Smrg	    # There doesn't appear to be a way to prevent this compiler from
72073c15da26Smrg	    # explicitly linking system object files so we need to strip them
72083c15da26Smrg	    # from the output so that they don't get included in the library
72093c15da26Smrg	    # dependencies.
7210300346aeSmrg	    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"'
72113c15da26Smrg	    ;;
72123c15da26Smrg	  *)
7213300346aeSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7214300346aeSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
72153c15da26Smrg	      case $host in
72163c15da26Smrg	        osf3*)
7217300346aeSmrg	          _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'
72183c15da26Smrg		  ;;
72193c15da26Smrg	        *)
7220300346aeSmrg	          _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'
72213c15da26Smrg		  ;;
72223c15da26Smrg	      esac
7223126a8a12Smrg
7224300346aeSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
72253c15da26Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7226126a8a12Smrg
72273c15da26Smrg	      # Commands to make compiler produce verbose output that lists
72283c15da26Smrg	      # what "hidden" libraries, object files and flags are used when
72293c15da26Smrg	      # linking a shared library.
72303c15da26Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7231126a8a12Smrg
72323c15da26Smrg	    else
72333c15da26Smrg	      # FIXME: insert proper C++ library support
72343c15da26Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
72353c15da26Smrg	    fi
72363c15da26Smrg	    ;;
72373c15da26Smrg        esac
72383c15da26Smrg        ;;
7239126a8a12Smrg
72403c15da26Smrg      psos*)
72413c15da26Smrg        # FIXME: insert proper C++ library support
72423c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
72433c15da26Smrg        ;;
7244126a8a12Smrg
72453c15da26Smrg      sunos4*)
72463c15da26Smrg        case $cc_basename in
72473c15da26Smrg          CC*)
72483c15da26Smrg	    # Sun C++ 4.x
72493c15da26Smrg	    # FIXME: insert proper C++ library support
72503c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72513c15da26Smrg	    ;;
72523c15da26Smrg          lcc*)
72533c15da26Smrg	    # Lucid
72543c15da26Smrg	    # FIXME: insert proper C++ library support
72553c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72563c15da26Smrg	    ;;
72573c15da26Smrg          *)
72583c15da26Smrg	    # FIXME: insert proper C++ library support
72593c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
72603c15da26Smrg	    ;;
72613c15da26Smrg        esac
72623c15da26Smrg        ;;
7263126a8a12Smrg
72643c15da26Smrg      solaris*)
72653c15da26Smrg        case $cc_basename in
72663c15da26Smrg          CC* | sunCC*)
72673c15da26Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
72683c15da26Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
72693c15da26Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7270300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
72713c15da26Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7272300346aeSmrg              $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'
7273126a8a12Smrg
72743c15da26Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
72753c15da26Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
72763c15da26Smrg	    case $host_os in
72773c15da26Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
72783c15da26Smrg	      *)
72793c15da26Smrg		# The compiler driver will combine and reorder linker options,
7280300346aeSmrg		# but understands '-z linker_flag'.
72813c15da26Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
72823c15da26Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
72833c15da26Smrg	        ;;
72843c15da26Smrg	    esac
72853c15da26Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7286d656433aSmrg
72873c15da26Smrg	    output_verbose_link_cmd='func_echo_all'
7288126a8a12Smrg
72893c15da26Smrg	    # Archives containing C++ object files must be created using
72903c15da26Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
72913c15da26Smrg	    # necessary to make sure instantiated templates are included
72923c15da26Smrg	    # in the archive.
72933c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
72943c15da26Smrg	    ;;
72953c15da26Smrg          gcx*)
72963c15da26Smrg	    # Green Hills C++ Compiler
7297300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7298126a8a12Smrg
72993c15da26Smrg	    # The C++ compiler must be used to create the archive.
73003c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
73013c15da26Smrg	    ;;
73023c15da26Smrg          *)
73033c15da26Smrg	    # GNU C++ compiler with Solaris linker
7304300346aeSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7305300346aeSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
73063c15da26Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7307300346aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73083c15da26Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7309300346aeSmrg                  $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'
7310126a8a12Smrg
73113c15da26Smrg	        # Commands to make compiler produce verbose output that lists
73123c15da26Smrg	        # what "hidden" libraries, object files and flags are used when
73133c15da26Smrg	        # linking a shared library.
73143c15da26Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73153c15da26Smrg	      else
7316300346aeSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
73173c15da26Smrg	        # platform.
7318300346aeSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
73193c15da26Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7320300346aeSmrg                  $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'
7321126a8a12Smrg
73223c15da26Smrg	        # Commands to make compiler produce verbose output that lists
73233c15da26Smrg	        # what "hidden" libraries, object files and flags are used when
73243c15da26Smrg	        # linking a shared library.
73253c15da26Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
73263c15da26Smrg	      fi
73273c15da26Smrg
7328300346aeSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
73293c15da26Smrg	      case $host_os in
73303c15da26Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
73313c15da26Smrg		*)
7332300346aeSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
73333c15da26Smrg		  ;;
73343c15da26Smrg	      esac
73353c15da26Smrg	    fi
73363c15da26Smrg	    ;;
73373c15da26Smrg        esac
73383c15da26Smrg        ;;
7339126a8a12Smrg
7340555991fdSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7341300346aeSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7342555991fdSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7343555991fdSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7344555991fdSmrg      runpath_var='LD_RUN_PATH'
7345126a8a12Smrg
73463c15da26Smrg      case $cc_basename in
73473c15da26Smrg        CC*)
7348300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7349300346aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73503c15da26Smrg	  ;;
73513c15da26Smrg	*)
7352300346aeSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7353300346aeSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73543c15da26Smrg	  ;;
73553c15da26Smrg      esac
7356555991fdSmrg      ;;
7357d656433aSmrg
73583c15da26Smrg      sysv5* | sco3.2v5* | sco5v6*)
7359300346aeSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
73603c15da26Smrg	# link with -lc, and that would cause any symbols used from libc to
73613c15da26Smrg	# always be unresolved, which means just about no library would
73623c15da26Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
73633c15da26Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
73643c15da26Smrg	# as -z defs.
7365300346aeSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7366300346aeSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
73673c15da26Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
73683c15da26Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7369300346aeSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
73703c15da26Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
73713c15da26Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7372300346aeSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
73733c15da26Smrg	runpath_var='LD_RUN_PATH'
7374126a8a12Smrg
73753c15da26Smrg	case $cc_basename in
73763c15da26Smrg          CC*)
7377300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7378300346aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73793c15da26Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7380300346aeSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
73813c15da26Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7382300346aeSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
73833c15da26Smrg	    ;;
73843c15da26Smrg	  *)
7385300346aeSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7386300346aeSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
73873c15da26Smrg	    ;;
73883c15da26Smrg	esac
7389555991fdSmrg      ;;
7390d656433aSmrg
73913c15da26Smrg      tandem*)
73923c15da26Smrg        case $cc_basename in
73933c15da26Smrg          NCC*)
73943c15da26Smrg	    # NonStop-UX NCC 3.20
73953c15da26Smrg	    # FIXME: insert proper C++ library support
73963c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
73973c15da26Smrg	    ;;
73983c15da26Smrg          *)
73993c15da26Smrg	    # FIXME: insert proper C++ library support
74003c15da26Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
74013c15da26Smrg	    ;;
74023c15da26Smrg        esac
74033c15da26Smrg        ;;
7404d656433aSmrg
74053c15da26Smrg      vxworks*)
74063c15da26Smrg        # FIXME: insert proper C++ library support
74073c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
74083c15da26Smrg        ;;
74093c15da26Smrg
74103c15da26Smrg      *)
74113c15da26Smrg        # FIXME: insert proper C++ library support
74123c15da26Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
74133c15da26Smrg        ;;
7414555991fdSmrg    esac
7415d656433aSmrg
74163c15da26Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7417300346aeSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7418d656433aSmrg
7419300346aeSmrg    _LT_TAGVAR(GCC, $1)=$GXX
7420300346aeSmrg    _LT_TAGVAR(LD, $1)=$LD
7421d656433aSmrg
74223c15da26Smrg    ## CAVEAT EMPTOR:
74233c15da26Smrg    ## There is no encapsulation within the following macros, do not change
74243c15da26Smrg    ## the running order or otherwise move them around unless you know exactly
74253c15da26Smrg    ## what you are doing...
74263c15da26Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
74273c15da26Smrg    _LT_COMPILER_PIC($1)
74283c15da26Smrg    _LT_COMPILER_C_O($1)
74293c15da26Smrg    _LT_COMPILER_FILE_LOCKS($1)
74303c15da26Smrg    _LT_LINKER_SHLIBS($1)
74313c15da26Smrg    _LT_SYS_DYNAMIC_LINKER($1)
74323c15da26Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7433555991fdSmrg
74343c15da26Smrg    _LT_CONFIG($1)
74353c15da26Smrg  fi # test -n "$compiler"
74363c15da26Smrg
74373c15da26Smrg  CC=$lt_save_CC
74383c15da26Smrg  CFLAGS=$lt_save_CFLAGS
74393c15da26Smrg  LDCXX=$LD
74403c15da26Smrg  LD=$lt_save_LD
74413c15da26Smrg  GCC=$lt_save_GCC
74423c15da26Smrg  with_gnu_ld=$lt_save_with_gnu_ld
74433c15da26Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
74443c15da26Smrg  lt_cv_path_LD=$lt_save_path_LD
74453c15da26Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
74463c15da26Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7447300346aeSmrgfi # test yes != "$_lt_caught_CXX_error"
74483c15da26Smrg
74493c15da26SmrgAC_LANG_POP
74503c15da26Smrg])# _LT_LANG_CXX_CONFIG
74513c15da26Smrg
74523c15da26Smrg
74533c15da26Smrg# _LT_FUNC_STRIPNAME_CNF
74543c15da26Smrg# ----------------------
74553c15da26Smrg# func_stripname_cnf prefix suffix name
74563c15da26Smrg# strip PREFIX and SUFFIX off of NAME.
74573c15da26Smrg# PREFIX and SUFFIX must not contain globbing or regex special
74583c15da26Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
74593c15da26Smrg# dot (in which case that matches only a dot).
7460555991fdSmrg#
74613c15da26Smrg# This function is identical to the (non-XSI) version of func_stripname,
74623c15da26Smrg# except this one can be used by m4 code that may be executed by configure,
74633c15da26Smrg# rather than the libtool script.
74643c15da26Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
74653c15da26SmrgAC_REQUIRE([_LT_DECL_SED])
74663c15da26SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
74673c15da26Smrgfunc_stripname_cnf ()
74683c15da26Smrg{
7469300346aeSmrg  case @S|@2 in
7470300346aeSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7471300346aeSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
74723c15da26Smrg  esac
74733c15da26Smrg} # func_stripname_cnf
74743c15da26Smrg])# _LT_FUNC_STRIPNAME_CNF
7475555991fdSmrg
7476300346aeSmrg
74773c15da26Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
74783c15da26Smrg# ---------------------------------
74793c15da26Smrg# Figure out "hidden" library dependencies from verbose
74803c15da26Smrg# compiler output when linking a shared library.
74813c15da26Smrg# Parse the compiler output and extract the necessary
74823c15da26Smrg# objects, libraries and library flags.
74833c15da26Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
74843c15da26Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
74853c15da26SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
74863c15da26Smrg# Dependencies to place before and after the object being linked:
74873c15da26Smrg_LT_TAGVAR(predep_objects, $1)=
74883c15da26Smrg_LT_TAGVAR(postdep_objects, $1)=
74893c15da26Smrg_LT_TAGVAR(predeps, $1)=
74903c15da26Smrg_LT_TAGVAR(postdeps, $1)=
74913c15da26Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7492555991fdSmrg
74933c15da26Smrgdnl we can't use the lt_simple_compile_test_code here,
74943c15da26Smrgdnl because it contains code intended for an executable,
74953c15da26Smrgdnl not a library.  It's possible we should let each
74963c15da26Smrgdnl tag define a new lt_????_link_test_code variable,
74973c15da26Smrgdnl but it's only used here...
74983c15da26Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
74993c15da26Smrgint a;
75003c15da26Smrgvoid foo (void) { a = 0; }
75013c15da26Smrg_LT_EOF
75023c15da26Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
75033c15da26Smrgclass Foo
75043c15da26Smrg{
75053c15da26Smrgpublic:
75063c15da26Smrg  Foo (void) { a = 0; }
75073c15da26Smrgprivate:
75083c15da26Smrg  int a;
75093c15da26Smrg};
75103c15da26Smrg_LT_EOF
75113c15da26Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
75123c15da26Smrg      subroutine foo
75133c15da26Smrg      implicit none
75143c15da26Smrg      integer*4 a
75153c15da26Smrg      a=0
75163c15da26Smrg      return
75173c15da26Smrg      end
75183c15da26Smrg_LT_EOF
75193c15da26Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
75203c15da26Smrg      subroutine foo
75213c15da26Smrg      implicit none
75223c15da26Smrg      integer a
75233c15da26Smrg      a=0
75243c15da26Smrg      return
75253c15da26Smrg      end
75263c15da26Smrg_LT_EOF
75273c15da26Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
75283c15da26Smrgpublic class foo {
75293c15da26Smrg  private int a;
75303c15da26Smrg  public void bar (void) {
75313c15da26Smrg    a = 0;
75323c15da26Smrg  }
75333c15da26Smrg};
75343c15da26Smrg_LT_EOF
75350a6b08f8Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
75360a6b08f8Smrgpackage foo
75370a6b08f8Smrgfunc foo() {
75380a6b08f8Smrg}
75390a6b08f8Smrg_LT_EOF
75403c15da26Smrg])
75413c15da26Smrg
75423c15da26Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
75433c15da26Smrgcase "$CC $CFLAGS " in #(
75443c15da26Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
75453c15da26Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
75460a6b08f8Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7547d656433aSmrgesac
7548555991fdSmrg
75493c15da26Smrgdnl Parse the compiler output and extract the necessary
75503c15da26Smrgdnl objects, libraries and library flags.
75513c15da26Smrgif AC_TRY_EVAL(ac_compile); then
75523c15da26Smrg  # Parse the compiler output and extract the necessary
75533c15da26Smrg  # objects, libraries and library flags.
7554d656433aSmrg
75553c15da26Smrg  # Sentinel used to keep track of whether or not we are before
75563c15da26Smrg  # the conftest object file.
75573c15da26Smrg  pre_test_object_deps_done=no
7558d656433aSmrg
75593c15da26Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7560300346aeSmrg    case $prev$p in
7561d656433aSmrg
75623c15da26Smrg    -L* | -R* | -l*)
75633c15da26Smrg       # Some compilers place space between "-{L,R}" and the path.
75643c15da26Smrg       # Remove the space.
7565300346aeSmrg       if test x-L = "$p" ||
7566300346aeSmrg          test x-R = "$p"; then
75673c15da26Smrg	 prev=$p
75683c15da26Smrg	 continue
75693c15da26Smrg       fi
7570d656433aSmrg
75713c15da26Smrg       # Expand the sysroot to ease extracting the directories later.
75723c15da26Smrg       if test -z "$prev"; then
75733c15da26Smrg         case $p in
75743c15da26Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
75753c15da26Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
75763c15da26Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
75773c15da26Smrg         esac
75783c15da26Smrg       fi
75793c15da26Smrg       case $p in
75803c15da26Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
75813c15da26Smrg       esac
7582300346aeSmrg       if test no = "$pre_test_object_deps_done"; then
7583300346aeSmrg	 case $prev in
75843c15da26Smrg	 -L | -R)
75853c15da26Smrg	   # Internal compiler library paths should come after those
75863c15da26Smrg	   # provided the user.  The postdeps already come after the
75873c15da26Smrg	   # user supplied libs so there is no need to process them.
75883c15da26Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7589300346aeSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
75903c15da26Smrg	   else
7591300346aeSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
75923c15da26Smrg	   fi
75933c15da26Smrg	   ;;
75943c15da26Smrg	 # The "-l" case would never come before the object being
75953c15da26Smrg	 # linked, so don't bother handling this case.
75963c15da26Smrg	 esac
75973c15da26Smrg       else
75983c15da26Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7599300346aeSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
76003c15da26Smrg	 else
7601300346aeSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
76023c15da26Smrg	 fi
76033c15da26Smrg       fi
76043c15da26Smrg       prev=
76053c15da26Smrg       ;;
7606d656433aSmrg
76073c15da26Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
76083c15da26Smrg    *.$objext)
76093c15da26Smrg       # This assumes that the test object file only shows up
76103c15da26Smrg       # once in the compiler output.
76113c15da26Smrg       if test "$p" = "conftest.$objext"; then
76123c15da26Smrg	 pre_test_object_deps_done=yes
76133c15da26Smrg	 continue
76143c15da26Smrg       fi
7615d656433aSmrg
7616300346aeSmrg       if test no = "$pre_test_object_deps_done"; then
76173c15da26Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7618300346aeSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
76193c15da26Smrg	 else
76203c15da26Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
76213c15da26Smrg	 fi
76223c15da26Smrg       else
76233c15da26Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7624300346aeSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
76253c15da26Smrg	 else
76263c15da26Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
76273c15da26Smrg	 fi
76283c15da26Smrg       fi
76293c15da26Smrg       ;;
7630d656433aSmrg
76313c15da26Smrg    *) ;; # Ignore the rest.
7632d656433aSmrg
76333c15da26Smrg    esac
76343c15da26Smrg  done
7635d656433aSmrg
76363c15da26Smrg  # Clean up.
76373c15da26Smrg  rm -f a.out a.exe
76383c15da26Smrgelse
76393c15da26Smrg  echo "libtool.m4: error: problem compiling $1 test program"
76403c15da26Smrgfi
7641d656433aSmrg
76423c15da26Smrg$RM -f confest.$objext
76433c15da26SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7644d656433aSmrg
76453c15da26Smrg# PORTME: override above test on systems where it is broken
76463c15da26Smrgm4_if([$1], [CXX],
76473c15da26Smrg[case $host_os in
76483c15da26Smrginterix[[3-9]]*)
76493c15da26Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
76503c15da26Smrg  # hack all around it, let's just trust "g++" to DTRT.
76513c15da26Smrg  _LT_TAGVAR(predep_objects,$1)=
76523c15da26Smrg  _LT_TAGVAR(postdep_objects,$1)=
76533c15da26Smrg  _LT_TAGVAR(postdeps,$1)=
76543c15da26Smrg  ;;
7655300346aeSmrgesac
7656300346aeSmrg])
7657d656433aSmrg
76583c15da26Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
76593c15da26Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
76603c15da26Smrgesac
76613c15da26Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
76623c15da26Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7663300346aeSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7664555991fdSmrgfi
76653c15da26Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
76663c15da26Smrg    [The directories searched by this compiler when creating a shared library])
76673c15da26Smrg_LT_TAGDECL([], [predep_objects], [1],
76683c15da26Smrg    [Dependencies to place before and after the objects being linked to
76693c15da26Smrg    create a shared library])
76703c15da26Smrg_LT_TAGDECL([], [postdep_objects], [1])
76713c15da26Smrg_LT_TAGDECL([], [predeps], [1])
76723c15da26Smrg_LT_TAGDECL([], [postdeps], [1])
76733c15da26Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
76743c15da26Smrg    [The library search path used internally by the compiler when linking
76753c15da26Smrg    a shared library])
76763c15da26Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7677d656433aSmrg
7678d656433aSmrg
76793c15da26Smrg# _LT_LANG_F77_CONFIG([TAG])
7680555991fdSmrg# --------------------------
76813c15da26Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
76823c15da26Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7683300346aeSmrg# to write the compiler configuration to 'libtool'.
76843c15da26Smrgm4_defun([_LT_LANG_F77_CONFIG],
76853c15da26Smrg[AC_LANG_PUSH(Fortran 77)
7686300346aeSmrgif test -z "$F77" || test no = "$F77"; then
76873c15da26Smrg  _lt_disable_F77=yes
7688555991fdSmrgfi
7689d656433aSmrg
7690555991fdSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7691555991fdSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7692555991fdSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7693555991fdSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7694555991fdSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7695555991fdSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7696555991fdSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7697555991fdSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7698555991fdSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7699555991fdSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7700555991fdSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7701555991fdSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7702555991fdSmrg_LT_TAGVAR(module_cmds, $1)=
7703555991fdSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7704555991fdSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7705555991fdSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7706555991fdSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7707555991fdSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7708555991fdSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7709555991fdSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7710555991fdSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7711d656433aSmrg
77123c15da26Smrg# Source file extension for f77 test sources.
77133c15da26Smrgac_ext=f
7714d656433aSmrg
77153c15da26Smrg# Object file extension for compiled f77 test sources.
7716555991fdSmrgobjext=o
7717555991fdSmrg_LT_TAGVAR(objext, $1)=$objext
7718d656433aSmrg
7719555991fdSmrg# No sense in running all these tests if we already determined that
77203c15da26Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7721555991fdSmrg# are currently assumed to apply to all compilers on this platform,
7722555991fdSmrg# and will be corrupted by setting them based on a non-working compiler.
7723300346aeSmrgif test yes != "$_lt_disable_F77"; then
7724555991fdSmrg  # Code to be used in simple compile tests
77253c15da26Smrg  lt_simple_compile_test_code="\
77263c15da26Smrg      subroutine t
77273c15da26Smrg      return
77283c15da26Smrg      end
77293c15da26Smrg"
7730d656433aSmrg
7731555991fdSmrg  # Code to be used in simple link tests
77323c15da26Smrg  lt_simple_link_test_code="\
77333c15da26Smrg      program t
77343c15da26Smrg      end
77353c15da26Smrg"
7736d656433aSmrg
7737555991fdSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7738555991fdSmrg  _LT_TAG_COMPILER
7739d656433aSmrg
7740555991fdSmrg  # save warnings/boilerplate of simple test code
7741555991fdSmrg  _LT_COMPILER_BOILERPLATE
7742555991fdSmrg  _LT_LINKER_BOILERPLATE
7743d656433aSmrg
7744555991fdSmrg  # Allow CC to be a program name with arguments.
7745300346aeSmrg  lt_save_CC=$CC
7746555991fdSmrg  lt_save_GCC=$GCC
77473c15da26Smrg  lt_save_CFLAGS=$CFLAGS
77483c15da26Smrg  CC=${F77-"f77"}
77493c15da26Smrg  CFLAGS=$FFLAGS
77503c15da26Smrg  compiler=$CC
77513c15da26Smrg  _LT_TAGVAR(compiler, $1)=$CC
77523c15da26Smrg  _LT_CC_BASENAME([$compiler])
77533c15da26Smrg  GCC=$G77
77543c15da26Smrg  if test -n "$compiler"; then
77553c15da26Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
77563c15da26Smrg    AC_MSG_RESULT([$can_build_shared])
7757d656433aSmrg
77583c15da26Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7759300346aeSmrg    test no = "$can_build_shared" && enable_shared=no
77603c15da26Smrg
77613c15da26Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
77623c15da26Smrg    # are all built from PIC.
77633c15da26Smrg    case $host_os in
77643c15da26Smrg      aix3*)
7765300346aeSmrg        test yes = "$enable_shared" && enable_static=no
77663c15da26Smrg        if test -n "$RANLIB"; then
77673c15da26Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
77683c15da26Smrg          postinstall_cmds='$RANLIB $lib'
7769555991fdSmrg        fi
7770555991fdSmrg        ;;
77713c15da26Smrg      aix[[4-9]]*)
7772300346aeSmrg	if test ia64 != "$host_cpu"; then
7773300346aeSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7774300346aeSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7775300346aeSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7776300346aeSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7777300346aeSmrg	  esac
7778555991fdSmrg	fi
7779555991fdSmrg        ;;
77803c15da26Smrg    esac
77813c15da26Smrg    AC_MSG_RESULT([$enable_shared])
7782d656433aSmrg
77833c15da26Smrg    AC_MSG_CHECKING([whether to build static libraries])
77843c15da26Smrg    # Make sure either enable_shared or enable_static is yes.
7785300346aeSmrg    test yes = "$enable_shared" || enable_static=yes
77863c15da26Smrg    AC_MSG_RESULT([$enable_static])
7787d656433aSmrg
7788300346aeSmrg    _LT_TAGVAR(GCC, $1)=$G77
7789300346aeSmrg    _LT_TAGVAR(LD, $1)=$LD
7790d656433aSmrg
77913c15da26Smrg    ## CAVEAT EMPTOR:
77923c15da26Smrg    ## There is no encapsulation within the following macros, do not change
77933c15da26Smrg    ## the running order or otherwise move them around unless you know exactly
77943c15da26Smrg    ## what you are doing...
77953c15da26Smrg    _LT_COMPILER_PIC($1)
77963c15da26Smrg    _LT_COMPILER_C_O($1)
77973c15da26Smrg    _LT_COMPILER_FILE_LOCKS($1)
77983c15da26Smrg    _LT_LINKER_SHLIBS($1)
77993c15da26Smrg    _LT_SYS_DYNAMIC_LINKER($1)
78003c15da26Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7801d656433aSmrg
78023c15da26Smrg    _LT_CONFIG($1)
78033c15da26Smrg  fi # test -n "$compiler"
7804d656433aSmrg
78053c15da26Smrg  GCC=$lt_save_GCC
7806300346aeSmrg  CC=$lt_save_CC
7807300346aeSmrg  CFLAGS=$lt_save_CFLAGS
7808300346aeSmrgfi # test yes != "$_lt_disable_F77"
7809d656433aSmrg
78103c15da26SmrgAC_LANG_POP
78113c15da26Smrg])# _LT_LANG_F77_CONFIG
7812d656433aSmrg
7813d656433aSmrg
78143c15da26Smrg# _LT_LANG_FC_CONFIG([TAG])
78153c15da26Smrg# -------------------------
78163c15da26Smrg# Ensure that the configuration variables for a Fortran compiler are
78173c15da26Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7818300346aeSmrg# to write the compiler configuration to 'libtool'.
78193c15da26Smrgm4_defun([_LT_LANG_FC_CONFIG],
78203c15da26Smrg[AC_LANG_PUSH(Fortran)
7821d656433aSmrg
7822300346aeSmrgif test -z "$FC" || test no = "$FC"; then
78233c15da26Smrg  _lt_disable_FC=yes
78243c15da26Smrgfi
7825d656433aSmrg
78263c15da26Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
78273c15da26Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
78283c15da26Smrg_LT_TAGVAR(always_export_symbols, $1)=no
78293c15da26Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
78303c15da26Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
78313c15da26Smrg_LT_TAGVAR(hardcode_direct, $1)=no
78323c15da26Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
78333c15da26Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
78343c15da26Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
78353c15da26Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
78363c15da26Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
78373c15da26Smrg_LT_TAGVAR(inherit_rpath, $1)=no
78383c15da26Smrg_LT_TAGVAR(module_cmds, $1)=
78393c15da26Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
78403c15da26Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
78413c15da26Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
78423c15da26Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
78433c15da26Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
78443c15da26Smrg_LT_TAGVAR(no_undefined_flag, $1)=
78453c15da26Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
78463c15da26Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7847d656433aSmrg
78483c15da26Smrg# Source file extension for fc test sources.
78493c15da26Smrgac_ext=${ac_fc_srcext-f}
78503c15da26Smrg
78513c15da26Smrg# Object file extension for compiled fc test sources.
78523c15da26Smrgobjext=o
78533c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
78543c15da26Smrg
78553c15da26Smrg# No sense in running all these tests if we already determined that
78563c15da26Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
78573c15da26Smrg# are currently assumed to apply to all compilers on this platform,
78583c15da26Smrg# and will be corrupted by setting them based on a non-working compiler.
7859300346aeSmrgif test yes != "$_lt_disable_FC"; then
78603c15da26Smrg  # Code to be used in simple compile tests
78613c15da26Smrg  lt_simple_compile_test_code="\
78623c15da26Smrg      subroutine t
78633c15da26Smrg      return
78643c15da26Smrg      end
78653c15da26Smrg"
78663c15da26Smrg
78673c15da26Smrg  # Code to be used in simple link tests
78683c15da26Smrg  lt_simple_link_test_code="\
78693c15da26Smrg      program t
78703c15da26Smrg      end
78713c15da26Smrg"
78723c15da26Smrg
78733c15da26Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
78743c15da26Smrg  _LT_TAG_COMPILER
78753c15da26Smrg
78763c15da26Smrg  # save warnings/boilerplate of simple test code
78773c15da26Smrg  _LT_COMPILER_BOILERPLATE
78783c15da26Smrg  _LT_LINKER_BOILERPLATE
7879d656433aSmrg
78803c15da26Smrg  # Allow CC to be a program name with arguments.
7881300346aeSmrg  lt_save_CC=$CC
78823c15da26Smrg  lt_save_GCC=$GCC
78833c15da26Smrg  lt_save_CFLAGS=$CFLAGS
78843c15da26Smrg  CC=${FC-"f95"}
78853c15da26Smrg  CFLAGS=$FCFLAGS
78863c15da26Smrg  compiler=$CC
78873c15da26Smrg  GCC=$ac_cv_fc_compiler_gnu
7888d656433aSmrg
78893c15da26Smrg  _LT_TAGVAR(compiler, $1)=$CC
78903c15da26Smrg  _LT_CC_BASENAME([$compiler])
7891d656433aSmrg
78923c15da26Smrg  if test -n "$compiler"; then
78933c15da26Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
78943c15da26Smrg    AC_MSG_RESULT([$can_build_shared])
7895d656433aSmrg
78963c15da26Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7897300346aeSmrg    test no = "$can_build_shared" && enable_shared=no
7898555991fdSmrg
78993c15da26Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
79003c15da26Smrg    # are all built from PIC.
79013c15da26Smrg    case $host_os in
79023c15da26Smrg      aix3*)
7903300346aeSmrg        test yes = "$enable_shared" && enable_static=no
79043c15da26Smrg        if test -n "$RANLIB"; then
79053c15da26Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
79063c15da26Smrg          postinstall_cmds='$RANLIB $lib'
79073c15da26Smrg        fi
79083c15da26Smrg        ;;
79093c15da26Smrg      aix[[4-9]]*)
7910300346aeSmrg	if test ia64 != "$host_cpu"; then
7911300346aeSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7912300346aeSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7913300346aeSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7914300346aeSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7915300346aeSmrg	  esac
79163c15da26Smrg	fi
79173c15da26Smrg        ;;
79183c15da26Smrg    esac
79193c15da26Smrg    AC_MSG_RESULT([$enable_shared])
7920d656433aSmrg
79213c15da26Smrg    AC_MSG_CHECKING([whether to build static libraries])
79223c15da26Smrg    # Make sure either enable_shared or enable_static is yes.
7923300346aeSmrg    test yes = "$enable_shared" || enable_static=yes
79243c15da26Smrg    AC_MSG_RESULT([$enable_static])
7925d656433aSmrg
7926300346aeSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7927300346aeSmrg    _LT_TAGVAR(LD, $1)=$LD
7928d656433aSmrg
79293c15da26Smrg    ## CAVEAT EMPTOR:
79303c15da26Smrg    ## There is no encapsulation within the following macros, do not change
79313c15da26Smrg    ## the running order or otherwise move them around unless you know exactly
79323c15da26Smrg    ## what you are doing...
79333c15da26Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
79343c15da26Smrg    _LT_COMPILER_PIC($1)
79353c15da26Smrg    _LT_COMPILER_C_O($1)
79363c15da26Smrg    _LT_COMPILER_FILE_LOCKS($1)
79373c15da26Smrg    _LT_LINKER_SHLIBS($1)
79383c15da26Smrg    _LT_SYS_DYNAMIC_LINKER($1)
79393c15da26Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7940d656433aSmrg
79413c15da26Smrg    _LT_CONFIG($1)
79423c15da26Smrg  fi # test -n "$compiler"
7943d656433aSmrg
79443c15da26Smrg  GCC=$lt_save_GCC
79453c15da26Smrg  CC=$lt_save_CC
79463c15da26Smrg  CFLAGS=$lt_save_CFLAGS
7947300346aeSmrgfi # test yes != "$_lt_disable_FC"
7948d656433aSmrg
79493c15da26SmrgAC_LANG_POP
79503c15da26Smrg])# _LT_LANG_FC_CONFIG
7951d656433aSmrg
7952d656433aSmrg
79533c15da26Smrg# _LT_LANG_GCJ_CONFIG([TAG])
79543c15da26Smrg# --------------------------
79553c15da26Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
79563c15da26Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7957300346aeSmrg# to write the compiler configuration to 'libtool'.
79583c15da26Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
79593c15da26Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
79603c15da26SmrgAC_LANG_SAVE
7961d656433aSmrg
79623c15da26Smrg# Source file extension for Java test sources.
79633c15da26Smrgac_ext=java
7964d656433aSmrg
79653c15da26Smrg# Object file extension for compiled Java test sources.
79663c15da26Smrgobjext=o
79673c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
7968d656433aSmrg
79693c15da26Smrg# Code to be used in simple compile tests
79703c15da26Smrglt_simple_compile_test_code="class foo {}"
7971d656433aSmrg
79723c15da26Smrg# Code to be used in simple link tests
79733c15da26Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7974d656433aSmrg
79753c15da26Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
79763c15da26Smrg_LT_TAG_COMPILER
7977d656433aSmrg
79783c15da26Smrg# save warnings/boilerplate of simple test code
79793c15da26Smrg_LT_COMPILER_BOILERPLATE
79803c15da26Smrg_LT_LINKER_BOILERPLATE
7981d656433aSmrg
79823c15da26Smrg# Allow CC to be a program name with arguments.
79833c15da26Smrglt_save_CC=$CC
79843c15da26Smrglt_save_CFLAGS=$CFLAGS
79853c15da26Smrglt_save_GCC=$GCC
79863c15da26SmrgGCC=yes
79873c15da26SmrgCC=${GCJ-"gcj"}
79883c15da26SmrgCFLAGS=$GCJFLAGS
79893c15da26Smrgcompiler=$CC
79903c15da26Smrg_LT_TAGVAR(compiler, $1)=$CC
7991300346aeSmrg_LT_TAGVAR(LD, $1)=$LD
79923c15da26Smrg_LT_CC_BASENAME([$compiler])
7993d656433aSmrg
79943c15da26Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
79953c15da26Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7996d656433aSmrg
79973c15da26Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
79983c15da26Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
79993c15da26Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8000d656433aSmrg
80013c15da26Smrgif test -n "$compiler"; then
80023c15da26Smrg  _LT_COMPILER_NO_RTTI($1)
80033c15da26Smrg  _LT_COMPILER_PIC($1)
80043c15da26Smrg  _LT_COMPILER_C_O($1)
80053c15da26Smrg  _LT_COMPILER_FILE_LOCKS($1)
80063c15da26Smrg  _LT_LINKER_SHLIBS($1)
80073c15da26Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8008d656433aSmrg
80093c15da26Smrg  _LT_CONFIG($1)
80103c15da26Smrgfi
8011d656433aSmrg
80123c15da26SmrgAC_LANG_RESTORE
8013d656433aSmrg
80143c15da26SmrgGCC=$lt_save_GCC
80153c15da26SmrgCC=$lt_save_CC
80163c15da26SmrgCFLAGS=$lt_save_CFLAGS
80173c15da26Smrg])# _LT_LANG_GCJ_CONFIG
8018d656433aSmrg
8019d656433aSmrg
80200a6b08f8Smrg# _LT_LANG_GO_CONFIG([TAG])
80210a6b08f8Smrg# --------------------------
80220a6b08f8Smrg# Ensure that the configuration variables for the GNU Go compiler
80230a6b08f8Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8024300346aeSmrg# to write the compiler configuration to 'libtool'.
80250a6b08f8Smrgm4_defun([_LT_LANG_GO_CONFIG],
80260a6b08f8Smrg[AC_REQUIRE([LT_PROG_GO])dnl
80270a6b08f8SmrgAC_LANG_SAVE
80280a6b08f8Smrg
80290a6b08f8Smrg# Source file extension for Go test sources.
80300a6b08f8Smrgac_ext=go
80310a6b08f8Smrg
80320a6b08f8Smrg# Object file extension for compiled Go test sources.
80330a6b08f8Smrgobjext=o
80340a6b08f8Smrg_LT_TAGVAR(objext, $1)=$objext
80350a6b08f8Smrg
80360a6b08f8Smrg# Code to be used in simple compile tests
80370a6b08f8Smrglt_simple_compile_test_code="package main; func main() { }"
80380a6b08f8Smrg
80390a6b08f8Smrg# Code to be used in simple link tests
80400a6b08f8Smrglt_simple_link_test_code='package main; func main() { }'
80410a6b08f8Smrg
80420a6b08f8Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
80430a6b08f8Smrg_LT_TAG_COMPILER
80440a6b08f8Smrg
80450a6b08f8Smrg# save warnings/boilerplate of simple test code
80460a6b08f8Smrg_LT_COMPILER_BOILERPLATE
80470a6b08f8Smrg_LT_LINKER_BOILERPLATE
80480a6b08f8Smrg
80490a6b08f8Smrg# Allow CC to be a program name with arguments.
80500a6b08f8Smrglt_save_CC=$CC
80510a6b08f8Smrglt_save_CFLAGS=$CFLAGS
80520a6b08f8Smrglt_save_GCC=$GCC
80530a6b08f8SmrgGCC=yes
80540a6b08f8SmrgCC=${GOC-"gccgo"}
80550a6b08f8SmrgCFLAGS=$GOFLAGS
80560a6b08f8Smrgcompiler=$CC
80570a6b08f8Smrg_LT_TAGVAR(compiler, $1)=$CC
8058300346aeSmrg_LT_TAGVAR(LD, $1)=$LD
80590a6b08f8Smrg_LT_CC_BASENAME([$compiler])
80600a6b08f8Smrg
80610a6b08f8Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
80620a6b08f8Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
80630a6b08f8Smrg
80640a6b08f8Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
80650a6b08f8Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
80660a6b08f8Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
80670a6b08f8Smrg
80680a6b08f8Smrgif test -n "$compiler"; then
80690a6b08f8Smrg  _LT_COMPILER_NO_RTTI($1)
80700a6b08f8Smrg  _LT_COMPILER_PIC($1)
80710a6b08f8Smrg  _LT_COMPILER_C_O($1)
80720a6b08f8Smrg  _LT_COMPILER_FILE_LOCKS($1)
80730a6b08f8Smrg  _LT_LINKER_SHLIBS($1)
80740a6b08f8Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
80750a6b08f8Smrg
80760a6b08f8Smrg  _LT_CONFIG($1)
80770a6b08f8Smrgfi
80780a6b08f8Smrg
80790a6b08f8SmrgAC_LANG_RESTORE
80800a6b08f8Smrg
80810a6b08f8SmrgGCC=$lt_save_GCC
80820a6b08f8SmrgCC=$lt_save_CC
80830a6b08f8SmrgCFLAGS=$lt_save_CFLAGS
80840a6b08f8Smrg])# _LT_LANG_GO_CONFIG
80850a6b08f8Smrg
80860a6b08f8Smrg
80873c15da26Smrg# _LT_LANG_RC_CONFIG([TAG])
80883c15da26Smrg# -------------------------
80893c15da26Smrg# Ensure that the configuration variables for the Windows resource compiler
80903c15da26Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8091300346aeSmrg# to write the compiler configuration to 'libtool'.
80923c15da26Smrgm4_defun([_LT_LANG_RC_CONFIG],
80933c15da26Smrg[AC_REQUIRE([LT_PROG_RC])dnl
80943c15da26SmrgAC_LANG_SAVE
8095d656433aSmrg
80963c15da26Smrg# Source file extension for RC test sources.
80973c15da26Smrgac_ext=rc
8098d656433aSmrg
80993c15da26Smrg# Object file extension for compiled RC test sources.
81003c15da26Smrgobjext=o
81013c15da26Smrg_LT_TAGVAR(objext, $1)=$objext
8102d656433aSmrg
81033c15da26Smrg# Code to be used in simple compile tests
81043c15da26Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
81053c15da26Smrg
81063c15da26Smrg# Code to be used in simple link tests
8107300346aeSmrglt_simple_link_test_code=$lt_simple_compile_test_code
81083c15da26Smrg
81093c15da26Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
81103c15da26Smrg_LT_TAG_COMPILER
81113c15da26Smrg
81123c15da26Smrg# save warnings/boilerplate of simple test code
81133c15da26Smrg_LT_COMPILER_BOILERPLATE
81143c15da26Smrg_LT_LINKER_BOILERPLATE
81153c15da26Smrg
81163c15da26Smrg# Allow CC to be a program name with arguments.
8117300346aeSmrglt_save_CC=$CC
81183c15da26Smrglt_save_CFLAGS=$CFLAGS
81193c15da26Smrglt_save_GCC=$GCC
81203c15da26SmrgGCC=
81213c15da26SmrgCC=${RC-"windres"}
81223c15da26SmrgCFLAGS=
81233c15da26Smrgcompiler=$CC
81243c15da26Smrg_LT_TAGVAR(compiler, $1)=$CC
81253c15da26Smrg_LT_CC_BASENAME([$compiler])
81263c15da26Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8127d656433aSmrg
81283c15da26Smrgif test -n "$compiler"; then
81293c15da26Smrg  :
81303c15da26Smrg  _LT_CONFIG($1)
81313c15da26Smrgfi
8132d656433aSmrg
81333c15da26SmrgGCC=$lt_save_GCC
81343c15da26SmrgAC_LANG_RESTORE
81353c15da26SmrgCC=$lt_save_CC
81363c15da26SmrgCFLAGS=$lt_save_CFLAGS
81373c15da26Smrg])# _LT_LANG_RC_CONFIG
8138d656433aSmrg
8139d656433aSmrg
81403c15da26Smrg# LT_PROG_GCJ
81413c15da26Smrg# -----------
81423c15da26SmrgAC_DEFUN([LT_PROG_GCJ],
81433c15da26Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
81443c15da26Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
81453c15da26Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
8146300346aeSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
81473c15da26Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
81483c15da26Smrg])
8149d656433aSmrg
81503c15da26Smrg# Old name:
81513c15da26SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
81523c15da26Smrgdnl aclocal-1.4 backwards compatibility:
81533c15da26Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8154d656433aSmrg
8155d656433aSmrg
81560a6b08f8Smrg# LT_PROG_GO
81570a6b08f8Smrg# ----------
81580a6b08f8SmrgAC_DEFUN([LT_PROG_GO],
81590a6b08f8Smrg[AC_CHECK_TOOL(GOC, gccgo,)
81600a6b08f8Smrg])
81610a6b08f8Smrg
81620a6b08f8Smrg
81633c15da26Smrg# LT_PROG_RC
81643c15da26Smrg# ----------
81653c15da26SmrgAC_DEFUN([LT_PROG_RC],
81663c15da26Smrg[AC_CHECK_TOOL(RC, windres,)
81673c15da26Smrg])
8168d656433aSmrg
81693c15da26Smrg# Old name:
81703c15da26SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
81713c15da26Smrgdnl aclocal-1.4 backwards compatibility:
81723c15da26Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8173d656433aSmrg
8174d656433aSmrg
81753c15da26Smrg# _LT_DECL_EGREP
81763c15da26Smrg# --------------
81773c15da26Smrg# If we don't have a new enough Autoconf to choose the best grep
81783c15da26Smrg# available, choose the one first in the user's PATH.
81793c15da26Smrgm4_defun([_LT_DECL_EGREP],
81803c15da26Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
81813c15da26SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
81823c15da26Smrgtest -z "$GREP" && GREP=grep
81833c15da26Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
81843c15da26Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
81853c15da26Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
81863c15da26Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
81873c15da26SmrgAC_SUBST([GREP])
81883c15da26Smrg])
8189d656433aSmrg
8190d656433aSmrg
81913c15da26Smrg# _LT_DECL_OBJDUMP
81923c15da26Smrg# --------------
81933c15da26Smrg# If we don't have a new enough Autoconf to choose the best objdump
81943c15da26Smrg# available, choose the one first in the user's PATH.
81953c15da26Smrgm4_defun([_LT_DECL_OBJDUMP],
81963c15da26Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
81973c15da26Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
81983c15da26Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
81993c15da26SmrgAC_SUBST([OBJDUMP])
82003c15da26Smrg])
8201d656433aSmrg
82023c15da26Smrg# _LT_DECL_DLLTOOL
82033c15da26Smrg# ----------------
82043c15da26Smrg# Ensure DLLTOOL variable is set.
82053c15da26Smrgm4_defun([_LT_DECL_DLLTOOL],
82063c15da26Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
82073c15da26Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
82083c15da26Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
82093c15da26SmrgAC_SUBST([DLLTOOL])
82103c15da26Smrg])
8211d656433aSmrg
82123c15da26Smrg# _LT_DECL_SED
82133c15da26Smrg# ------------
82143c15da26Smrg# Check for a fully-functional sed program, that truncates
82153c15da26Smrg# as few characters as possible.  Prefer GNU sed if found.
82163c15da26Smrgm4_defun([_LT_DECL_SED],
82173c15da26Smrg[AC_PROG_SED
82183c15da26Smrgtest -z "$SED" && SED=sed
82193c15da26SmrgXsed="$SED -e 1s/^X//"
82203c15da26Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
82213c15da26Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
82223c15da26Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
82233c15da26Smrg])# _LT_DECL_SED
8224d656433aSmrg
82253c15da26Smrgm4_ifndef([AC_PROG_SED], [
82263c15da26Smrg# NOTE: This macro has been submitted for inclusion into   #
82273c15da26Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
82283c15da26Smrg#  a released version of Autoconf we should remove this    #
82293c15da26Smrg#  macro and use it instead.                               #
82303c15da26Smrg
82313c15da26Smrgm4_defun([AC_PROG_SED],
82323c15da26Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
82333c15da26SmrgAC_CACHE_VAL(lt_cv_path_SED,
82343c15da26Smrg[# Loop through the user's path and test for sed and gsed.
82353c15da26Smrg# Then use that list of sed's as ones to test for truncation.
82363c15da26Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
82373c15da26Smrgfor as_dir in $PATH
82383c15da26Smrgdo
82393c15da26Smrg  IFS=$as_save_IFS
82403c15da26Smrg  test -z "$as_dir" && as_dir=.
82413c15da26Smrg  for lt_ac_prog in sed gsed; do
82423c15da26Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
82433c15da26Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
82443c15da26Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
82453c15da26Smrg      fi
82463c15da26Smrg    done
82473c15da26Smrg  done
82483c15da26Smrgdone
82493c15da26SmrgIFS=$as_save_IFS
82503c15da26Smrglt_ac_max=0
82513c15da26Smrglt_ac_count=0
82523c15da26Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
82533c15da26Smrg# along with /bin/sed that truncates output.
82543c15da26Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8255300346aeSmrg  test ! -f "$lt_ac_sed" && continue
82563c15da26Smrg  cat /dev/null > conftest.in
82573c15da26Smrg  lt_ac_count=0
82583c15da26Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
82593c15da26Smrg  # Check for GNU sed and select it if it is found.
82603c15da26Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
82613c15da26Smrg    lt_cv_path_SED=$lt_ac_sed
82623c15da26Smrg    break
82633c15da26Smrg  fi
82643c15da26Smrg  while true; do
82653c15da26Smrg    cat conftest.in conftest.in >conftest.tmp
82663c15da26Smrg    mv conftest.tmp conftest.in
82673c15da26Smrg    cp conftest.in conftest.nl
82683c15da26Smrg    echo >>conftest.nl
82693c15da26Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
82703c15da26Smrg    cmp -s conftest.out conftest.nl || break
82713c15da26Smrg    # 10000 chars as input seems more than enough
8272300346aeSmrg    test 10 -lt "$lt_ac_count" && break
82733c15da26Smrg    lt_ac_count=`expr $lt_ac_count + 1`
8274300346aeSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
82753c15da26Smrg      lt_ac_max=$lt_ac_count
82763c15da26Smrg      lt_cv_path_SED=$lt_ac_sed
82773c15da26Smrg    fi
82783c15da26Smrg  done
82793c15da26Smrgdone
82803c15da26Smrg])
82813c15da26SmrgSED=$lt_cv_path_SED
82823c15da26SmrgAC_SUBST([SED])
82833c15da26SmrgAC_MSG_RESULT([$SED])
82843c15da26Smrg])#AC_PROG_SED
82853c15da26Smrg])#m4_ifndef
8286d656433aSmrg
82873c15da26Smrg# Old name:
82883c15da26SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
82893c15da26Smrgdnl aclocal-1.4 backwards compatibility:
82903c15da26Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8291d656433aSmrg
8292d656433aSmrg
82933c15da26Smrg# _LT_CHECK_SHELL_FEATURES
82943c15da26Smrg# ------------------------
82953c15da26Smrg# Find out whether the shell is Bourne or XSI compatible,
82963c15da26Smrg# or has some other useful features.
82973c15da26Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8298300346aeSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
82993c15da26Smrg  lt_unset=unset
83003c15da26Smrgelse
83013c15da26Smrg  lt_unset=false
83023c15da26Smrgfi
83033c15da26Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8304d656433aSmrg
83053c15da26Smrg# test EBCDIC or ASCII
83063c15da26Smrgcase `echo X|tr X '\101'` in
83073c15da26Smrg A) # ASCII based system
83083c15da26Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
83093c15da26Smrg  lt_SP2NL='tr \040 \012'
83103c15da26Smrg  lt_NL2SP='tr \015\012 \040\040'
83113c15da26Smrg  ;;
83123c15da26Smrg *) # EBCDIC based system
83133c15da26Smrg  lt_SP2NL='tr \100 \n'
83143c15da26Smrg  lt_NL2SP='tr \r\n \100\100'
83153c15da26Smrg  ;;
83163c15da26Smrgesac
83173c15da26Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
83183c15da26Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
83193c15da26Smrg])# _LT_CHECK_SHELL_FEATURES
8320d656433aSmrg
8321d656433aSmrg
83223c15da26Smrg# _LT_PATH_CONVERSION_FUNCTIONS
83233c15da26Smrg# -----------------------------
8324300346aeSmrg# Determine what file name conversion functions should be used by
83253c15da26Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
83263c15da26Smrg# for certain cross-compile configurations and native mingw.
83273c15da26Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
83283c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
83293c15da26SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
83303c15da26SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
83313c15da26SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
83323c15da26Smrg[case $host in
83333c15da26Smrg  *-*-mingw* )
83343c15da26Smrg    case $build in
83353c15da26Smrg      *-*-mingw* ) # actually msys
83363c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
83373c15da26Smrg        ;;
83383c15da26Smrg      *-*-cygwin* )
83393c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
83403c15da26Smrg        ;;
83413c15da26Smrg      * ) # otherwise, assume *nix
83423c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
83433c15da26Smrg        ;;
83443c15da26Smrg    esac
8345555991fdSmrg    ;;
83463c15da26Smrg  *-*-cygwin* )
83473c15da26Smrg    case $build in
83483c15da26Smrg      *-*-mingw* ) # actually msys
83493c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
83503c15da26Smrg        ;;
83513c15da26Smrg      *-*-cygwin* )
83523c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
83533c15da26Smrg        ;;
83543c15da26Smrg      * ) # otherwise, assume *nix
83553c15da26Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
83563c15da26Smrg        ;;
8357555991fdSmrg    esac
8358555991fdSmrg    ;;
83593c15da26Smrg  * ) # unhandled hosts (and "normal" native builds)
83603c15da26Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
83613c15da26Smrg    ;;
8362555991fdSmrgesac
8363555991fdSmrg])
83643c15da26Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
83653c15da26SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
83663c15da26Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
83673c15da26Smrg         [0], [convert $build file names to $host format])dnl
83683c15da26Smrg
83693c15da26SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
83703c15da26SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
83713c15da26Smrg[#assume ordinary cross tools, or native build.
83723c15da26Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
83733c15da26Smrgcase $host in
83743c15da26Smrg  *-*-mingw* )
83753c15da26Smrg    case $build in
83763c15da26Smrg      *-*-mingw* ) # actually msys
83773c15da26Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
83783c15da26Smrg        ;;
83793c15da26Smrg    esac
83803c15da26Smrg    ;;
8381555991fdSmrgesac
83823c15da26Smrg])
83833c15da26Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
83843c15da26SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
83853c15da26Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
83863c15da26Smrg         [0], [convert $build files to toolchain format])dnl
83873c15da26Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
8388d656433aSmrg
83893c15da26Smrg# Helper functions for option handling.                    -*- Autoconf -*-
83903c15da26Smrg#
8391300346aeSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8392300346aeSmrg#   Foundation, Inc.
83933c15da26Smrg#   Written by Gary V. Vaughan, 2004
83943c15da26Smrg#
83953c15da26Smrg# This file is free software; the Free Software Foundation gives
83963c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
83973c15da26Smrg# modifications, as long as this notice is preserved.
8398d656433aSmrg
8399300346aeSmrg# serial 8 ltoptions.m4
8400d656433aSmrg
84013c15da26Smrg# This is to help aclocal find these macros, as it can't see m4_define.
84023c15da26SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8403d656433aSmrg
8404126a8a12Smrg
84053c15da26Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
84063c15da26Smrg# ------------------------------------------
84073c15da26Smrgm4_define([_LT_MANGLE_OPTION],
84083c15da26Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8409126a8a12Smrg
8410126a8a12Smrg
84113c15da26Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
84123c15da26Smrg# ---------------------------------------
84133c15da26Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
84143c15da26Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
84153c15da26Smrg# saved as a flag.
84163c15da26Smrgm4_define([_LT_SET_OPTION],
84173c15da26Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
84183c15da26Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
84193c15da26Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
8420300346aeSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
84213c15da26Smrg])
8422126a8a12Smrg
8423126a8a12Smrg
84243c15da26Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
84253c15da26Smrg# ------------------------------------------------------------
84263c15da26Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
84273c15da26Smrgm4_define([_LT_IF_OPTION],
84283c15da26Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8429126a8a12Smrg
8430126a8a12Smrg
84313c15da26Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
84323c15da26Smrg# -------------------------------------------------------
84333c15da26Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
84343c15da26Smrg# are set.
84353c15da26Smrgm4_define([_LT_UNLESS_OPTIONS],
84363c15da26Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84373c15da26Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
84383c15da26Smrg		      [m4_define([$0_found])])])[]dnl
84393c15da26Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
84403c15da26Smrg])[]dnl
84413c15da26Smrg])
8442126a8a12Smrg
8443126a8a12Smrg
84443c15da26Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
84453c15da26Smrg# ----------------------------------------
84463c15da26Smrg# OPTION-LIST is a space-separated list of Libtool options associated
84473c15da26Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
84483c15da26Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
84493c15da26Smrg# the unknown option and exit.
84503c15da26Smrgm4_defun([_LT_SET_OPTIONS],
84513c15da26Smrg[# Set options
84523c15da26Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
84533c15da26Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
8454126a8a12Smrg
84553c15da26Smrgm4_if([$1],[LT_INIT],[
84563c15da26Smrg  dnl
84573c15da26Smrg  dnl Simply set some default values (i.e off) if boolean options were not
84583c15da26Smrg  dnl specified:
84593c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
84603c15da26Smrg  ])
84613c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
84623c15da26Smrg  ])
84633c15da26Smrg  dnl
84643c15da26Smrg  dnl If no reference was made to various pairs of opposing options, then
84653c15da26Smrg  dnl we run the default mode handler for the pair.  For example, if neither
8466300346aeSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
84673c15da26Smrg  dnl archives by default:
84683c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
84693c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
84703c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
84713c15da26Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8472300346aeSmrg		   [_LT_ENABLE_FAST_INSTALL])
8473300346aeSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8474300346aeSmrg		   [_LT_WITH_AIX_SONAME([aix])])
84753c15da26Smrg  ])
84763c15da26Smrg])# _LT_SET_OPTIONS
8477126a8a12Smrg
8478126a8a12Smrg
8479126a8a12Smrg
84803c15da26Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
84813c15da26Smrg# -----------------------------------------
84823c15da26Smrgm4_define([_LT_MANGLE_DEFUN],
84833c15da26Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
84843c15da26Smrg
84853c15da26Smrg
84863c15da26Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
84873c15da26Smrg# -----------------------------------------------
84883c15da26Smrgm4_define([LT_OPTION_DEFINE],
84893c15da26Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
84903c15da26Smrg])# LT_OPTION_DEFINE
84913c15da26Smrg
84923c15da26Smrg
84933c15da26Smrg# dlopen
84943c15da26Smrg# ------
84953c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
84963c15da26Smrg])
84973c15da26Smrg
84983c15da26SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
84993c15da26Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
85003c15da26SmrgAC_DIAGNOSE([obsolete],
85013c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8502300346aeSmrgput the 'dlopen' option into LT_INIT's first parameter.])
85033c15da26Smrg])
85043c15da26Smrg
85053c15da26Smrgdnl aclocal-1.4 backwards compatibility:
85063c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
85073c15da26Smrg
85083c15da26Smrg
85093c15da26Smrg# win32-dll
85103c15da26Smrg# ---------
85113c15da26Smrg# Declare package support for building win32 dll's.
85123c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
85133c15da26Smrg[enable_win32_dll=yes
85143c15da26Smrg
85153c15da26Smrgcase $host in
85163c15da26Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
85173c15da26Smrg  AC_CHECK_TOOL(AS, as, false)
85183c15da26Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
85193c15da26Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
85203c15da26Smrg  ;;
85213c15da26Smrgesac
8522126a8a12Smrg
85233c15da26Smrgtest -z "$AS" && AS=as
85243c15da26Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8525126a8a12Smrg
85263c15da26Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
85273c15da26Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8528126a8a12Smrg
85293c15da26Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
85303c15da26Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
85313c15da26Smrg])# win32-dll
8532126a8a12Smrg
85333c15da26SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
85343c15da26Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
85353c15da26Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
85363c15da26SmrgAC_DIAGNOSE([obsolete],
85373c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8538300346aeSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
85393c15da26Smrg])
8540126a8a12Smrg
85413c15da26Smrgdnl aclocal-1.4 backwards compatibility:
85423c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8543d656433aSmrg
8544d656433aSmrg
85453c15da26Smrg# _LT_ENABLE_SHARED([DEFAULT])
85463c15da26Smrg# ----------------------------
8547300346aeSmrg# implement the --enable-shared flag, and supports the 'shared' and
8548300346aeSmrg# 'disable-shared' LT_INIT options.
8549300346aeSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
85503c15da26Smrgm4_define([_LT_ENABLE_SHARED],
85513c15da26Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
85523c15da26SmrgAC_ARG_ENABLE([shared],
85533c15da26Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
85543c15da26Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
85553c15da26Smrg    [p=${PACKAGE-default}
85563c15da26Smrg    case $enableval in
85573c15da26Smrg    yes) enable_shared=yes ;;
85583c15da26Smrg    no) enable_shared=no ;;
85593c15da26Smrg    *)
85603c15da26Smrg      enable_shared=no
85613c15da26Smrg      # Look at the argument we got.  We use all the common list separators.
8562300346aeSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
85633c15da26Smrg      for pkg in $enableval; do
8564300346aeSmrg	IFS=$lt_save_ifs
85653c15da26Smrg	if test "X$pkg" = "X$p"; then
85663c15da26Smrg	  enable_shared=yes
85673c15da26Smrg	fi
85683c15da26Smrg      done
8569300346aeSmrg      IFS=$lt_save_ifs
85703c15da26Smrg      ;;
85713c15da26Smrg    esac],
85723c15da26Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8573d656433aSmrg
85743c15da26Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
85753c15da26Smrg	[Whether or not to build shared libraries])
85763c15da26Smrg])# _LT_ENABLE_SHARED
8577555991fdSmrg
85783c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
85793c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8580d656433aSmrg
85813c15da26Smrg# Old names:
85823c15da26SmrgAC_DEFUN([AC_ENABLE_SHARED],
85833c15da26Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
85843c15da26Smrg])
8585d656433aSmrg
85863c15da26SmrgAC_DEFUN([AC_DISABLE_SHARED],
85873c15da26Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
85883c15da26Smrg])
8589d656433aSmrg
85903c15da26SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
85913c15da26SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8592d656433aSmrg
85933c15da26Smrgdnl aclocal-1.4 backwards compatibility:
85943c15da26Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
85953c15da26Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8596d656433aSmrg
8597d656433aSmrg
8598d656433aSmrg
85993c15da26Smrg# _LT_ENABLE_STATIC([DEFAULT])
86003c15da26Smrg# ----------------------------
8601300346aeSmrg# implement the --enable-static flag, and support the 'static' and
8602300346aeSmrg# 'disable-static' LT_INIT options.
8603300346aeSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
86043c15da26Smrgm4_define([_LT_ENABLE_STATIC],
86053c15da26Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
86063c15da26SmrgAC_ARG_ENABLE([static],
86073c15da26Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
86083c15da26Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
86093c15da26Smrg    [p=${PACKAGE-default}
86103c15da26Smrg    case $enableval in
86113c15da26Smrg    yes) enable_static=yes ;;
86123c15da26Smrg    no) enable_static=no ;;
86133c15da26Smrg    *)
86143c15da26Smrg     enable_static=no
86153c15da26Smrg      # Look at the argument we got.  We use all the common list separators.
8616300346aeSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86173c15da26Smrg      for pkg in $enableval; do
8618300346aeSmrg	IFS=$lt_save_ifs
86193c15da26Smrg	if test "X$pkg" = "X$p"; then
86203c15da26Smrg	  enable_static=yes
8621555991fdSmrg	fi
86223c15da26Smrg      done
8623300346aeSmrg      IFS=$lt_save_ifs
86243c15da26Smrg      ;;
86253c15da26Smrg    esac],
86263c15da26Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8627d656433aSmrg
86283c15da26Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
86293c15da26Smrg	[Whether or not to build static libraries])
86303c15da26Smrg])# _LT_ENABLE_STATIC
8631d656433aSmrg
86323c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
86333c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8634d656433aSmrg
86353c15da26Smrg# Old names:
86363c15da26SmrgAC_DEFUN([AC_ENABLE_STATIC],
86373c15da26Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
86383c15da26Smrg])
8639d656433aSmrg
86403c15da26SmrgAC_DEFUN([AC_DISABLE_STATIC],
86413c15da26Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
86423c15da26Smrg])
8643d656433aSmrg
86443c15da26SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
86453c15da26SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8646d656433aSmrg
86473c15da26Smrgdnl aclocal-1.4 backwards compatibility:
86483c15da26Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
86493c15da26Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8650d656433aSmrg
8651d656433aSmrg
8652d656433aSmrg
86533c15da26Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
86543c15da26Smrg# ----------------------------------
8655300346aeSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
8656300346aeSmrg# and 'disable-fast-install' LT_INIT options.
8657300346aeSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
86583c15da26Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
86593c15da26Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
86603c15da26SmrgAC_ARG_ENABLE([fast-install],
86613c15da26Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
86623c15da26Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
86633c15da26Smrg    [p=${PACKAGE-default}
86643c15da26Smrg    case $enableval in
86653c15da26Smrg    yes) enable_fast_install=yes ;;
86663c15da26Smrg    no) enable_fast_install=no ;;
86673c15da26Smrg    *)
86683c15da26Smrg      enable_fast_install=no
86693c15da26Smrg      # Look at the argument we got.  We use all the common list separators.
8670300346aeSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
86713c15da26Smrg      for pkg in $enableval; do
8672300346aeSmrg	IFS=$lt_save_ifs
86733c15da26Smrg	if test "X$pkg" = "X$p"; then
86743c15da26Smrg	  enable_fast_install=yes
86753c15da26Smrg	fi
86763c15da26Smrg      done
8677300346aeSmrg      IFS=$lt_save_ifs
86783c15da26Smrg      ;;
86793c15da26Smrg    esac],
86803c15da26Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
86813c15da26Smrg
86823c15da26Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
86833c15da26Smrg	 [Whether or not to optimize for fast installation])dnl
86843c15da26Smrg])# _LT_ENABLE_FAST_INSTALL
8685d656433aSmrg
86863c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
86873c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8688d656433aSmrg
86893c15da26Smrg# Old names:
86903c15da26SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
86913c15da26Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
86923c15da26SmrgAC_DIAGNOSE([obsolete],
86933c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8694300346aeSmrgthe 'fast-install' option into LT_INIT's first parameter.])
86953c15da26Smrg])
8696d656433aSmrg
86973c15da26SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
86983c15da26Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
86993c15da26SmrgAC_DIAGNOSE([obsolete],
87003c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8701300346aeSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
87023c15da26Smrg])
8703d656433aSmrg
87043c15da26Smrgdnl aclocal-1.4 backwards compatibility:
87053c15da26Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
87063c15da26Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8707d656433aSmrg
8708d656433aSmrg
8709300346aeSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
8710300346aeSmrg# ----------------------------------
8711300346aeSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8712300346aeSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8713300346aeSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8714300346aeSmrgm4_define([_LT_WITH_AIX_SONAME],
8715300346aeSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8716300346aeSmrgshared_archive_member_spec=
8717300346aeSmrgcase $host,$enable_shared in
8718300346aeSmrgpower*-*-aix[[5-9]]*,yes)
8719300346aeSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8720300346aeSmrg  AC_ARG_WITH([aix-soname],
8721300346aeSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8722300346aeSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8723300346aeSmrg    [case $withval in
8724300346aeSmrg    aix|svr4|both)
8725300346aeSmrg      ;;
8726300346aeSmrg    *)
8727300346aeSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8728300346aeSmrg      ;;
8729300346aeSmrg    esac
8730300346aeSmrg    lt_cv_with_aix_soname=$with_aix_soname],
8731300346aeSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8732300346aeSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8733300346aeSmrg    with_aix_soname=$lt_cv_with_aix_soname])
8734300346aeSmrg  AC_MSG_RESULT([$with_aix_soname])
8735300346aeSmrg  if test aix != "$with_aix_soname"; then
8736300346aeSmrg    # For the AIX way of multilib, we name the shared archive member
8737300346aeSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8738300346aeSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8739300346aeSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8740300346aeSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8741300346aeSmrg    if test 64 = "${OBJECT_MODE-32}"; then
8742300346aeSmrg      shared_archive_member_spec=shr_64
8743300346aeSmrg    else
8744300346aeSmrg      shared_archive_member_spec=shr
8745300346aeSmrg    fi
8746300346aeSmrg  fi
8747300346aeSmrg  ;;
8748300346aeSmrg*)
8749300346aeSmrg  with_aix_soname=aix
8750300346aeSmrg  ;;
8751300346aeSmrgesac
8752300346aeSmrg
8753300346aeSmrg_LT_DECL([], [shared_archive_member_spec], [0],
8754300346aeSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8755300346aeSmrg])# _LT_WITH_AIX_SONAME
8756300346aeSmrg
8757300346aeSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8758300346aeSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8759300346aeSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8760300346aeSmrg
8761300346aeSmrg
87623c15da26Smrg# _LT_WITH_PIC([MODE])
87633c15da26Smrg# --------------------
8764300346aeSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
87653c15da26Smrg# LT_INIT options.
8766300346aeSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
87673c15da26Smrgm4_define([_LT_WITH_PIC],
87683c15da26Smrg[AC_ARG_WITH([pic],
87690a6b08f8Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
87703c15da26Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
87710a6b08f8Smrg    [lt_p=${PACKAGE-default}
87720a6b08f8Smrg    case $withval in
87730a6b08f8Smrg    yes|no) pic_mode=$withval ;;
87740a6b08f8Smrg    *)
87750a6b08f8Smrg      pic_mode=default
87760a6b08f8Smrg      # Look at the argument we got.  We use all the common list separators.
8777300346aeSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
87780a6b08f8Smrg      for lt_pkg in $withval; do
8779300346aeSmrg	IFS=$lt_save_ifs
87800a6b08f8Smrg	if test "X$lt_pkg" = "X$lt_p"; then
87810a6b08f8Smrg	  pic_mode=yes
87820a6b08f8Smrg	fi
87830a6b08f8Smrg      done
8784300346aeSmrg      IFS=$lt_save_ifs
87850a6b08f8Smrg      ;;
87860a6b08f8Smrg    esac],
8787300346aeSmrg    [pic_mode=m4_default([$1], [default])])
8788d656433aSmrg
87893c15da26Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
87903c15da26Smrg])# _LT_WITH_PIC
8791d656433aSmrg
87923c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
87933c15da26SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8794555991fdSmrg
87953c15da26Smrg# Old name:
87963c15da26SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
87973c15da26Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
87983c15da26SmrgAC_DIAGNOSE([obsolete],
87993c15da26Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8800300346aeSmrgput the 'pic-only' option into LT_INIT's first parameter.])
88013c15da26Smrg])
8802d656433aSmrg
88033c15da26Smrgdnl aclocal-1.4 backwards compatibility:
88043c15da26Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8805555991fdSmrg
8806555991fdSmrg
88073c15da26Smrgm4_define([_LTDL_MODE], [])
88083c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
88093c15da26Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
88103c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
88113c15da26Smrg		 [m4_define([_LTDL_MODE], [recursive])])
88123c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
88133c15da26Smrg		 [m4_define([_LTDL_MODE], [subproject])])
8814555991fdSmrg
88153c15da26Smrgm4_define([_LTDL_TYPE], [])
88163c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
88173c15da26Smrg		 [m4_define([_LTDL_TYPE], [installable])])
88183c15da26SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
88193c15da26Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8820555991fdSmrg
88213c15da26Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
88223c15da26Smrg#
8823300346aeSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8824300346aeSmrg# Foundation, Inc.
88253c15da26Smrg# Written by Gary V. Vaughan, 2004
88263c15da26Smrg#
88273c15da26Smrg# This file is free software; the Free Software Foundation gives
88283c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
88293c15da26Smrg# modifications, as long as this notice is preserved.
8830555991fdSmrg
88313c15da26Smrg# serial 6 ltsugar.m4
8832555991fdSmrg
88333c15da26Smrg# This is to help aclocal find these macros, as it can't see m4_define.
88343c15da26SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8835555991fdSmrg
8836d656433aSmrg
88373c15da26Smrg# lt_join(SEP, ARG1, [ARG2...])
88383c15da26Smrg# -----------------------------
88393c15da26Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
88403c15da26Smrg# associated separator.
88413c15da26Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
88423c15da26Smrg# versions in m4sugar had bugs.
88433c15da26Smrgm4_define([lt_join],
88443c15da26Smrg[m4_if([$#], [1], [],
88453c15da26Smrg       [$#], [2], [[$2]],
88463c15da26Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
88473c15da26Smrgm4_define([_lt_join],
88483c15da26Smrg[m4_if([$#$2], [2], [],
88493c15da26Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8850d656433aSmrg
8851d656433aSmrg
88523c15da26Smrg# lt_car(LIST)
88533c15da26Smrg# lt_cdr(LIST)
88543c15da26Smrg# ------------
88553c15da26Smrg# Manipulate m4 lists.
88563c15da26Smrg# These macros are necessary as long as will still need to support
8857300346aeSmrg# Autoconf-2.59, which quotes differently.
88583c15da26Smrgm4_define([lt_car], [[$1]])
88593c15da26Smrgm4_define([lt_cdr],
88603c15da26Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
88613c15da26Smrg       [$#], 1, [],
88623c15da26Smrg       [m4_dquote(m4_shift($@))])])
88633c15da26Smrgm4_define([lt_unquote], $1)
8864d656433aSmrg
8865d656433aSmrg
88663c15da26Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
88673c15da26Smrg# ------------------------------------------
8868300346aeSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
88693c15da26Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
88703c15da26Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
88713c15da26Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
88723c15da26Smrg# than defined and empty).
88733c15da26Smrg#
88743c15da26Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
88753c15da26Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
88763c15da26Smrgm4_define([lt_append],
88773c15da26Smrg[m4_define([$1],
88783c15da26Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8879d656433aSmrg
8880d656433aSmrg
8881d656433aSmrg
88823c15da26Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
88833c15da26Smrg# ----------------------------------------------------------
88843c15da26Smrg# Produce a SEP delimited list of all paired combinations of elements of
88853c15da26Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
88863c15da26Smrg# has the form PREFIXmINFIXSUFFIXn.
88873c15da26Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
88883c15da26Smrgm4_define([lt_combine],
88893c15da26Smrg[m4_if(m4_eval([$# > 3]), [1],
88903c15da26Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
88913c15da26Smrg[[m4_foreach([_Lt_prefix], [$2],
88923c15da26Smrg	     [m4_foreach([_Lt_suffix],
88933c15da26Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
88943c15da26Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8895d656433aSmrg
8896d656433aSmrg
88973c15da26Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
88983c15da26Smrg# -----------------------------------------------------------------------
88993c15da26Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
89003c15da26Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
89013c15da26Smrgm4_define([lt_if_append_uniq],
89023c15da26Smrg[m4_ifdef([$1],
89033c15da26Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
89043c15da26Smrg		 [lt_append([$1], [$2], [$3])$4],
89053c15da26Smrg		 [$5])],
89063c15da26Smrg	  [lt_append([$1], [$2], [$3])$4])])
8907d656433aSmrg
8908d656433aSmrg
89093c15da26Smrg# lt_dict_add(DICT, KEY, VALUE)
89103c15da26Smrg# -----------------------------
89113c15da26Smrgm4_define([lt_dict_add],
89123c15da26Smrg[m4_define([$1($2)], [$3])])
8913d656433aSmrg
89143c15da26Smrg
89153c15da26Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
89163c15da26Smrg# --------------------------------------------
89173c15da26Smrgm4_define([lt_dict_add_subkey],
89183c15da26Smrg[m4_define([$1($2:$3)], [$4])])
8919d656433aSmrg
8920d656433aSmrg
89213c15da26Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
89223c15da26Smrg# ----------------------------------
89233c15da26Smrgm4_define([lt_dict_fetch],
89243c15da26Smrg[m4_ifval([$3],
89253c15da26Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
89263c15da26Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8927d656433aSmrg
8928d656433aSmrg
89293c15da26Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
89303c15da26Smrg# -----------------------------------------------------------------
89313c15da26Smrgm4_define([lt_if_dict_fetch],
89323c15da26Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
89333c15da26Smrg	[$5],
89343c15da26Smrg    [$6])])
8935555991fdSmrg
8936555991fdSmrg
89373c15da26Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
89383c15da26Smrg# --------------------------------------------------------------
89393c15da26Smrgm4_define([lt_dict_filter],
89403c15da26Smrg[m4_if([$5], [], [],
89413c15da26Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
89423c15da26Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
89433c15da26Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8944555991fdSmrg])
8945555991fdSmrg
89463c15da26Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
89473c15da26Smrg#
8948300346aeSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
89493c15da26Smrg#   Written by Scott James Remnant, 2004
89503c15da26Smrg#
89513c15da26Smrg# This file is free software; the Free Software Foundation gives
89523c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
89533c15da26Smrg# modifications, as long as this notice is preserved.
8954d656433aSmrg
89553c15da26Smrg# @configure_input@
8956d656433aSmrg
8957300346aeSmrg# serial 4179 ltversion.m4
89583c15da26Smrg# This file is part of GNU Libtool
8959126a8a12Smrg
8960300346aeSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
8961300346aeSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
8962126a8a12Smrg
89633c15da26SmrgAC_DEFUN([LTVERSION_VERSION],
8964300346aeSmrg[macro_version='2.4.6'
8965300346aeSmrgmacro_revision='2.4.6'
89663c15da26Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
89673c15da26Smrg_LT_DECL(, macro_revision, 0)
89683c15da26Smrg])
8969d656433aSmrg
89703c15da26Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
89713c15da26Smrg#
8972300346aeSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8973300346aeSmrg#   Foundation, Inc.
89743c15da26Smrg#   Written by Scott James Remnant, 2004.
89753c15da26Smrg#
89763c15da26Smrg# This file is free software; the Free Software Foundation gives
89773c15da26Smrg# unlimited permission to copy and/or distribute it, with or without
89783c15da26Smrg# modifications, as long as this notice is preserved.
8979126a8a12Smrg
89803c15da26Smrg# serial 5 lt~obsolete.m4
8981126a8a12Smrg
89823c15da26Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
89833c15da26Smrg#
8984300346aeSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
89853c15da26Smrg# which have later been changed to m4_define as they aren't part of the
89863c15da26Smrg# exported API, or moved to Autoconf or Automake where they belong.
89873c15da26Smrg#
89883c15da26Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
89893c15da26Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
89903c15da26Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
89913c15da26Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
89923c15da26Smrg# and doesn't know about Autoconf macros at all.)
89933c15da26Smrg#
89943c15da26Smrg# So we provide this file, which has a silly filename so it's always
89953c15da26Smrg# included after everything else.  This provides aclocal with the
89963c15da26Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
89973c15da26Smrg# because those macros already exist, or will be overwritten later.
8998300346aeSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
89993c15da26Smrg#
90003c15da26Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
90013c15da26Smrg# Yes, that means every name once taken will need to remain here until
90023c15da26Smrg# we give up compatibility with versions before 1.7, at which point
90033c15da26Smrg# we need to keep only those names which we still refer to.
9004d656433aSmrg
90053c15da26Smrg# This is to help aclocal find these macros, as it can't see m4_define.
90063c15da26SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9007126a8a12Smrg
90083c15da26Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
90093c15da26Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
90103c15da26Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
90113c15da26Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
90123c15da26Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
90133c15da26Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
90143c15da26Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
90153c15da26Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
90163c15da26Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
90173c15da26Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
90183c15da26Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
90193c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
90203c15da26Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
90213c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
90223c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
90233c15da26Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
90243c15da26Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
90253c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
90263c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
90273c15da26Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
90283c15da26Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
90293c15da26Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
90303c15da26Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
90313c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
90323c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
90333c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
90343c15da26Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
90353c15da26Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
90363c15da26Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
90373c15da26Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
90383c15da26Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
90393c15da26Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
90403c15da26Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
90413c15da26Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
90423c15da26Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
90433c15da26Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
90443c15da26Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
90453c15da26Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
90463c15da26Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
90473c15da26Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
90483c15da26Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
90493c15da26Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
90503c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
90513c15da26Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
90523c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
90533c15da26Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
90543c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
90553c15da26Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
90563c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
90573c15da26Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
90583c15da26Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
90593c15da26Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
90603c15da26Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
90613c15da26Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
90623c15da26Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
90633c15da26Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
90643c15da26Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
90653c15da26Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
90663c15da26Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
90673c15da26Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
90683c15da26Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9069126a8a12Smrg
9070300346aeSmrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
9071300346aeSmrgdnl serial 11 (pkg-config-0.29.1)
9072300346aeSmrgdnl
9073300346aeSmrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9074300346aeSmrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
9075300346aeSmrgdnl
9076300346aeSmrgdnl This program is free software; you can redistribute it and/or modify
9077300346aeSmrgdnl it under the terms of the GNU General Public License as published by
9078300346aeSmrgdnl the Free Software Foundation; either version 2 of the License, or
9079300346aeSmrgdnl (at your option) any later version.
9080300346aeSmrgdnl
9081300346aeSmrgdnl This program is distributed in the hope that it will be useful, but
9082300346aeSmrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
9083300346aeSmrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9084300346aeSmrgdnl General Public License for more details.
9085300346aeSmrgdnl
9086300346aeSmrgdnl You should have received a copy of the GNU General Public License
9087300346aeSmrgdnl along with this program; if not, write to the Free Software
9088300346aeSmrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
9089300346aeSmrgdnl 02111-1307, USA.
9090300346aeSmrgdnl
9091300346aeSmrgdnl As a special exception to the GNU General Public License, if you
9092300346aeSmrgdnl distribute this file as part of a program that contains a
9093300346aeSmrgdnl configuration script generated by Autoconf, you may include it under
9094300346aeSmrgdnl the same distribution terms that you use for the rest of that
9095300346aeSmrgdnl program.
9096300346aeSmrg
9097300346aeSmrgdnl PKG_PREREQ(MIN-VERSION)
9098300346aeSmrgdnl -----------------------
9099300346aeSmrgdnl Since: 0.29
9100300346aeSmrgdnl
9101300346aeSmrgdnl Verify that the version of the pkg-config macros are at least
9102300346aeSmrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
9103300346aeSmrgdnl installed version of pkg-config, this checks the developer's version
9104300346aeSmrgdnl of pkg.m4 when generating configure.
9105300346aeSmrgdnl
9106300346aeSmrgdnl To ensure that this macro is defined, also add:
9107300346aeSmrgdnl m4_ifndef([PKG_PREREQ],
9108300346aeSmrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
9109300346aeSmrgdnl
9110300346aeSmrgdnl See the "Since" comment for each macro you use to see what version
9111300346aeSmrgdnl of the macros you require.
9112300346aeSmrgm4_defun([PKG_PREREQ],
9113300346aeSmrg[m4_define([PKG_MACROS_VERSION], [0.29.1])
9114300346aeSmrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
9115300346aeSmrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
9116300346aeSmrg])dnl PKG_PREREQ
9117300346aeSmrg
9118300346aeSmrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
9119300346aeSmrgdnl ----------------------------------
9120300346aeSmrgdnl Since: 0.16
9121300346aeSmrgdnl
9122300346aeSmrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
9123300346aeSmrgdnl first found in the path. Checks that the version of pkg-config found
9124300346aeSmrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
9125300346aeSmrgdnl used since that's the first version where most current features of
9126300346aeSmrgdnl pkg-config existed.
91270a6b08f8SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
91280a6b08f8Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9129300346aeSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9130300346aeSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9131300346aeSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9132300346aeSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9133300346aeSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9134300346aeSmrg
91350a6b08f8Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
91360a6b08f8Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
91370a6b08f8Smrgfi
91380a6b08f8Smrgif test -n "$PKG_CONFIG"; then
91390a6b08f8Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
91400a6b08f8Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
91410a6b08f8Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
91420a6b08f8Smrg		AC_MSG_RESULT([yes])
91430a6b08f8Smrg	else
91440a6b08f8Smrg		AC_MSG_RESULT([no])
91450a6b08f8Smrg		PKG_CONFIG=""
91460a6b08f8Smrg	fi
91470a6b08f8Smrgfi[]dnl
9148300346aeSmrg])dnl PKG_PROG_PKG_CONFIG
91490a6b08f8Smrg
9150300346aeSmrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9151300346aeSmrgdnl -------------------------------------------------------------------
9152300346aeSmrgdnl Since: 0.18
9153300346aeSmrgdnl
9154300346aeSmrgdnl Check to see whether a particular set of modules exists. Similar to
9155300346aeSmrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
9156300346aeSmrgdnl
9157300346aeSmrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9158300346aeSmrgdnl only at the first occurence in configure.ac, so if the first place
9159300346aeSmrgdnl it's called might be skipped (such as if it is within an "if", you
9160300346aeSmrgdnl have to call PKG_CHECK_EXISTS manually
91610a6b08f8SmrgAC_DEFUN([PKG_CHECK_EXISTS],
91620a6b08f8Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
91630a6b08f8Smrgif test -n "$PKG_CONFIG" && \
91640a6b08f8Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9165300346aeSmrg  m4_default([$2], [:])
91660a6b08f8Smrgm4_ifvaln([$3], [else
91670a6b08f8Smrg  $3])dnl
91680a6b08f8Smrgfi])
91690a6b08f8Smrg
9170300346aeSmrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9171300346aeSmrgdnl ---------------------------------------------
9172300346aeSmrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
9173300346aeSmrgdnl pkg_failed based on the result.
91740a6b08f8Smrgm4_define([_PKG_CONFIG],
91750a6b08f8Smrg[if test -n "$$1"; then
91760a6b08f8Smrg    pkg_cv_[]$1="$$1"
91770a6b08f8Smrg elif test -n "$PKG_CONFIG"; then
91780a6b08f8Smrg    PKG_CHECK_EXISTS([$3],
9179300346aeSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9180300346aeSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
91810a6b08f8Smrg		     [pkg_failed=yes])
91820a6b08f8Smrg else
91830a6b08f8Smrg    pkg_failed=untried
91840a6b08f8Smrgfi[]dnl
9185300346aeSmrg])dnl _PKG_CONFIG
91860a6b08f8Smrg
9187300346aeSmrgdnl _PKG_SHORT_ERRORS_SUPPORTED
9188300346aeSmrgdnl ---------------------------
9189300346aeSmrgdnl Internal check to see if pkg-config supports short errors.
91900a6b08f8SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
91910a6b08f8Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
91920a6b08f8Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
91930a6b08f8Smrg        _pkg_short_errors_supported=yes
91940a6b08f8Smrgelse
91950a6b08f8Smrg        _pkg_short_errors_supported=no
91960a6b08f8Smrgfi[]dnl
9197300346aeSmrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
91980a6b08f8Smrg
91990a6b08f8Smrg
9200300346aeSmrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9201300346aeSmrgdnl   [ACTION-IF-NOT-FOUND])
9202300346aeSmrgdnl --------------------------------------------------------------
9203300346aeSmrgdnl Since: 0.4.0
9204300346aeSmrgdnl
9205300346aeSmrgdnl Note that if there is a possibility the first call to
9206300346aeSmrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
9207300346aeSmrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
92080a6b08f8SmrgAC_DEFUN([PKG_CHECK_MODULES],
92090a6b08f8Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
92100a6b08f8SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
92110a6b08f8SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
92120a6b08f8Smrg
92130a6b08f8Smrgpkg_failed=no
92140a6b08f8SmrgAC_MSG_CHECKING([for $1])
92150a6b08f8Smrg
92160a6b08f8Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
92170a6b08f8Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
92180a6b08f8Smrg
92190a6b08f8Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
92200a6b08f8Smrgand $1[]_LIBS to avoid the need to call pkg-config.
92210a6b08f8SmrgSee the pkg-config man page for more details.])
92220a6b08f8Smrg
92230a6b08f8Smrgif test $pkg_failed = yes; then
9224300346aeSmrg   	AC_MSG_RESULT([no])
92250a6b08f8Smrg        _PKG_SHORT_ERRORS_SUPPORTED
92260a6b08f8Smrg        if test $_pkg_short_errors_supported = yes; then
9227300346aeSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
92280a6b08f8Smrg        else 
9229300346aeSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
92300a6b08f8Smrg        fi
92310a6b08f8Smrg	# Put the nasty error message in config.log where it belongs
92320a6b08f8Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
92330a6b08f8Smrg
9234300346aeSmrg	m4_default([$4], [AC_MSG_ERROR(
92350a6b08f8Smrg[Package requirements ($2) were not met:
92360a6b08f8Smrg
92370a6b08f8Smrg$$1_PKG_ERRORS
92380a6b08f8Smrg
92390a6b08f8SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
92400a6b08f8Smrginstalled software in a non-standard prefix.
92410a6b08f8Smrg
9242300346aeSmrg_PKG_TEXT])[]dnl
9243300346aeSmrg        ])
92440a6b08f8Smrgelif test $pkg_failed = untried; then
9245300346aeSmrg     	AC_MSG_RESULT([no])
9246300346aeSmrg	m4_default([$4], [AC_MSG_FAILURE(
92470a6b08f8Smrg[The pkg-config script could not be found or is too old.  Make sure it
92480a6b08f8Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
92490a6b08f8Smrgpath to pkg-config.
92500a6b08f8Smrg
92510a6b08f8Smrg_PKG_TEXT
92520a6b08f8Smrg
9253300346aeSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9254300346aeSmrg        ])
92550a6b08f8Smrgelse
92560a6b08f8Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
92570a6b08f8Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
92580a6b08f8Smrg        AC_MSG_RESULT([yes])
9259300346aeSmrg	$3
92600a6b08f8Smrgfi[]dnl
9261300346aeSmrg])dnl PKG_CHECK_MODULES
9262300346aeSmrg
9263300346aeSmrg
9264300346aeSmrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9265300346aeSmrgdnl   [ACTION-IF-NOT-FOUND])
9266300346aeSmrgdnl ---------------------------------------------------------------------
9267300346aeSmrgdnl Since: 0.29
9268300346aeSmrgdnl
9269300346aeSmrgdnl Checks for existence of MODULES and gathers its build flags with
9270300346aeSmrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
9271300346aeSmrgdnl and VARIABLE-PREFIX_LIBS from --libs.
9272300346aeSmrgdnl
9273300346aeSmrgdnl Note that if there is a possibility the first call to
9274300346aeSmrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
9275300346aeSmrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
9276300346aeSmrgdnl configure.ac.
9277300346aeSmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
9278300346aeSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9279300346aeSmrg_save_PKG_CONFIG=$PKG_CONFIG
9280300346aeSmrgPKG_CONFIG="$PKG_CONFIG --static"
9281300346aeSmrgPKG_CHECK_MODULES($@)
9282300346aeSmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
9283300346aeSmrg])dnl PKG_CHECK_MODULES_STATIC
9284300346aeSmrg
9285300346aeSmrg
9286300346aeSmrgdnl PKG_INSTALLDIR([DIRECTORY])
9287300346aeSmrgdnl -------------------------
9288300346aeSmrgdnl Since: 0.27
9289300346aeSmrgdnl
9290300346aeSmrgdnl Substitutes the variable pkgconfigdir as the location where a module
9291300346aeSmrgdnl should install pkg-config .pc files. By default the directory is
9292300346aeSmrgdnl $libdir/pkgconfig, but the default can be changed by passing
9293300346aeSmrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
9294300346aeSmrgdnl parameter.
9295300346aeSmrgAC_DEFUN([PKG_INSTALLDIR],
9296300346aeSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9297300346aeSmrgm4_pushdef([pkg_description],
9298300346aeSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9299300346aeSmrgAC_ARG_WITH([pkgconfigdir],
9300300346aeSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9301300346aeSmrg    [with_pkgconfigdir=]pkg_default)
9302300346aeSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9303300346aeSmrgm4_popdef([pkg_default])
9304300346aeSmrgm4_popdef([pkg_description])
9305300346aeSmrg])dnl PKG_INSTALLDIR
9306300346aeSmrg
9307300346aeSmrg
9308300346aeSmrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
9309300346aeSmrgdnl --------------------------------
9310300346aeSmrgdnl Since: 0.27
9311300346aeSmrgdnl
9312300346aeSmrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
9313300346aeSmrgdnl module should install arch-independent pkg-config .pc files. By
9314300346aeSmrgdnl default the directory is $datadir/pkgconfig, but the default can be
9315300346aeSmrgdnl changed by passing DIRECTORY. The user can override through the
9316300346aeSmrgdnl --with-noarch-pkgconfigdir parameter.
9317300346aeSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9318300346aeSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9319300346aeSmrgm4_pushdef([pkg_description],
9320300346aeSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9321300346aeSmrgAC_ARG_WITH([noarch-pkgconfigdir],
9322300346aeSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9323300346aeSmrg    [with_noarch_pkgconfigdir=]pkg_default)
9324300346aeSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9325300346aeSmrgm4_popdef([pkg_default])
9326300346aeSmrgm4_popdef([pkg_description])
9327300346aeSmrg])dnl PKG_NOARCH_INSTALLDIR
9328300346aeSmrg
9329300346aeSmrg
9330300346aeSmrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9331300346aeSmrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9332300346aeSmrgdnl -------------------------------------------
9333300346aeSmrgdnl Since: 0.28
9334300346aeSmrgdnl
9335300346aeSmrgdnl Retrieves the value of the pkg-config variable for the given module.
9336300346aeSmrgAC_DEFUN([PKG_CHECK_VAR],
9337300346aeSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9338300346aeSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
9339300346aeSmrg
9340300346aeSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9341300346aeSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
9342300346aeSmrg
9343300346aeSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9344300346aeSmrg])dnl PKG_CHECK_VAR
93450a6b08f8Smrg
93463c15da26Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
93473c15da26Smrgdnl
93483c15da26Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
93490a6b08f8Smrgdnl
93503c15da26Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
93513c15da26Smrgdnl copy of this software and associated documentation files (the "Software"),
93523c15da26Smrgdnl to deal in the Software without restriction, including without limitation
93533c15da26Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
93543c15da26Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
93553c15da26Smrgdnl Software is furnished to do so, subject to the following conditions:
93563c15da26Smrgdnl
93573c15da26Smrgdnl The above copyright notice and this permission notice (including the next
93583c15da26Smrgdnl paragraph) shall be included in all copies or substantial portions of the
93593c15da26Smrgdnl Software.
93603c15da26Smrgdnl
93613c15da26Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
93623c15da26Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93633c15da26Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
93643c15da26Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
93653c15da26Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93663c15da26Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
93673c15da26Smrgdnl DEALINGS IN THE SOFTWARE.
9368126a8a12Smrg
93693c15da26Smrg# XORG_MACROS_VERSION(required-version)
93703c15da26Smrg# -------------------------------------
93713c15da26Smrg# Minimum version: 1.1.0
93723c15da26Smrg#
93733c15da26Smrg# If you're using a macro added in Version 1.1 or newer, include this in
93743c15da26Smrg# your configure.ac with the minimum required version, such as:
93753c15da26Smrg# XORG_MACROS_VERSION(1.1)
93763c15da26Smrg#
93773c15da26Smrg# To ensure that this macro is defined, also add:
93783c15da26Smrg# m4_ifndef([XORG_MACROS_VERSION],
93793c15da26Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
93803c15da26Smrg#
93813c15da26Smrg#
93820a6b08f8Smrg# See the "minimum version" comment for each macro you use to see what
93833c15da26Smrg# version you require.
93843c15da26Smrgm4_defun([XORG_MACROS_VERSION],[
9385300346aeSmrgm4_define([vers_have], [1.19.0])
93863c15da26Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
93873c15da26Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
93883c15da26Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
93893c15da26Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
93903c15da26Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
93913c15da26Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
93923c15da26Smrgm4_undefine([vers_have])
93933c15da26Smrgm4_undefine([maj_have])
93943c15da26Smrgm4_undefine([maj_needed])
93953c15da26Smrg]) # XORG_MACROS_VERSION
9396126a8a12Smrg
93973c15da26Smrg# XORG_PROG_RAWCPP()
93983c15da26Smrg# ------------------
93993c15da26Smrg# Minimum version: 1.0.0
94003c15da26Smrg#
94013c15da26Smrg# Find cpp program and necessary flags for use in pre-processing text files
94023c15da26Smrg# such as man pages and config files
94033c15da26SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
94043c15da26SmrgAC_REQUIRE([AC_PROG_CPP])
94050a6b08f8SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
94063c15da26Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9407126a8a12Smrg
94083c15da26Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
94093c15da26Smrg# which is not the best choice for supporting other OS'es, but covers most
94103c15da26Smrg# of the ones we need for now.
94113c15da26SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
94123c15da26SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
94133c15da26Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94143c15da26Smrg	AC_MSG_RESULT([no])
94153c15da26Smrgelse
94163c15da26Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94173c15da26Smrg		RAWCPPFLAGS=-undef
94183c15da26Smrg		AC_MSG_RESULT([yes])
94193c15da26Smrg	# under Cygwin unix is still defined even with -undef
94203c15da26Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
94213c15da26Smrg		RAWCPPFLAGS="-undef -ansi"
94223c15da26Smrg		AC_MSG_RESULT([yes, with -ansi])
94233c15da26Smrg	else
94243c15da26Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
94253c15da26Smrg	fi
94263c15da26Smrgfi
94273c15da26Smrgrm -f conftest.$ac_ext
9428126a8a12Smrg
94293c15da26SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
94303c15da26SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
94313c15da26Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
94323c15da26Smrg	AC_MSG_RESULT([no])
94333c15da26Smrgelse
94343c15da26Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9435300346aeSmrg		TRADITIONALCPPFLAGS="-traditional"
94363c15da26Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
94373c15da26Smrg		AC_MSG_RESULT([yes])
94383c15da26Smrg	else
94393c15da26Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
94403c15da26Smrg	fi
94413c15da26Smrgfi
94423c15da26Smrgrm -f conftest.$ac_ext
94433c15da26SmrgAC_SUBST(RAWCPPFLAGS)
9444300346aeSmrgAC_SUBST(TRADITIONALCPPFLAGS)
94453c15da26Smrg]) # XORG_PROG_RAWCPP
9446126a8a12Smrg
94473c15da26Smrg# XORG_MANPAGE_SECTIONS()
94483c15da26Smrg# -----------------------
94493c15da26Smrg# Minimum version: 1.0.0
94503c15da26Smrg#
94513c15da26Smrg# Determine which sections man pages go in for the different man page types
94523c15da26Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
94533c15da26Smrg# Not sure if there's any better way than just hardcoding by OS name.
94543c15da26Smrg# Override default settings by setting environment variables
94553c15da26Smrg# Added MAN_SUBSTS in version 1.8
94563c15da26Smrg# Added AC_PROG_SED in version 1.8
9457126a8a12Smrg
94583c15da26SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
94593c15da26SmrgAC_REQUIRE([AC_CANONICAL_HOST])
94603c15da26SmrgAC_REQUIRE([AC_PROG_SED])
9461126a8a12Smrg
94623c15da26Smrgif test x$APP_MAN_SUFFIX = x    ; then
94633c15da26Smrg    APP_MAN_SUFFIX=1
94643c15da26Smrgfi
94653c15da26Smrgif test x$APP_MAN_DIR = x    ; then
94663c15da26Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
94673c15da26Smrgfi
9468126a8a12Smrg
94693c15da26Smrgif test x$LIB_MAN_SUFFIX = x    ; then
94703c15da26Smrg    LIB_MAN_SUFFIX=3
94713c15da26Smrgfi
94723c15da26Smrgif test x$LIB_MAN_DIR = x    ; then
94733c15da26Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
94743c15da26Smrgfi
9475126a8a12Smrg
94763c15da26Smrgif test x$FILE_MAN_SUFFIX = x    ; then
94773c15da26Smrg    case $host_os in
94783c15da26Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
94793c15da26Smrg	*)		FILE_MAN_SUFFIX=5  ;;
94803c15da26Smrg    esac
94813c15da26Smrgfi
94823c15da26Smrgif test x$FILE_MAN_DIR = x    ; then
94833c15da26Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
94843c15da26Smrgfi
9485126a8a12Smrg
94863c15da26Smrgif test x$MISC_MAN_SUFFIX = x    ; then
94873c15da26Smrg    case $host_os in
94883c15da26Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
94893c15da26Smrg	*)		MISC_MAN_SUFFIX=7  ;;
94903c15da26Smrg    esac
94913c15da26Smrgfi
94923c15da26Smrgif test x$MISC_MAN_DIR = x    ; then
94933c15da26Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
94943c15da26Smrgfi
9495126a8a12Smrg
94963c15da26Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
94973c15da26Smrg    case $host_os in
94983c15da26Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
94993c15da26Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
95003c15da26Smrg    esac
95013c15da26Smrgfi
95023c15da26Smrgif test x$DRIVER_MAN_DIR = x    ; then
95033c15da26Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
95043c15da26Smrgfi
9505126a8a12Smrg
95063c15da26Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
95073c15da26Smrg    case $host_os in
95083c15da26Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
95093c15da26Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
95103c15da26Smrg    esac
95113c15da26Smrgfi
95123c15da26Smrgif test x$ADMIN_MAN_DIR = x    ; then
95133c15da26Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
95143c15da26Smrgfi
9515126a8a12Smrg
9516126a8a12Smrg
95173c15da26SmrgAC_SUBST([APP_MAN_SUFFIX])
95183c15da26SmrgAC_SUBST([LIB_MAN_SUFFIX])
95193c15da26SmrgAC_SUBST([FILE_MAN_SUFFIX])
95203c15da26SmrgAC_SUBST([MISC_MAN_SUFFIX])
95213c15da26SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
95223c15da26SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
95233c15da26SmrgAC_SUBST([APP_MAN_DIR])
95243c15da26SmrgAC_SUBST([LIB_MAN_DIR])
95253c15da26SmrgAC_SUBST([FILE_MAN_DIR])
95263c15da26SmrgAC_SUBST([MISC_MAN_DIR])
95273c15da26SmrgAC_SUBST([DRIVER_MAN_DIR])
95283c15da26SmrgAC_SUBST([ADMIN_MAN_DIR])
9529126a8a12Smrg
95303c15da26SmrgXORG_MAN_PAGE="X Version 11"
95313c15da26SmrgAC_SUBST([XORG_MAN_PAGE])
95323c15da26SmrgMAN_SUBSTS="\
95333c15da26Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95343c15da26Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
95353c15da26Smrg	-e 's|__xservername__|Xorg|g' \
95363c15da26Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
95373c15da26Smrg	-e 's|__projectroot__|\$(prefix)|g' \
95383c15da26Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
95393c15da26Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
95403c15da26Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
95413c15da26Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
95423c15da26Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
95433c15da26Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
95443c15da26Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
95453c15da26SmrgAC_SUBST([MAN_SUBSTS])
9546555991fdSmrg
95473c15da26Smrg]) # XORG_MANPAGE_SECTIONS
9548126a8a12Smrg
95493c15da26Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
95503c15da26Smrg# ------------------------
95513c15da26Smrg# Minimum version: 1.7.0
95523c15da26Smrg#
95533c15da26Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
95543c15da26Smrg# provided by xorg-sgml-doctools, if installed.
95553c15da26SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
95563c15da26SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
95573c15da26SmrgXORG_SGML_PATH=
95583c15da26SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
95593c15da26Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
95603c15da26Smrg    [m4_ifval([$1],[:],
95613c15da26Smrg        [if test x"$cross_compiling" != x"yes" ; then
95623c15da26Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
95633c15da26Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
95643c15da26Smrg         fi])
95653c15da26Smrg    ])
9566126a8a12Smrg
95673c15da26Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
95683c15da26Smrg# the path and the name of the doc stylesheet
95693c15da26Smrgif test "x$XORG_SGML_PATH" != "x" ; then
95703c15da26Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
95713c15da26Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
95723c15da26Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
95733c15da26Smrgelse
95743c15da26Smrg   AC_MSG_RESULT([no])
95753c15da26Smrgfi
9576126a8a12Smrg
95773c15da26SmrgAC_SUBST(XORG_SGML_PATH)
95783c15da26SmrgAC_SUBST(STYLESHEET_SRCDIR)
95793c15da26SmrgAC_SUBST(XSL_STYLESHEET)
95803c15da26SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
95813c15da26Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9582555991fdSmrg
95833c15da26Smrg# XORG_CHECK_LINUXDOC
95843c15da26Smrg# -------------------
95853c15da26Smrg# Minimum version: 1.0.0
95863c15da26Smrg#
95873c15da26Smrg# Defines the variable MAKE_TEXT if the necessary tools and
95883c15da26Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
95893c15da26Smrg# Whether or not the necessary tools and files are found can be checked
95903c15da26Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
95913c15da26SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
95923c15da26SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
95933c15da26SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9594126a8a12Smrg
95953c15da26SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9596126a8a12Smrg
95973c15da26SmrgAC_MSG_CHECKING([whether to build documentation])
9598126a8a12Smrg
95993c15da26Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
96003c15da26Smrg   BUILDDOC=yes
96013c15da26Smrgelse
96023c15da26Smrg   BUILDDOC=no
96033c15da26Smrgfi
9604126a8a12Smrg
96053c15da26SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9606126a8a12Smrg
96073c15da26SmrgAC_MSG_RESULT([$BUILDDOC])
9608d656433aSmrg
96093c15da26SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9610126a8a12Smrg
96113c15da26Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
96123c15da26Smrg   BUILDPDFDOC=yes
96133c15da26Smrgelse
96143c15da26Smrg   BUILDPDFDOC=no
96153c15da26Smrgfi
9616126a8a12Smrg
96173c15da26SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9618126a8a12Smrg
96193c15da26SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9620126a8a12Smrg
96213c15da26SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
96223c15da26SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
96233c15da26SmrgMAKE_PDF="$PS2PDF"
96243c15da26SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9625126a8a12Smrg
96263c15da26SmrgAC_SUBST(MAKE_TEXT)
96273c15da26SmrgAC_SUBST(MAKE_PS)
96283c15da26SmrgAC_SUBST(MAKE_PDF)
96293c15da26SmrgAC_SUBST(MAKE_HTML)
96303c15da26Smrg]) # XORG_CHECK_LINUXDOC
9631126a8a12Smrg
96323c15da26Smrg# XORG_CHECK_DOCBOOK
96333c15da26Smrg# -------------------
96343c15da26Smrg# Minimum version: 1.0.0
96353c15da26Smrg#
96363c15da26Smrg# Checks for the ability to build output formats from SGML DocBook source.
96373c15da26Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
96383c15da26Smrg# indicates whether the necessary tools and files are found and, if set,
96393c15da26Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
96403c15da26SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
96413c15da26SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9642126a8a12Smrg
96433c15da26SmrgBUILDTXTDOC=no
96443c15da26SmrgBUILDPDFDOC=no
96453c15da26SmrgBUILDPSDOC=no
96463c15da26SmrgBUILDHTMLDOC=no
9647126a8a12Smrg
96483c15da26SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
96493c15da26SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
96503c15da26SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
96513c15da26SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9652555991fdSmrg
96533c15da26SmrgAC_MSG_CHECKING([whether to build text documentation])
96543c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
96553c15da26Smrg   test x$BUILD_TXTDOC != xno; then
96563c15da26Smrg	BUILDTXTDOC=yes
96573c15da26Smrgfi
96583c15da26SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
96593c15da26SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9660555991fdSmrg
96613c15da26SmrgAC_MSG_CHECKING([whether to build PDF documentation])
96623c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
96633c15da26Smrg   test x$BUILD_PDFDOC != xno; then
96643c15da26Smrg	BUILDPDFDOC=yes
96653c15da26Smrgfi
96663c15da26SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
96673c15da26SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9668555991fdSmrg
96693c15da26SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
96703c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
96713c15da26Smrg   test x$BUILD_PSDOC != xno; then
96723c15da26Smrg	BUILDPSDOC=yes
96733c15da26Smrgfi
96743c15da26SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
96753c15da26SmrgAC_MSG_RESULT([$BUILDPSDOC])
9676126a8a12Smrg
96773c15da26SmrgAC_MSG_CHECKING([whether to build HTML documentation])
96783c15da26Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
96793c15da26Smrg   test x$BUILD_HTMLDOC != xno; then
96803c15da26Smrg	BUILDHTMLDOC=yes
96813c15da26Smrgfi
96823c15da26SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
96833c15da26SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9684126a8a12Smrg
96853c15da26SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
96863c15da26SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
96873c15da26SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
96883c15da26SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9689126a8a12Smrg
96903c15da26SmrgAC_SUBST(MAKE_TEXT)
96913c15da26SmrgAC_SUBST(MAKE_PS)
96923c15da26SmrgAC_SUBST(MAKE_PDF)
96933c15da26SmrgAC_SUBST(MAKE_HTML)
96943c15da26Smrg]) # XORG_CHECK_DOCBOOK
9695126a8a12Smrg
96963c15da26Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
96973c15da26Smrg# ----------------
96983c15da26Smrg# Minimum version: 1.5.0
96993c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
97003c15da26Smrg#
97013c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
97023c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
97033c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
97043c15da26Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
97053c15da26Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
97063c15da26Smrg# --with-xmlto assumes 'auto'.
97073c15da26Smrg#
97083c15da26Smrg# Interface to module:
97093c15da26Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
97103c15da26Smrg# XMLTO:	returns the path of the xmlto program found
97113c15da26Smrg#		returns the path set by the user in the environment
97123c15da26Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
97133c15da26Smrg#		'no' user instructs the module not to use xmlto
97143c15da26Smrg#
97153c15da26Smrg# Added in version 1.10.0
97163c15da26Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
97173c15da26Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
97183c15da26Smrg#
97193c15da26Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
97203c15da26Smrg#
97213c15da26SmrgAC_DEFUN([XORG_WITH_XMLTO],[
97223c15da26SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
97233c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
97243c15da26SmrgAC_ARG_WITH(xmlto,
97253c15da26Smrg	AS_HELP_STRING([--with-xmlto],
97263c15da26Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
97273c15da26Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
97283c15da26Smrgm4_undefine([_defopt])
9729555991fdSmrg
97303c15da26Smrgif test "x$use_xmlto" = x"auto"; then
97313c15da26Smrg   AC_PATH_PROG([XMLTO], [xmlto])
97323c15da26Smrg   if test "x$XMLTO" = "x"; then
97333c15da26Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
97343c15da26Smrg	have_xmlto=no
97353c15da26Smrg   else
97363c15da26Smrg        have_xmlto=yes
97373c15da26Smrg   fi
97383c15da26Smrgelif test "x$use_xmlto" = x"yes" ; then
97393c15da26Smrg   AC_PATH_PROG([XMLTO], [xmlto])
97403c15da26Smrg   if test "x$XMLTO" = "x"; then
97413c15da26Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
97423c15da26Smrg   fi
97433c15da26Smrg   have_xmlto=yes
97443c15da26Smrgelif test "x$use_xmlto" = x"no" ; then
97453c15da26Smrg   if test "x$XMLTO" != "x"; then
97463c15da26Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
97473c15da26Smrg   fi
97483c15da26Smrg   have_xmlto=no
97493c15da26Smrgelse
97503c15da26Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
97513c15da26Smrgfi
9752126a8a12Smrg
97533c15da26Smrg# Test for a minimum version of xmlto, if provided.
97543c15da26Smrgm4_ifval([$1],
97553c15da26Smrg[if test "$have_xmlto" = yes; then
97563c15da26Smrg    # scrape the xmlto version
97573c15da26Smrg    AC_MSG_CHECKING([the xmlto version])
97583c15da26Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
97593c15da26Smrg    AC_MSG_RESULT([$xmlto_version])
97603c15da26Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
97613c15da26Smrg        [if test "x$use_xmlto" = xauto; then
97623c15da26Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
97633c15da26Smrg            have_xmlto=no
97643c15da26Smrg        else
97653c15da26Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
97663c15da26Smrg        fi])
97673c15da26Smrgfi])
9768126a8a12Smrg
97693c15da26Smrg# Test for the ability of xmlto to generate a text target
9770300346aeSmrg#
9771300346aeSmrg# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the
9772300346aeSmrg# following test for empty XML docbook files.
9773300346aeSmrg# For compatibility reasons use the following empty XML docbook file and if
9774300346aeSmrg# it fails try it again with a non-empty XML file.
97753c15da26Smrghave_xmlto_text=no
97763c15da26Smrgcat > conftest.xml << "EOF"
97773c15da26SmrgEOF
97783c15da26SmrgAS_IF([test "$have_xmlto" = yes],
97793c15da26Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
97803c15da26Smrg             [have_xmlto_text=yes],
9781300346aeSmrg             [# Try it again with a non-empty XML file.
9782300346aeSmrg              cat > conftest.xml << "EOF"
9783300346aeSmrg<x></x>
9784300346aeSmrgEOF
9785300346aeSmrg              AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9786300346aeSmrg                    [have_xmlto_text=yes],
9787300346aeSmrg                    [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])])
97883c15da26Smrgrm -f conftest.xml
97893c15da26SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
97903c15da26SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
97913c15da26Smrg]) # XORG_WITH_XMLTO
9792126a8a12Smrg
97933c15da26Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
97943c15da26Smrg# --------------------------------------------
97953c15da26Smrg# Minimum version: 1.12.0
97963c15da26Smrg# Minimum version for optional DEFAULT argument: 1.12.0
97973c15da26Smrg#
97983c15da26Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
97993c15da26Smrg# XML-based language used for the transformation of XML documents.
98003c15da26Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
98013c15da26Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
98023c15da26Smrg# The XSLT processor is often used as a standalone tool for transformations.
98033c15da26Smrg# It should not be assumed that this tool is used only to work with documnetation.
98043c15da26Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
98053c15da26Smrg#
98063c15da26Smrg# Interface to module:
98073c15da26Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
98083c15da26Smrg# XSLTPROC:	 returns the path of the xsltproc program found
98093c15da26Smrg#		 returns the path set by the user in the environment
98103c15da26Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
98113c15da26Smrg#		  'no' user instructs the module not to use xsltproc
98123c15da26Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
98133c15da26Smrg#
98143c15da26Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
98153c15da26Smrg#
98163c15da26SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
98173c15da26SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
98183c15da26Smrg# Preserves the interface, should it be implemented later
98193c15da26Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
98203c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
98213c15da26SmrgAC_ARG_WITH(xsltproc,
98223c15da26Smrg	AS_HELP_STRING([--with-xsltproc],
98233c15da26Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
98243c15da26Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
98253c15da26Smrgm4_undefine([_defopt])
98263c15da26Smrg
98273c15da26Smrgif test "x$use_xsltproc" = x"auto"; then
98283c15da26Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98293c15da26Smrg   if test "x$XSLTPROC" = "x"; then
98303c15da26Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
98313c15da26Smrg	have_xsltproc=no
98323c15da26Smrg   else
98333c15da26Smrg        have_xsltproc=yes
98343c15da26Smrg   fi
98353c15da26Smrgelif test "x$use_xsltproc" = x"yes" ; then
98363c15da26Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
98373c15da26Smrg   if test "x$XSLTPROC" = "x"; then
98383c15da26Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
98393c15da26Smrg   fi
98403c15da26Smrg   have_xsltproc=yes
98413c15da26Smrgelif test "x$use_xsltproc" = x"no" ; then
98423c15da26Smrg   if test "x$XSLTPROC" != "x"; then
98433c15da26Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
98443c15da26Smrg   fi
98453c15da26Smrg   have_xsltproc=no
98463c15da26Smrgelse
98473c15da26Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
98483c15da26Smrgfi
9849126a8a12Smrg
98503c15da26SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
98513c15da26Smrg]) # XORG_WITH_XSLTPROC
9852126a8a12Smrg
98533c15da26Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
98543c15da26Smrg# ----------------------------------------
98553c15da26Smrg# Minimum version: 1.15.0
98563c15da26Smrg#
98573c15da26Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
98583c15da26Smrg# scanning arbitrary text files, extracting information from those text files,
98593c15da26Smrg# and printing reports based on that information.
98603c15da26Smrg#
98613c15da26Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
98623c15da26Smrg#
98633c15da26Smrg# Interface to module:
98643c15da26Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
98653c15da26Smrg# PERL:	     returns the path of the perl program found
98663c15da26Smrg#	     returns the path set by the user in the environment
98673c15da26Smrg# --with-perl: 'yes' user instructs the module to use perl
98683c15da26Smrg#	       'no' user instructs the module not to use perl
98693c15da26Smrg# have_perl: returns yes if perl found in PATH or no
98703c15da26Smrg#
98713c15da26Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
98723c15da26Smrg#
98733c15da26SmrgAC_DEFUN([XORG_WITH_PERL],[
98743c15da26SmrgAC_ARG_VAR([PERL], [Path to perl command])
98753c15da26Smrg# Preserves the interface, should it be implemented later
98763c15da26Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
98773c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
98783c15da26SmrgAC_ARG_WITH(perl,
98793c15da26Smrg	AS_HELP_STRING([--with-perl],
98803c15da26Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
98813c15da26Smrg	   [use_perl=$withval], [use_perl=]_defopt)
98823c15da26Smrgm4_undefine([_defopt])
98833c15da26Smrg
98843c15da26Smrgif test "x$use_perl" = x"auto"; then
98853c15da26Smrg   AC_PATH_PROG([PERL], [perl])
98863c15da26Smrg   if test "x$PERL" = "x"; then
98873c15da26Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
98883c15da26Smrg	have_perl=no
98893c15da26Smrg   else
98903c15da26Smrg        have_perl=yes
98913c15da26Smrg   fi
98923c15da26Smrgelif test "x$use_perl" = x"yes" ; then
98933c15da26Smrg   AC_PATH_PROG([PERL], [perl])
98943c15da26Smrg   if test "x$PERL" = "x"; then
98953c15da26Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
98963c15da26Smrg   fi
98973c15da26Smrg   have_perl=yes
98983c15da26Smrgelif test "x$use_perl" = x"no" ; then
98993c15da26Smrg   if test "x$PERL" != "x"; then
99003c15da26Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
99013c15da26Smrg   fi
99023c15da26Smrg   have_perl=no
99033c15da26Smrgelse
99043c15da26Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
99053c15da26Smrgfi
9906126a8a12Smrg
99073c15da26SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
99083c15da26Smrg]) # XORG_WITH_PERL
9909126a8a12Smrg
99103c15da26Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
99113c15da26Smrg# ----------------
99123c15da26Smrg# Minimum version: 1.5.0
99133c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
99143c15da26Smrg#
99153c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
99163c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
99173c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
99183c15da26Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
99193c15da26Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
99203c15da26Smrg# --with-asciidoc assumes 'auto'.
99213c15da26Smrg#
99223c15da26Smrg# Interface to module:
99233c15da26Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
99243c15da26Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
99253c15da26Smrg#		 returns the path set by the user in the environment
99263c15da26Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
99273c15da26Smrg#		  'no' user instructs the module not to use asciidoc
99283c15da26Smrg#
99293c15da26Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
99303c15da26Smrg#
99313c15da26SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
99323c15da26SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
99333c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
99343c15da26SmrgAC_ARG_WITH(asciidoc,
99353c15da26Smrg	AS_HELP_STRING([--with-asciidoc],
99363c15da26Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
99373c15da26Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
99383c15da26Smrgm4_undefine([_defopt])
9939126a8a12Smrg
99403c15da26Smrgif test "x$use_asciidoc" = x"auto"; then
99413c15da26Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99423c15da26Smrg   if test "x$ASCIIDOC" = "x"; then
99433c15da26Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
99443c15da26Smrg	have_asciidoc=no
99453c15da26Smrg   else
99463c15da26Smrg        have_asciidoc=yes
99473c15da26Smrg   fi
99483c15da26Smrgelif test "x$use_asciidoc" = x"yes" ; then
99493c15da26Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
99503c15da26Smrg   if test "x$ASCIIDOC" = "x"; then
99513c15da26Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
99523c15da26Smrg   fi
99533c15da26Smrg   have_asciidoc=yes
99543c15da26Smrgelif test "x$use_asciidoc" = x"no" ; then
99553c15da26Smrg   if test "x$ASCIIDOC" != "x"; then
99563c15da26Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
99573c15da26Smrg   fi
99583c15da26Smrg   have_asciidoc=no
99593c15da26Smrgelse
99603c15da26Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
99613c15da26Smrgfi
99623c15da26Smrgm4_ifval([$1],
99633c15da26Smrg[if test "$have_asciidoc" = yes; then
99643c15da26Smrg    # scrape the asciidoc version
99653c15da26Smrg    AC_MSG_CHECKING([the asciidoc version])
99663c15da26Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
99673c15da26Smrg    AC_MSG_RESULT([$asciidoc_version])
99683c15da26Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
99693c15da26Smrg        [if test "x$use_asciidoc" = xauto; then
99703c15da26Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
99713c15da26Smrg            have_asciidoc=no
99723c15da26Smrg        else
99733c15da26Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
99743c15da26Smrg        fi])
99753c15da26Smrgfi])
99763c15da26SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
99773c15da26Smrg]) # XORG_WITH_ASCIIDOC
9978126a8a12Smrg
99793c15da26Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9980300346aeSmrg# -------------------------------------------
99813c15da26Smrg# Minimum version: 1.5.0
99823c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9983300346aeSmrg# Minimum version for optional DOT checking: 1.18.0
99843c15da26Smrg#
99853c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
99863c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
99873c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
99883c15da26Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
99893c15da26Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
99903c15da26Smrg# --with-doxygen assumes 'auto'.
99913c15da26Smrg#
99923c15da26Smrg# Interface to module:
99933c15da26Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
99943c15da26Smrg# DOXYGEN:	 returns the path of the doxygen program found
99953c15da26Smrg#		 returns the path set by the user in the environment
99963c15da26Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
99973c15da26Smrg#		  'no' user instructs the module not to use doxygen
99983c15da26Smrg#
99993c15da26Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
100003c15da26Smrg#
100013c15da26SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
100023c15da26SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10003300346aeSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
100043c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
100053c15da26SmrgAC_ARG_WITH(doxygen,
100063c15da26Smrg	AS_HELP_STRING([--with-doxygen],
100073c15da26Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
100083c15da26Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
100093c15da26Smrgm4_undefine([_defopt])
10010126a8a12Smrg
100113c15da26Smrgif test "x$use_doxygen" = x"auto"; then
100123c15da26Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
100133c15da26Smrg   if test "x$DOXYGEN" = "x"; then
100143c15da26Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
100153c15da26Smrg	have_doxygen=no
100163c15da26Smrg   else
100173c15da26Smrg        have_doxygen=yes
100183c15da26Smrg   fi
100193c15da26Smrgelif test "x$use_doxygen" = x"yes" ; then
100203c15da26Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
100213c15da26Smrg   if test "x$DOXYGEN" = "x"; then
100223c15da26Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
100233c15da26Smrg   fi
100243c15da26Smrg   have_doxygen=yes
100253c15da26Smrgelif test "x$use_doxygen" = x"no" ; then
100263c15da26Smrg   if test "x$DOXYGEN" != "x"; then
100273c15da26Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
100283c15da26Smrg   fi
100293c15da26Smrg   have_doxygen=no
100303c15da26Smrgelse
100313c15da26Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
100323c15da26Smrgfi
100333c15da26Smrgm4_ifval([$1],
100343c15da26Smrg[if test "$have_doxygen" = yes; then
100353c15da26Smrg    # scrape the doxygen version
100363c15da26Smrg    AC_MSG_CHECKING([the doxygen version])
100373c15da26Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
100383c15da26Smrg    AC_MSG_RESULT([$doxygen_version])
100393c15da26Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
100403c15da26Smrg        [if test "x$use_doxygen" = xauto; then
100413c15da26Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
100423c15da26Smrg            have_doxygen=no
100433c15da26Smrg        else
100443c15da26Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
100453c15da26Smrg        fi])
100463c15da26Smrgfi])
10047300346aeSmrg
10048300346aeSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10049300346aeSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10050300346aeSmrgdnl 	HAVE_DOT = @HAVE_DOT@
10051300346aeSmrgHAVE_DOT=no
10052300346aeSmrgif test "x$have_doxygen" = "xyes"; then
10053300346aeSmrg  AC_PATH_PROG([DOT], [dot])
10054300346aeSmrg    if test "x$DOT" != "x"; then
10055300346aeSmrg      HAVE_DOT=yes
10056300346aeSmrg    fi
10057300346aeSmrgfi
10058300346aeSmrg
10059300346aeSmrgAC_SUBST([HAVE_DOT])
10060300346aeSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
100613c15da26SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
100623c15da26Smrg]) # XORG_WITH_DOXYGEN
10063126a8a12Smrg
100643c15da26Smrg# XORG_WITH_GROFF([DEFAULT])
100653c15da26Smrg# ----------------
100663c15da26Smrg# Minimum version: 1.6.0
100673c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
100683c15da26Smrg#
100693c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
100703c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
100713c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
100723c15da26Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
100733c15da26Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
100743c15da26Smrg# --with-groff assumes 'auto'.
100753c15da26Smrg#
100763c15da26Smrg# Interface to module:
100773c15da26Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
100783c15da26Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
100793c15da26Smrg# HAVE_GROFF_MS: the -ms macros package
100803c15da26Smrg# GROFF:	 returns the path of the groff program found
100813c15da26Smrg#		 returns the path set by the user in the environment
100823c15da26Smrg# --with-groff:	 'yes' user instructs the module to use groff
100833c15da26Smrg#		 'no' user instructs the module not to use groff
100843c15da26Smrg#
100853c15da26Smrg# Added in version 1.9.0:
100863c15da26Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
100873c15da26Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
100883c15da26Smrg#		   psselect from the psutils package.
100893c15da26Smrg#		   the ghostcript package. Refer to the grohtml man pages
100903c15da26Smrg#
100913c15da26Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
100923c15da26Smrg#
100933c15da26Smrg# OS and distros often splits groff in a basic and full package, the former
100943c15da26Smrg# having the groff program and the later having devices, fonts and macros
100953c15da26Smrg# Checking for the groff executable is not enough.
100963c15da26Smrg#
100973c15da26Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
100983c15da26Smrg# unset HAVE_GROFF or GROFF env variables.
100993c15da26Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
101003c15da26Smrg#
101013c15da26SmrgAC_DEFUN([XORG_WITH_GROFF],[
101023c15da26SmrgAC_ARG_VAR([GROFF], [Path to groff command])
101033c15da26Smrgm4_define([_defopt], m4_default([$1], [auto]))
101043c15da26SmrgAC_ARG_WITH(groff,
101053c15da26Smrg	AS_HELP_STRING([--with-groff],
101063c15da26Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
101073c15da26Smrg	   [use_groff=$withval], [use_groff=]_defopt)
101083c15da26Smrgm4_undefine([_defopt])
10109126a8a12Smrg
101103c15da26Smrgif test "x$use_groff" = x"auto"; then
101113c15da26Smrg   AC_PATH_PROG([GROFF], [groff])
101123c15da26Smrg   if test "x$GROFF" = "x"; then
101133c15da26Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
101143c15da26Smrg	have_groff=no
101153c15da26Smrg   else
101163c15da26Smrg        have_groff=yes
101173c15da26Smrg   fi
101183c15da26Smrgelif test "x$use_groff" = x"yes" ; then
101193c15da26Smrg   AC_PATH_PROG([GROFF], [groff])
101203c15da26Smrg   if test "x$GROFF" = "x"; then
101213c15da26Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
101223c15da26Smrg   fi
101233c15da26Smrg   have_groff=yes
101243c15da26Smrgelif test "x$use_groff" = x"no" ; then
101253c15da26Smrg   if test "x$GROFF" != "x"; then
101263c15da26Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
101273c15da26Smrg   fi
101283c15da26Smrg   have_groff=no
101293c15da26Smrgelse
101303c15da26Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
101313c15da26Smrgfi
10132555991fdSmrg
101333c15da26Smrg# We have groff, test for the presence of the macro packages
101343c15da26Smrgif test "x$have_groff" = x"yes"; then
101353c15da26Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
101363c15da26Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
101373c15da26Smrg        groff_ms_works=yes
101383c15da26Smrg    else
101393c15da26Smrg        groff_ms_works=no
101403c15da26Smrg    fi
101413c15da26Smrg    AC_MSG_RESULT([$groff_ms_works])
101423c15da26Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
101433c15da26Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
101443c15da26Smrg        groff_mm_works=yes
101453c15da26Smrg    else
101463c15da26Smrg        groff_mm_works=no
101473c15da26Smrg    fi
101483c15da26Smrg    AC_MSG_RESULT([$groff_mm_works])
101493c15da26Smrgfi
10150555991fdSmrg
101513c15da26Smrg# We have groff, test for HTML dependencies, one command per package
101523c15da26Smrgif test "x$have_groff" = x"yes"; then
101533c15da26Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
101543c15da26Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
101553c15da26Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
101563c15da26Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
101573c15da26Smrg      have_groff_html=yes
101583c15da26Smrg   else
101593c15da26Smrg      have_groff_html=no
101603c15da26Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
101613c15da26Smrg   fi
101623c15da26Smrgfi
10163555991fdSmrg
101643c15da26Smrg# Set Automake conditionals for Makefiles
101653c15da26SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
101663c15da26SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
101673c15da26SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
101683c15da26SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
101693c15da26Smrg]) # XORG_WITH_GROFF
10170555991fdSmrg
101713c15da26Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
101723c15da26Smrg# ---------------------------------------
101733c15da26Smrg# Minimum version: 1.6.0
101743c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
101753c15da26Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
101763c15da26Smrg#
101773c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
101783c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
101793c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
101803c15da26Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
101813c15da26Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
101823c15da26Smrg# --with-fop assumes 'auto'.
101833c15da26Smrg#
101843c15da26Smrg# Interface to module:
101853c15da26Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
101863c15da26Smrg# FOP:	 	returns the path of the fop program found
101873c15da26Smrg#		returns the path set by the user in the environment
101883c15da26Smrg# --with-fop: 	'yes' user instructs the module to use fop
101893c15da26Smrg#		'no' user instructs the module not to use fop
101903c15da26Smrg#
101913c15da26Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
101923c15da26Smrg#
101933c15da26SmrgAC_DEFUN([XORG_WITH_FOP],[
101943c15da26SmrgAC_ARG_VAR([FOP], [Path to fop command])
101953c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
101963c15da26SmrgAC_ARG_WITH(fop,
101973c15da26Smrg	AS_HELP_STRING([--with-fop],
101983c15da26Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
101993c15da26Smrg	   [use_fop=$withval], [use_fop=]_defopt)
102003c15da26Smrgm4_undefine([_defopt])
10201126a8a12Smrg
102023c15da26Smrgif test "x$use_fop" = x"auto"; then
102033c15da26Smrg   AC_PATH_PROG([FOP], [fop])
102043c15da26Smrg   if test "x$FOP" = "x"; then
102053c15da26Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
102063c15da26Smrg	have_fop=no
102073c15da26Smrg   else
102083c15da26Smrg        have_fop=yes
102093c15da26Smrg   fi
102103c15da26Smrgelif test "x$use_fop" = x"yes" ; then
102113c15da26Smrg   AC_PATH_PROG([FOP], [fop])
102123c15da26Smrg   if test "x$FOP" = "x"; then
102133c15da26Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
102143c15da26Smrg   fi
102153c15da26Smrg   have_fop=yes
102163c15da26Smrgelif test "x$use_fop" = x"no" ; then
102173c15da26Smrg   if test "x$FOP" != "x"; then
102183c15da26Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
102193c15da26Smrg   fi
102203c15da26Smrg   have_fop=no
102213c15da26Smrgelse
102223c15da26Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
102233c15da26Smrgfi
10224d656433aSmrg
102253c15da26Smrg# Test for a minimum version of fop, if provided.
102263c15da26Smrgm4_ifval([$1],
102273c15da26Smrg[if test "$have_fop" = yes; then
102283c15da26Smrg    # scrape the fop version
102293c15da26Smrg    AC_MSG_CHECKING([for fop minimum version])
102303c15da26Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
102313c15da26Smrg    AC_MSG_RESULT([$fop_version])
102323c15da26Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
102333c15da26Smrg        [if test "x$use_fop" = xauto; then
102343c15da26Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
102353c15da26Smrg            have_fop=no
102363c15da26Smrg        else
102373c15da26Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
102383c15da26Smrg        fi])
102393c15da26Smrgfi])
102403c15da26SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
102413c15da26Smrg]) # XORG_WITH_FOP
10242126a8a12Smrg
10243300346aeSmrg# XORG_WITH_M4([MIN-VERSION])
10244300346aeSmrg# ---------------------------
10245300346aeSmrg# Minimum version: 1.19.0
10246300346aeSmrg#
10247300346aeSmrg# This macro attempts to locate an m4 macro processor which supports
10248300346aeSmrg# -I option and is only useful for modules relying on M4 in order to
10249300346aeSmrg# expand macros in source code files.
10250300346aeSmrg#
10251300346aeSmrg# Interface to module:
10252300346aeSmrg# M4:	 	returns the path of the m4 program found
10253300346aeSmrg#		returns the path set by the user in the environment
10254300346aeSmrg#
10255300346aeSmrgAC_DEFUN([XORG_WITH_M4], [
10256300346aeSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10257300346aeSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10258300346aeSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10259300346aeSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10260300346aeSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10261300346aeSmrg   [$PATH:/usr/gnu/bin])])
10262300346aeSmrg
10263300346aeSmrgAC_SUBST([M4], [$ac_cv_path_M4])
10264300346aeSmrg]) # XORG_WITH_M4
10265300346aeSmrg
102663c15da26Smrg# XORG_WITH_PS2PDF([DEFAULT])
102673c15da26Smrg# ----------------
102683c15da26Smrg# Minimum version: 1.6.0
102693c15da26Smrg# Minimum version for optional DEFAULT argument: 1.11.0
102703c15da26Smrg#
102713c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
102723c15da26Smrg# not at the appropriate level. This macro enables a module to test for the
102733c15da26Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
102743c15da26Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
102753c15da26Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
102763c15da26Smrg# --with-ps2pdf assumes 'auto'.
102773c15da26Smrg#
102783c15da26Smrg# Interface to module:
102793c15da26Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
102803c15da26Smrg# PS2PDF:	returns the path of the ps2pdf program found
102813c15da26Smrg#		returns the path set by the user in the environment
102823c15da26Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
102833c15da26Smrg#		 'no' user instructs the module not to use ps2pdf
102843c15da26Smrg#
102853c15da26Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
102863c15da26Smrg#
102873c15da26SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
102883c15da26SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
102893c15da26Smrgm4_define([_defopt], m4_default([$1], [auto]))
102903c15da26SmrgAC_ARG_WITH(ps2pdf,
102913c15da26Smrg	AS_HELP_STRING([--with-ps2pdf],
102923c15da26Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
102933c15da26Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
102943c15da26Smrgm4_undefine([_defopt])
10295126a8a12Smrg
102963c15da26Smrgif test "x$use_ps2pdf" = x"auto"; then
102973c15da26Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
102983c15da26Smrg   if test "x$PS2PDF" = "x"; then
102993c15da26Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
103003c15da26Smrg	have_ps2pdf=no
103013c15da26Smrg   else
103023c15da26Smrg        have_ps2pdf=yes
103033c15da26Smrg   fi
103043c15da26Smrgelif test "x$use_ps2pdf" = x"yes" ; then
103053c15da26Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
103063c15da26Smrg   if test "x$PS2PDF" = "x"; then
103073c15da26Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
103083c15da26Smrg   fi
103093c15da26Smrg   have_ps2pdf=yes
103103c15da26Smrgelif test "x$use_ps2pdf" = x"no" ; then
103113c15da26Smrg   if test "x$PS2PDF" != "x"; then
103123c15da26Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
103133c15da26Smrg   fi
103143c15da26Smrg   have_ps2pdf=no
103153c15da26Smrgelse
103163c15da26Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
103173c15da26Smrgfi
103183c15da26SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
103193c15da26Smrg]) # XORG_WITH_PS2PDF
10320126a8a12Smrg
103213c15da26Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
103223c15da26Smrg# ----------------
103233c15da26Smrg# Minimum version: 1.6.0
103243c15da26Smrg#
103253c15da26Smrg# Documentation tools are not always available on all platforms and sometimes
103263c15da26Smrg# not at the appropriate level. This macro enables a builder to skip all
103273c15da26Smrg# documentation targets except traditional man pages.
103283c15da26Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103293c15da26Smrg# maximum flexibilty in controlling documentation building.
103303c15da26Smrg# Refer to:
103313c15da26Smrg# XORG_WITH_XMLTO         --with-xmlto
103323c15da26Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103333c15da26Smrg# XORG_WITH_DOXYGEN       --with-doxygen
103343c15da26Smrg# XORG_WITH_FOP           --with-fop
103353c15da26Smrg# XORG_WITH_GROFF         --with-groff
103363c15da26Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
103373c15da26Smrg#
103383c15da26Smrg# Interface to module:
103393c15da26Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
103403c15da26Smrg# --enable-docs: 'yes' user instructs the module to generate docs
103413c15da26Smrg#		 'no' user instructs the module not to generate docs
103423c15da26Smrg# parm1:	specify the default value, yes or no.
103433c15da26Smrg#
103443c15da26SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
103453c15da26Smrgm4_define([docs_default], m4_default([$1], [yes]))
103463c15da26SmrgAC_ARG_ENABLE(docs,
103473c15da26Smrg	AS_HELP_STRING([--enable-docs],
103483c15da26Smrg	   [Enable building the documentation (default: ]docs_default[)]),
103493c15da26Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
103503c15da26Smrgm4_undefine([docs_default])
103513c15da26SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
103523c15da26SmrgAC_MSG_CHECKING([whether to build documentation])
103533c15da26SmrgAC_MSG_RESULT([$build_docs])
103543c15da26Smrg]) # XORG_ENABLE_DOCS
10355126a8a12Smrg
103563c15da26Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
103573c15da26Smrg# ----------------
103583c15da26Smrg# Minimum version: 1.6.0
103593c15da26Smrg#
103603c15da26Smrg# This macro enables a builder to skip all developer documentation.
103613c15da26Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103623c15da26Smrg# maximum flexibilty in controlling documentation building.
103633c15da26Smrg# Refer to:
103643c15da26Smrg# XORG_WITH_XMLTO         --with-xmlto
103653c15da26Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103663c15da26Smrg# XORG_WITH_DOXYGEN       --with-doxygen
103673c15da26Smrg# XORG_WITH_FOP           --with-fop
103683c15da26Smrg# XORG_WITH_GROFF         --with-groff
103693c15da26Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
103703c15da26Smrg#
103713c15da26Smrg# Interface to module:
103723c15da26Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
103733c15da26Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
103743c15da26Smrg#			'no' user instructs the module not to generate developer docs
103753c15da26Smrg# parm1:		specify the default value, yes or no.
103763c15da26Smrg#
103773c15da26SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
103783c15da26Smrgm4_define([devel_default], m4_default([$1], [yes]))
103793c15da26SmrgAC_ARG_ENABLE(devel-docs,
103803c15da26Smrg	AS_HELP_STRING([--enable-devel-docs],
103813c15da26Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
103823c15da26Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
103833c15da26Smrgm4_undefine([devel_default])
103843c15da26SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
103853c15da26SmrgAC_MSG_CHECKING([whether to build developer documentation])
103863c15da26SmrgAC_MSG_RESULT([$build_devel_docs])
103873c15da26Smrg]) # XORG_ENABLE_DEVEL_DOCS
10388126a8a12Smrg
103893c15da26Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
103903c15da26Smrg# ----------------
103913c15da26Smrg# Minimum version: 1.6.0
103923c15da26Smrg#
103933c15da26Smrg# This macro enables a builder to skip all functional specification targets.
103943c15da26Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
103953c15da26Smrg# maximum flexibilty in controlling documentation building.
103963c15da26Smrg# Refer to:
103973c15da26Smrg# XORG_WITH_XMLTO         --with-xmlto
103983c15da26Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
103993c15da26Smrg# XORG_WITH_DOXYGEN       --with-doxygen
104003c15da26Smrg# XORG_WITH_FOP           --with-fop
104013c15da26Smrg# XORG_WITH_GROFF         --with-groff
104023c15da26Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
104033c15da26Smrg#
104043c15da26Smrg# Interface to module:
104053c15da26Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
104063c15da26Smrg# --enable-specs:	'yes' user instructs the module to generate specs
104073c15da26Smrg#			'no' user instructs the module not to generate specs
104083c15da26Smrg# parm1:		specify the default value, yes or no.
104093c15da26Smrg#
104103c15da26SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
104113c15da26Smrgm4_define([spec_default], m4_default([$1], [yes]))
104123c15da26SmrgAC_ARG_ENABLE(specs,
104133c15da26Smrg	AS_HELP_STRING([--enable-specs],
104143c15da26Smrg	   [Enable building the specs (default: ]spec_default[)]),
104153c15da26Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
104163c15da26Smrgm4_undefine([spec_default])
104173c15da26SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
104183c15da26SmrgAC_MSG_CHECKING([whether to build functional specifications])
104193c15da26SmrgAC_MSG_RESULT([$build_specs])
104203c15da26Smrg]) # XORG_ENABLE_SPECS
10421126a8a12Smrg
104223c15da26Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
104233c15da26Smrg# ----------------------------------------------
104243c15da26Smrg# Minimum version: 1.13.0
104253c15da26Smrg#
104263c15da26Smrg# This macro enables a builder to enable/disable unit testing
104273c15da26Smrg# It makes no assumption about the test cases implementation
104283c15da26Smrg# Test cases may or may not use Automake "Support for test suites"
104293c15da26Smrg# They may or may not use the software utility library GLib
104303c15da26Smrg#
104313c15da26Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
104323c15da26Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
104333c15da26Smrg# The variable enable_unit_tests is used by other macros in this file.
104343c15da26Smrg#
104353c15da26Smrg# Interface to module:
104363c15da26Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
104373c15da26Smrg# enable_unit_tests:    used in configure.ac for additional configuration
104383c15da26Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
104393c15da26Smrg#			'no' user instructs the module not to build tests
104403c15da26Smrg# parm1:		specify the default value, yes or no.
104413c15da26Smrg#
104423c15da26SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
104433c15da26SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
104443c15da26SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
104453c15da26SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
104463c15da26Smrgm4_define([_defopt], m4_default([$1], [auto]))
104473c15da26SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
104483c15da26Smrg	[Enable building unit test cases (default: ]_defopt[)]),
104493c15da26Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
104503c15da26Smrgm4_undefine([_defopt])
104513c15da26SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
104523c15da26SmrgAC_MSG_CHECKING([whether to build unit test cases])
104533c15da26SmrgAC_MSG_RESULT([$enable_unit_tests])
104543c15da26Smrg]) # XORG_ENABLE_UNIT_TESTS
104553c15da26Smrg
104560a6b08f8Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
104570a6b08f8Smrg# ------------------------------------------------------
104580a6b08f8Smrg# Minimum version: 1.17.0
104590a6b08f8Smrg#
104600a6b08f8Smrg# This macro enables a builder to enable/disable integration testing
104610a6b08f8Smrg# It makes no assumption about the test cases' implementation
104620a6b08f8Smrg# Test cases may or may not use Automake "Support for test suites"
104630a6b08f8Smrg#
104640a6b08f8Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
104650a6b08f8Smrg# usually requires less dependencies and may be built and run under less
104660a6b08f8Smrg# stringent environments than integration tests.
104670a6b08f8Smrg#
104680a6b08f8Smrg# Interface to module:
104690a6b08f8Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
104700a6b08f8Smrg# enable_integration_tests:   used in configure.ac for additional configuration
104710a6b08f8Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
104720a6b08f8Smrg#                             'no' user instructs the module not to build tests
104730a6b08f8Smrg# parm1:                      specify the default value, yes or no.
104740a6b08f8Smrg#
104750a6b08f8SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
104760a6b08f8SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
104770a6b08f8Smrgm4_define([_defopt], m4_default([$1], [auto]))
104780a6b08f8SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
104790a6b08f8Smrg	[Enable building integration test cases (default: ]_defopt[)]),
104800a6b08f8Smrg	[enable_integration_tests=$enableval],
104810a6b08f8Smrg	[enable_integration_tests=]_defopt)
104820a6b08f8Smrgm4_undefine([_defopt])
104830a6b08f8SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
104840a6b08f8Smrg	[test "x$enable_integration_tests" != xno])
104850a6b08f8SmrgAC_MSG_CHECKING([whether to build unit test cases])
104860a6b08f8SmrgAC_MSG_RESULT([$enable_integration_tests])
104870a6b08f8Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
104880a6b08f8Smrg
104893c15da26Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
104903c15da26Smrg# ----------------------------------------
104913c15da26Smrg# Minimum version: 1.13.0
104923c15da26Smrg#
104933c15da26Smrg# GLib is a library which provides advanced data structures and functions.
104943c15da26Smrg# This macro enables a module to test for the presence of Glib.
104953c15da26Smrg#
104963c15da26Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
104973c15da26Smrg# Otherwise the value of $enable_unit_tests is blank.
104983c15da26Smrg#
104990a6b08f8Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
105000a6b08f8Smrg# test support usually requires less dependencies and may be built and run under
105010a6b08f8Smrg# less stringent environments than integration tests.
105020a6b08f8Smrg#
105033c15da26Smrg# Interface to module:
105043c15da26Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
105053c15da26Smrg# with_glib: used in configure.ac to know if GLib has been found
105063c15da26Smrg# --with-glib:	'yes' user instructs the module to use glib
105073c15da26Smrg#		'no' user instructs the module not to use glib
105083c15da26Smrg#
105093c15da26SmrgAC_DEFUN([XORG_WITH_GLIB],[
105103c15da26SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
105113c15da26Smrgm4_define([_defopt], m4_default([$2], [auto]))
105123c15da26SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
105133c15da26Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
105143c15da26Smrg	[with_glib=$withval], [with_glib=]_defopt)
105153c15da26Smrgm4_undefine([_defopt])
105163c15da26Smrg
105173c15da26Smrghave_glib=no
105183c15da26Smrg# Do not probe GLib if user explicitly disabled unit testing
105193c15da26Smrgif test "x$enable_unit_tests" != x"no"; then
105203c15da26Smrg  # Do not probe GLib if user explicitly disabled it
105213c15da26Smrg  if test "x$with_glib" != x"no"; then
105223c15da26Smrg    m4_ifval(
105233c15da26Smrg      [$1],
105243c15da26Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
105253c15da26Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
105263c15da26Smrg    )
105273c15da26Smrg  fi
105283c15da26Smrgfi
10529126a8a12Smrg
105303c15da26Smrg# Not having GLib when unit testing has been explicitly requested is an error
105313c15da26Smrgif test "x$enable_unit_tests" = x"yes"; then
105323c15da26Smrg  if test "x$have_glib" = x"no"; then
105333c15da26Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105343c15da26Smrg  fi
105353c15da26Smrgfi
10536126a8a12Smrg
105373c15da26Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
105383c15da26Smrgif test "x$enable_unit_tests" = x"no"; then
105393c15da26Smrg  if test "x$with_glib" = x"yes"; then
105403c15da26Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
105413c15da26Smrg  fi
105423c15da26Smrgfi
10543126a8a12Smrg
105443c15da26Smrg# Not having GLib when it has been explicitly requested is an error
105453c15da26Smrgif test "x$with_glib" = x"yes"; then
105463c15da26Smrg  if test "x$have_glib" = x"no"; then
105473c15da26Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
105483c15da26Smrg  fi
105493c15da26Smrgfi
10550126a8a12Smrg
105513c15da26SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
105523c15da26Smrg]) # XORG_WITH_GLIB
10553126a8a12Smrg
105543c15da26Smrg# XORG_LD_WRAP([required|optional])
105553c15da26Smrg# ---------------------------------
105563c15da26Smrg# Minimum version: 1.13.0
105573c15da26Smrg#
105583c15da26Smrg# Check if linker supports -wrap, passed via compiler flags
105593c15da26Smrg#
105603c15da26Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
105613c15da26Smrg# Otherwise the value of $enable_unit_tests is blank.
105623c15da26Smrg#
105633c15da26Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
105643c15da26Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
105653c15da26Smrg# available, an argument of "optional" allows use when some unit tests require
105663c15da26Smrg# ld -wrap and others do not.
105673c15da26Smrg#
105683c15da26SmrgAC_DEFUN([XORG_LD_WRAP],[
105693c15da26SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
105703c15da26Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
105713c15da26Smrg                      void __wrap_exit(int status) { return; }],
105723c15da26Smrg                     [exit(0);])])
105733c15da26Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
105743c15da26Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
105753c15da26Smrg  if test "x$have_ld_wrap" = x"no"; then
105763c15da26Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
105773c15da26Smrg  fi
105783c15da26Smrgfi
105793c15da26SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
105803c15da26Smrg#
105813c15da26Smrg]) # XORG_LD_WRAP
10582126a8a12Smrg
105833c15da26Smrg# XORG_CHECK_LINKER_FLAGS
105843c15da26Smrg# -----------------------
105853c15da26Smrg# SYNOPSIS
105863c15da26Smrg#
105873c15da26Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
105883c15da26Smrg#
105893c15da26Smrg# DESCRIPTION
105903c15da26Smrg#
105913c15da26Smrg#   Check whether the given linker FLAGS work with the current language's
105923c15da26Smrg#   linker, or whether they give an error.
105933c15da26Smrg#
105943c15da26Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
105953c15da26Smrg#   success/failure.
105963c15da26Smrg#
105973c15da26Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
105983c15da26Smrg#
105993c15da26Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
106003c15da26Smrg#
106013c15da26Smrg# LICENSE
106023c15da26Smrg#
106033c15da26Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
106043c15da26Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
106053c15da26Smrg#   Copyright (c) 2009 Matteo Frigo
106063c15da26Smrg#
106073c15da26Smrg#   This program is free software: you can redistribute it and/or modify it
106083c15da26Smrg#   under the terms of the GNU General Public License as published by the
106093c15da26Smrg#   Free Software Foundation, either version 3 of the License, or (at your
106103c15da26Smrg#   option) any later version.
106113c15da26Smrg#
106123c15da26Smrg#   This program is distributed in the hope that it will be useful, but
106133c15da26Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
106143c15da26Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
106153c15da26Smrg#   Public License for more details.
106163c15da26Smrg#
106173c15da26Smrg#   You should have received a copy of the GNU General Public License along
106183c15da26Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
106193c15da26Smrg#
106203c15da26Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
106213c15da26Smrg#   gives unlimited permission to copy, distribute and modify the configure
106223c15da26Smrg#   scripts that are the output of Autoconf when processing the Macro. You
106233c15da26Smrg#   need not follow the terms of the GNU General Public License when using
106243c15da26Smrg#   or distributing such scripts, even though portions of the text of the
106253c15da26Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
106263c15da26Smrg#   all other use of the material that constitutes the Autoconf Macro.
106273c15da26Smrg#
106283c15da26Smrg#   This special exception to the GPL applies to versions of the Autoconf
106293c15da26Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
106303c15da26Smrg#   modified version of the Autoconf Macro, you may extend this special
106313c15da26Smrg#   exception to the GPL to apply to your modified version as well.#
106323c15da26SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
106333c15da26Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
106343c15da26Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
106353c15da26SmrgAS_LITERAL_IF([$1],
106363c15da26Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
106373c15da26Smrg      ax_save_FLAGS=$LDFLAGS
106383c15da26Smrg      LDFLAGS="$1"
106393c15da26Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
106403c15da26Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106413c15da26Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106423c15da26Smrg      LDFLAGS=$ax_save_FLAGS])],
106433c15da26Smrg  [ax_save_FLAGS=$LDFLAGS
106443c15da26Smrg   LDFLAGS="$1"
106453c15da26Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
106463c15da26Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
106473c15da26Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
106483c15da26Smrg   LDFLAGS=$ax_save_FLAGS])
106493c15da26Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
106503c15da26SmrgAC_MSG_RESULT($xorg_check_linker_flags)
106513c15da26Smrgif test "x$xorg_check_linker_flags" = xyes; then
106523c15da26Smrg	m4_default([$2], :)
106533c15da26Smrgelse
106543c15da26Smrg	m4_default([$3], :)
106553c15da26Smrgfi
106563c15da26Smrg]) # XORG_CHECK_LINKER_FLAGS
10657126a8a12Smrg
106583c15da26Smrg# XORG_MEMORY_CHECK_FLAGS
106593c15da26Smrg# -----------------------
106603c15da26Smrg# Minimum version: 1.16.0
106613c15da26Smrg#
106623c15da26Smrg# This macro attempts to find appropriate memory checking functionality
106633c15da26Smrg# for various platforms which unit testing code may use to catch various
106643c15da26Smrg# forms of memory allocation and access errors in testing.
106653c15da26Smrg#
106663c15da26Smrg# Interface to module:
106673c15da26Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
106683c15da26Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
106693c15da26Smrg#
106703c15da26Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
106713c15da26Smrg#
106723c15da26SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10673126a8a12Smrg
106743c15da26SmrgAC_REQUIRE([AC_CANONICAL_HOST])
106753c15da26SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
106763c15da26Smrg           [Environment variables to enable memory checking in tests])
10677126a8a12Smrg
106783c15da26Smrg# Check for different types of support on different platforms
106793c15da26Smrgcase $host_os in
106803c15da26Smrg    solaris*)
106813c15da26Smrg        AC_CHECK_LIB([umem], [umem_alloc],
106823c15da26Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
106833c15da26Smrg        ;;
106843c15da26Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
106853c15da26Smrg        # both directly and inverted, so should not be 0 or 255.
106863c15da26Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
106873c15da26Smrg        ;;
106883c15da26Smrg    darwin*)
106893c15da26Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
106903c15da26Smrg        ;;
106913c15da26Smrg    *bsd*)
106923c15da26Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
106933c15da26Smrg        ;;
106943c15da26Smrgesac
10695126a8a12Smrg
106963c15da26Smrg# User supplied flags override default flags
106973c15da26Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
106983c15da26Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
106993c15da26Smrgfi
10700126a8a12Smrg
107013c15da26SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
107023c15da26Smrg]) # XORG_WITH_LINT
10703126a8a12Smrg
107043c15da26Smrg# XORG_CHECK_MALLOC_ZERO
107053c15da26Smrg# ----------------------
107063c15da26Smrg# Minimum version: 1.0.0
107073c15da26Smrg#
107083c15da26Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
107093c15da26Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
107103c15da26Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
107113c15da26SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
107123c15da26SmrgAC_ARG_ENABLE(malloc0returnsnull,
107133c15da26Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
107143c15da26Smrg		       [malloc(0) returns NULL (default: auto)]),
107153c15da26Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
107163c15da26Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10717126a8a12Smrg
107183c15da26SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
107193c15da26Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10720300346aeSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10721300346aeSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
107223c15da26Smrg#include <stdlib.h>
107233c15da26Smrg],[
107243c15da26Smrg    char *m0, *r0, *c0, *p;
107253c15da26Smrg    m0 = malloc(0);
107263c15da26Smrg    p = malloc(10);
107273c15da26Smrg    r0 = realloc(p,0);
107283c15da26Smrg    c0 = calloc(0,10);
107293c15da26Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
107303c15da26Smrg])],
10731300346aeSmrg		[xorg_cv_malloc0_returns_null=yes],
10732300346aeSmrg		[xorg_cv_malloc0_returns_null=no])])
10733300346aeSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
107343c15da26Smrgfi
107353c15da26SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10736126a8a12Smrg
107373c15da26Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
107383c15da26Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
107393c15da26Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
107403c15da26Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
107413c15da26Smrgelse
107423c15da26Smrg	MALLOC_ZERO_CFLAGS=""
107433c15da26Smrg	XMALLOC_ZERO_CFLAGS=""
107443c15da26Smrg	XTMALLOC_ZERO_CFLAGS=""
107453c15da26Smrgfi
10746126a8a12Smrg
107473c15da26SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
107483c15da26SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
107493c15da26SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
107503c15da26Smrg]) # XORG_CHECK_MALLOC_ZERO
10751126a8a12Smrg
107523c15da26Smrg# XORG_WITH_LINT()
107533c15da26Smrg# ----------------
107543c15da26Smrg# Minimum version: 1.1.0
107553c15da26Smrg#
107563c15da26Smrg# This macro enables the use of a tool that flags some suspicious and
107573c15da26Smrg# non-portable constructs (likely to be bugs) in C language source code.
107583c15da26Smrg# It will attempt to locate the tool and use appropriate options.
107593c15da26Smrg# There are various lint type tools on different platforms.
107603c15da26Smrg#
107613c15da26Smrg# Interface to module:
107623c15da26Smrg# LINT:		returns the path to the tool found on the platform
107633c15da26Smrg#		or the value set to LINT on the configure cmd line
107643c15da26Smrg#		also an Automake conditional
107653c15da26Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
107663c15da26Smrg#
107673c15da26Smrg# --with-lint:	'yes' user instructs the module to use lint
107683c15da26Smrg#		'no' user instructs the module not to use lint (default)
107693c15da26Smrg#
107703c15da26Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
107713c15da26Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
107723c15da26Smrg#
107733c15da26SmrgAC_DEFUN([XORG_WITH_LINT],[
10774555991fdSmrg
107753c15da26SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
107763c15da26SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
107773c15da26SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
107783c15da26Smrg		[Use a lint-style source code checker (default: disabled)])],
107793c15da26Smrg		[use_lint=$withval], [use_lint=no])
10780126a8a12Smrg
107813c15da26Smrg# Obtain platform specific info like program name and options
107823c15da26Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
107833c15da26Smrgcase $host_os in
107843c15da26Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
107853c15da26Smrg	lint_name=splint
107863c15da26Smrg	lint_options="-badflag"
107873c15da26Smrg	;;
107883c15da26Smrg  *freebsd* | *netbsd*)
107893c15da26Smrg	lint_name=lint
107903c15da26Smrg	lint_options="-u -b"
107913c15da26Smrg	;;
107923c15da26Smrg  *solaris*)
107933c15da26Smrg	lint_name=lint
107943c15da26Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
107953c15da26Smrg	;;
107963c15da26Smrgesac
107973c15da26Smrg
107983c15da26Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
107993c15da26Smrgif test "x$use_lint" = x"yes" ; then
108003c15da26Smrg   AC_PATH_PROG([LINT], [$lint_name])
108013c15da26Smrg   if test "x$LINT" = "x"; then
108023c15da26Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
108033c15da26Smrg   fi
108043c15da26Smrgelif test "x$use_lint" = x"no" ; then
108053c15da26Smrg   if test "x$LINT" != "x"; then
108063c15da26Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
108073c15da26Smrg   fi
108083c15da26Smrgelse
108093c15da26Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
108103c15da26Smrgfi
10811126a8a12Smrg
108123c15da26Smrg# User supplied flags override default flags
108133c15da26Smrgif test "x$LINT_FLAGS" != "x"; then
108143c15da26Smrg   lint_options=$LINT_FLAGS
108153c15da26Smrgfi
10816126a8a12Smrg
108173c15da26SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
108183c15da26SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10819126a8a12Smrg
108203c15da26Smrg]) # XORG_WITH_LINT
10821555991fdSmrg
108223c15da26Smrg# XORG_LINT_LIBRARY(LIBNAME)
108233c15da26Smrg# --------------------------
108243c15da26Smrg# Minimum version: 1.1.0
10825126a8a12Smrg#
108263c15da26Smrg# Sets up flags for building lint libraries for checking programs that call
108273c15da26Smrg# functions in the library.
10828555991fdSmrg#
108293c15da26Smrg# Interface to module:
108303c15da26Smrg# LINTLIB		- Automake variable with the name of lint library file to make
108313c15da26Smrg# MAKE_LINT_LIB		- Automake conditional
108323c15da26Smrg#
108333c15da26Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
108343c15da26Smrg#			  - 'no' user instructs the module not to create a lint library (default)
10835126a8a12Smrg
108363c15da26SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
108373c15da26SmrgAC_REQUIRE([XORG_WITH_LINT])
108383c15da26SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
108393c15da26Smrg	[Create lint library (default: disabled)])],
108403c15da26Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10841126a8a12Smrg
108423c15da26Smrgif test "x$make_lint_lib" = x"yes" ; then
108433c15da26Smrg   LINTLIB=llib-l$1.ln
108443c15da26Smrg   if test "x$LINT" = "x"; then
108453c15da26Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
108463c15da26Smrg   fi
108473c15da26Smrgelif test "x$make_lint_lib" != x"no" ; then
108483c15da26Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
108493c15da26Smrgfi
10850126a8a12Smrg
108513c15da26SmrgAC_SUBST(LINTLIB)
108523c15da26SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10853126a8a12Smrg
108543c15da26Smrg]) # XORG_LINT_LIBRARY
10855126a8a12Smrg
108563c15da26Smrg# XORG_COMPILER_BRAND
108573c15da26Smrg# -------------------
108583c15da26Smrg# Minimum version: 1.14.0
108593c15da26Smrg#
108603c15da26Smrg# Checks for various brands of compilers and sets flags as appropriate:
108613c15da26Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
108620a6b08f8Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
108633c15da26Smrg#   clang compiler - sets CLANGCC to "yes"
108643c15da26Smrg#   Intel compiler - sets INTELCC to "yes"
108653c15da26Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
108663c15da26Smrg#
108673c15da26SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
108680a6b08f8SmrgAC_LANG_CASE(
108690a6b08f8Smrg	[C], [
108700a6b08f8Smrg		AC_REQUIRE([AC_PROG_CC_C99])
108710a6b08f8Smrg	],
108720a6b08f8Smrg	[C++], [
108730a6b08f8Smrg		AC_REQUIRE([AC_PROG_CXX])
108740a6b08f8Smrg	]
108750a6b08f8Smrg)
108763c15da26SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
108773c15da26SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
108783c15da26SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
108793c15da26Smrg]) # XORG_COMPILER_BRAND
10880555991fdSmrg
108813c15da26Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
108823c15da26Smrg# ---------------
108833c15da26Smrg# Minimum version: 1.16.0
10884126a8a12Smrg#
108853c15da26Smrg# Test if the compiler works when passed the given flag as a command line argument.
108863c15da26Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
108873c15da26Smrg# next flag in the list until there are no more options.
108883c15da26Smrg#
108893c15da26Smrg# Note that this does not guarantee that the compiler supports the flag as some
108903c15da26Smrg# compilers will simply ignore arguments that they do not understand, but we do
108913c15da26Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
108923c15da26Smrg# -Werror=unused-command-line-argument
108933c15da26Smrg#
108943c15da26SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
108953c15da26Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
108963c15da26Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
108973c15da26Smrg
108980a6b08f8SmrgAC_LANG_COMPILER_REQUIRE
108990a6b08f8Smrg
109000a6b08f8SmrgAC_LANG_CASE(
109010a6b08f8Smrg	[C], [
109020a6b08f8Smrg		AC_REQUIRE([AC_PROG_CC_C99])
109030a6b08f8Smrg		define([PREFIX], [C])
109040a6b08f8Smrg		define([CACHE_PREFIX], [cc])
109050a6b08f8Smrg		define([COMPILER], [$CC])
109060a6b08f8Smrg	],
109070a6b08f8Smrg	[C++], [
109080a6b08f8Smrg		define([PREFIX], [CXX])
109090a6b08f8Smrg		define([CACHE_PREFIX], [cxx])
109100a6b08f8Smrg		define([COMPILER], [$CXX])
109110a6b08f8Smrg	]
109120a6b08f8Smrg)
109130a6b08f8Smrg
109140a6b08f8Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
109153c15da26Smrg
109160a6b08f8Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
109170a6b08f8Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109180a6b08f8Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
109190a6b08f8Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
109203c15da26Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109210a6b08f8Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
109220a6b08f8Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
109230a6b08f8Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
109240a6b08f8Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109253c15da26Smrgfi
10926126a8a12Smrg
109270a6b08f8Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
109280a6b08f8Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
109290a6b08f8Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109303c15da26Smrg	fi
109310a6b08f8Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109320a6b08f8Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
109330a6b08f8Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
109343c15da26Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
109350a6b08f8Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
109360a6b08f8Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
109370a6b08f8Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
109380a6b08f8Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109393c15da26Smrgfi
10940126a8a12Smrg
109413c15da26Smrgfound="no"
109423c15da26Smrgm4_foreach([flag], m4_cdr($@), [
109433c15da26Smrg	if test $found = "no" ; then
109440a6b08f8Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
109450a6b08f8Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
109463c15da26Smrg		fi
109473c15da26Smrg
109480a6b08f8Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
109490a6b08f8Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
109503c15da26Smrg		fi
109513c15da26Smrg
109520a6b08f8Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
109533c15da26Smrg
109543c15da26Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
109550a6b08f8Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
109560a6b08f8Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
109570a6b08f8Smrg		AC_CACHE_VAL($cacheid,
109583c15da26Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
109590a6b08f8Smrg					     [eval $cacheid=yes],
109600a6b08f8Smrg					     [eval $cacheid=no])])
109613c15da26Smrg
109620a6b08f8Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
109633c15da26Smrg
109640a6b08f8Smrg		eval supported=\$$cacheid
109653c15da26Smrg		AC_MSG_RESULT([$supported])
109663c15da26Smrg		if test "$supported" = "yes" ; then
109673c15da26Smrg			$1="$$1 ]flag["
109683c15da26Smrg			found="yes"
109693c15da26Smrg		fi
109703c15da26Smrg	fi
109713c15da26Smrg])
109723c15da26Smrg]) # XORG_TESTSET_CFLAG
10973d656433aSmrg
109743c15da26Smrg# XORG_COMPILER_FLAGS
109753c15da26Smrg# ---------------
109763c15da26Smrg# Minimum version: 1.16.0
109773c15da26Smrg#
109780a6b08f8Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
109790a6b08f8Smrg# arguments supported by the selected compiler which do NOT alter the generated
109800a6b08f8Smrg# code.  These arguments will cause the compiler to print various warnings
109810a6b08f8Smrg# during compilation AND turn a conservative set of warnings into errors.
109823c15da26Smrg#
109830a6b08f8Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
109840a6b08f8Smrg# future versions of util-macros as options are added to new compilers.
109853c15da26Smrg#
109863c15da26SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
109873c15da26SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10988555991fdSmrg
109893c15da26SmrgAC_ARG_ENABLE(selective-werror,
109903c15da26Smrg              AS_HELP_STRING([--disable-selective-werror],
109913c15da26Smrg                             [Turn off selective compiler errors. (default: enabled)]),
109923c15da26Smrg              [SELECTIVE_WERROR=$enableval],
109933c15da26Smrg              [SELECTIVE_WERROR=yes])
10994555991fdSmrg
109950a6b08f8SmrgAC_LANG_CASE(
109960a6b08f8Smrg        [C], [
109970a6b08f8Smrg                define([PREFIX], [C])
109980a6b08f8Smrg        ],
109990a6b08f8Smrg        [C++], [
110000a6b08f8Smrg                define([PREFIX], [CXX])
110010a6b08f8Smrg        ]
110020a6b08f8Smrg)
110033c15da26Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
110043c15da26Smrgif test "x$SUNCC" = "xyes"; then
110050a6b08f8Smrg    [BASE_]PREFIX[FLAGS]="-v"
110063c15da26Smrgelse
110070a6b08f8Smrg    [BASE_]PREFIX[FLAGS]=""
110083c15da26Smrgfi
11009555991fdSmrg
110103c15da26Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
110110a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
110120a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
110130a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
110140a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
110150a6b08f8Smrg
110160a6b08f8SmrgAC_LANG_CASE(
110170a6b08f8Smrg	[C], [
110180a6b08f8Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
110190a6b08f8Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
110200a6b08f8Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
110210a6b08f8Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11022300346aeSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
110230a6b08f8Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
110240a6b08f8Smrg	]
110250a6b08f8Smrg)
110263c15da26Smrg
110273c15da26Smrg# This chunk adds additional warnings that could catch undesired effects.
110280a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
110290a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
110300a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
110310a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
110320a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
110330a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11034300346aeSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
110353c15da26Smrg
110363c15da26Smrg# These are currently disabled because they are noisy.  They will be enabled
110373c15da26Smrg# in the future once the codebase is sufficiently modernized to silence
110383c15da26Smrg# them.  For now, I don't want them to drown out the other warnings.
110390a6b08f8Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
110400a6b08f8Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11041300346aeSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
110423c15da26Smrg
110433c15da26Smrg# Turn some warnings into errors, so we don't accidently get successful builds
110443c15da26Smrg# when there are problems that should be fixed.
110453c15da26Smrg
110463c15da26Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
110470a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
110480a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
110490a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
110500a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
110510a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
110520a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
110530a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
110540a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
110550a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
110560a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
110570a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
110580a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
110590a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
110603c15da26Smrgelse
110613c15da26SmrgAC_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])
110620a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
110630a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
110640a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
110650a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
110660a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
110670a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
110680a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
110690a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
110700a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
110710a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
110720a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
110730a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
110740a6b08f8SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
110753c15da26Smrgfi
11076555991fdSmrg
110770a6b08f8SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
110783c15da26Smrg]) # XORG_COMPILER_FLAGS
11079555991fdSmrg
110803c15da26Smrg# XORG_CWARNFLAGS
110813c15da26Smrg# ---------------
110823c15da26Smrg# Minimum version: 1.2.0
110833c15da26Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
110843c15da26Smrg#
110853c15da26Smrg# Defines CWARNFLAGS to enable C compiler warnings.
110863c15da26Smrg#
110873c15da26Smrg# This function is deprecated because it defines -fno-strict-aliasing
110883c15da26Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
110893c15da26Smrg# is needed, then it should be added explicitly in the module when
110903c15da26Smrg# it is updated to use BASE_CFLAGS.
110913c15da26Smrg#
110923c15da26SmrgAC_DEFUN([XORG_CWARNFLAGS], [
110933c15da26SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
110943c15da26SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
110950a6b08f8SmrgAC_LANG_CASE(
110960a6b08f8Smrg	[C], [
110970a6b08f8Smrg		CWARNFLAGS="$BASE_CFLAGS"
110980a6b08f8Smrg		if  test "x$GCC" = xyes ; then
110990a6b08f8Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
111000a6b08f8Smrg		fi
111010a6b08f8Smrg		AC_SUBST(CWARNFLAGS)
111020a6b08f8Smrg	]
111030a6b08f8Smrg)
111043c15da26Smrg]) # XORG_CWARNFLAGS
11105555991fdSmrg
111063c15da26Smrg# XORG_STRICT_OPTION
111073c15da26Smrg# -----------------------
111083c15da26Smrg# Minimum version: 1.3.0
111093c15da26Smrg#
111103c15da26Smrg# Add configure option to enable strict compilation flags, such as treating
111113c15da26Smrg# warnings as fatal errors.
111123c15da26Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
111130a6b08f8Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
111143c15da26Smrg#
111153c15da26Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
111163c15da26Smrg# when strict compilation is unconditionally desired.
111173c15da26SmrgAC_DEFUN([XORG_STRICT_OPTION], [
111183c15da26SmrgAC_REQUIRE([XORG_CWARNFLAGS])
111193c15da26SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11120555991fdSmrg
111213c15da26SmrgAC_ARG_ENABLE(strict-compilation,
111223c15da26Smrg			  AS_HELP_STRING([--enable-strict-compilation],
111233c15da26Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
111243c15da26Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11125555991fdSmrg
111260a6b08f8SmrgAC_LANG_CASE(
111270a6b08f8Smrg        [C], [
111280a6b08f8Smrg                define([PREFIX], [C])
111290a6b08f8Smrg        ],
111300a6b08f8Smrg        [C++], [
111310a6b08f8Smrg                define([PREFIX], [CXX])
111320a6b08f8Smrg        ]
111330a6b08f8Smrg)
111340a6b08f8Smrg
111350a6b08f8Smrg[STRICT_]PREFIX[FLAGS]=""
111360a6b08f8SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
111370a6b08f8SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11138126a8a12Smrg
111393c15da26Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
111403c15da26Smrg# activate it with -Werror, so we add it here explicitly.
111410a6b08f8SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11142126a8a12Smrg
111433c15da26Smrgif test "x$STRICT_COMPILE" = "xyes"; then
111440a6b08f8Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
111450a6b08f8Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
111463c15da26Smrgfi
111470a6b08f8SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
111480a6b08f8SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
111490a6b08f8SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
111503c15da26Smrg]) # XORG_STRICT_OPTION
111513c15da26Smrg
111523c15da26Smrg# XORG_DEFAULT_OPTIONS
111533c15da26Smrg# --------------------
111543c15da26Smrg# Minimum version: 1.3.0
111553c15da26Smrg#
111563c15da26Smrg# Defines default options for X.Org modules.
111573c15da26Smrg#
111583c15da26SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
111593c15da26SmrgAC_REQUIRE([AC_PROG_INSTALL])
111603c15da26SmrgXORG_COMPILER_FLAGS
111613c15da26SmrgXORG_CWARNFLAGS
111623c15da26SmrgXORG_STRICT_OPTION
111633c15da26SmrgXORG_RELEASE_VERSION
111643c15da26SmrgXORG_CHANGELOG
111653c15da26SmrgXORG_INSTALL
111663c15da26SmrgXORG_MANPAGE_SECTIONS
111673c15da26Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
111683c15da26Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
111693c15da26Smrg]) # XORG_DEFAULT_OPTIONS
11170126a8a12Smrg
111713c15da26Smrg# XORG_INSTALL()
111723c15da26Smrg# ----------------
111733c15da26Smrg# Minimum version: 1.4.0
111743c15da26Smrg#
111753c15da26Smrg# Defines the variable INSTALL_CMD as the command to copy
111763c15da26Smrg# INSTALL from $prefix/share/util-macros.
111773c15da26Smrg#
111783c15da26SmrgAC_DEFUN([XORG_INSTALL], [
111793c15da26SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
111803c15da26Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
111813c15da26SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
111823c15da26Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
111833c15da26Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
111843c15da26Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
111853c15da26SmrgAC_SUBST([INSTALL_CMD])
111863c15da26Smrg]) # XORG_INSTALL
111873c15da26Smrgdnl Copyright 2005 Red Hat, Inc
111883c15da26Smrgdnl
111893c15da26Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
111903c15da26Smrgdnl documentation for any purpose is hereby granted without fee, provided that
111913c15da26Smrgdnl the above copyright notice appear in all copies and that both that
111923c15da26Smrgdnl copyright notice and this permission notice appear in supporting
111933c15da26Smrgdnl documentation.
111943c15da26Smrgdnl
111953c15da26Smrgdnl The above copyright notice and this permission notice shall be included
111963c15da26Smrgdnl in all copies or substantial portions of the Software.
111973c15da26Smrgdnl
111983c15da26Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
111993c15da26Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
112003c15da26Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
112013c15da26Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
112023c15da26Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
112033c15da26Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
112043c15da26Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
112053c15da26Smrgdnl
112063c15da26Smrgdnl Except as contained in this notice, the name of the copyright holders shall
112073c15da26Smrgdnl not be used in advertising or otherwise to promote the sale, use or
112083c15da26Smrgdnl other dealings in this Software without prior written authorization
112093c15da26Smrgdnl from the copyright holders.
112103c15da26Smrgdnl
11211126a8a12Smrg
112123c15da26Smrg# XORG_RELEASE_VERSION
112133c15da26Smrg# --------------------
112143c15da26Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
112150a6b08f8Smrg
112163c15da26SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
112173c15da26Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
112183c15da26Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
112193c15da26Smrg		[Major version of this package])
112203c15da26Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
112213c15da26Smrg	if test "x$PVM" = "x"; then
112223c15da26Smrg		PVM="0"
112233c15da26Smrg	fi
112243c15da26Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
112253c15da26Smrg		[$PVM],
112263c15da26Smrg		[Minor version of this package])
112273c15da26Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
112283c15da26Smrg	if test "x$PVP" = "x"; then
112293c15da26Smrg		PVP="0"
112303c15da26Smrg	fi
112313c15da26Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
112323c15da26Smrg		[$PVP],
112333c15da26Smrg		[Patch version of this package])
11234555991fdSmrg])
11235126a8a12Smrg
11236300346aeSmrg# XORG_CHANGELOG()
11237300346aeSmrg# ----------------
11238300346aeSmrg# Minimum version: 1.2.0
11239300346aeSmrg#
11240300346aeSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11241300346aeSmrg# ChangeLog from git.
11242300346aeSmrg#
11243300346aeSmrg#
11244300346aeSmrgAC_DEFUN([XORG_CHANGELOG], [
11245300346aeSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11246300346aeSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11247300346aeSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11248300346aeSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11249300346aeSmrgAC_SUBST([CHANGELOG_CMD])
11250300346aeSmrg]) # XORG_CHANGELOG
11251300346aeSmrg
11252300346aeSmrgdnl
11253300346aeSmrgdnl Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
11254300346aeSmrgdnl
11255300346aeSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
11256300346aeSmrgdnl copy of this software and associated documentation files (the "Software"),
11257300346aeSmrgdnl to deal in the Software without restriction, including without limitation
11258300346aeSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
11259300346aeSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
11260300346aeSmrgdnl Software is furnished to do so, subject to the following conditions:
11261300346aeSmrgdnl
11262300346aeSmrgdnl The above copyright notice and this permission notice (including the next
11263300346aeSmrgdnl paragraph) shall be included in all copies or substantial portions of the
11264300346aeSmrgdnl Software.
11265300346aeSmrgdnl
11266300346aeSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11267300346aeSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11268300346aeSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
11269300346aeSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11270300346aeSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
11271300346aeSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
11272300346aeSmrgdnl DEALINGS IN THE SOFTWARE.
11273300346aeSmrgdnl
11274300346aeSmrg
11275300346aeSmrg# XTRANS_TCP_FLAGS()
11276300346aeSmrg# ------------------
11277300346aeSmrg# Find needed libraries for TCP sockets, and check for IPv6 support
11278300346aeSmrgAC_DEFUN([XTRANS_TCP_FLAGS],[
11279300346aeSmrg # SVR4 hides these in libraries other than libc
11280300346aeSmrg AC_SEARCH_LIBS(socket, [socket])
11281300346aeSmrg AC_SEARCH_LIBS(gethostbyname, [nsl])
11282300346aeSmrg if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then
11283300346aeSmrg   AC_CHECK_LIB([ws2_32],[main])
11284300346aeSmrg fi
11285300346aeSmrg
11286300346aeSmrg # Needs to come after above checks for libsocket & libnsl for SVR4 systems
11287300346aeSmrg AC_ARG_ENABLE(ipv6,
11288300346aeSmrg	AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),
11289300346aeSmrg	[IPV6CONN=$enableval],
11290300346aeSmrg	[AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])])
11291300346aeSmrg AC_MSG_CHECKING([if IPv6 support should be built])
11292300346aeSmrg if test "$IPV6CONN" = "yes"; then
11293300346aeSmrg	AC_DEFINE(IPv6,1,[Support IPv6 for TCP connections])
11294300346aeSmrg fi
11295300346aeSmrg AC_MSG_RESULT($IPV6CONN)
11296300346aeSmrg
11297300346aeSmrg # 4.3BSD-Reno added a new member to struct sockaddr_in
11298300346aeSmrg AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
11299300346aeSmrg	AC_DEFINE([BSD44SOCKETS],1,
11300300346aeSmrg 	    [Define to 1 if `struct sockaddr_in' has a `sin_len' member]), [], [
11301300346aeSmrg#include <sys/types.h>
11302300346aeSmrg#include <sys/socket.h>
11303300346aeSmrg#include <netinet/in.h>
11304300346aeSmrg ])
11305300346aeSmrg
11306300346aeSmrg # POSIX.1g changed the type of pointer passed to getsockname/getpeername/etc.
11307300346aeSmrg AC_CHECK_TYPES([socklen_t], [], [], [
11308300346aeSmrgAC_INCLUDES_DEFAULT
11309300346aeSmrg#include <sys/socket.h>])
11310300346aeSmrg
11311300346aeSmrg # XPG4v2/UNIX95 added msg_control - check to see if we need to define
11312300346aeSmrg # _XOPEN_SOURCE to get it (such as on Solaris)
11313300346aeSmrg AC_CHECK_MEMBER([struct msghdr.msg_control], [], [],
11314300346aeSmrg                 [
11315300346aeSmrgAC_INCLUDES_DEFAULT
11316300346aeSmrg#include <sys/socket.h>
11317300346aeSmrg                 ])
11318300346aeSmrg # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03
11319300346aeSmrg if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
11320300346aeSmrg     unset ac_cv_member_struct_msghdr_msg_control
11321300346aeSmrg     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600])
11322300346aeSmrg     AC_CHECK_MEMBER([struct msghdr.msg_control],
11323300346aeSmrg                     [AC_DEFINE([_XOPEN_SOURCE], [600],
11324300346aeSmrg                       [Defined if needed to expose struct msghdr.msg_control])
11325300346aeSmrg                     ], [], [
11326300346aeSmrg#define _XOPEN_SOURCE 600
11327300346aeSmrgAC_INCLUDES_DEFAULT
11328300346aeSmrg#include <sys/socket.h>
11329300346aeSmrg                     ])
11330300346aeSmrg fi
11331300346aeSmrg # If that didn't work, fall back to XPG5/UNIX98 with C89
11332300346aeSmrg if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then
11333300346aeSmrg     unset ac_cv_member_struct_msghdr_msg_control
11334300346aeSmrg     AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500])
11335300346aeSmrg     AC_CHECK_MEMBER([struct msghdr.msg_control],
11336300346aeSmrg                     [AC_DEFINE([_XOPEN_SOURCE], [500],
11337300346aeSmrg                       [Defined if needed to expose struct msghdr.msg_control])
11338300346aeSmrg                     ], [], [
11339300346aeSmrg#define _XOPEN_SOURCE 500
11340300346aeSmrgAC_INCLUDES_DEFAULT
11341300346aeSmrg#include <sys/socket.h>
11342300346aeSmrg                     ])
11343300346aeSmrg fi
11344300346aeSmrg
11345300346aeSmrg
11346300346aeSmrg]) # XTRANS_TCP_FLAGS
11347300346aeSmrg
11348300346aeSmrg# XTRANS_CONNECTION_FLAGS()
11349300346aeSmrg# -------------------------
11350300346aeSmrg# Standard checks for which Xtrans transports to use by the Xorg packages
11351300346aeSmrg# that use Xtrans functions
11352300346aeSmrgAC_DEFUN([XTRANS_CONNECTION_FLAGS],[
11353300346aeSmrg AC_REQUIRE([AC_CANONICAL_HOST])
11354300346aeSmrg [case $host_os in
11355300346aeSmrg	mingw*)	unixdef="no"   ;;
11356300346aeSmrg	*)	unixdef="yes"  ;;
11357300346aeSmrg esac]
11358300346aeSmrg AC_ARG_ENABLE(unix-transport,
11359300346aeSmrg	AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]),
11360300346aeSmrg	[UNIXCONN=$enableval], [UNIXCONN=$unixdef])
11361300346aeSmrg AC_MSG_CHECKING([if Xtrans should support UNIX socket connections])
11362300346aeSmrg if test "$UNIXCONN" = "yes"; then
11363300346aeSmrg	AC_DEFINE(UNIXCONN,1,[Support UNIX socket connections])
11364300346aeSmrg fi
11365300346aeSmrg AC_MSG_RESULT($UNIXCONN)
11366300346aeSmrg AC_ARG_ENABLE(tcp-transport,
11367300346aeSmrg	AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]),
11368300346aeSmrg	[TCPCONN=$enableval], [TCPCONN=yes])
11369300346aeSmrg AC_MSG_CHECKING([if Xtrans should support TCP socket connections])
11370300346aeSmrg AC_MSG_RESULT($TCPCONN)
11371300346aeSmrg if test "$TCPCONN" = "yes"; then
11372300346aeSmrg	AC_DEFINE(TCPCONN,1,[Support TCP socket connections])
11373300346aeSmrg	XTRANS_TCP_FLAGS
11374300346aeSmrg fi
11375300346aeSmrg [case $host_os in
11376300346aeSmrg	solaris*|sco*|sysv4*)	localdef="yes" ;;
11377300346aeSmrg	*)			localdef="no"  ;;
11378300346aeSmrg esac]
11379300346aeSmrg AC_ARG_ENABLE(local-transport,
11380300346aeSmrg	AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]),
11381300346aeSmrg	[LOCALCONN=$enableval], [LOCALCONN=$localdef])
11382300346aeSmrg AC_MSG_CHECKING([if Xtrans should support os-specific local connections])
11383300346aeSmrg AC_MSG_RESULT($LOCALCONN)
11384300346aeSmrg if test "$LOCALCONN" = "yes"; then
11385300346aeSmrg	AC_DEFINE(LOCALCONN,1,[Support os-specific local connections])
11386300346aeSmrg fi
11387300346aeSmrg
11388300346aeSmrg]) # XTRANS_CONNECTION_FLAGS
11389300346aeSmrg
11390300346aeSmrg
11391300346aeSmrg# XTRANS_SECURE_RPC_FLAGS()
11392300346aeSmrg# -------------------------
11393300346aeSmrg# Check for Secure RPC functions - must come after XTRANS_TCP_FLAGS
11394300346aeSmrg# so that any necessary networking libraries are already found
11395300346aeSmrgAC_DEFUN([XTRANS_SECURE_RPC_FLAGS],
11396300346aeSmrg[AC_REQUIRE([XTRANS_TCP_FLAGS])
11397300346aeSmrg AC_ARG_ENABLE(secure-rpc,
11398300346aeSmrg	AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]),
11399300346aeSmrg        [SECURE_RPC=$enableval], [SECURE_RPC="try"])
11400300346aeSmrg
11401300346aeSmrg if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then
11402300346aeSmrg	FOUND_SECURE_RPC="no"
11403300346aeSmrg	AC_CHECK_FUNCS([authdes_seccreate authdes_create],
11404300346aeSmrg			[FOUND_SECURE_RPC="yes"])
11405300346aeSmrg	if test "x$FOUND_SECURE_RPC" = "xno" ; then
11406300346aeSmrg		if test "x$SECURE_RPC" = "xyes" ; then
11407300346aeSmrg	AC_MSG_ERROR([Secure RPC requested, but required functions not found])
11408300346aeSmrg		fi
11409300346aeSmrg		SECURE_RPC="no"
11410300346aeSmrg	else
11411300346aeSmrg		dnl FreeBSD keeps getsecretkey in librpcsvc
11412300346aeSmrg		AC_SEARCH_LIBS(getsecretkey, [rpcsvc])
11413300346aeSmrg		SECURE_RPC="yes"
11414300346aeSmrg	fi
11415300346aeSmrg fi
11416300346aeSmrg AC_MSG_CHECKING([if Secure RPC authentication ("SUN-DES-1") should be supported])
11417300346aeSmrg if test "x$SECURE_RPC" = "xyes" ; then
11418300346aeSmrg	AC_DEFINE(SECURE_RPC, 1, [Support Secure RPC ("SUN-DES-1") authentication for X11 clients])
11419300346aeSmrg fi
11420300346aeSmrg AC_MSG_RESULT($SECURE_RPC)
11421300346aeSmrg]) # XTRANS_SECURE_RPC_FLAGS
11422300346aeSmrg
11423300346aeSmrg
11424300346aeSmrg# Copyright (C) 2002-2017 Free Software Foundation, Inc.
11425300346aeSmrg#
11426300346aeSmrg# This file is free software; the Free Software Foundation
11427300346aeSmrg# gives unlimited permission to copy and/or distribute it,
11428300346aeSmrg# with or without modifications, as long as this notice is preserved.
11429300346aeSmrg
11430300346aeSmrg# AM_AUTOMAKE_VERSION(VERSION)
11431300346aeSmrg# ----------------------------
11432300346aeSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11433300346aeSmrg# generated from the m4 files accompanying Automake X.Y.
11434300346aeSmrg# (This private macro should not be called outside this file.)
11435300346aeSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
11436300346aeSmrg[am__api_version='1.15'
11437300346aeSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11438300346aeSmrgdnl require some minimum version.  Point them to the right macro.
11439300346aeSmrgm4_if([$1], [1.15.1], [],
11440300346aeSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11441300346aeSmrg])
11442300346aeSmrg
11443300346aeSmrg# _AM_AUTOCONF_VERSION(VERSION)
11444300346aeSmrg# -----------------------------
11445300346aeSmrg# aclocal traces this macro to find the Autoconf version.
11446300346aeSmrg# This is a private macro too.  Using m4_define simplifies
11447300346aeSmrg# the logic in aclocal, which can simply ignore this definition.
11448300346aeSmrgm4_define([_AM_AUTOCONF_VERSION], [])
11449300346aeSmrg
11450300346aeSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11451300346aeSmrg# -------------------------------
11452300346aeSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11453300346aeSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11454300346aeSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11455300346aeSmrg[AM_AUTOMAKE_VERSION([1.15.1])dnl
11456300346aeSmrgm4_ifndef([AC_AUTOCONF_VERSION],
11457300346aeSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11458300346aeSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11459300346aeSmrg
11460300346aeSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11461300346aeSmrg
11462300346aeSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
11463300346aeSmrg#
11464300346aeSmrg# This file is free software; the Free Software Foundation
11465300346aeSmrg# gives unlimited permission to copy and/or distribute it,
11466300346aeSmrg# with or without modifications, as long as this notice is preserved.
11467300346aeSmrg
11468300346aeSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11469300346aeSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11470300346aeSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
11471300346aeSmrg#
11472300346aeSmrg# Of course, Automake must honor this variable whenever it calls a
11473300346aeSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11474300346aeSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11475300346aeSmrg# depending on how configure is run.  This is pretty annoying, since
11476300346aeSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11477300346aeSmrg# source directory, any form will work fine, but in subdirectories a
11478300346aeSmrg# relative path needs to be adjusted first.
11479300346aeSmrg#
11480300346aeSmrg# $ac_aux_dir/missing
11481300346aeSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11482300346aeSmrg# $top_srcdir/$ac_aux_dir/missing
11483300346aeSmrg#    fails if $ac_aux_dir is absolute,
11484300346aeSmrg#    fails when called from a subdirectory in a VPATH build with
11485300346aeSmrg#          a relative $ac_aux_dir
11486300346aeSmrg#
11487300346aeSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11488300346aeSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
11489300346aeSmrg# harmless because $srcdir is '.', but things will broke when you
11490300346aeSmrg# start a VPATH build or use an absolute $srcdir.
11491300346aeSmrg#
11492300346aeSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11493300346aeSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11494300346aeSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11495300346aeSmrg# and then we would define $MISSING as
11496300346aeSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11497300346aeSmrg# This will work as long as MISSING is not called from configure, because
11498300346aeSmrg# unfortunately $(top_srcdir) has no meaning in configure.
11499300346aeSmrg# However there are other variables, like CC, which are often used in
11500300346aeSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
11501300346aeSmrg#
11502300346aeSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
11503300346aeSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
11504300346aeSmrg# configured tree to be moved without reconfiguration.
11505300346aeSmrg
11506300346aeSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
11507300346aeSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
11508300346aeSmrg# Expand $ac_aux_dir to an absolute path.
11509300346aeSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11510300346aeSmrg])
11511300346aeSmrg
11512300346aeSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11513300346aeSmrg
11514300346aeSmrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
11515300346aeSmrg#
11516300346aeSmrg# This file is free software; the Free Software Foundation
11517300346aeSmrg# gives unlimited permission to copy and/or distribute it,
11518300346aeSmrg# with or without modifications, as long as this notice is preserved.
11519300346aeSmrg
11520300346aeSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11521300346aeSmrg# -------------------------------------
11522300346aeSmrg# Define a conditional.
11523300346aeSmrgAC_DEFUN([AM_CONDITIONAL],
11524300346aeSmrg[AC_PREREQ([2.52])dnl
11525300346aeSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11526300346aeSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11527300346aeSmrgAC_SUBST([$1_TRUE])dnl
11528300346aeSmrgAC_SUBST([$1_FALSE])dnl
11529300346aeSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11530300346aeSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11531300346aeSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11532300346aeSmrgif $2; then
11533300346aeSmrg  $1_TRUE=
11534300346aeSmrg  $1_FALSE='#'
11535300346aeSmrgelse
11536300346aeSmrg  $1_TRUE='#'
11537300346aeSmrg  $1_FALSE=
11538300346aeSmrgfi
11539300346aeSmrgAC_CONFIG_COMMANDS_PRE(
11540300346aeSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11541300346aeSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11542300346aeSmrgUsually this means the macro was only invoked conditionally.]])
11543300346aeSmrgfi])])
11544300346aeSmrg
11545300346aeSmrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
11546300346aeSmrg#
11547300346aeSmrg# This file is free software; the Free Software Foundation
11548300346aeSmrg# gives unlimited permission to copy and/or distribute it,
11549300346aeSmrg# with or without modifications, as long as this notice is preserved.
11550300346aeSmrg
11551300346aeSmrg
11552300346aeSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11553300346aeSmrg# written in clear, in which case automake, when reading aclocal.m4,
11554300346aeSmrg# will think it sees a *use*, and therefore will trigger all it's
11555300346aeSmrg# C support machinery.  Also note that it means that autoscan, seeing
11556300346aeSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11557300346aeSmrg
11558300346aeSmrg
11559300346aeSmrg# _AM_DEPENDENCIES(NAME)
11560300346aeSmrg# ----------------------
11561300346aeSmrg# See how the compiler implements dependency checking.
11562300346aeSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11563300346aeSmrg# We try a few techniques and use that to set a single cache variable.
11564300346aeSmrg#
11565300346aeSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11566300346aeSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11567300346aeSmrg# dependency, and given that the user is not expected to run this macro,
11568300346aeSmrg# just rely on AC_PROG_CC.
11569300346aeSmrgAC_DEFUN([_AM_DEPENDENCIES],
11570300346aeSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11571300346aeSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11572300346aeSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11573300346aeSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11574300346aeSmrg
11575300346aeSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11576300346aeSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11577300346aeSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11578300346aeSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11579300346aeSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11580300346aeSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11581300346aeSmrg                    [depcc="$$1"   am_compiler_list=])
11582300346aeSmrg
11583300346aeSmrgAC_CACHE_CHECK([dependency style of $depcc],
11584300346aeSmrg               [am_cv_$1_dependencies_compiler_type],
11585300346aeSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11586300346aeSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
11587300346aeSmrg  # making bogus files that we don't know about and never remove.  For
11588300346aeSmrg  # instance it was reported that on HP-UX the gcc test will end up
11589300346aeSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11590300346aeSmrg  # in D".
11591300346aeSmrg  rm -rf conftest.dir
11592300346aeSmrg  mkdir conftest.dir
11593300346aeSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11594300346aeSmrg  # using a relative directory.
11595300346aeSmrg  cp "$am_depcomp" conftest.dir
11596300346aeSmrg  cd conftest.dir
11597300346aeSmrg  # We will build objects and dependencies in a subdirectory because
11598300346aeSmrg  # it helps to detect inapplicable dependency modes.  For instance
11599300346aeSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11600300346aeSmrg  # side effect of compilation, but ICC will put the dependencies in
11601300346aeSmrg  # the current directory while Tru64 will put them in the object
11602300346aeSmrg  # directory.
11603300346aeSmrg  mkdir sub
11604300346aeSmrg
11605300346aeSmrg  am_cv_$1_dependencies_compiler_type=none
11606300346aeSmrg  if test "$am_compiler_list" = ""; then
11607300346aeSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11608300346aeSmrg  fi
11609300346aeSmrg  am__universal=false
11610300346aeSmrg  m4_case([$1], [CC],
11611300346aeSmrg    [case " $depcc " in #(
11612300346aeSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11613300346aeSmrg     esac],
11614300346aeSmrg    [CXX],
11615300346aeSmrg    [case " $depcc " in #(
11616300346aeSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11617300346aeSmrg     esac])
11618300346aeSmrg
11619300346aeSmrg  for depmode in $am_compiler_list; do
11620300346aeSmrg    # Setup a source with many dependencies, because some compilers
11621300346aeSmrg    # like to wrap large dependency lists on column 80 (with \), and
11622300346aeSmrg    # we should not choose a depcomp mode which is confused by this.
11623300346aeSmrg    #
11624300346aeSmrg    # We need to recreate these files for each test, as the compiler may
11625300346aeSmrg    # overwrite some of them when testing with obscure command lines.
11626300346aeSmrg    # This happens at least with the AIX C compiler.
11627300346aeSmrg    : > sub/conftest.c
11628300346aeSmrg    for i in 1 2 3 4 5 6; do
11629300346aeSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11630300346aeSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11631300346aeSmrg      # Solaris 10 /bin/sh.
11632300346aeSmrg      echo '/* dummy */' > sub/conftst$i.h
11633300346aeSmrg    done
11634300346aeSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11635300346aeSmrg
11636300346aeSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11637300346aeSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11638300346aeSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11639300346aeSmrg    # versions had trouble with output in subdirs.
11640300346aeSmrg    am__obj=sub/conftest.${OBJEXT-o}
11641300346aeSmrg    am__minus_obj="-o $am__obj"
11642300346aeSmrg    case $depmode in
11643300346aeSmrg    gcc)
11644300346aeSmrg      # This depmode causes a compiler race in universal mode.
11645300346aeSmrg      test "$am__universal" = false || continue
11646300346aeSmrg      ;;
11647300346aeSmrg    nosideeffect)
11648300346aeSmrg      # After this tag, mechanisms are not by side-effect, so they'll
11649300346aeSmrg      # only be used when explicitly requested.
11650300346aeSmrg      if test "x$enable_dependency_tracking" = xyes; then
11651300346aeSmrg	continue
11652300346aeSmrg      else
11653300346aeSmrg	break
11654300346aeSmrg      fi
11655300346aeSmrg      ;;
11656300346aeSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11657300346aeSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
11658300346aeSmrg      # not run yet.  These depmodes are late enough in the game, and
11659300346aeSmrg      # so weak that their functioning should not be impacted.
11660300346aeSmrg      am__obj=conftest.${OBJEXT-o}
11661300346aeSmrg      am__minus_obj=
11662300346aeSmrg      ;;
11663300346aeSmrg    none) break ;;
11664300346aeSmrg    esac
11665300346aeSmrg    if depmode=$depmode \
11666300346aeSmrg       source=sub/conftest.c object=$am__obj \
11667300346aeSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11668300346aeSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11669300346aeSmrg         >/dev/null 2>conftest.err &&
11670300346aeSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11671300346aeSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11672300346aeSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11673300346aeSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11674300346aeSmrg      # icc doesn't choke on unknown options, it will just issue warnings
11675300346aeSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
11676300346aeSmrg      # that says an option was ignored or not supported.
11677300346aeSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11678300346aeSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11679300346aeSmrg      # The diagnosis changed in icc 8.0:
11680300346aeSmrg      #   icc: Command line remark: option '-MP' not supported
11681300346aeSmrg      if (grep 'ignoring option' conftest.err ||
11682300346aeSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11683300346aeSmrg        am_cv_$1_dependencies_compiler_type=$depmode
11684300346aeSmrg        break
11685300346aeSmrg      fi
11686300346aeSmrg    fi
11687300346aeSmrg  done
11688300346aeSmrg
11689300346aeSmrg  cd ..
11690300346aeSmrg  rm -rf conftest.dir
11691300346aeSmrgelse
11692300346aeSmrg  am_cv_$1_dependencies_compiler_type=none
11693300346aeSmrgfi
11694300346aeSmrg])
11695300346aeSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11696300346aeSmrgAM_CONDITIONAL([am__fastdep$1], [
11697300346aeSmrg  test "x$enable_dependency_tracking" != xno \
11698300346aeSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11699300346aeSmrg])
11700300346aeSmrg
11701300346aeSmrg
11702300346aeSmrg# AM_SET_DEPDIR
11703300346aeSmrg# -------------
11704300346aeSmrg# Choose a directory name for dependency files.
11705300346aeSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11706300346aeSmrgAC_DEFUN([AM_SET_DEPDIR],
11707300346aeSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11708300346aeSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11709300346aeSmrg])
11710300346aeSmrg
11711300346aeSmrg
11712300346aeSmrg# AM_DEP_TRACK
11713300346aeSmrg# ------------
11714300346aeSmrgAC_DEFUN([AM_DEP_TRACK],
11715300346aeSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11716300346aeSmrgAS_HELP_STRING(
11717300346aeSmrg  [--enable-dependency-tracking],
11718300346aeSmrg  [do not reject slow dependency extractors])
11719300346aeSmrgAS_HELP_STRING(
11720300346aeSmrg  [--disable-dependency-tracking],
11721300346aeSmrg  [speeds up one-time build])])
11722300346aeSmrgif test "x$enable_dependency_tracking" != xno; then
11723300346aeSmrg  am_depcomp="$ac_aux_dir/depcomp"
11724300346aeSmrg  AMDEPBACKSLASH='\'
11725300346aeSmrg  am__nodep='_no'
11726300346aeSmrgfi
11727300346aeSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11728300346aeSmrgAC_SUBST([AMDEPBACKSLASH])dnl
11729300346aeSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11730300346aeSmrgAC_SUBST([am__nodep])dnl
11731300346aeSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11732300346aeSmrg])
11733300346aeSmrg
11734300346aeSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
11735300346aeSmrg
11736300346aeSmrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
11737300346aeSmrg#
11738300346aeSmrg# This file is free software; the Free Software Foundation
11739300346aeSmrg# gives unlimited permission to copy and/or distribute it,
11740300346aeSmrg# with or without modifications, as long as this notice is preserved.
11741300346aeSmrg
11742300346aeSmrg
11743300346aeSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11744300346aeSmrg# ------------------------------
11745300346aeSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11746300346aeSmrg[{
11747300346aeSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
11748300346aeSmrg  # are listed without --file.  Let's play safe and only enable the eval
11749300346aeSmrg  # if we detect the quoting.
11750300346aeSmrg  case $CONFIG_FILES in
11751300346aeSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
11752300346aeSmrg  *)   set x $CONFIG_FILES ;;
11753300346aeSmrg  esac
11754300346aeSmrg  shift
11755300346aeSmrg  for mf
11756300346aeSmrg  do
11757300346aeSmrg    # Strip MF so we end up with the name of the file.
11758300346aeSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11759300346aeSmrg    # Check whether this is an Automake generated Makefile or not.
11760300346aeSmrg    # We used to match only the files named 'Makefile.in', but
11761300346aeSmrg    # some people rename them; so instead we look at the file content.
11762300346aeSmrg    # Grep'ing the first line is not enough: some people post-process
11763300346aeSmrg    # each Makefile.in and add a new line on top of each file to say so.
11764300346aeSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
11765300346aeSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
11766300346aeSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11767300346aeSmrg      dirpart=`AS_DIRNAME("$mf")`
11768300346aeSmrg    else
11769300346aeSmrg      continue
11770300346aeSmrg    fi
11771300346aeSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
11772300346aeSmrg    # from the Makefile without running 'make'.
11773300346aeSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11774300346aeSmrg    test -z "$DEPDIR" && continue
11775300346aeSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11776300346aeSmrg    test -z "$am__include" && continue
11777300346aeSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11778300346aeSmrg    # Find all dependency output files, they are included files with
11779300346aeSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11780300346aeSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11781300346aeSmrg    # expansion.
11782300346aeSmrg    for file in `sed -n "
11783300346aeSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11784300346aeSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11785300346aeSmrg      # Make sure the directory exists.
11786300346aeSmrg      test -f "$dirpart/$file" && continue
11787300346aeSmrg      fdir=`AS_DIRNAME(["$file"])`
11788300346aeSmrg      AS_MKDIR_P([$dirpart/$fdir])
11789300346aeSmrg      # echo "creating $dirpart/$file"
11790300346aeSmrg      echo '# dummy' > "$dirpart/$file"
11791300346aeSmrg    done
11792300346aeSmrg  done
11793300346aeSmrg}
11794300346aeSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11795300346aeSmrg
11796300346aeSmrg
11797300346aeSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11798300346aeSmrg# -----------------------------
11799300346aeSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
11800300346aeSmrg#
11801300346aeSmrg# This code is only required when automatic dependency tracking
11802300346aeSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
11803300346aeSmrg# need in order to bootstrap the dependency handling code.
11804300346aeSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11805300346aeSmrg[AC_CONFIG_COMMANDS([depfiles],
11806300346aeSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11807300346aeSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11808300346aeSmrg])
11809300346aeSmrg
11810300346aeSmrg# Do all the work for Automake.                             -*- Autoconf -*-
11811300346aeSmrg
11812300346aeSmrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
11813300346aeSmrg#
11814300346aeSmrg# This file is free software; the Free Software Foundation
11815300346aeSmrg# gives unlimited permission to copy and/or distribute it,
11816300346aeSmrg# with or without modifications, as long as this notice is preserved.
11817300346aeSmrg
11818300346aeSmrg# This macro actually does too much.  Some checks are only needed if
11819300346aeSmrg# your package does certain things.  But this isn't really a big deal.
11820300346aeSmrg
11821300346aeSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11822300346aeSmrgm4_define([AC_PROG_CC],
11823300346aeSmrgm4_defn([AC_PROG_CC])
11824300346aeSmrg[_AM_PROG_CC_C_O
11825300346aeSmrg])
11826300346aeSmrg
11827300346aeSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11828300346aeSmrg# AM_INIT_AUTOMAKE([OPTIONS])
11829300346aeSmrg# -----------------------------------------------
11830300346aeSmrg# The call with PACKAGE and VERSION arguments is the old style
11831300346aeSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11832300346aeSmrg# and VERSION should now be passed to AC_INIT and removed from
11833300346aeSmrg# the call to AM_INIT_AUTOMAKE.
11834300346aeSmrg# We support both call styles for the transition.  After
11835300346aeSmrg# the next Automake release, Autoconf can make the AC_INIT
11836300346aeSmrg# arguments mandatory, and then we can depend on a new Autoconf
11837300346aeSmrg# release and drop the old call support.
11838300346aeSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11839300346aeSmrg[AC_PREREQ([2.65])dnl
11840300346aeSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11841300346aeSmrgdnl the ones we care about.
11842300346aeSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11843300346aeSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11844300346aeSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11845300346aeSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11846300346aeSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11847300346aeSmrg  # is not polluted with repeated "-I."
11848300346aeSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11849300346aeSmrg  # test to see if srcdir already configured
11850300346aeSmrg  if test -f $srcdir/config.status; then
11851300346aeSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11852300346aeSmrg  fi
11853300346aeSmrgfi
11854300346aeSmrg
11855300346aeSmrg# test whether we have cygpath
11856300346aeSmrgif test -z "$CYGPATH_W"; then
11857300346aeSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11858300346aeSmrg    CYGPATH_W='cygpath -w'
11859300346aeSmrg  else
11860300346aeSmrg    CYGPATH_W=echo
11861300346aeSmrg  fi
11862300346aeSmrgfi
11863300346aeSmrgAC_SUBST([CYGPATH_W])
11864300346aeSmrg
11865300346aeSmrg# Define the identity of the package.
11866300346aeSmrgdnl Distinguish between old-style and new-style calls.
11867300346aeSmrgm4_ifval([$2],
11868300346aeSmrg[AC_DIAGNOSE([obsolete],
11869300346aeSmrg             [$0: two- and three-arguments forms are deprecated.])
11870300346aeSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11871300346aeSmrg AC_SUBST([PACKAGE], [$1])dnl
11872300346aeSmrg AC_SUBST([VERSION], [$2])],
11873300346aeSmrg[_AM_SET_OPTIONS([$1])dnl
11874300346aeSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11875300346aeSmrgm4_if(
11876300346aeSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11877300346aeSmrg  [ok:ok],,
11878300346aeSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11879300346aeSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11880300346aeSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11881300346aeSmrg
11882300346aeSmrg_AM_IF_OPTION([no-define],,
11883300346aeSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11884300346aeSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11885300346aeSmrg
11886300346aeSmrg# Some tools Automake needs.
11887300346aeSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11888300346aeSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11889300346aeSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11890300346aeSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11891300346aeSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11892300346aeSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11893300346aeSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11894300346aeSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11895300346aeSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11896300346aeSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11897300346aeSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
11898300346aeSmrg# dies out for good.  For more background, see:
11899300346aeSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11900300346aeSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11901300346aeSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
11902300346aeSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
11903300346aeSmrg# system "awk" is bad on some platforms.
11904300346aeSmrgAC_REQUIRE([AC_PROG_AWK])dnl
11905300346aeSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11906300346aeSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11907300346aeSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11908300346aeSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11909300346aeSmrg			     [_AM_PROG_TAR([v7])])])
11910300346aeSmrg_AM_IF_OPTION([no-dependencies],,
11911300346aeSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11912300346aeSmrg		  [_AM_DEPENDENCIES([CC])],
11913300346aeSmrg		  [m4_define([AC_PROG_CC],
11914300346aeSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11915300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11916300346aeSmrg		  [_AM_DEPENDENCIES([CXX])],
11917300346aeSmrg		  [m4_define([AC_PROG_CXX],
11918300346aeSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11919300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11920300346aeSmrg		  [_AM_DEPENDENCIES([OBJC])],
11921300346aeSmrg		  [m4_define([AC_PROG_OBJC],
11922300346aeSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11923300346aeSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11924300346aeSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
11925300346aeSmrg		  [m4_define([AC_PROG_OBJCXX],
11926300346aeSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11927300346aeSmrg])
11928300346aeSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11929300346aeSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
11930300346aeSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11931300346aeSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11932300346aeSmrgAC_CONFIG_COMMANDS_PRE(dnl
11933300346aeSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11934300346aeSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11935300346aeSmrg
11936300346aeSmrg# POSIX will say in a future version that running "rm -f" with no argument
11937300346aeSmrg# is OK; and we want to be able to make that assumption in our Makefile
11938300346aeSmrg# recipes.  So use an aggressive probe to check that the usage we want is
11939300346aeSmrg# actually supported "in the wild" to an acceptable degree.
11940300346aeSmrg# See automake bug#10828.
11941300346aeSmrg# To make any issue more visible, cause the running configure to be aborted
11942300346aeSmrg# by default if the 'rm' program in use doesn't match our expectations; the
11943300346aeSmrg# user can still override this though.
11944300346aeSmrgif rm -f && rm -fr && rm -rf; then : OK; else
11945300346aeSmrg  cat >&2 <<'END'
11946300346aeSmrgOops!
11947300346aeSmrg
11948300346aeSmrgYour 'rm' program seems unable to run without file operands specified
11949300346aeSmrgon the command line, even when the '-f' option is present.  This is contrary
11950300346aeSmrgto the behaviour of most rm programs out there, and not conforming with
11951300346aeSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11952300346aeSmrg
11953300346aeSmrgPlease tell bug-automake@gnu.org about your system, including the value
11954300346aeSmrgof your $PATH and any error possibly output before this message.  This
11955300346aeSmrgcan help us improve future automake versions.
11956300346aeSmrg
11957300346aeSmrgEND
11958300346aeSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11959300346aeSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11960300346aeSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11961300346aeSmrg    echo >&2
11962300346aeSmrg  else
11963300346aeSmrg    cat >&2 <<'END'
11964300346aeSmrgAborting the configuration process, to ensure you take notice of the issue.
11965300346aeSmrg
11966300346aeSmrgYou can download and install GNU coreutils to get an 'rm' implementation
11967300346aeSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11968300346aeSmrg
11969300346aeSmrgIf you want to complete the configuration process using your problematic
11970300346aeSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11971300346aeSmrgto "yes", and re-run configure.
11972300346aeSmrg
11973300346aeSmrgEND
11974300346aeSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11975300346aeSmrg  fi
11976300346aeSmrgfi
11977300346aeSmrgdnl The trailing newline in this macro's definition is deliberate, for
11978300346aeSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
11979300346aeSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
11980300346aeSmrg])
11981300346aeSmrg
11982300346aeSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11983300346aeSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11984300346aeSmrgdnl mangled by Autoconf and run in a shell conditional statement.
11985300346aeSmrgm4_define([_AC_COMPILER_EXEEXT],
11986300346aeSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11987300346aeSmrg
11988300346aeSmrg# When config.status generates a header, we must update the stamp-h file.
11989300346aeSmrg# This file resides in the same directory as the config header
11990300346aeSmrg# that is generated.  The stamp files are numbered to have different names.
11991300346aeSmrg
11992300346aeSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11993300346aeSmrg# loop where config.status creates the headers, so we can generate
11994300346aeSmrg# our stamp files there.
11995300346aeSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11996300346aeSmrg[# Compute $1's index in $config_headers.
11997300346aeSmrg_am_arg=$1
11998300346aeSmrg_am_stamp_count=1
11999300346aeSmrgfor _am_header in $config_headers :; do
12000300346aeSmrg  case $_am_header in
12001300346aeSmrg    $_am_arg | $_am_arg:* )
12002300346aeSmrg      break ;;
12003300346aeSmrg    * )
12004300346aeSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
12005300346aeSmrg  esac
12006300346aeSmrgdone
12007300346aeSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
12008300346aeSmrg
12009300346aeSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12010300346aeSmrg#
12011300346aeSmrg# This file is free software; the Free Software Foundation
12012300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12013300346aeSmrg# with or without modifications, as long as this notice is preserved.
12014300346aeSmrg
12015300346aeSmrg# AM_PROG_INSTALL_SH
12016300346aeSmrg# ------------------
12017300346aeSmrg# Define $install_sh.
12018300346aeSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
12019300346aeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12020300346aeSmrgif test x"${install_sh+set}" != xset; then
12021300346aeSmrg  case $am_aux_dir in
12022300346aeSmrg  *\ * | *\	*)
12023300346aeSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
12024300346aeSmrg  *)
12025300346aeSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
12026300346aeSmrg  esac
12027300346aeSmrgfi
12028300346aeSmrgAC_SUBST([install_sh])])
12029300346aeSmrg
12030300346aeSmrg# Copyright (C) 2003-2017 Free Software Foundation, Inc.
12031300346aeSmrg#
12032300346aeSmrg# This file is free software; the Free Software Foundation
12033300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12034300346aeSmrg# with or without modifications, as long as this notice is preserved.
12035300346aeSmrg
12036300346aeSmrg# Check whether the underlying file-system supports filenames
12037300346aeSmrg# with a leading dot.  For instance MS-DOS doesn't.
12038300346aeSmrgAC_DEFUN([AM_SET_LEADING_DOT],
12039300346aeSmrg[rm -rf .tst 2>/dev/null
12040300346aeSmrgmkdir .tst 2>/dev/null
12041300346aeSmrgif test -d .tst; then
12042300346aeSmrg  am__leading_dot=.
12043300346aeSmrgelse
12044300346aeSmrg  am__leading_dot=_
12045300346aeSmrgfi
12046300346aeSmrgrmdir .tst 2>/dev/null
12047300346aeSmrgAC_SUBST([am__leading_dot])])
12048300346aeSmrg
12049300346aeSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
12050300346aeSmrg
12051300346aeSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12052300346aeSmrg#
12053300346aeSmrg# This file is free software; the Free Software Foundation
12054300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12055300346aeSmrg# with or without modifications, as long as this notice is preserved.
12056300346aeSmrg
12057300346aeSmrg# AM_MAKE_INCLUDE()
12058300346aeSmrg# -----------------
12059300346aeSmrg# Check to see how make treats includes.
12060300346aeSmrgAC_DEFUN([AM_MAKE_INCLUDE],
12061300346aeSmrg[am_make=${MAKE-make}
12062300346aeSmrgcat > confinc << 'END'
12063300346aeSmrgam__doit:
12064300346aeSmrg	@echo this is the am__doit target
12065300346aeSmrg.PHONY: am__doit
12066300346aeSmrgEND
12067300346aeSmrg# If we don't find an include directive, just comment out the code.
12068300346aeSmrgAC_MSG_CHECKING([for style of include used by $am_make])
12069300346aeSmrgam__include="#"
12070300346aeSmrgam__quote=
12071300346aeSmrg_am_result=none
12072300346aeSmrg# First try GNU make style include.
12073300346aeSmrgecho "include confinc" > confmf
12074300346aeSmrg# Ignore all kinds of additional output from 'make'.
12075300346aeSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
12076300346aeSmrg*the\ am__doit\ target*)
12077300346aeSmrg  am__include=include
12078300346aeSmrg  am__quote=
12079300346aeSmrg  _am_result=GNU
12080300346aeSmrg  ;;
12081300346aeSmrgesac
12082300346aeSmrg# Now try BSD make style include.
12083300346aeSmrgif test "$am__include" = "#"; then
12084300346aeSmrg   echo '.include "confinc"' > confmf
12085300346aeSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
12086300346aeSmrg   *the\ am__doit\ target*)
12087300346aeSmrg     am__include=.include
12088300346aeSmrg     am__quote="\""
12089300346aeSmrg     _am_result=BSD
12090300346aeSmrg     ;;
12091300346aeSmrg   esac
12092300346aeSmrgfi
12093300346aeSmrgAC_SUBST([am__include])
12094300346aeSmrgAC_SUBST([am__quote])
12095300346aeSmrgAC_MSG_RESULT([$_am_result])
12096300346aeSmrgrm -f confinc confmf
12097300346aeSmrg])
12098300346aeSmrg
12099300346aeSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
12100300346aeSmrg
12101300346aeSmrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
12102300346aeSmrg#
12103300346aeSmrg# This file is free software; the Free Software Foundation
12104300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12105300346aeSmrg# with or without modifications, as long as this notice is preserved.
12106300346aeSmrg
12107300346aeSmrg# AM_MISSING_PROG(NAME, PROGRAM)
12108300346aeSmrg# ------------------------------
12109300346aeSmrgAC_DEFUN([AM_MISSING_PROG],
12110300346aeSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
12111300346aeSmrg$1=${$1-"${am_missing_run}$2"}
12112300346aeSmrgAC_SUBST($1)])
12113300346aeSmrg
12114300346aeSmrg# AM_MISSING_HAS_RUN
12115300346aeSmrg# ------------------
12116300346aeSmrg# Define MISSING if not defined so far and test if it is modern enough.
12117300346aeSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
12118300346aeSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
12119300346aeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12120300346aeSmrgAC_REQUIRE_AUX_FILE([missing])dnl
12121300346aeSmrgif test x"${MISSING+set}" != xset; then
12122300346aeSmrg  case $am_aux_dir in
12123300346aeSmrg  *\ * | *\	*)
12124300346aeSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
12125300346aeSmrg  *)
12126300346aeSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
12127300346aeSmrg  esac
12128300346aeSmrgfi
12129300346aeSmrg# Use eval to expand $SHELL
12130300346aeSmrgif eval "$MISSING --is-lightweight"; then
12131300346aeSmrg  am_missing_run="$MISSING "
12132300346aeSmrgelse
12133300346aeSmrg  am_missing_run=
12134300346aeSmrg  AC_MSG_WARN(['missing' script is too old or missing])
12135300346aeSmrgfi
12136300346aeSmrg])
12137300346aeSmrg
12138300346aeSmrg# Helper functions for option handling.                     -*- Autoconf -*-
12139300346aeSmrg
12140300346aeSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12141300346aeSmrg#
12142300346aeSmrg# This file is free software; the Free Software Foundation
12143300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12144300346aeSmrg# with or without modifications, as long as this notice is preserved.
12145300346aeSmrg
12146300346aeSmrg# _AM_MANGLE_OPTION(NAME)
12147300346aeSmrg# -----------------------
12148300346aeSmrgAC_DEFUN([_AM_MANGLE_OPTION],
12149300346aeSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
12150300346aeSmrg
12151300346aeSmrg# _AM_SET_OPTION(NAME)
12152300346aeSmrg# --------------------
12153300346aeSmrg# Set option NAME.  Presently that only means defining a flag for this option.
12154300346aeSmrgAC_DEFUN([_AM_SET_OPTION],
12155300346aeSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
12156300346aeSmrg
12157300346aeSmrg# _AM_SET_OPTIONS(OPTIONS)
12158300346aeSmrg# ------------------------
12159300346aeSmrg# OPTIONS is a space-separated list of Automake options.
12160300346aeSmrgAC_DEFUN([_AM_SET_OPTIONS],
12161300346aeSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
12162300346aeSmrg
12163300346aeSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
12164300346aeSmrg# -------------------------------------------
12165300346aeSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
12166300346aeSmrgAC_DEFUN([_AM_IF_OPTION],
12167300346aeSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12168300346aeSmrg
12169300346aeSmrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
12170300346aeSmrg#
12171300346aeSmrg# This file is free software; the Free Software Foundation
12172300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12173300346aeSmrg# with or without modifications, as long as this notice is preserved.
12174300346aeSmrg
12175300346aeSmrg# _AM_PROG_CC_C_O
12176300346aeSmrg# ---------------
12177300346aeSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
12178300346aeSmrg# to automatically call this.
12179300346aeSmrgAC_DEFUN([_AM_PROG_CC_C_O],
12180300346aeSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12181300346aeSmrgAC_REQUIRE_AUX_FILE([compile])dnl
12182300346aeSmrgAC_LANG_PUSH([C])dnl
12183300346aeSmrgAC_CACHE_CHECK(
12184300346aeSmrg  [whether $CC understands -c and -o together],
12185300346aeSmrg  [am_cv_prog_cc_c_o],
12186300346aeSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
12187300346aeSmrg  # Make sure it works both with $CC and with simple cc.
12188300346aeSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
12189300346aeSmrg  # compilers refuse to overwrite an existing .o file with -o,
12190300346aeSmrg  # though they will create one.
12191300346aeSmrg  am_cv_prog_cc_c_o=yes
12192300346aeSmrg  for am_i in 1 2; do
12193300346aeSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
12194300346aeSmrg         && test -f conftest2.$ac_objext; then
12195300346aeSmrg      : OK
12196300346aeSmrg    else
12197300346aeSmrg      am_cv_prog_cc_c_o=no
12198300346aeSmrg      break
12199300346aeSmrg    fi
12200300346aeSmrg  done
12201300346aeSmrg  rm -f core conftest*
12202300346aeSmrg  unset am_i])
12203300346aeSmrgif test "$am_cv_prog_cc_c_o" != yes; then
12204300346aeSmrg   # Losing compiler, so override with the script.
12205300346aeSmrg   # FIXME: It is wrong to rewrite CC.
12206300346aeSmrg   # But if we don't then we get into trouble of one sort or another.
12207300346aeSmrg   # A longer-term fix would be to have automake use am__CC in this case,
12208300346aeSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12209300346aeSmrg   CC="$am_aux_dir/compile $CC"
12210300346aeSmrgfi
12211300346aeSmrgAC_LANG_POP([C])])
12212300346aeSmrg
12213300346aeSmrg# For backward compatibility.
12214300346aeSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12215300346aeSmrg
12216300346aeSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12217300346aeSmrg#
12218300346aeSmrg# This file is free software; the Free Software Foundation
12219300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12220300346aeSmrg# with or without modifications, as long as this notice is preserved.
12221300346aeSmrg
12222300346aeSmrg# AM_RUN_LOG(COMMAND)
12223300346aeSmrg# -------------------
12224300346aeSmrg# Run COMMAND, save the exit status in ac_status, and log it.
12225300346aeSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12226300346aeSmrgAC_DEFUN([AM_RUN_LOG],
12227300346aeSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12228300346aeSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12229300346aeSmrg   ac_status=$?
12230300346aeSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12231300346aeSmrg   (exit $ac_status); }])
12232300346aeSmrg
12233300346aeSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12234300346aeSmrg
12235300346aeSmrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
12236300346aeSmrg#
12237300346aeSmrg# This file is free software; the Free Software Foundation
12238300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12239300346aeSmrg# with or without modifications, as long as this notice is preserved.
12240300346aeSmrg
12241300346aeSmrg# AM_SANITY_CHECK
12242300346aeSmrg# ---------------
12243300346aeSmrgAC_DEFUN([AM_SANITY_CHECK],
12244300346aeSmrg[AC_MSG_CHECKING([whether build environment is sane])
12245300346aeSmrg# Reject unsafe characters in $srcdir or the absolute working directory
12246300346aeSmrg# name.  Accept space and tab only in the latter.
12247300346aeSmrgam_lf='
12248300346aeSmrg'
12249300346aeSmrgcase `pwd` in
12250300346aeSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12251300346aeSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12252300346aeSmrgesac
12253300346aeSmrgcase $srcdir in
12254300346aeSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12255300346aeSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12256300346aeSmrgesac
12257300346aeSmrg
12258300346aeSmrg# Do 'set' in a subshell so we don't clobber the current shell's
12259300346aeSmrg# arguments.  Must try -L first in case configure is actually a
12260300346aeSmrg# symlink; some systems play weird games with the mod time of symlinks
12261300346aeSmrg# (eg FreeBSD returns the mod time of the symlink's containing
12262300346aeSmrg# directory).
12263300346aeSmrgif (
12264300346aeSmrg   am_has_slept=no
12265300346aeSmrg   for am_try in 1 2; do
12266300346aeSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12267300346aeSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12268300346aeSmrg     if test "$[*]" = "X"; then
12269300346aeSmrg	# -L didn't work.
12270300346aeSmrg	set X `ls -t "$srcdir/configure" conftest.file`
12271300346aeSmrg     fi
12272300346aeSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12273300346aeSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12274300346aeSmrg
12275300346aeSmrg	# If neither matched, then we have a broken ls.  This can happen
12276300346aeSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12277300346aeSmrg	# broken ls alias from the environment.  This has actually
12278300346aeSmrg	# happened.  Such a system could not be considered "sane".
12279300346aeSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12280300346aeSmrg  alias in your environment])
12281300346aeSmrg     fi
12282300346aeSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12283300346aeSmrg       break
12284300346aeSmrg     fi
12285300346aeSmrg     # Just in case.
12286300346aeSmrg     sleep 1
12287300346aeSmrg     am_has_slept=yes
12288300346aeSmrg   done
12289300346aeSmrg   test "$[2]" = conftest.file
12290300346aeSmrg   )
12291300346aeSmrgthen
12292300346aeSmrg   # Ok.
12293300346aeSmrg   :
12294300346aeSmrgelse
12295300346aeSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
12296300346aeSmrgCheck your system clock])
12297300346aeSmrgfi
12298300346aeSmrgAC_MSG_RESULT([yes])
12299300346aeSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12300300346aeSmrg# generated files are strictly newer.
12301300346aeSmrgam_sleep_pid=
12302300346aeSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12303300346aeSmrg  ( sleep 1 ) &
12304300346aeSmrg  am_sleep_pid=$!
12305300346aeSmrgfi
12306300346aeSmrgAC_CONFIG_COMMANDS_PRE(
12307300346aeSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12308300346aeSmrg   if test -n "$am_sleep_pid"; then
12309300346aeSmrg     # Hide warnings about reused PIDs.
12310300346aeSmrg     wait $am_sleep_pid 2>/dev/null
12311300346aeSmrg   fi
12312300346aeSmrg   AC_MSG_RESULT([done])])
12313300346aeSmrgrm -f conftest.file
12314300346aeSmrg])
12315300346aeSmrg
12316300346aeSmrg# Copyright (C) 2009-2017 Free Software Foundation, Inc.
12317300346aeSmrg#
12318300346aeSmrg# This file is free software; the Free Software Foundation
12319300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12320300346aeSmrg# with or without modifications, as long as this notice is preserved.
12321300346aeSmrg
12322300346aeSmrg# AM_SILENT_RULES([DEFAULT])
12323300346aeSmrg# --------------------------
12324300346aeSmrg# Enable less verbose build rules; with the default set to DEFAULT
12325300346aeSmrg# ("yes" being less verbose, "no" or empty being verbose).
12326300346aeSmrgAC_DEFUN([AM_SILENT_RULES],
12327300346aeSmrg[AC_ARG_ENABLE([silent-rules], [dnl
12328300346aeSmrgAS_HELP_STRING(
12329300346aeSmrg  [--enable-silent-rules],
12330300346aeSmrg  [less verbose build output (undo: "make V=1")])
12331300346aeSmrgAS_HELP_STRING(
12332300346aeSmrg  [--disable-silent-rules],
12333300346aeSmrg  [verbose build output (undo: "make V=0")])dnl
12334300346aeSmrg])
12335300346aeSmrgcase $enable_silent_rules in @%:@ (((
12336300346aeSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
12337300346aeSmrg   no) AM_DEFAULT_VERBOSITY=1;;
12338300346aeSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12339300346aeSmrgesac
12340300346aeSmrgdnl
12341300346aeSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12342300346aeSmrgdnl do not support nested variable expansions.
12343300346aeSmrgdnl See automake bug#9928 and bug#10237.
12344300346aeSmrgam_make=${MAKE-make}
12345300346aeSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12346300346aeSmrg   [am_cv_make_support_nested_variables],
12347300346aeSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12348300346aeSmrgBAR0=false
12349300346aeSmrgBAR1=true
12350300346aeSmrgV=1
12351300346aeSmrgam__doit:
12352300346aeSmrg	@$(TRUE)
12353300346aeSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12354300346aeSmrg  am_cv_make_support_nested_variables=yes
12355300346aeSmrgelse
12356300346aeSmrg  am_cv_make_support_nested_variables=no
12357300346aeSmrgfi])
12358300346aeSmrgif test $am_cv_make_support_nested_variables = yes; then
12359300346aeSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12360300346aeSmrg  AM_V='$(V)'
12361300346aeSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12362300346aeSmrgelse
12363300346aeSmrg  AM_V=$AM_DEFAULT_VERBOSITY
12364300346aeSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12365300346aeSmrgfi
12366300346aeSmrgAC_SUBST([AM_V])dnl
12367300346aeSmrgAM_SUBST_NOTMAKE([AM_V])dnl
12368300346aeSmrgAC_SUBST([AM_DEFAULT_V])dnl
12369300346aeSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12370300346aeSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12371300346aeSmrgAM_BACKSLASH='\'
12372300346aeSmrgAC_SUBST([AM_BACKSLASH])dnl
12373300346aeSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12374300346aeSmrg])
12375300346aeSmrg
12376300346aeSmrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12377300346aeSmrg#
12378300346aeSmrg# This file is free software; the Free Software Foundation
12379300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12380300346aeSmrg# with or without modifications, as long as this notice is preserved.
12381300346aeSmrg
12382300346aeSmrg# AM_PROG_INSTALL_STRIP
12383300346aeSmrg# ---------------------
12384300346aeSmrg# One issue with vendor 'install' (even GNU) is that you can't
12385300346aeSmrg# specify the program used to strip binaries.  This is especially
12386300346aeSmrg# annoying in cross-compiling environments, where the build's strip
12387300346aeSmrg# is unlikely to handle the host's binaries.
12388300346aeSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12389300346aeSmrg# always use install-sh in "make install-strip", and initialize
12390300346aeSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
12391300346aeSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12392300346aeSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12393300346aeSmrg# Installed binaries are usually stripped using 'strip' when the user
12394300346aeSmrg# run "make install-strip".  However 'strip' might not be the right
12395300346aeSmrg# tool to use in cross-compilation environments, therefore Automake
12396300346aeSmrg# will honor the 'STRIP' environment variable to overrule this program.
12397300346aeSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12398300346aeSmrgif test "$cross_compiling" != no; then
12399300346aeSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
12400300346aeSmrgfi
12401300346aeSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12402300346aeSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
12403300346aeSmrg
12404300346aeSmrg# Copyright (C) 2006-2017 Free Software Foundation, Inc.
12405300346aeSmrg#
12406300346aeSmrg# This file is free software; the Free Software Foundation
12407300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12408300346aeSmrg# with or without modifications, as long as this notice is preserved.
12409300346aeSmrg
12410300346aeSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
12411300346aeSmrg# ---------------------------
12412300346aeSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12413300346aeSmrg# This macro is traced by Automake.
12414300346aeSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
12415300346aeSmrg
12416300346aeSmrg# AM_SUBST_NOTMAKE(VARIABLE)
12417300346aeSmrg# --------------------------
12418300346aeSmrg# Public sister of _AM_SUBST_NOTMAKE.
12419300346aeSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
12420300346aeSmrg
12421300346aeSmrg# Check how to create a tarball.                            -*- Autoconf -*-
12422300346aeSmrg
12423300346aeSmrg# Copyright (C) 2004-2017 Free Software Foundation, Inc.
12424126a8a12Smrg#
12425300346aeSmrg# This file is free software; the Free Software Foundation
12426300346aeSmrg# gives unlimited permission to copy and/or distribute it,
12427300346aeSmrg# with or without modifications, as long as this notice is preserved.
12428300346aeSmrg
12429300346aeSmrg# _AM_PROG_TAR(FORMAT)
12430300346aeSmrg# --------------------
12431300346aeSmrg# Check how to create a tarball in format FORMAT.
12432300346aeSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12433555991fdSmrg#
12434300346aeSmrg# Substitute a variable $(am__tar) that is a command
12435300346aeSmrg# writing to stdout a FORMAT-tarball containing the directory
12436300346aeSmrg# $tardir.
12437300346aeSmrg#     tardir=directory && $(am__tar) > result.tar
124383c15da26Smrg#
12439300346aeSmrg# Substitute a variable $(am__untar) that extract such
12440300346aeSmrg# a tarball read from stdin.
12441300346aeSmrg#     $(am__untar) < result.tar
12442300346aeSmrg#
12443300346aeSmrgAC_DEFUN([_AM_PROG_TAR],
12444300346aeSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12445300346aeSmrg# in the wild :-(  We should find a proper way to deprecate it ...
12446300346aeSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
12447126a8a12Smrg
12448300346aeSmrg# We'll loop over all known methods to create a tar archive until one works.
12449300346aeSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12450d656433aSmrg
12451300346aeSmrgm4_if([$1], [v7],
12452300346aeSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12453126a8a12Smrg
12454300346aeSmrg  [m4_case([$1],
12455300346aeSmrg    [ustar],
12456300346aeSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12457300346aeSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12458300346aeSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12459300346aeSmrg      # and bug#13588).
12460300346aeSmrg      am_max_uid=2097151 # 2^21 - 1
12461300346aeSmrg      am_max_gid=$am_max_uid
12462300346aeSmrg      # The $UID and $GID variables are not portable, so we need to resort
12463300346aeSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12464300346aeSmrg      # below are definitely unexpected, so allow the users to see them
12465300346aeSmrg      # (that is, avoid stderr redirection).
12466300346aeSmrg      am_uid=`id -u || echo unknown`
12467300346aeSmrg      am_gid=`id -g || echo unknown`
12468300346aeSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12469300346aeSmrg      if test $am_uid -le $am_max_uid; then
12470300346aeSmrg         AC_MSG_RESULT([yes])
12471300346aeSmrg      else
12472300346aeSmrg         AC_MSG_RESULT([no])
12473300346aeSmrg         _am_tools=none
12474300346aeSmrg      fi
12475300346aeSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12476300346aeSmrg      if test $am_gid -le $am_max_gid; then
12477300346aeSmrg         AC_MSG_RESULT([yes])
12478300346aeSmrg      else
12479300346aeSmrg        AC_MSG_RESULT([no])
12480300346aeSmrg        _am_tools=none
12481300346aeSmrg      fi],
12482d656433aSmrg
12483300346aeSmrg  [pax],
12484300346aeSmrg    [],
12485126a8a12Smrg
12486300346aeSmrg  [m4_fatal([Unknown tar format])])
12487126a8a12Smrg
12488300346aeSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12489126a8a12Smrg
12490300346aeSmrg  # Go ahead even if we have the value already cached.  We do so because we
12491300346aeSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12492300346aeSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12493126a8a12Smrg
12494300346aeSmrg  for _am_tool in $_am_tools; do
12495300346aeSmrg    case $_am_tool in
12496300346aeSmrg    gnutar)
12497300346aeSmrg      for _am_tar in tar gnutar gtar; do
12498300346aeSmrg        AM_RUN_LOG([$_am_tar --version]) && break
12499300346aeSmrg      done
12500300346aeSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12501300346aeSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12502300346aeSmrg      am__untar="$_am_tar -xf -"
12503300346aeSmrg      ;;
12504300346aeSmrg    plaintar)
12505300346aeSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12506300346aeSmrg      # ustar tarball either.
12507300346aeSmrg      (tar --version) >/dev/null 2>&1 && continue
12508300346aeSmrg      am__tar='tar chf - "$$tardir"'
12509300346aeSmrg      am__tar_='tar chf - "$tardir"'
12510300346aeSmrg      am__untar='tar xf -'
12511300346aeSmrg      ;;
12512300346aeSmrg    pax)
12513300346aeSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
12514300346aeSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
12515300346aeSmrg      am__untar='pax -r'
12516300346aeSmrg      ;;
12517300346aeSmrg    cpio)
12518300346aeSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12519300346aeSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12520300346aeSmrg      am__untar='cpio -i -H $1 -d'
12521300346aeSmrg      ;;
12522300346aeSmrg    none)
12523300346aeSmrg      am__tar=false
12524300346aeSmrg      am__tar_=false
12525300346aeSmrg      am__untar=false
12526300346aeSmrg      ;;
12527300346aeSmrg    esac
125283c15da26Smrg
12529300346aeSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
12530300346aeSmrg    # and am__untar set.
12531300346aeSmrg    test -n "${am_cv_prog_tar_$1}" && break
125323c15da26Smrg
12533300346aeSmrg    # tar/untar a dummy directory, and stop if the command works.
12534300346aeSmrg    rm -rf conftest.dir
12535300346aeSmrg    mkdir conftest.dir
12536300346aeSmrg    echo GrepMe > conftest.dir/file
12537300346aeSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12538300346aeSmrg    rm -rf conftest.dir
12539300346aeSmrg    if test -s conftest.tar; then
12540300346aeSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
12541300346aeSmrg      AM_RUN_LOG([cat conftest.dir/file])
12542300346aeSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12543300346aeSmrg    fi
12544300346aeSmrg  done
12545300346aeSmrg  rm -rf conftest.dir
125463c15da26Smrg
12547300346aeSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12548300346aeSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12549126a8a12Smrg
12550300346aeSmrgAC_SUBST([am__tar])
12551300346aeSmrgAC_SUBST([am__untar])
12552300346aeSmrg]) # _AM_PROG_TAR
12553126a8a12Smrg
12554