aclocal.m4 revision 16ee1e9a
116ee1e9aSmrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
2fda9279dSmrg
316ee1e9aSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
4fda9279dSmrg
5fda9279dSmrg# This file is free software; the Free Software Foundation
6fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
7fda9279dSmrg# with or without modifications, as long as this notice is preserved.
8fda9279dSmrg
9fda9279dSmrg# This program is distributed in the hope that it will be useful,
10fda9279dSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11fda9279dSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12fda9279dSmrg# PARTICULAR PURPOSE.
13fda9279dSmrg
14fda9279dSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15fda9279dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16fda9279dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17fda9279dSmrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18fda9279dSmrg[m4_warning([this file was generated for autoconf 2.69.
19fda9279dSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20fda9279dSmrgIf you have problems, you may need to regenerate the build system entirely.
21fda9279dSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22fda9279dSmrg
23fda9279dSmrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24fda9279dSmrg#
2516ee1e9aSmrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
26fda9279dSmrg#   Written by Gordon Matzigkeit, 1996
27fda9279dSmrg#
28fda9279dSmrg# This file is free software; the Free Software Foundation gives
29fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
30fda9279dSmrg# modifications, as long as this notice is preserved.
31fda9279dSmrg
32fda9279dSmrgm4_define([_LT_COPYING], [dnl
3316ee1e9aSmrg# Copyright (C) 2014 Free Software Foundation, Inc.
3416ee1e9aSmrg# This is free software; see the source for copying conditions.  There is NO
3516ee1e9aSmrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3616ee1e9aSmrg
3716ee1e9aSmrg# GNU Libtool is free software; you can redistribute it and/or modify
3816ee1e9aSmrg# it under the terms of the GNU General Public License as published by
3916ee1e9aSmrg# the Free Software Foundation; either version 2 of of the License, or
4016ee1e9aSmrg# (at your option) any later version.
41fda9279dSmrg#
4216ee1e9aSmrg# As a special exception to the GNU General Public License, if you
4316ee1e9aSmrg# distribute this file as part of a program or library that is built
4416ee1e9aSmrg# using GNU Libtool, you may include this file under the  same
4516ee1e9aSmrg# distribution terms that you use for the rest of that program.
46fda9279dSmrg#
4716ee1e9aSmrg# GNU Libtool is distributed in the hope that it will be useful, but
4816ee1e9aSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49fda9279dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50fda9279dSmrg# GNU General Public License for more details.
51fda9279dSmrg#
52fda9279dSmrg# You should have received a copy of the GNU General Public License
5316ee1e9aSmrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54fda9279dSmrg])
55fda9279dSmrg
5616ee1e9aSmrg# serial 58 LT_INIT
57fda9279dSmrg
58fda9279dSmrg
59fda9279dSmrg# LT_PREREQ(VERSION)
60fda9279dSmrg# ------------------
61fda9279dSmrg# Complain and exit if this libtool version is less that VERSION.
62fda9279dSmrgm4_defun([LT_PREREQ],
63fda9279dSmrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64fda9279dSmrg       [m4_default([$3],
65fda9279dSmrg		   [m4_fatal([Libtool version $1 or higher is required],
66fda9279dSmrg		             63)])],
67fda9279dSmrg       [$2])])
68fda9279dSmrg
69fda9279dSmrg
70fda9279dSmrg# _LT_CHECK_BUILDDIR
71fda9279dSmrg# ------------------
72fda9279dSmrg# Complain if the absolute build directory name contains unusual characters
73fda9279dSmrgm4_defun([_LT_CHECK_BUILDDIR],
74fda9279dSmrg[case `pwd` in
75fda9279dSmrg  *\ * | *\	*)
76fda9279dSmrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77fda9279dSmrgesac
78fda9279dSmrg])
79fda9279dSmrg
80fda9279dSmrg
81fda9279dSmrg# LT_INIT([OPTIONS])
82fda9279dSmrg# ------------------
83fda9279dSmrgAC_DEFUN([LT_INIT],
8416ee1e9aSmrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85fda9279dSmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86fda9279dSmrgAC_BEFORE([$0], [LT_LANG])dnl
87fda9279dSmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88fda9279dSmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89fda9279dSmrgm4_require([_LT_CHECK_BUILDDIR])dnl
90fda9279dSmrg
91fda9279dSmrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92fda9279dSmrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93fda9279dSmrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94fda9279dSmrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95fda9279dSmrgdnl unless we require an AC_DEFUNed macro:
96fda9279dSmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97fda9279dSmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98fda9279dSmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99fda9279dSmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100fda9279dSmrgm4_require([_LT_PROG_LTMAIN])dnl
101fda9279dSmrg
102fda9279dSmrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103fda9279dSmrg
104fda9279dSmrgdnl Parse OPTIONS
105fda9279dSmrg_LT_SET_OPTIONS([$0], [$1])
106fda9279dSmrg
107fda9279dSmrg# This can be used to rebuild libtool when needed
10816ee1e9aSmrgLIBTOOL_DEPS=$ltmain
109fda9279dSmrg
110fda9279dSmrg# Always use our own libtool.
111fda9279dSmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112fda9279dSmrgAC_SUBST(LIBTOOL)dnl
113fda9279dSmrg
114fda9279dSmrg_LT_SETUP
115fda9279dSmrg
116fda9279dSmrg# Only expand once:
117fda9279dSmrgm4_define([LT_INIT])
118fda9279dSmrg])# LT_INIT
119fda9279dSmrg
120fda9279dSmrg# Old names:
121fda9279dSmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122fda9279dSmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
124fda9279dSmrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125fda9279dSmrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126fda9279dSmrg
127fda9279dSmrg
12816ee1e9aSmrg# _LT_PREPARE_CC_BASENAME
12916ee1e9aSmrg# -----------------------
13016ee1e9aSmrgm4_defun([_LT_PREPARE_CC_BASENAME], [
13116ee1e9aSmrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13216ee1e9aSmrgfunc_cc_basename ()
13316ee1e9aSmrg{
13416ee1e9aSmrg    for cc_temp in @S|@*""; do
13516ee1e9aSmrg      case $cc_temp in
13616ee1e9aSmrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
13716ee1e9aSmrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
13816ee1e9aSmrg        \-*) ;;
13916ee1e9aSmrg        *) break;;
14016ee1e9aSmrg      esac
14116ee1e9aSmrg    done
14216ee1e9aSmrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14316ee1e9aSmrg}
14416ee1e9aSmrg])# _LT_PREPARE_CC_BASENAME
14516ee1e9aSmrg
14616ee1e9aSmrg
147fda9279dSmrg# _LT_CC_BASENAME(CC)
148fda9279dSmrg# -------------------
14916ee1e9aSmrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
15016ee1e9aSmrg# but that macro is also expanded into generated libtool script, which
15116ee1e9aSmrg# arranges for $SED and $ECHO to be set by different means.
152fda9279dSmrgm4_defun([_LT_CC_BASENAME],
15316ee1e9aSmrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
15416ee1e9aSmrgAC_REQUIRE([_LT_DECL_SED])dnl
15516ee1e9aSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
15616ee1e9aSmrgfunc_cc_basename $1
15716ee1e9aSmrgcc_basename=$func_cc_basename_result
158fda9279dSmrg])
159fda9279dSmrg
160fda9279dSmrg
161fda9279dSmrg# _LT_FILEUTILS_DEFAULTS
162fda9279dSmrg# ----------------------
163fda9279dSmrg# It is okay to use these file commands and assume they have been set
16416ee1e9aSmrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
165fda9279dSmrgm4_defun([_LT_FILEUTILS_DEFAULTS],
166fda9279dSmrg[: ${CP="cp -f"}
167fda9279dSmrg: ${MV="mv -f"}
168fda9279dSmrg: ${RM="rm -f"}
169fda9279dSmrg])# _LT_FILEUTILS_DEFAULTS
170fda9279dSmrg
171fda9279dSmrg
172fda9279dSmrg# _LT_SETUP
173fda9279dSmrg# ---------
174fda9279dSmrgm4_defun([_LT_SETUP],
175fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
176fda9279dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177fda9279dSmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178fda9279dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179fda9279dSmrg
180fda9279dSmrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181fda9279dSmrgdnl
182fda9279dSmrg_LT_DECL([], [host_alias], [0], [The host system])dnl
183fda9279dSmrg_LT_DECL([], [host], [0])dnl
184fda9279dSmrg_LT_DECL([], [host_os], [0])dnl
185fda9279dSmrgdnl
186fda9279dSmrg_LT_DECL([], [build_alias], [0], [The build system])dnl
187fda9279dSmrg_LT_DECL([], [build], [0])dnl
188fda9279dSmrg_LT_DECL([], [build_os], [0])dnl
189fda9279dSmrgdnl
190fda9279dSmrgAC_REQUIRE([AC_PROG_CC])dnl
191fda9279dSmrgAC_REQUIRE([LT_PATH_LD])dnl
192fda9279dSmrgAC_REQUIRE([LT_PATH_NM])dnl
193fda9279dSmrgdnl
194fda9279dSmrgAC_REQUIRE([AC_PROG_LN_S])dnl
195fda9279dSmrgtest -z "$LN_S" && LN_S="ln -s"
196fda9279dSmrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
197fda9279dSmrgdnl
198fda9279dSmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
199fda9279dSmrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
200fda9279dSmrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
201fda9279dSmrgdnl
202fda9279dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
203fda9279dSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204fda9279dSmrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
205fda9279dSmrgm4_require([_LT_CMD_RELOAD])dnl
206fda9279dSmrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207fda9279dSmrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
208fda9279dSmrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
209fda9279dSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210fda9279dSmrgm4_require([_LT_WITH_SYSROOT])dnl
21116ee1e9aSmrgm4_require([_LT_CMD_TRUNCATE])dnl
212fda9279dSmrg
213fda9279dSmrg_LT_CONFIG_LIBTOOL_INIT([
21416ee1e9aSmrg# See if we are running on zsh, and set the options that allow our
215fda9279dSmrg# commands through without removal of \ escapes INIT.
21616ee1e9aSmrgif test -n "\${ZSH_VERSION+set}"; then
217fda9279dSmrg   setopt NO_GLOB_SUBST
218fda9279dSmrgfi
219fda9279dSmrg])
22016ee1e9aSmrgif test -n "${ZSH_VERSION+set}"; then
221fda9279dSmrg   setopt NO_GLOB_SUBST
222fda9279dSmrgfi
223fda9279dSmrg
224fda9279dSmrg_LT_CHECK_OBJDIR
225fda9279dSmrg
226fda9279dSmrgm4_require([_LT_TAG_COMPILER])dnl
227fda9279dSmrg
228fda9279dSmrgcase $host_os in
229fda9279dSmrgaix3*)
230fda9279dSmrg  # AIX sometimes has problems with the GCC collect2 program.  For some
231fda9279dSmrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
232fda9279dSmrg  # vanish in a puff of smoke.
23316ee1e9aSmrg  if test set != "${COLLECT_NAMES+set}"; then
234fda9279dSmrg    COLLECT_NAMES=
235fda9279dSmrg    export COLLECT_NAMES
236fda9279dSmrg  fi
237fda9279dSmrg  ;;
238fda9279dSmrgesac
239fda9279dSmrg
240fda9279dSmrg# Global variables:
241fda9279dSmrgofile=libtool
242fda9279dSmrgcan_build_shared=yes
243fda9279dSmrg
24416ee1e9aSmrg# All known linkers require a '.a' archive for static linking (except MSVC,
245fda9279dSmrg# which needs '.lib').
246fda9279dSmrglibext=a
247fda9279dSmrg
24816ee1e9aSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
249fda9279dSmrg
25016ee1e9aSmrgold_CC=$CC
25116ee1e9aSmrgold_CFLAGS=$CFLAGS
252fda9279dSmrg
253fda9279dSmrg# Set sane defaults for various variables
254fda9279dSmrgtest -z "$CC" && CC=cc
255fda9279dSmrgtest -z "$LTCC" && LTCC=$CC
256fda9279dSmrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
257fda9279dSmrgtest -z "$LD" && LD=ld
258fda9279dSmrgtest -z "$ac_objext" && ac_objext=o
259fda9279dSmrg
260fda9279dSmrg_LT_CC_BASENAME([$compiler])
261fda9279dSmrg
262fda9279dSmrg# Only perform the check for file, if the check method requires it
263fda9279dSmrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
264fda9279dSmrgcase $deplibs_check_method in
265fda9279dSmrgfile_magic*)
266fda9279dSmrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
267fda9279dSmrg    _LT_PATH_MAGIC
268fda9279dSmrg  fi
269fda9279dSmrg  ;;
270fda9279dSmrgesac
271fda9279dSmrg
272fda9279dSmrg# Use C for the default configuration in the libtool script
273fda9279dSmrgLT_SUPPORTED_TAG([CC])
274fda9279dSmrg_LT_LANG_C_CONFIG
275fda9279dSmrg_LT_LANG_DEFAULT_CONFIG
276fda9279dSmrg_LT_CONFIG_COMMANDS
277fda9279dSmrg])# _LT_SETUP
278fda9279dSmrg
279fda9279dSmrg
280fda9279dSmrg# _LT_PREPARE_SED_QUOTE_VARS
281fda9279dSmrg# --------------------------
282fda9279dSmrg# Define a few sed substitution that help us do robust quoting.
283fda9279dSmrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284fda9279dSmrg[# Backslashify metacharacters that are still active within
285fda9279dSmrg# double-quoted strings.
286fda9279dSmrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287fda9279dSmrg
288fda9279dSmrg# Same as above, but do not quote variable references.
289fda9279dSmrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
290fda9279dSmrg
291fda9279dSmrg# Sed substitution to delay expansion of an escaped shell variable in a
292fda9279dSmrg# double_quote_subst'ed string.
293fda9279dSmrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
294fda9279dSmrg
295fda9279dSmrg# Sed substitution to delay expansion of an escaped single quote.
296fda9279dSmrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297fda9279dSmrg
298fda9279dSmrg# Sed substitution to avoid accidental globbing in evaled expressions
299fda9279dSmrgno_glob_subst='s/\*/\\\*/g'
300fda9279dSmrg])
301fda9279dSmrg
302fda9279dSmrg# _LT_PROG_LTMAIN
303fda9279dSmrg# ---------------
30416ee1e9aSmrg# Note that this code is called both from 'configure', and 'config.status'
305fda9279dSmrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
30616ee1e9aSmrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
307fda9279dSmrg# so we pass a copy along to make sure it has a sensible value anyway.
308fda9279dSmrgm4_defun([_LT_PROG_LTMAIN],
309fda9279dSmrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
310fda9279dSmrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
31116ee1e9aSmrgltmain=$ac_aux_dir/ltmain.sh
312fda9279dSmrg])# _LT_PROG_LTMAIN
313fda9279dSmrg
314fda9279dSmrg
315fda9279dSmrg
316fda9279dSmrg# So that we can recreate a full libtool script including additional
317fda9279dSmrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
31816ee1e9aSmrg# in macros and then make a single call at the end using the 'libtool'
319fda9279dSmrg# label.
320fda9279dSmrg
321fda9279dSmrg
322fda9279dSmrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
323fda9279dSmrg# ----------------------------------------
324fda9279dSmrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325fda9279dSmrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
326fda9279dSmrg[m4_ifval([$1],
327fda9279dSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
328fda9279dSmrg                     [$1
329fda9279dSmrg])])])
330fda9279dSmrg
331fda9279dSmrg# Initialize.
332fda9279dSmrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333fda9279dSmrg
334fda9279dSmrg
335fda9279dSmrg# _LT_CONFIG_LIBTOOL([COMMANDS])
336fda9279dSmrg# ------------------------------
337fda9279dSmrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
338fda9279dSmrgm4_define([_LT_CONFIG_LIBTOOL],
339fda9279dSmrg[m4_ifval([$1],
340fda9279dSmrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
341fda9279dSmrg                     [$1
342fda9279dSmrg])])])
343fda9279dSmrg
344fda9279dSmrg# Initialize.
345fda9279dSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
346fda9279dSmrg
347fda9279dSmrg
348fda9279dSmrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
349fda9279dSmrg# -----------------------------------------------------
350fda9279dSmrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
351fda9279dSmrg[_LT_CONFIG_LIBTOOL([$1])
352fda9279dSmrg_LT_CONFIG_LIBTOOL_INIT([$2])
353fda9279dSmrg])
354fda9279dSmrg
355fda9279dSmrg
356fda9279dSmrg# _LT_FORMAT_COMMENT([COMMENT])
357fda9279dSmrg# -----------------------------
358fda9279dSmrg# Add leading comment marks to the start of each line, and a trailing
359fda9279dSmrg# full-stop to the whole comment if one is not present already.
360fda9279dSmrgm4_define([_LT_FORMAT_COMMENT],
361fda9279dSmrg[m4_ifval([$1], [
362fda9279dSmrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
363fda9279dSmrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
364fda9279dSmrg)])
365fda9279dSmrg
366fda9279dSmrg
367fda9279dSmrg
368fda9279dSmrg
369fda9279dSmrg
370fda9279dSmrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
371fda9279dSmrg# -------------------------------------------------------------------
372fda9279dSmrg# CONFIGNAME is the name given to the value in the libtool script.
373fda9279dSmrg# VARNAME is the (base) name used in the configure script.
374fda9279dSmrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
375fda9279dSmrg# VARNAME.  Any other value will be used directly.
376fda9279dSmrgm4_define([_LT_DECL],
377fda9279dSmrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
378fda9279dSmrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
379fda9279dSmrg	[m4_ifval([$1], [$1], [$2])])
380fda9279dSmrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
381fda9279dSmrg    m4_ifval([$4],
382fda9279dSmrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
383fda9279dSmrg    lt_dict_add_subkey([lt_decl_dict], [$2],
384fda9279dSmrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
385fda9279dSmrg])
386fda9279dSmrg
387fda9279dSmrg
388fda9279dSmrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
389fda9279dSmrg# --------------------------------------------------------
390fda9279dSmrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
391fda9279dSmrg
392fda9279dSmrg
393fda9279dSmrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
394fda9279dSmrg# ------------------------------------------------
395fda9279dSmrgm4_define([lt_decl_tag_varnames],
396fda9279dSmrg[_lt_decl_filter([tagged?], [yes], $@)])
397fda9279dSmrg
398fda9279dSmrg
399fda9279dSmrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
400fda9279dSmrg# ---------------------------------------------------------
401fda9279dSmrgm4_define([_lt_decl_filter],
402fda9279dSmrg[m4_case([$#],
403fda9279dSmrg  [0], [m4_fatal([$0: too few arguments: $#])],
404fda9279dSmrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
405fda9279dSmrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
406fda9279dSmrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
407fda9279dSmrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
408fda9279dSmrg])
409fda9279dSmrg
410fda9279dSmrg
411fda9279dSmrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
412fda9279dSmrg# --------------------------------------------------
413fda9279dSmrgm4_define([lt_decl_quote_varnames],
414fda9279dSmrg[_lt_decl_filter([value], [1], $@)])
415fda9279dSmrg
416fda9279dSmrg
417fda9279dSmrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
418fda9279dSmrg# ---------------------------------------------------
419fda9279dSmrgm4_define([lt_decl_dquote_varnames],
420fda9279dSmrg[_lt_decl_filter([value], [2], $@)])
421fda9279dSmrg
422fda9279dSmrg
423fda9279dSmrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
424fda9279dSmrg# ---------------------------------------------------
425fda9279dSmrgm4_define([lt_decl_varnames_tagged],
426fda9279dSmrg[m4_assert([$# <= 2])dnl
427fda9279dSmrg_$0(m4_quote(m4_default([$1], [[, ]])),
428fda9279dSmrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
429fda9279dSmrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
430fda9279dSmrgm4_define([_lt_decl_varnames_tagged],
431fda9279dSmrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
432fda9279dSmrg
433fda9279dSmrg
434fda9279dSmrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
435fda9279dSmrg# ------------------------------------------------
436fda9279dSmrgm4_define([lt_decl_all_varnames],
437fda9279dSmrg[_$0(m4_quote(m4_default([$1], [[, ]])),
438fda9279dSmrg     m4_if([$2], [],
439fda9279dSmrg	   m4_quote(lt_decl_varnames),
440fda9279dSmrg	m4_quote(m4_shift($@))))[]dnl
441fda9279dSmrg])
442fda9279dSmrgm4_define([_lt_decl_all_varnames],
443fda9279dSmrg[lt_join($@, lt_decl_varnames_tagged([$1],
444fda9279dSmrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
445fda9279dSmrg])
446fda9279dSmrg
447fda9279dSmrg
448fda9279dSmrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
449fda9279dSmrg# ------------------------------------
45016ee1e9aSmrg# Quote a variable value, and forward it to 'config.status' so that its
45116ee1e9aSmrg# declaration there will have the same value as in 'configure'.  VARNAME
452fda9279dSmrg# must have a single quote delimited value for this to work.
453fda9279dSmrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454fda9279dSmrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455fda9279dSmrg
456fda9279dSmrg
457fda9279dSmrg# _LT_CONFIG_STATUS_DECLARATIONS
458fda9279dSmrg# ------------------------------
459fda9279dSmrg# We delimit libtool config variables with single quotes, so when
460fda9279dSmrg# we write them to config.status, we have to be sure to quote all
461fda9279dSmrg# embedded single quotes properly.  In configure, this macro expands
462fda9279dSmrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
463fda9279dSmrg#
464fda9279dSmrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
465fda9279dSmrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
466fda9279dSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
467fda9279dSmrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
468fda9279dSmrg
469fda9279dSmrg
470fda9279dSmrg# _LT_LIBTOOL_TAGS
471fda9279dSmrg# ----------------
472fda9279dSmrg# Output comment and list of tags supported by the script
473fda9279dSmrgm4_defun([_LT_LIBTOOL_TAGS],
474fda9279dSmrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
47516ee1e9aSmrgavailable_tags='_LT_TAGS'dnl
476fda9279dSmrg])
477fda9279dSmrg
478fda9279dSmrg
479fda9279dSmrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
480fda9279dSmrg# -----------------------------------
481fda9279dSmrg# Extract the dictionary values for VARNAME (optionally with TAG) and
482fda9279dSmrg# expand to a commented shell variable setting:
483fda9279dSmrg#
484fda9279dSmrg#    # Some comment about what VAR is for.
485fda9279dSmrg#    visible_name=$lt_internal_name
486fda9279dSmrgm4_define([_LT_LIBTOOL_DECLARE],
487fda9279dSmrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
488fda9279dSmrg					   [description])))[]dnl
489fda9279dSmrgm4_pushdef([_libtool_name],
490fda9279dSmrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
491fda9279dSmrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
492fda9279dSmrg    [0], [_libtool_name=[$]$1],
493fda9279dSmrg    [1], [_libtool_name=$lt_[]$1],
494fda9279dSmrg    [2], [_libtool_name=$lt_[]$1],
495fda9279dSmrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
496fda9279dSmrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497fda9279dSmrg])
498fda9279dSmrg
499fda9279dSmrg
500fda9279dSmrg# _LT_LIBTOOL_CONFIG_VARS
501fda9279dSmrg# -----------------------
502fda9279dSmrg# Produce commented declarations of non-tagged libtool config variables
50316ee1e9aSmrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
504fda9279dSmrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
505fda9279dSmrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
506fda9279dSmrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
507fda9279dSmrg[m4_foreach([_lt_var],
508fda9279dSmrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
509fda9279dSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
510fda9279dSmrg
511fda9279dSmrg
512fda9279dSmrg# _LT_LIBTOOL_TAG_VARS(TAG)
513fda9279dSmrg# -------------------------
514fda9279dSmrgm4_define([_LT_LIBTOOL_TAG_VARS],
515fda9279dSmrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
516fda9279dSmrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517fda9279dSmrg
518fda9279dSmrg
519fda9279dSmrg# _LT_TAGVAR(VARNAME, [TAGNAME])
520fda9279dSmrg# ------------------------------
521fda9279dSmrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522fda9279dSmrg
523fda9279dSmrg
524fda9279dSmrg# _LT_CONFIG_COMMANDS
525fda9279dSmrg# -------------------
526fda9279dSmrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
527fda9279dSmrg# variables for single and double quote escaping we saved from calls
528fda9279dSmrg# to _LT_DECL, we can put quote escaped variables declarations
52916ee1e9aSmrg# into 'config.status', and then the shell code to quote escape them in
53016ee1e9aSmrg# for loops in 'config.status'.  Finally, any additional code accumulated
531fda9279dSmrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
532fda9279dSmrgm4_defun([_LT_CONFIG_COMMANDS],
533fda9279dSmrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
534fda9279dSmrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
535fda9279dSmrg	dnl instead of duplicating it all over again into config.status,
536fda9279dSmrg	dnl then we will have config.status run $CONFIG_LT later, so it
537fda9279dSmrg	dnl needs to know what name is stored there:
538fda9279dSmrg        [AC_CONFIG_COMMANDS([libtool],
539fda9279dSmrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
540fda9279dSmrg    dnl If the libtool generation code is destined for config.status,
541fda9279dSmrg    dnl expand the accumulated commands and init code now:
542fda9279dSmrg    [AC_CONFIG_COMMANDS([libtool],
543fda9279dSmrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
544fda9279dSmrg])#_LT_CONFIG_COMMANDS
545fda9279dSmrg
546fda9279dSmrg
547fda9279dSmrg# Initialize.
548fda9279dSmrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
549fda9279dSmrg[
550fda9279dSmrg
551fda9279dSmrg# The HP-UX ksh and POSIX shell print the target directory to stdout
552fda9279dSmrg# if CDPATH is set.
553fda9279dSmrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554fda9279dSmrg
555fda9279dSmrgsed_quote_subst='$sed_quote_subst'
556fda9279dSmrgdouble_quote_subst='$double_quote_subst'
557fda9279dSmrgdelay_variable_subst='$delay_variable_subst'
558fda9279dSmrg_LT_CONFIG_STATUS_DECLARATIONS
559fda9279dSmrgLTCC='$LTCC'
560fda9279dSmrgLTCFLAGS='$LTCFLAGS'
561fda9279dSmrgcompiler='$compiler_DEFAULT'
562fda9279dSmrg
563fda9279dSmrg# A function that is used when there is no print builtin or printf.
564fda9279dSmrgfunc_fallback_echo ()
565fda9279dSmrg{
566fda9279dSmrg  eval 'cat <<_LTECHO_EOF
567fda9279dSmrg\$[]1
568fda9279dSmrg_LTECHO_EOF'
569fda9279dSmrg}
570fda9279dSmrg
571fda9279dSmrg# Quote evaled strings.
572fda9279dSmrgfor var in lt_decl_all_varnames([[ \
573fda9279dSmrg]], lt_decl_quote_varnames); do
574fda9279dSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575fda9279dSmrg    *[[\\\\\\\`\\"\\\$]]*)
57616ee1e9aSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
577fda9279dSmrg      ;;
578fda9279dSmrg    *)
579fda9279dSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
580fda9279dSmrg      ;;
581fda9279dSmrg    esac
582fda9279dSmrgdone
583fda9279dSmrg
584fda9279dSmrg# Double-quote double-evaled strings.
585fda9279dSmrgfor var in lt_decl_all_varnames([[ \
586fda9279dSmrg]], lt_decl_dquote_varnames); do
587fda9279dSmrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
588fda9279dSmrg    *[[\\\\\\\`\\"\\\$]]*)
58916ee1e9aSmrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
590fda9279dSmrg      ;;
591fda9279dSmrg    *)
592fda9279dSmrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
593fda9279dSmrg      ;;
594fda9279dSmrg    esac
595fda9279dSmrgdone
596fda9279dSmrg
597fda9279dSmrg_LT_OUTPUT_LIBTOOL_INIT
598fda9279dSmrg])
599fda9279dSmrg
600fda9279dSmrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601fda9279dSmrg# ------------------------------------
602fda9279dSmrg# Generate a child script FILE with all initialization necessary to
603fda9279dSmrg# reuse the environment learned by the parent script, and make the
604fda9279dSmrg# file executable.  If COMMENT is supplied, it is inserted after the
60516ee1e9aSmrg# '#!' sequence but before initialization text begins.  After this
606fda9279dSmrg# macro, additional text can be appended to FILE to form the body of
607fda9279dSmrg# the child script.  The macro ends with non-zero status if the
608fda9279dSmrg# file could not be fully written (such as if the disk is full).
609fda9279dSmrgm4_ifdef([AS_INIT_GENERATED],
610fda9279dSmrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611fda9279dSmrg[m4_defun([_LT_GENERATED_FILE_INIT],
612fda9279dSmrg[m4_require([AS_PREPARE])]dnl
613fda9279dSmrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614fda9279dSmrg[lt_write_fail=0
615fda9279dSmrgcat >$1 <<_ASEOF || lt_write_fail=1
616fda9279dSmrg#! $SHELL
617fda9279dSmrg# Generated by $as_me.
618fda9279dSmrg$2
619fda9279dSmrgSHELL=\${CONFIG_SHELL-$SHELL}
620fda9279dSmrgexport SHELL
621fda9279dSmrg_ASEOF
622fda9279dSmrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623fda9279dSmrgAS_SHELL_SANITIZE
624fda9279dSmrg_AS_PREPARE
625fda9279dSmrgexec AS_MESSAGE_FD>&1
626fda9279dSmrg_ASEOF
62716ee1e9aSmrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628fda9279dSmrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
629fda9279dSmrg
630fda9279dSmrg# LT_OUTPUT
631fda9279dSmrg# ---------
632fda9279dSmrg# This macro allows early generation of the libtool script (before
633fda9279dSmrg# AC_OUTPUT is called), incase it is used in configure for compilation
634fda9279dSmrg# tests.
635fda9279dSmrgAC_DEFUN([LT_OUTPUT],
636fda9279dSmrg[: ${CONFIG_LT=./config.lt}
637fda9279dSmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638fda9279dSmrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639fda9279dSmrg[# Run this file to recreate a libtool stub with the current configuration.])
640fda9279dSmrg
641fda9279dSmrgcat >>"$CONFIG_LT" <<\_LTEOF
642fda9279dSmrglt_cl_silent=false
643fda9279dSmrgexec AS_MESSAGE_LOG_FD>>config.log
644fda9279dSmrg{
645fda9279dSmrg  echo
646fda9279dSmrg  AS_BOX([Running $as_me.])
647fda9279dSmrg} >&AS_MESSAGE_LOG_FD
648fda9279dSmrg
649fda9279dSmrglt_cl_help="\
65016ee1e9aSmrg'$as_me' creates a local libtool stub from the current configuration,
651fda9279dSmrgfor use in further configure time tests before the real libtool is
652fda9279dSmrggenerated.
653fda9279dSmrg
654fda9279dSmrgUsage: $[0] [[OPTIONS]]
655fda9279dSmrg
656fda9279dSmrg  -h, --help      print this help, then exit
657fda9279dSmrg  -V, --version   print version number, then exit
658fda9279dSmrg  -q, --quiet     do not print progress messages
659fda9279dSmrg  -d, --debug     don't remove temporary files
660fda9279dSmrg
661fda9279dSmrgReport bugs to <bug-libtool@gnu.org>."
662fda9279dSmrg
663fda9279dSmrglt_cl_version="\
664fda9279dSmrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
665fda9279dSmrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
666fda9279dSmrgconfigured by $[0], generated by m4_PACKAGE_STRING.
667fda9279dSmrg
668fda9279dSmrgCopyright (C) 2011 Free Software Foundation, Inc.
669fda9279dSmrgThis config.lt script is free software; the Free Software Foundation
670fda9279dSmrggives unlimited permision to copy, distribute and modify it."
671fda9279dSmrg
67216ee1e9aSmrgwhile test 0 != $[#]
673fda9279dSmrgdo
674fda9279dSmrg  case $[1] in
675fda9279dSmrg    --version | --v* | -V )
676fda9279dSmrg      echo "$lt_cl_version"; exit 0 ;;
677fda9279dSmrg    --help | --h* | -h )
678fda9279dSmrg      echo "$lt_cl_help"; exit 0 ;;
679fda9279dSmrg    --debug | --d* | -d )
680fda9279dSmrg      debug=: ;;
681fda9279dSmrg    --quiet | --q* | --silent | --s* | -q )
682fda9279dSmrg      lt_cl_silent=: ;;
683fda9279dSmrg
684fda9279dSmrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
68516ee1e9aSmrgTry '$[0] --help' for more information.]) ;;
686fda9279dSmrg
687fda9279dSmrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
68816ee1e9aSmrgTry '$[0] --help' for more information.]) ;;
689fda9279dSmrg  esac
690fda9279dSmrg  shift
691fda9279dSmrgdone
692fda9279dSmrg
693fda9279dSmrgif $lt_cl_silent; then
694fda9279dSmrg  exec AS_MESSAGE_FD>/dev/null
695fda9279dSmrgfi
696fda9279dSmrg_LTEOF
697fda9279dSmrg
698fda9279dSmrgcat >>"$CONFIG_LT" <<_LTEOF
699fda9279dSmrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
700fda9279dSmrg_LTEOF
701fda9279dSmrg
702fda9279dSmrgcat >>"$CONFIG_LT" <<\_LTEOF
703fda9279dSmrgAC_MSG_NOTICE([creating $ofile])
704fda9279dSmrg_LT_OUTPUT_LIBTOOL_COMMANDS
705fda9279dSmrgAS_EXIT(0)
706fda9279dSmrg_LTEOF
707fda9279dSmrgchmod +x "$CONFIG_LT"
708fda9279dSmrg
709fda9279dSmrg# configure is writing to config.log, but config.lt does its own redirection,
710fda9279dSmrg# appending to config.log, which fails on DOS, as config.log is still kept
711fda9279dSmrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
712fda9279dSmrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713fda9279dSmrglt_cl_success=:
71416ee1e9aSmrgtest yes = "$silent" &&
715fda9279dSmrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716fda9279dSmrgexec AS_MESSAGE_LOG_FD>/dev/null
717fda9279dSmrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718fda9279dSmrgexec AS_MESSAGE_LOG_FD>>config.log
719fda9279dSmrg$lt_cl_success || AS_EXIT(1)
720fda9279dSmrg])# LT_OUTPUT
721fda9279dSmrg
722fda9279dSmrg
723fda9279dSmrg# _LT_CONFIG(TAG)
724fda9279dSmrg# ---------------
725fda9279dSmrg# If TAG is the built-in tag, create an initial libtool script with a
726fda9279dSmrg# default configuration from the untagged config vars.  Otherwise add code
727fda9279dSmrg# to config.status for appending the configuration named by TAG from the
728fda9279dSmrg# matching tagged config vars.
729fda9279dSmrgm4_defun([_LT_CONFIG],
730fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
731fda9279dSmrg_LT_CONFIG_SAVE_COMMANDS([
732fda9279dSmrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
733fda9279dSmrg  m4_if(_LT_TAG, [C], [
73416ee1e9aSmrg    # See if we are running on zsh, and set the options that allow our
735fda9279dSmrg    # commands through without removal of \ escapes.
73616ee1e9aSmrg    if test -n "${ZSH_VERSION+set}"; then
737fda9279dSmrg      setopt NO_GLOB_SUBST
738fda9279dSmrg    fi
739fda9279dSmrg
74016ee1e9aSmrg    cfgfile=${ofile}T
741fda9279dSmrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
742fda9279dSmrg    $RM "$cfgfile"
743fda9279dSmrg
744fda9279dSmrg    cat <<_LT_EOF >> "$cfgfile"
745fda9279dSmrg#! $SHELL
74616ee1e9aSmrg# Generated automatically by $as_me ($PACKAGE) $VERSION
747fda9279dSmrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
748fda9279dSmrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74916ee1e9aSmrg
75016ee1e9aSmrg# Provide generalized library-building support services.
75116ee1e9aSmrg# Written by Gordon Matzigkeit, 1996
75216ee1e9aSmrg
753fda9279dSmrg_LT_COPYING
754fda9279dSmrg_LT_LIBTOOL_TAGS
755fda9279dSmrg
75616ee1e9aSmrg# Configured defaults for sys_lib_dlsearch_path munging.
75716ee1e9aSmrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
75816ee1e9aSmrg
759fda9279dSmrg# ### BEGIN LIBTOOL CONFIG
760fda9279dSmrg_LT_LIBTOOL_CONFIG_VARS
761fda9279dSmrg_LT_LIBTOOL_TAG_VARS
762fda9279dSmrg# ### END LIBTOOL CONFIG
763fda9279dSmrg
76416ee1e9aSmrg_LT_EOF
76516ee1e9aSmrg
76616ee1e9aSmrg    cat <<'_LT_EOF' >> "$cfgfile"
76716ee1e9aSmrg
76816ee1e9aSmrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
76916ee1e9aSmrg
77016ee1e9aSmrg_LT_PREPARE_MUNGE_PATH_LIST
77116ee1e9aSmrg_LT_PREPARE_CC_BASENAME
77216ee1e9aSmrg
77316ee1e9aSmrg# ### END FUNCTIONS SHARED WITH CONFIGURE
77416ee1e9aSmrg
775fda9279dSmrg_LT_EOF
776fda9279dSmrg
777fda9279dSmrg  case $host_os in
778fda9279dSmrg  aix3*)
779fda9279dSmrg    cat <<\_LT_EOF >> "$cfgfile"
780fda9279dSmrg# AIX sometimes has problems with the GCC collect2 program.  For some
781fda9279dSmrg# reason, if we set the COLLECT_NAMES environment variable, the problems
782fda9279dSmrg# vanish in a puff of smoke.
78316ee1e9aSmrgif test set != "${COLLECT_NAMES+set}"; then
784fda9279dSmrg  COLLECT_NAMES=
785fda9279dSmrg  export COLLECT_NAMES
786fda9279dSmrgfi
787fda9279dSmrg_LT_EOF
788fda9279dSmrg    ;;
789fda9279dSmrg  esac
790fda9279dSmrg
791fda9279dSmrg  _LT_PROG_LTMAIN
792fda9279dSmrg
793fda9279dSmrg  # We use sed instead of cat because bash on DJGPP gets confused if
794fda9279dSmrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
795fda9279dSmrg  # text mode, it properly converts lines to CR/LF.  This bash problem
796fda9279dSmrg  # is reportedly fixed, but why not run on old versions too?
797fda9279dSmrg  sed '$q' "$ltmain" >> "$cfgfile" \
798fda9279dSmrg     || (rm -f "$cfgfile"; exit 1)
799fda9279dSmrg
800fda9279dSmrg   mv -f "$cfgfile" "$ofile" ||
801fda9279dSmrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
802fda9279dSmrg  chmod +x "$ofile"
803fda9279dSmrg],
804fda9279dSmrg[cat <<_LT_EOF >> "$ofile"
805fda9279dSmrg
806fda9279dSmrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
807fda9279dSmrgdnl in a comment (ie after a #).
808fda9279dSmrg# ### BEGIN LIBTOOL TAG CONFIG: $1
809fda9279dSmrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
810fda9279dSmrg# ### END LIBTOOL TAG CONFIG: $1
811fda9279dSmrg_LT_EOF
812fda9279dSmrg])dnl /m4_if
813fda9279dSmrg],
814fda9279dSmrg[m4_if([$1], [], [
815fda9279dSmrg    PACKAGE='$PACKAGE'
816fda9279dSmrg    VERSION='$VERSION'
817fda9279dSmrg    RM='$RM'
818fda9279dSmrg    ofile='$ofile'], [])
819fda9279dSmrg])dnl /_LT_CONFIG_SAVE_COMMANDS
820fda9279dSmrg])# _LT_CONFIG
821fda9279dSmrg
822fda9279dSmrg
823fda9279dSmrg# LT_SUPPORTED_TAG(TAG)
824fda9279dSmrg# ---------------------
825fda9279dSmrg# Trace this macro to discover what tags are supported by the libtool
826fda9279dSmrg# --tag option, using:
827fda9279dSmrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
828fda9279dSmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
829fda9279dSmrg
830fda9279dSmrg
831fda9279dSmrg# C support is built-in for now
832fda9279dSmrgm4_define([_LT_LANG_C_enabled], [])
833fda9279dSmrgm4_define([_LT_TAGS], [])
834fda9279dSmrg
835fda9279dSmrg
836fda9279dSmrg# LT_LANG(LANG)
837fda9279dSmrg# -------------
838fda9279dSmrg# Enable libtool support for the given language if not already enabled.
839fda9279dSmrgAC_DEFUN([LT_LANG],
840fda9279dSmrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
841fda9279dSmrgm4_case([$1],
842fda9279dSmrg  [C],			[_LT_LANG(C)],
843fda9279dSmrg  [C++],		[_LT_LANG(CXX)],
844fda9279dSmrg  [Go],			[_LT_LANG(GO)],
845fda9279dSmrg  [Java],		[_LT_LANG(GCJ)],
846fda9279dSmrg  [Fortran 77],		[_LT_LANG(F77)],
847fda9279dSmrg  [Fortran],		[_LT_LANG(FC)],
848fda9279dSmrg  [Windows Resource],	[_LT_LANG(RC)],
849fda9279dSmrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
850fda9279dSmrg    [_LT_LANG($1)],
851fda9279dSmrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
852fda9279dSmrg])# LT_LANG
853fda9279dSmrg
854fda9279dSmrg
855fda9279dSmrg# _LT_LANG(LANGNAME)
856fda9279dSmrg# ------------------
857fda9279dSmrgm4_defun([_LT_LANG],
858fda9279dSmrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
859fda9279dSmrg  [LT_SUPPORTED_TAG([$1])dnl
860fda9279dSmrg  m4_append([_LT_TAGS], [$1 ])dnl
861fda9279dSmrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
862fda9279dSmrg  _LT_LANG_$1_CONFIG($1)])dnl
863fda9279dSmrg])# _LT_LANG
864fda9279dSmrg
865fda9279dSmrg
866fda9279dSmrgm4_ifndef([AC_PROG_GO], [
867fda9279dSmrg# NOTE: This macro has been submitted for inclusion into   #
868fda9279dSmrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
869fda9279dSmrg#  a released version of Autoconf we should remove this    #
870fda9279dSmrg#  macro and use it instead.                               #
871fda9279dSmrgm4_defun([AC_PROG_GO],
872fda9279dSmrg[AC_LANG_PUSH(Go)dnl
873fda9279dSmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
874fda9279dSmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
875fda9279dSmrg_AC_ARG_VAR_LDFLAGS()dnl
876fda9279dSmrgAC_CHECK_TOOL(GOC, gccgo)
877fda9279dSmrgif test -z "$GOC"; then
878fda9279dSmrg  if test -n "$ac_tool_prefix"; then
879fda9279dSmrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
880fda9279dSmrg  fi
881fda9279dSmrgfi
882fda9279dSmrgif test -z "$GOC"; then
883fda9279dSmrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
884fda9279dSmrgfi
885fda9279dSmrg])#m4_defun
886fda9279dSmrg])#m4_ifndef
887fda9279dSmrg
888fda9279dSmrg
889fda9279dSmrg# _LT_LANG_DEFAULT_CONFIG
890fda9279dSmrg# -----------------------
891fda9279dSmrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
892fda9279dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
893fda9279dSmrg  [LT_LANG(CXX)],
894fda9279dSmrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
895fda9279dSmrg
896fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
897fda9279dSmrg  [LT_LANG(F77)],
898fda9279dSmrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
899fda9279dSmrg
900fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
901fda9279dSmrg  [LT_LANG(FC)],
902fda9279dSmrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
903fda9279dSmrg
904fda9279dSmrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
905fda9279dSmrgdnl pulling things in needlessly.
906fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
907fda9279dSmrg  [LT_LANG(GCJ)],
908fda9279dSmrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
909fda9279dSmrg    [LT_LANG(GCJ)],
910fda9279dSmrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
911fda9279dSmrg      [LT_LANG(GCJ)],
912fda9279dSmrg      [m4_ifdef([AC_PROG_GCJ],
913fda9279dSmrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
914fda9279dSmrg       m4_ifdef([A][M_PROG_GCJ],
915fda9279dSmrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
916fda9279dSmrg       m4_ifdef([LT_PROG_GCJ],
917fda9279dSmrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
918fda9279dSmrg
919fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
920fda9279dSmrg  [LT_LANG(GO)],
921fda9279dSmrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
922fda9279dSmrg
923fda9279dSmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
924fda9279dSmrg  [LT_LANG(RC)],
925fda9279dSmrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
926fda9279dSmrg])# _LT_LANG_DEFAULT_CONFIG
927fda9279dSmrg
928fda9279dSmrg# Obsolete macros:
929fda9279dSmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
930fda9279dSmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
931fda9279dSmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
932fda9279dSmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
933fda9279dSmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
934fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
935fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
936fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
937fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
938fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
939fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
940fda9279dSmrg
941fda9279dSmrg
942fda9279dSmrg# _LT_TAG_COMPILER
943fda9279dSmrg# ----------------
944fda9279dSmrgm4_defun([_LT_TAG_COMPILER],
945fda9279dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
946fda9279dSmrg
947fda9279dSmrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
948fda9279dSmrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
949fda9279dSmrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
950fda9279dSmrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
951fda9279dSmrg
952fda9279dSmrg# If no C compiler was specified, use CC.
953fda9279dSmrgLTCC=${LTCC-"$CC"}
954fda9279dSmrg
955fda9279dSmrg# If no C compiler flags were specified, use CFLAGS.
956fda9279dSmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
957fda9279dSmrg
958fda9279dSmrg# Allow CC to be a program name with arguments.
959fda9279dSmrgcompiler=$CC
960fda9279dSmrg])# _LT_TAG_COMPILER
961fda9279dSmrg
962fda9279dSmrg
963fda9279dSmrg# _LT_COMPILER_BOILERPLATE
964fda9279dSmrg# ------------------------
965fda9279dSmrg# Check for compiler boilerplate output or warnings with
966fda9279dSmrg# the simple compiler test code.
967fda9279dSmrgm4_defun([_LT_COMPILER_BOILERPLATE],
968fda9279dSmrg[m4_require([_LT_DECL_SED])dnl
969fda9279dSmrgac_outfile=conftest.$ac_objext
970fda9279dSmrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
971fda9279dSmrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
972fda9279dSmrg_lt_compiler_boilerplate=`cat conftest.err`
973fda9279dSmrg$RM conftest*
974fda9279dSmrg])# _LT_COMPILER_BOILERPLATE
975fda9279dSmrg
976fda9279dSmrg
977fda9279dSmrg# _LT_LINKER_BOILERPLATE
978fda9279dSmrg# ----------------------
979fda9279dSmrg# Check for linker boilerplate output or warnings with
980fda9279dSmrg# the simple link test code.
981fda9279dSmrgm4_defun([_LT_LINKER_BOILERPLATE],
982fda9279dSmrg[m4_require([_LT_DECL_SED])dnl
983fda9279dSmrgac_outfile=conftest.$ac_objext
984fda9279dSmrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
985fda9279dSmrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
986fda9279dSmrg_lt_linker_boilerplate=`cat conftest.err`
987fda9279dSmrg$RM -r conftest*
988fda9279dSmrg])# _LT_LINKER_BOILERPLATE
989fda9279dSmrg
990fda9279dSmrg# _LT_REQUIRED_DARWIN_CHECKS
991fda9279dSmrg# -------------------------
992fda9279dSmrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
993fda9279dSmrg  case $host_os in
994fda9279dSmrg    rhapsody* | darwin*)
995fda9279dSmrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
996fda9279dSmrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
997fda9279dSmrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
998fda9279dSmrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
999fda9279dSmrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1000fda9279dSmrg    _LT_DECL([], [DSYMUTIL], [1],
1001fda9279dSmrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1002fda9279dSmrg    _LT_DECL([], [NMEDIT], [1],
1003fda9279dSmrg      [Tool to change global to local symbols on Mac OS X])
1004fda9279dSmrg    _LT_DECL([], [LIPO], [1],
1005fda9279dSmrg      [Tool to manipulate fat objects and archives on Mac OS X])
1006fda9279dSmrg    _LT_DECL([], [OTOOL], [1],
1007fda9279dSmrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1008fda9279dSmrg    _LT_DECL([], [OTOOL64], [1],
1009fda9279dSmrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1010fda9279dSmrg
1011fda9279dSmrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1012fda9279dSmrg      [lt_cv_apple_cc_single_mod=no
101316ee1e9aSmrg      if test -z "$LT_MULTI_MODULE"; then
1014fda9279dSmrg	# By default we will add the -single_module flag. You can override
1015fda9279dSmrg	# by either setting the environment variable LT_MULTI_MODULE
1016fda9279dSmrg	# non-empty at configure time, or by adding -multi_module to the
1017fda9279dSmrg	# link flags.
1018fda9279dSmrg	rm -rf libconftest.dylib*
1019fda9279dSmrg	echo "int foo(void){return 1;}" > conftest.c
1020fda9279dSmrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1021fda9279dSmrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1022fda9279dSmrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1023fda9279dSmrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1024fda9279dSmrg        _lt_result=$?
1025fda9279dSmrg	# If there is a non-empty error log, and "single_module"
1026fda9279dSmrg	# appears in it, assume the flag caused a linker warning
1027fda9279dSmrg        if test -s conftest.err && $GREP single_module conftest.err; then
1028fda9279dSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1029fda9279dSmrg	# Otherwise, if the output was created with a 0 exit code from
1030fda9279dSmrg	# the compiler, it worked.
103116ee1e9aSmrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1032fda9279dSmrg	  lt_cv_apple_cc_single_mod=yes
1033fda9279dSmrg	else
1034fda9279dSmrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1035fda9279dSmrg	fi
1036fda9279dSmrg	rm -rf libconftest.dylib*
1037fda9279dSmrg	rm -f conftest.*
1038fda9279dSmrg      fi])
1039fda9279dSmrg
1040fda9279dSmrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1041fda9279dSmrg      [lt_cv_ld_exported_symbols_list],
1042fda9279dSmrg      [lt_cv_ld_exported_symbols_list=no
1043fda9279dSmrg      save_LDFLAGS=$LDFLAGS
1044fda9279dSmrg      echo "_main" > conftest.sym
1045fda9279dSmrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1046fda9279dSmrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1047fda9279dSmrg	[lt_cv_ld_exported_symbols_list=yes],
1048fda9279dSmrg	[lt_cv_ld_exported_symbols_list=no])
104916ee1e9aSmrg	LDFLAGS=$save_LDFLAGS
1050fda9279dSmrg    ])
1051fda9279dSmrg
1052fda9279dSmrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1053fda9279dSmrg      [lt_cv_ld_force_load=no
1054fda9279dSmrg      cat > conftest.c << _LT_EOF
1055fda9279dSmrgint forced_loaded() { return 2;}
1056fda9279dSmrg_LT_EOF
1057fda9279dSmrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1058fda9279dSmrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1059fda9279dSmrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1060fda9279dSmrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1061fda9279dSmrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1062fda9279dSmrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1063fda9279dSmrg      cat > conftest.c << _LT_EOF
1064fda9279dSmrgint main() { return 0;}
1065fda9279dSmrg_LT_EOF
1066fda9279dSmrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1067fda9279dSmrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1068fda9279dSmrg      _lt_result=$?
1069fda9279dSmrg      if test -s conftest.err && $GREP force_load conftest.err; then
1070fda9279dSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
107116ee1e9aSmrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1072fda9279dSmrg	lt_cv_ld_force_load=yes
1073fda9279dSmrg      else
1074fda9279dSmrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1075fda9279dSmrg      fi
1076fda9279dSmrg        rm -f conftest.err libconftest.a conftest conftest.c
1077fda9279dSmrg        rm -rf conftest.dSYM
1078fda9279dSmrg    ])
1079fda9279dSmrg    case $host_os in
1080fda9279dSmrg    rhapsody* | darwin1.[[012]])
108116ee1e9aSmrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1082fda9279dSmrg    darwin1.*)
108316ee1e9aSmrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1084fda9279dSmrg    darwin*) # darwin 5.x on
1085fda9279dSmrg      # if running on 10.5 or later, the deployment target defaults
1086fda9279dSmrg      # to the OS version, if on x86, and 10.4, the deployment
1087fda9279dSmrg      # target defaults to 10.4. Don't you love it?
1088fda9279dSmrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1089fda9279dSmrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
109016ee1e9aSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
109116ee1e9aSmrg	10.[[012]][[,.]]*)
109216ee1e9aSmrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1093fda9279dSmrg	10.*)
109416ee1e9aSmrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1095fda9279dSmrg      esac
1096fda9279dSmrg    ;;
1097fda9279dSmrg  esac
109816ee1e9aSmrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1099fda9279dSmrg      _lt_dar_single_mod='$single_module'
1100fda9279dSmrg    fi
110116ee1e9aSmrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
110216ee1e9aSmrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1103fda9279dSmrg    else
110416ee1e9aSmrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1105fda9279dSmrg    fi
110616ee1e9aSmrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1107fda9279dSmrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1108fda9279dSmrg    else
1109fda9279dSmrg      _lt_dsymutil=
1110fda9279dSmrg    fi
1111fda9279dSmrg    ;;
1112fda9279dSmrg  esac
1113fda9279dSmrg])
1114fda9279dSmrg
1115fda9279dSmrg
1116fda9279dSmrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1117fda9279dSmrg# ---------------------------------
1118fda9279dSmrg# Checks for linker and compiler features on darwin
1119fda9279dSmrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1120fda9279dSmrg[
1121fda9279dSmrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1122fda9279dSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1123fda9279dSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
1124fda9279dSmrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1125fda9279dSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
112616ee1e9aSmrg  if test yes = "$lt_cv_ld_force_load"; then
112716ee1e9aSmrg    _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\"`'
1128fda9279dSmrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1129fda9279dSmrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1130fda9279dSmrg  else
1131fda9279dSmrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1132fda9279dSmrg  fi
1133fda9279dSmrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
113416ee1e9aSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1135fda9279dSmrg  case $cc_basename in
113616ee1e9aSmrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1137fda9279dSmrg     *) _lt_dar_can_shared=$GCC ;;
1138fda9279dSmrg  esac
113916ee1e9aSmrg  if test yes = "$_lt_dar_can_shared"; then
1140fda9279dSmrg    output_verbose_link_cmd=func_echo_all
114116ee1e9aSmrg    _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"
114216ee1e9aSmrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
114316ee1e9aSmrg    _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"
114416ee1e9aSmrg    _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"
1145fda9279dSmrg    m4_if([$1], [CXX],
114616ee1e9aSmrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
114716ee1e9aSmrg      _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"
114816ee1e9aSmrg      _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"
1149fda9279dSmrg    fi
1150fda9279dSmrg],[])
1151fda9279dSmrg  else
1152fda9279dSmrg  _LT_TAGVAR(ld_shlibs, $1)=no
1153fda9279dSmrg  fi
1154fda9279dSmrg])
1155fda9279dSmrg
1156fda9279dSmrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1157fda9279dSmrg# ----------------------------------
1158fda9279dSmrg# Links a minimal program and checks the executable
1159fda9279dSmrg# for the system default hardcoded library path. In most cases,
1160fda9279dSmrg# this is /usr/lib:/lib, but when the MPI compilers are used
1161fda9279dSmrg# the location of the communication and MPI libs are included too.
1162fda9279dSmrg# If we don't find anything, use the default library path according
1163fda9279dSmrg# to the aix ld manual.
1164fda9279dSmrg# Store the results from the different compilers for each TAGNAME.
1165fda9279dSmrg# Allow to override them for all tags through lt_cv_aix_libpath.
1166fda9279dSmrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1167fda9279dSmrg[m4_require([_LT_DECL_SED])dnl
116816ee1e9aSmrgif test set = "${lt_cv_aix_libpath+set}"; then
1169fda9279dSmrg  aix_libpath=$lt_cv_aix_libpath
1170fda9279dSmrgelse
1171fda9279dSmrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1172fda9279dSmrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1173fda9279dSmrg  lt_aix_libpath_sed='[
1174fda9279dSmrg      /Import File Strings/,/^$/ {
1175fda9279dSmrg	  /^0/ {
1176fda9279dSmrg	      s/^0  *\([^ ]*\) *$/\1/
1177fda9279dSmrg	      p
1178fda9279dSmrg	  }
1179fda9279dSmrg      }]'
1180fda9279dSmrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1181fda9279dSmrg  # Check for a 64-bit object if we didn't find anything.
1182fda9279dSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1183fda9279dSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1184fda9279dSmrg  fi],[])
1185fda9279dSmrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
118616ee1e9aSmrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1187fda9279dSmrg  fi
1188fda9279dSmrg  ])
1189fda9279dSmrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1190fda9279dSmrgfi
1191fda9279dSmrg])# _LT_SYS_MODULE_PATH_AIX
1192fda9279dSmrg
1193fda9279dSmrg
1194fda9279dSmrg# _LT_SHELL_INIT(ARG)
1195fda9279dSmrg# -------------------
1196fda9279dSmrgm4_define([_LT_SHELL_INIT],
1197fda9279dSmrg[m4_divert_text([M4SH-INIT], [$1
1198fda9279dSmrg])])# _LT_SHELL_INIT
1199fda9279dSmrg
1200fda9279dSmrg
1201fda9279dSmrg
1202fda9279dSmrg# _LT_PROG_ECHO_BACKSLASH
1203fda9279dSmrg# -----------------------
1204fda9279dSmrg# Find how we can fake an echo command that does not interpret backslash.
1205fda9279dSmrg# In particular, with Autoconf 2.60 or later we add some code to the start
120616ee1e9aSmrg# of the generated configure script that will find a shell with a builtin
120716ee1e9aSmrg# printf (that we can use as an echo command).
1208fda9279dSmrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1209fda9279dSmrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1210fda9279dSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1211fda9279dSmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1212fda9279dSmrg
1213fda9279dSmrgAC_MSG_CHECKING([how to print strings])
1214fda9279dSmrg# Test print first, because it will be a builtin if present.
1215fda9279dSmrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1216fda9279dSmrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1217fda9279dSmrg  ECHO='print -r --'
1218fda9279dSmrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1219fda9279dSmrg  ECHO='printf %s\n'
1220fda9279dSmrgelse
1221fda9279dSmrg  # Use this function as a fallback that always works.
1222fda9279dSmrg  func_fallback_echo ()
1223fda9279dSmrg  {
1224fda9279dSmrg    eval 'cat <<_LTECHO_EOF
1225fda9279dSmrg$[]1
1226fda9279dSmrg_LTECHO_EOF'
1227fda9279dSmrg  }
1228fda9279dSmrg  ECHO='func_fallback_echo'
1229fda9279dSmrgfi
1230fda9279dSmrg
1231fda9279dSmrg# func_echo_all arg...
1232fda9279dSmrg# Invoke $ECHO with all args, space-separated.
1233fda9279dSmrgfunc_echo_all ()
1234fda9279dSmrg{
123516ee1e9aSmrg    $ECHO "$*"
1236fda9279dSmrg}
1237fda9279dSmrg
123816ee1e9aSmrgcase $ECHO in
1239fda9279dSmrg  printf*) AC_MSG_RESULT([printf]) ;;
1240fda9279dSmrg  print*) AC_MSG_RESULT([print -r]) ;;
1241fda9279dSmrg  *) AC_MSG_RESULT([cat]) ;;
1242fda9279dSmrgesac
1243fda9279dSmrg
1244fda9279dSmrgm4_ifdef([_AS_DETECT_SUGGESTED],
1245fda9279dSmrg[_AS_DETECT_SUGGESTED([
1246fda9279dSmrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1247fda9279dSmrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1248fda9279dSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1249fda9279dSmrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1250fda9279dSmrg    PATH=/empty FPATH=/empty; export PATH FPATH
1251fda9279dSmrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1252fda9279dSmrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1253fda9279dSmrg
1254fda9279dSmrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1255fda9279dSmrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1256fda9279dSmrg])# _LT_PROG_ECHO_BACKSLASH
1257fda9279dSmrg
1258fda9279dSmrg
1259fda9279dSmrg# _LT_WITH_SYSROOT
1260fda9279dSmrg# ----------------
1261fda9279dSmrgAC_DEFUN([_LT_WITH_SYSROOT],
1262fda9279dSmrg[AC_MSG_CHECKING([for sysroot])
1263fda9279dSmrgAC_ARG_WITH([sysroot],
126416ee1e9aSmrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
126516ee1e9aSmrg  [Search for dependent libraries within DIR (or the compiler's sysroot
126616ee1e9aSmrg   if not specified).])],
1267fda9279dSmrg[], [with_sysroot=no])
1268fda9279dSmrg
1269fda9279dSmrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1270fda9279dSmrgdnl in case the user passed a directory name.
1271fda9279dSmrglt_sysroot=
127216ee1e9aSmrgcase $with_sysroot in #(
1273fda9279dSmrg yes)
127416ee1e9aSmrg   if test yes = "$GCC"; then
1275fda9279dSmrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1276fda9279dSmrg   fi
1277fda9279dSmrg   ;; #(
1278fda9279dSmrg /*)
1279fda9279dSmrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1280fda9279dSmrg   ;; #(
1281fda9279dSmrg no|'')
1282fda9279dSmrg   ;; #(
1283fda9279dSmrg *)
128416ee1e9aSmrg   AC_MSG_RESULT([$with_sysroot])
1285fda9279dSmrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1286fda9279dSmrg   ;;
1287fda9279dSmrgesac
1288fda9279dSmrg
1289fda9279dSmrg AC_MSG_RESULT([${lt_sysroot:-no}])
1290fda9279dSmrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
129116ee1e9aSmrg[dependent libraries, and where our libraries should be installed.])])
1292fda9279dSmrg
1293fda9279dSmrg# _LT_ENABLE_LOCK
1294fda9279dSmrg# ---------------
1295fda9279dSmrgm4_defun([_LT_ENABLE_LOCK],
1296fda9279dSmrg[AC_ARG_ENABLE([libtool-lock],
1297fda9279dSmrg  [AS_HELP_STRING([--disable-libtool-lock],
1298fda9279dSmrg    [avoid locking (might break parallel builds)])])
129916ee1e9aSmrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1300fda9279dSmrg
1301fda9279dSmrg# Some flags need to be propagated to the compiler or linker for good
1302fda9279dSmrg# libtool support.
1303fda9279dSmrgcase $host in
1304fda9279dSmrgia64-*-hpux*)
130516ee1e9aSmrg  # Find out what ABI is being produced by ac_compile, and set mode
130616ee1e9aSmrg  # options accordingly.
1307fda9279dSmrg  echo 'int i;' > conftest.$ac_ext
1308fda9279dSmrg  if AC_TRY_EVAL(ac_compile); then
1309fda9279dSmrg    case `/usr/bin/file conftest.$ac_objext` in
1310fda9279dSmrg      *ELF-32*)
131116ee1e9aSmrg	HPUX_IA64_MODE=32
1312fda9279dSmrg	;;
1313fda9279dSmrg      *ELF-64*)
131416ee1e9aSmrg	HPUX_IA64_MODE=64
1315fda9279dSmrg	;;
1316fda9279dSmrg    esac
1317fda9279dSmrg  fi
1318fda9279dSmrg  rm -rf conftest*
1319fda9279dSmrg  ;;
1320fda9279dSmrg*-*-irix6*)
132116ee1e9aSmrg  # Find out what ABI is being produced by ac_compile, and set linker
132216ee1e9aSmrg  # options accordingly.
1323fda9279dSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1324fda9279dSmrg  if AC_TRY_EVAL(ac_compile); then
132516ee1e9aSmrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1326fda9279dSmrg      case `/usr/bin/file conftest.$ac_objext` in
1327fda9279dSmrg	*32-bit*)
1328fda9279dSmrg	  LD="${LD-ld} -melf32bsmip"
1329fda9279dSmrg	  ;;
1330fda9279dSmrg	*N32*)
1331fda9279dSmrg	  LD="${LD-ld} -melf32bmipn32"
1332fda9279dSmrg	  ;;
1333fda9279dSmrg	*64-bit*)
1334fda9279dSmrg	  LD="${LD-ld} -melf64bmip"
1335fda9279dSmrg	;;
1336fda9279dSmrg      esac
1337fda9279dSmrg    else
1338fda9279dSmrg      case `/usr/bin/file conftest.$ac_objext` in
1339fda9279dSmrg	*32-bit*)
1340fda9279dSmrg	  LD="${LD-ld} -32"
1341fda9279dSmrg	  ;;
1342fda9279dSmrg	*N32*)
1343fda9279dSmrg	  LD="${LD-ld} -n32"
1344fda9279dSmrg	  ;;
1345fda9279dSmrg	*64-bit*)
1346fda9279dSmrg	  LD="${LD-ld} -64"
1347fda9279dSmrg	  ;;
1348fda9279dSmrg      esac
1349fda9279dSmrg    fi
1350fda9279dSmrg  fi
1351fda9279dSmrg  rm -rf conftest*
1352fda9279dSmrg  ;;
1353fda9279dSmrg
135416ee1e9aSmrgmips64*-*linux*)
135516ee1e9aSmrg  # Find out what ABI is being produced by ac_compile, and set linker
135616ee1e9aSmrg  # options accordingly.
135716ee1e9aSmrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
135816ee1e9aSmrg  if AC_TRY_EVAL(ac_compile); then
135916ee1e9aSmrg    emul=elf
136016ee1e9aSmrg    case `/usr/bin/file conftest.$ac_objext` in
136116ee1e9aSmrg      *32-bit*)
136216ee1e9aSmrg	emul="${emul}32"
136316ee1e9aSmrg	;;
136416ee1e9aSmrg      *64-bit*)
136516ee1e9aSmrg	emul="${emul}64"
136616ee1e9aSmrg	;;
136716ee1e9aSmrg    esac
136816ee1e9aSmrg    case `/usr/bin/file conftest.$ac_objext` in
136916ee1e9aSmrg      *MSB*)
137016ee1e9aSmrg	emul="${emul}btsmip"
137116ee1e9aSmrg	;;
137216ee1e9aSmrg      *LSB*)
137316ee1e9aSmrg	emul="${emul}ltsmip"
137416ee1e9aSmrg	;;
137516ee1e9aSmrg    esac
137616ee1e9aSmrg    case `/usr/bin/file conftest.$ac_objext` in
137716ee1e9aSmrg      *N32*)
137816ee1e9aSmrg	emul="${emul}n32"
137916ee1e9aSmrg	;;
138016ee1e9aSmrg    esac
138116ee1e9aSmrg    LD="${LD-ld} -m $emul"
138216ee1e9aSmrg  fi
138316ee1e9aSmrg  rm -rf conftest*
138416ee1e9aSmrg  ;;
138516ee1e9aSmrg
1386fda9279dSmrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1387fda9279dSmrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
138816ee1e9aSmrg  # Find out what ABI is being produced by ac_compile, and set linker
138916ee1e9aSmrg  # options accordingly.  Note that the listed cases only cover the
139016ee1e9aSmrg  # situations where additional linker options are needed (such as when
139116ee1e9aSmrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
139216ee1e9aSmrg  # vice versa); the common cases where no linker options are needed do
139316ee1e9aSmrg  # not appear in the list.
1394fda9279dSmrg  echo 'int i;' > conftest.$ac_ext
1395fda9279dSmrg  if AC_TRY_EVAL(ac_compile); then
1396fda9279dSmrg    case `/usr/bin/file conftest.o` in
1397fda9279dSmrg      *32-bit*)
1398fda9279dSmrg	case $host in
1399fda9279dSmrg	  x86_64-*kfreebsd*-gnu)
1400fda9279dSmrg	    LD="${LD-ld} -m elf_i386_fbsd"
1401fda9279dSmrg	    ;;
1402fda9279dSmrg	  x86_64-*linux*)
1403fda9279dSmrg	    case `/usr/bin/file conftest.o` in
1404fda9279dSmrg	      *x86-64*)
1405fda9279dSmrg		LD="${LD-ld} -m elf32_x86_64"
1406fda9279dSmrg		;;
1407fda9279dSmrg	      *)
1408fda9279dSmrg		LD="${LD-ld} -m elf_i386"
1409fda9279dSmrg		;;
1410fda9279dSmrg	    esac
1411fda9279dSmrg	    ;;
141216ee1e9aSmrg	  powerpc64le-*linux*)
1413fda9279dSmrg	    LD="${LD-ld} -m elf32lppclinux"
1414fda9279dSmrg	    ;;
141516ee1e9aSmrg	  powerpc64-*linux*)
1416fda9279dSmrg	    LD="${LD-ld} -m elf32ppclinux"
1417fda9279dSmrg	    ;;
1418fda9279dSmrg	  s390x-*linux*)
1419fda9279dSmrg	    LD="${LD-ld} -m elf_s390"
1420fda9279dSmrg	    ;;
1421fda9279dSmrg	  sparc64-*linux*)
1422fda9279dSmrg	    LD="${LD-ld} -m elf32_sparc"
1423fda9279dSmrg	    ;;
1424fda9279dSmrg	esac
1425fda9279dSmrg	;;
1426fda9279dSmrg      *64-bit*)
1427fda9279dSmrg	case $host in
1428fda9279dSmrg	  x86_64-*kfreebsd*-gnu)
1429fda9279dSmrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1430fda9279dSmrg	    ;;
1431fda9279dSmrg	  x86_64-*linux*)
1432fda9279dSmrg	    LD="${LD-ld} -m elf_x86_64"
1433fda9279dSmrg	    ;;
143416ee1e9aSmrg	  powerpcle-*linux*)
1435fda9279dSmrg	    LD="${LD-ld} -m elf64lppc"
1436fda9279dSmrg	    ;;
143716ee1e9aSmrg	  powerpc-*linux*)
1438fda9279dSmrg	    LD="${LD-ld} -m elf64ppc"
1439fda9279dSmrg	    ;;
1440fda9279dSmrg	  s390*-*linux*|s390*-*tpf*)
1441fda9279dSmrg	    LD="${LD-ld} -m elf64_s390"
1442fda9279dSmrg	    ;;
1443fda9279dSmrg	  sparc*-*linux*)
1444fda9279dSmrg	    LD="${LD-ld} -m elf64_sparc"
1445fda9279dSmrg	    ;;
1446fda9279dSmrg	esac
1447fda9279dSmrg	;;
1448fda9279dSmrg    esac
1449fda9279dSmrg  fi
1450fda9279dSmrg  rm -rf conftest*
1451fda9279dSmrg  ;;
1452fda9279dSmrg
1453fda9279dSmrg*-*-sco3.2v5*)
1454fda9279dSmrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
145516ee1e9aSmrg  SAVE_CFLAGS=$CFLAGS
1456fda9279dSmrg  CFLAGS="$CFLAGS -belf"
1457fda9279dSmrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1458fda9279dSmrg    [AC_LANG_PUSH(C)
1459fda9279dSmrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1460fda9279dSmrg     AC_LANG_POP])
146116ee1e9aSmrg  if test yes != "$lt_cv_cc_needs_belf"; then
1462fda9279dSmrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
146316ee1e9aSmrg    CFLAGS=$SAVE_CFLAGS
1464fda9279dSmrg  fi
1465fda9279dSmrg  ;;
1466fda9279dSmrg*-*solaris*)
146716ee1e9aSmrg  # Find out what ABI is being produced by ac_compile, and set linker
146816ee1e9aSmrg  # options accordingly.
1469fda9279dSmrg  echo 'int i;' > conftest.$ac_ext
1470fda9279dSmrg  if AC_TRY_EVAL(ac_compile); then
1471fda9279dSmrg    case `/usr/bin/file conftest.o` in
1472fda9279dSmrg    *64-bit*)
1473fda9279dSmrg      case $lt_cv_prog_gnu_ld in
1474fda9279dSmrg      yes*)
1475fda9279dSmrg        case $host in
147616ee1e9aSmrg        i?86-*-solaris*|x86_64-*-solaris*)
1477fda9279dSmrg          LD="${LD-ld} -m elf_x86_64"
1478fda9279dSmrg          ;;
1479fda9279dSmrg        sparc*-*-solaris*)
1480fda9279dSmrg          LD="${LD-ld} -m elf64_sparc"
1481fda9279dSmrg          ;;
1482fda9279dSmrg        esac
1483fda9279dSmrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1484fda9279dSmrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
148516ee1e9aSmrg          LD=${LD-ld}_sol2
1486fda9279dSmrg        fi
1487fda9279dSmrg        ;;
1488fda9279dSmrg      *)
1489fda9279dSmrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1490fda9279dSmrg	  LD="${LD-ld} -64"
1491fda9279dSmrg	fi
1492fda9279dSmrg	;;
1493fda9279dSmrg      esac
1494fda9279dSmrg      ;;
1495fda9279dSmrg    esac
1496fda9279dSmrg  fi
1497fda9279dSmrg  rm -rf conftest*
1498fda9279dSmrg  ;;
1499fda9279dSmrgesac
1500fda9279dSmrg
150116ee1e9aSmrgneed_locks=$enable_libtool_lock
1502fda9279dSmrg])# _LT_ENABLE_LOCK
1503fda9279dSmrg
1504fda9279dSmrg
1505fda9279dSmrg# _LT_PROG_AR
1506fda9279dSmrg# -----------
1507fda9279dSmrgm4_defun([_LT_PROG_AR],
1508fda9279dSmrg[AC_CHECK_TOOLS(AR, [ar], false)
1509fda9279dSmrg: ${AR=ar}
1510fda9279dSmrg: ${AR_FLAGS=cru}
1511fda9279dSmrg_LT_DECL([], [AR], [1], [The archiver])
1512fda9279dSmrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1513fda9279dSmrg
1514fda9279dSmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1515fda9279dSmrg  [lt_cv_ar_at_file=no
1516fda9279dSmrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1517fda9279dSmrg     [echo conftest.$ac_objext > conftest.lst
1518fda9279dSmrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1519fda9279dSmrg      AC_TRY_EVAL([lt_ar_try])
152016ee1e9aSmrg      if test 0 -eq "$ac_status"; then
1521fda9279dSmrg	# Ensure the archiver fails upon bogus file names.
1522fda9279dSmrg	rm -f conftest.$ac_objext libconftest.a
1523fda9279dSmrg	AC_TRY_EVAL([lt_ar_try])
152416ee1e9aSmrg	if test 0 -ne "$ac_status"; then
1525fda9279dSmrg          lt_cv_ar_at_file=@
1526fda9279dSmrg        fi
1527fda9279dSmrg      fi
1528fda9279dSmrg      rm -f conftest.* libconftest.a
1529fda9279dSmrg     ])
1530fda9279dSmrg  ])
1531fda9279dSmrg
153216ee1e9aSmrgif test no = "$lt_cv_ar_at_file"; then
1533fda9279dSmrg  archiver_list_spec=
1534fda9279dSmrgelse
1535fda9279dSmrg  archiver_list_spec=$lt_cv_ar_at_file
1536fda9279dSmrgfi
1537fda9279dSmrg_LT_DECL([], [archiver_list_spec], [1],
1538fda9279dSmrg  [How to feed a file listing to the archiver])
1539fda9279dSmrg])# _LT_PROG_AR
1540fda9279dSmrg
1541fda9279dSmrg
1542fda9279dSmrg# _LT_CMD_OLD_ARCHIVE
1543fda9279dSmrg# -------------------
1544fda9279dSmrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1545fda9279dSmrg[_LT_PROG_AR
1546fda9279dSmrg
1547fda9279dSmrgAC_CHECK_TOOL(STRIP, strip, :)
1548fda9279dSmrgtest -z "$STRIP" && STRIP=:
1549fda9279dSmrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1550fda9279dSmrg
1551fda9279dSmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1552fda9279dSmrgtest -z "$RANLIB" && RANLIB=:
1553fda9279dSmrg_LT_DECL([], [RANLIB], [1],
1554fda9279dSmrg    [Commands used to install an old-style archive])
1555fda9279dSmrg
1556fda9279dSmrg# Determine commands to create old-style static archives.
1557fda9279dSmrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1558fda9279dSmrgold_postinstall_cmds='chmod 644 $oldlib'
1559fda9279dSmrgold_postuninstall_cmds=
1560fda9279dSmrg
1561fda9279dSmrgif test -n "$RANLIB"; then
1562fda9279dSmrg  case $host_os in
156316ee1e9aSmrg  bitrig* | openbsd*)
1564fda9279dSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1565fda9279dSmrg    ;;
1566fda9279dSmrg  *)
1567fda9279dSmrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1568fda9279dSmrg    ;;
1569fda9279dSmrg  esac
1570fda9279dSmrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1571fda9279dSmrgfi
1572fda9279dSmrg
1573fda9279dSmrgcase $host_os in
1574fda9279dSmrg  darwin*)
1575fda9279dSmrg    lock_old_archive_extraction=yes ;;
1576fda9279dSmrg  *)
1577fda9279dSmrg    lock_old_archive_extraction=no ;;
1578fda9279dSmrgesac
1579fda9279dSmrg_LT_DECL([], [old_postinstall_cmds], [2])
1580fda9279dSmrg_LT_DECL([], [old_postuninstall_cmds], [2])
1581fda9279dSmrg_LT_TAGDECL([], [old_archive_cmds], [2],
1582fda9279dSmrg    [Commands used to build an old-style archive])
1583fda9279dSmrg_LT_DECL([], [lock_old_archive_extraction], [0],
1584fda9279dSmrg    [Whether to use a lock for old archive extraction])
1585fda9279dSmrg])# _LT_CMD_OLD_ARCHIVE
1586fda9279dSmrg
1587fda9279dSmrg
1588fda9279dSmrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1589fda9279dSmrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1590fda9279dSmrg# ----------------------------------------------------------------
1591fda9279dSmrg# Check whether the given compiler option works
1592fda9279dSmrgAC_DEFUN([_LT_COMPILER_OPTION],
1593fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1594fda9279dSmrgm4_require([_LT_DECL_SED])dnl
1595fda9279dSmrgAC_CACHE_CHECK([$1], [$2],
1596fda9279dSmrg  [$2=no
1597fda9279dSmrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1598fda9279dSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
159916ee1e9aSmrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1600fda9279dSmrg   # Insert the option either (1) after the last *FLAGS variable, or
1601fda9279dSmrg   # (2) before a word containing "conftest.", or (3) at the end.
1602fda9279dSmrg   # Note that $ac_compile itself does not contain backslashes and begins
1603fda9279dSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1604fda9279dSmrg   # The option is referenced via a variable to avoid confusing sed.
1605fda9279dSmrg   lt_compile=`echo "$ac_compile" | $SED \
1606fda9279dSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1607fda9279dSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1608fda9279dSmrg   -e 's:$: $lt_compiler_flag:'`
1609fda9279dSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1610fda9279dSmrg   (eval "$lt_compile" 2>conftest.err)
1611fda9279dSmrg   ac_status=$?
1612fda9279dSmrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1613fda9279dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1614fda9279dSmrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1615fda9279dSmrg     # The compiler can only warn and ignore the option if not recognized
1616fda9279dSmrg     # So say no if there are warnings other than the usual output.
1617fda9279dSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1618fda9279dSmrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1619fda9279dSmrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1620fda9279dSmrg       $2=yes
1621fda9279dSmrg     fi
1622fda9279dSmrg   fi
1623fda9279dSmrg   $RM conftest*
1624fda9279dSmrg])
1625fda9279dSmrg
162616ee1e9aSmrgif test yes = "[$]$2"; then
1627fda9279dSmrg    m4_if([$5], , :, [$5])
1628fda9279dSmrgelse
1629fda9279dSmrg    m4_if([$6], , :, [$6])
1630fda9279dSmrgfi
1631fda9279dSmrg])# _LT_COMPILER_OPTION
1632fda9279dSmrg
1633fda9279dSmrg# Old name:
1634fda9279dSmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1635fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
1636fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1637fda9279dSmrg
1638fda9279dSmrg
1639fda9279dSmrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1640fda9279dSmrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1641fda9279dSmrg# ----------------------------------------------------
1642fda9279dSmrg# Check whether the given linker option works
1643fda9279dSmrgAC_DEFUN([_LT_LINKER_OPTION],
1644fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1645fda9279dSmrgm4_require([_LT_DECL_SED])dnl
1646fda9279dSmrgAC_CACHE_CHECK([$1], [$2],
1647fda9279dSmrg  [$2=no
164816ee1e9aSmrg   save_LDFLAGS=$LDFLAGS
1649fda9279dSmrg   LDFLAGS="$LDFLAGS $3"
1650fda9279dSmrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1651fda9279dSmrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1652fda9279dSmrg     # The linker can only warn and ignore the option if not recognized
1653fda9279dSmrg     # So say no if there are warnings
1654fda9279dSmrg     if test -s conftest.err; then
1655fda9279dSmrg       # Append any errors to the config.log.
1656fda9279dSmrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1657fda9279dSmrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1658fda9279dSmrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1659fda9279dSmrg       if diff conftest.exp conftest.er2 >/dev/null; then
1660fda9279dSmrg         $2=yes
1661fda9279dSmrg       fi
1662fda9279dSmrg     else
1663fda9279dSmrg       $2=yes
1664fda9279dSmrg     fi
1665fda9279dSmrg   fi
1666fda9279dSmrg   $RM -r conftest*
166716ee1e9aSmrg   LDFLAGS=$save_LDFLAGS
1668fda9279dSmrg])
1669fda9279dSmrg
167016ee1e9aSmrgif test yes = "[$]$2"; then
1671fda9279dSmrg    m4_if([$4], , :, [$4])
1672fda9279dSmrgelse
1673fda9279dSmrg    m4_if([$5], , :, [$5])
1674fda9279dSmrgfi
1675fda9279dSmrg])# _LT_LINKER_OPTION
1676fda9279dSmrg
1677fda9279dSmrg# Old name:
1678fda9279dSmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1679fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
1680fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1681fda9279dSmrg
1682fda9279dSmrg
1683fda9279dSmrg# LT_CMD_MAX_LEN
1684fda9279dSmrg#---------------
1685fda9279dSmrgAC_DEFUN([LT_CMD_MAX_LEN],
1686fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1687fda9279dSmrg# find the maximum length of command line arguments
1688fda9279dSmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1689fda9279dSmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1690fda9279dSmrg  i=0
169116ee1e9aSmrg  teststring=ABCD
1692fda9279dSmrg
1693fda9279dSmrg  case $build_os in
1694fda9279dSmrg  msdosdjgpp*)
1695fda9279dSmrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1696fda9279dSmrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1697fda9279dSmrg    # during glob expansion).  Even if it were fixed, the result of this
1698fda9279dSmrg    # check would be larger than it should be.
1699fda9279dSmrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1700fda9279dSmrg    ;;
1701fda9279dSmrg
1702fda9279dSmrg  gnu*)
1703fda9279dSmrg    # Under GNU Hurd, this test is not required because there is
1704fda9279dSmrg    # no limit to the length of command line arguments.
1705fda9279dSmrg    # Libtool will interpret -1 as no limit whatsoever
1706fda9279dSmrg    lt_cv_sys_max_cmd_len=-1;
1707fda9279dSmrg    ;;
1708fda9279dSmrg
1709fda9279dSmrg  cygwin* | mingw* | cegcc*)
1710fda9279dSmrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1711fda9279dSmrg    # about 5 minutes as the teststring grows exponentially.
1712fda9279dSmrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1713fda9279dSmrg    # you end up with a "frozen" computer, even though with patience
1714fda9279dSmrg    # the test eventually succeeds (with a max line length of 256k).
1715fda9279dSmrg    # Instead, let's just punt: use the minimum linelength reported by
1716fda9279dSmrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1717fda9279dSmrg    lt_cv_sys_max_cmd_len=8192;
1718fda9279dSmrg    ;;
1719fda9279dSmrg
1720fda9279dSmrg  mint*)
1721fda9279dSmrg    # On MiNT this can take a long time and run out of memory.
1722fda9279dSmrg    lt_cv_sys_max_cmd_len=8192;
1723fda9279dSmrg    ;;
1724fda9279dSmrg
1725fda9279dSmrg  amigaos*)
1726fda9279dSmrg    # On AmigaOS with pdksh, this test takes hours, literally.
1727fda9279dSmrg    # So we just punt and use a minimum line length of 8192.
1728fda9279dSmrg    lt_cv_sys_max_cmd_len=8192;
1729fda9279dSmrg    ;;
1730fda9279dSmrg
173116ee1e9aSmrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1732fda9279dSmrg    # This has been around since 386BSD, at least.  Likely further.
1733fda9279dSmrg    if test -x /sbin/sysctl; then
1734fda9279dSmrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1735fda9279dSmrg    elif test -x /usr/sbin/sysctl; then
1736fda9279dSmrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1737fda9279dSmrg    else
1738fda9279dSmrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1739fda9279dSmrg    fi
1740fda9279dSmrg    # And add a safety zone
1741fda9279dSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1742fda9279dSmrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1743fda9279dSmrg    ;;
1744fda9279dSmrg
1745fda9279dSmrg  interix*)
1746fda9279dSmrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1747fda9279dSmrg    lt_cv_sys_max_cmd_len=196608
1748fda9279dSmrg    ;;
1749fda9279dSmrg
1750fda9279dSmrg  os2*)
1751fda9279dSmrg    # The test takes a long time on OS/2.
1752fda9279dSmrg    lt_cv_sys_max_cmd_len=8192
1753fda9279dSmrg    ;;
1754fda9279dSmrg
1755fda9279dSmrg  osf*)
1756fda9279dSmrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1757fda9279dSmrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1758fda9279dSmrg    # nice to cause kernel panics so lets avoid the loop below.
1759fda9279dSmrg    # First set a reasonable default.
1760fda9279dSmrg    lt_cv_sys_max_cmd_len=16384
1761fda9279dSmrg    #
1762fda9279dSmrg    if test -x /sbin/sysconfig; then
1763fda9279dSmrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1764fda9279dSmrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1765fda9279dSmrg      esac
1766fda9279dSmrg    fi
1767fda9279dSmrg    ;;
1768fda9279dSmrg  sco3.2v5*)
1769fda9279dSmrg    lt_cv_sys_max_cmd_len=102400
1770fda9279dSmrg    ;;
1771fda9279dSmrg  sysv5* | sco5v6* | sysv4.2uw2*)
1772fda9279dSmrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1773fda9279dSmrg    if test -n "$kargmax"; then
1774fda9279dSmrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1775fda9279dSmrg    else
1776fda9279dSmrg      lt_cv_sys_max_cmd_len=32768
1777fda9279dSmrg    fi
1778fda9279dSmrg    ;;
1779fda9279dSmrg  *)
1780fda9279dSmrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1781fda9279dSmrg    if test -n "$lt_cv_sys_max_cmd_len" && \
178216ee1e9aSmrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1783fda9279dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1784fda9279dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1785fda9279dSmrg    else
1786fda9279dSmrg      # Make teststring a little bigger before we do anything with it.
1787fda9279dSmrg      # a 1K string should be a reasonable start.
178816ee1e9aSmrg      for i in 1 2 3 4 5 6 7 8; do
1789fda9279dSmrg        teststring=$teststring$teststring
1790fda9279dSmrg      done
1791fda9279dSmrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1792fda9279dSmrg      # If test is not a shell built-in, we'll probably end up computing a
1793fda9279dSmrg      # maximum length that is only half of the actual maximum length, but
1794fda9279dSmrg      # we can't tell.
179516ee1e9aSmrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1796fda9279dSmrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
179716ee1e9aSmrg	      test 17 != "$i" # 1/2 MB should be enough
1798fda9279dSmrg      do
1799fda9279dSmrg        i=`expr $i + 1`
1800fda9279dSmrg        teststring=$teststring$teststring
1801fda9279dSmrg      done
1802fda9279dSmrg      # Only check the string length outside the loop.
1803fda9279dSmrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1804fda9279dSmrg      teststring=
1805fda9279dSmrg      # Add a significant safety factor because C++ compilers can tack on
1806fda9279dSmrg      # massive amounts of additional arguments before passing them to the
1807fda9279dSmrg      # linker.  It appears as though 1/2 is a usable value.
1808fda9279dSmrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1809fda9279dSmrg    fi
1810fda9279dSmrg    ;;
1811fda9279dSmrg  esac
1812fda9279dSmrg])
181316ee1e9aSmrgif test -n "$lt_cv_sys_max_cmd_len"; then
1814fda9279dSmrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1815fda9279dSmrgelse
1816fda9279dSmrg  AC_MSG_RESULT(none)
1817fda9279dSmrgfi
1818fda9279dSmrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1819fda9279dSmrg_LT_DECL([], [max_cmd_len], [0],
1820fda9279dSmrg    [What is the maximum length of a command?])
1821fda9279dSmrg])# LT_CMD_MAX_LEN
1822fda9279dSmrg
1823fda9279dSmrg# Old name:
1824fda9279dSmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1825fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
1826fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1827fda9279dSmrg
1828fda9279dSmrg
1829fda9279dSmrg# _LT_HEADER_DLFCN
1830fda9279dSmrg# ----------------
1831fda9279dSmrgm4_defun([_LT_HEADER_DLFCN],
1832fda9279dSmrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1833fda9279dSmrg])# _LT_HEADER_DLFCN
1834fda9279dSmrg
1835fda9279dSmrg
1836fda9279dSmrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1837fda9279dSmrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1838fda9279dSmrg# ----------------------------------------------------------------
1839fda9279dSmrgm4_defun([_LT_TRY_DLOPEN_SELF],
1840fda9279dSmrg[m4_require([_LT_HEADER_DLFCN])dnl
184116ee1e9aSmrgif test yes = "$cross_compiling"; then :
1842fda9279dSmrg  [$4]
1843fda9279dSmrgelse
1844fda9279dSmrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1845fda9279dSmrg  lt_status=$lt_dlunknown
1846fda9279dSmrg  cat > conftest.$ac_ext <<_LT_EOF
1847fda9279dSmrg[#line $LINENO "configure"
1848fda9279dSmrg#include "confdefs.h"
1849fda9279dSmrg
1850fda9279dSmrg#if HAVE_DLFCN_H
1851fda9279dSmrg#include <dlfcn.h>
1852fda9279dSmrg#endif
1853fda9279dSmrg
1854fda9279dSmrg#include <stdio.h>
1855fda9279dSmrg
1856fda9279dSmrg#ifdef RTLD_GLOBAL
1857fda9279dSmrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1858fda9279dSmrg#else
1859fda9279dSmrg#  ifdef DL_GLOBAL
1860fda9279dSmrg#    define LT_DLGLOBAL		DL_GLOBAL
1861fda9279dSmrg#  else
1862fda9279dSmrg#    define LT_DLGLOBAL		0
1863fda9279dSmrg#  endif
1864fda9279dSmrg#endif
1865fda9279dSmrg
1866fda9279dSmrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1867fda9279dSmrg   find out it does not work in some platform. */
1868fda9279dSmrg#ifndef LT_DLLAZY_OR_NOW
1869fda9279dSmrg#  ifdef RTLD_LAZY
1870fda9279dSmrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1871fda9279dSmrg#  else
1872fda9279dSmrg#    ifdef DL_LAZY
1873fda9279dSmrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1874fda9279dSmrg#    else
1875fda9279dSmrg#      ifdef RTLD_NOW
1876fda9279dSmrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1877fda9279dSmrg#      else
1878fda9279dSmrg#        ifdef DL_NOW
1879fda9279dSmrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1880fda9279dSmrg#        else
1881fda9279dSmrg#          define LT_DLLAZY_OR_NOW	0
1882fda9279dSmrg#        endif
1883fda9279dSmrg#      endif
1884fda9279dSmrg#    endif
1885fda9279dSmrg#  endif
1886fda9279dSmrg#endif
1887fda9279dSmrg
188816ee1e9aSmrg/* When -fvisibility=hidden is used, assume the code has been annotated
1889fda9279dSmrg   correspondingly for the symbols needed.  */
189016ee1e9aSmrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1891fda9279dSmrgint fnord () __attribute__((visibility("default")));
1892fda9279dSmrg#endif
1893fda9279dSmrg
1894fda9279dSmrgint fnord () { return 42; }
1895fda9279dSmrgint main ()
1896fda9279dSmrg{
1897fda9279dSmrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1898fda9279dSmrg  int status = $lt_dlunknown;
1899fda9279dSmrg
1900fda9279dSmrg  if (self)
1901fda9279dSmrg    {
1902fda9279dSmrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1903fda9279dSmrg      else
1904fda9279dSmrg        {
1905fda9279dSmrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1906fda9279dSmrg          else puts (dlerror ());
1907fda9279dSmrg	}
1908fda9279dSmrg      /* dlclose (self); */
1909fda9279dSmrg    }
1910fda9279dSmrg  else
1911fda9279dSmrg    puts (dlerror ());
1912fda9279dSmrg
1913fda9279dSmrg  return status;
1914fda9279dSmrg}]
1915fda9279dSmrg_LT_EOF
191616ee1e9aSmrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1917fda9279dSmrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1918fda9279dSmrg    lt_status=$?
1919fda9279dSmrg    case x$lt_status in
1920fda9279dSmrg      x$lt_dlno_uscore) $1 ;;
1921fda9279dSmrg      x$lt_dlneed_uscore) $2 ;;
1922fda9279dSmrg      x$lt_dlunknown|x*) $3 ;;
1923fda9279dSmrg    esac
1924fda9279dSmrg  else :
1925fda9279dSmrg    # compilation failed
1926fda9279dSmrg    $3
1927fda9279dSmrg  fi
1928fda9279dSmrgfi
1929fda9279dSmrgrm -fr conftest*
1930fda9279dSmrg])# _LT_TRY_DLOPEN_SELF
1931fda9279dSmrg
1932fda9279dSmrg
1933fda9279dSmrg# LT_SYS_DLOPEN_SELF
1934fda9279dSmrg# ------------------
1935fda9279dSmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1936fda9279dSmrg[m4_require([_LT_HEADER_DLFCN])dnl
193716ee1e9aSmrgif test yes != "$enable_dlopen"; then
1938fda9279dSmrg  enable_dlopen=unknown
1939fda9279dSmrg  enable_dlopen_self=unknown
1940fda9279dSmrg  enable_dlopen_self_static=unknown
1941fda9279dSmrgelse
1942fda9279dSmrg  lt_cv_dlopen=no
1943fda9279dSmrg  lt_cv_dlopen_libs=
1944fda9279dSmrg
1945fda9279dSmrg  case $host_os in
1946fda9279dSmrg  beos*)
194716ee1e9aSmrg    lt_cv_dlopen=load_add_on
1948fda9279dSmrg    lt_cv_dlopen_libs=
1949fda9279dSmrg    lt_cv_dlopen_self=yes
1950fda9279dSmrg    ;;
1951fda9279dSmrg
1952fda9279dSmrg  mingw* | pw32* | cegcc*)
195316ee1e9aSmrg    lt_cv_dlopen=LoadLibrary
1954fda9279dSmrg    lt_cv_dlopen_libs=
1955fda9279dSmrg    ;;
1956fda9279dSmrg
1957fda9279dSmrg  cygwin*)
195816ee1e9aSmrg    lt_cv_dlopen=dlopen
1959fda9279dSmrg    lt_cv_dlopen_libs=
1960fda9279dSmrg    ;;
1961fda9279dSmrg
1962fda9279dSmrg  darwin*)
196316ee1e9aSmrg    # if libdl is installed we need to link against it
1964fda9279dSmrg    AC_CHECK_LIB([dl], [dlopen],
196516ee1e9aSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
196616ee1e9aSmrg    lt_cv_dlopen=dyld
1967fda9279dSmrg    lt_cv_dlopen_libs=
1968fda9279dSmrg    lt_cv_dlopen_self=yes
1969fda9279dSmrg    ])
1970fda9279dSmrg    ;;
1971fda9279dSmrg
197216ee1e9aSmrg  tpf*)
197316ee1e9aSmrg    # Don't try to run any link tests for TPF.  We know it's impossible
197416ee1e9aSmrg    # because TPF is a cross-compiler, and we know how we open DSOs.
197516ee1e9aSmrg    lt_cv_dlopen=dlopen
197616ee1e9aSmrg    lt_cv_dlopen_libs=
197716ee1e9aSmrg    lt_cv_dlopen_self=no
197816ee1e9aSmrg    ;;
197916ee1e9aSmrg
1980fda9279dSmrg  *)
1981fda9279dSmrg    AC_CHECK_FUNC([shl_load],
198216ee1e9aSmrg	  [lt_cv_dlopen=shl_load],
1983fda9279dSmrg      [AC_CHECK_LIB([dld], [shl_load],
198416ee1e9aSmrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1985fda9279dSmrg	[AC_CHECK_FUNC([dlopen],
198616ee1e9aSmrg	      [lt_cv_dlopen=dlopen],
1987fda9279dSmrg	  [AC_CHECK_LIB([dl], [dlopen],
198816ee1e9aSmrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1989fda9279dSmrg	    [AC_CHECK_LIB([svld], [dlopen],
199016ee1e9aSmrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1991fda9279dSmrg	      [AC_CHECK_LIB([dld], [dld_link],
199216ee1e9aSmrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1993fda9279dSmrg	      ])
1994fda9279dSmrg	    ])
1995fda9279dSmrg	  ])
1996fda9279dSmrg	])
1997fda9279dSmrg      ])
1998fda9279dSmrg    ;;
1999fda9279dSmrg  esac
2000fda9279dSmrg
200116ee1e9aSmrg  if test no = "$lt_cv_dlopen"; then
2002fda9279dSmrg    enable_dlopen=no
200316ee1e9aSmrg  else
200416ee1e9aSmrg    enable_dlopen=yes
2005fda9279dSmrg  fi
2006fda9279dSmrg
2007fda9279dSmrg  case $lt_cv_dlopen in
2008fda9279dSmrg  dlopen)
200916ee1e9aSmrg    save_CPPFLAGS=$CPPFLAGS
201016ee1e9aSmrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2011fda9279dSmrg
201216ee1e9aSmrg    save_LDFLAGS=$LDFLAGS
2013fda9279dSmrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2014fda9279dSmrg
201516ee1e9aSmrg    save_LIBS=$LIBS
2016fda9279dSmrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2017fda9279dSmrg
2018fda9279dSmrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2019fda9279dSmrg	  lt_cv_dlopen_self, [dnl
2020fda9279dSmrg	  _LT_TRY_DLOPEN_SELF(
2021fda9279dSmrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2022fda9279dSmrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2023fda9279dSmrg    ])
2024fda9279dSmrg
202516ee1e9aSmrg    if test yes = "$lt_cv_dlopen_self"; then
2026fda9279dSmrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2027fda9279dSmrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2028fda9279dSmrg	  lt_cv_dlopen_self_static, [dnl
2029fda9279dSmrg	  _LT_TRY_DLOPEN_SELF(
2030fda9279dSmrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2031fda9279dSmrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2032fda9279dSmrg      ])
2033fda9279dSmrg    fi
2034fda9279dSmrg
203516ee1e9aSmrg    CPPFLAGS=$save_CPPFLAGS
203616ee1e9aSmrg    LDFLAGS=$save_LDFLAGS
203716ee1e9aSmrg    LIBS=$save_LIBS
2038fda9279dSmrg    ;;
2039fda9279dSmrg  esac
2040fda9279dSmrg
2041fda9279dSmrg  case $lt_cv_dlopen_self in
2042fda9279dSmrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2043fda9279dSmrg  *) enable_dlopen_self=unknown ;;
2044fda9279dSmrg  esac
2045fda9279dSmrg
2046fda9279dSmrg  case $lt_cv_dlopen_self_static in
2047fda9279dSmrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2048fda9279dSmrg  *) enable_dlopen_self_static=unknown ;;
2049fda9279dSmrg  esac
2050fda9279dSmrgfi
2051fda9279dSmrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2052fda9279dSmrg	 [Whether dlopen is supported])
2053fda9279dSmrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2054fda9279dSmrg	 [Whether dlopen of programs is supported])
2055fda9279dSmrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2056fda9279dSmrg	 [Whether dlopen of statically linked programs is supported])
2057fda9279dSmrg])# LT_SYS_DLOPEN_SELF
2058fda9279dSmrg
2059fda9279dSmrg# Old name:
2060fda9279dSmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2061fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
2062fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2063fda9279dSmrg
2064fda9279dSmrg
2065fda9279dSmrg# _LT_COMPILER_C_O([TAGNAME])
2066fda9279dSmrg# ---------------------------
2067fda9279dSmrg# Check to see if options -c and -o are simultaneously supported by compiler.
2068fda9279dSmrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2069fda9279dSmrgm4_defun([_LT_COMPILER_C_O],
2070fda9279dSmrg[m4_require([_LT_DECL_SED])dnl
2071fda9279dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2072fda9279dSmrgm4_require([_LT_TAG_COMPILER])dnl
2073fda9279dSmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2074fda9279dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2075fda9279dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2076fda9279dSmrg   $RM -r conftest 2>/dev/null
2077fda9279dSmrg   mkdir conftest
2078fda9279dSmrg   cd conftest
2079fda9279dSmrg   mkdir out
2080fda9279dSmrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2081fda9279dSmrg
2082fda9279dSmrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2083fda9279dSmrg   # Insert the option either (1) after the last *FLAGS variable, or
2084fda9279dSmrg   # (2) before a word containing "conftest.", or (3) at the end.
2085fda9279dSmrg   # Note that $ac_compile itself does not contain backslashes and begins
2086fda9279dSmrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2087fda9279dSmrg   lt_compile=`echo "$ac_compile" | $SED \
2088fda9279dSmrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2089fda9279dSmrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2090fda9279dSmrg   -e 's:$: $lt_compiler_flag:'`
2091fda9279dSmrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2092fda9279dSmrg   (eval "$lt_compile" 2>out/conftest.err)
2093fda9279dSmrg   ac_status=$?
2094fda9279dSmrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2095fda9279dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2096fda9279dSmrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2097fda9279dSmrg   then
2098fda9279dSmrg     # The compiler can only warn and ignore the option if not recognized
2099fda9279dSmrg     # So say no if there are warnings
2100fda9279dSmrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2101fda9279dSmrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2102fda9279dSmrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2103fda9279dSmrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2104fda9279dSmrg     fi
2105fda9279dSmrg   fi
2106fda9279dSmrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2107fda9279dSmrg   $RM conftest*
2108fda9279dSmrg   # SGI C++ compiler will create directory out/ii_files/ for
2109fda9279dSmrg   # template instantiation
2110fda9279dSmrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2111fda9279dSmrg   $RM out/* && rmdir out
2112fda9279dSmrg   cd ..
2113fda9279dSmrg   $RM -r conftest
2114fda9279dSmrg   $RM conftest*
2115fda9279dSmrg])
2116fda9279dSmrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2117fda9279dSmrg	[Does compiler simultaneously support -c and -o options?])
2118fda9279dSmrg])# _LT_COMPILER_C_O
2119fda9279dSmrg
2120fda9279dSmrg
2121fda9279dSmrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2122fda9279dSmrg# ----------------------------------
2123fda9279dSmrg# Check to see if we can do hard links to lock some files if needed
2124fda9279dSmrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2125fda9279dSmrg[m4_require([_LT_ENABLE_LOCK])dnl
2126fda9279dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2127fda9279dSmrg_LT_COMPILER_C_O([$1])
2128fda9279dSmrg
212916ee1e9aSmrghard_links=nottested
213016ee1e9aSmrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2131fda9279dSmrg  # do not overwrite the value of need_locks provided by the user
2132fda9279dSmrg  AC_MSG_CHECKING([if we can lock with hard links])
2133fda9279dSmrg  hard_links=yes
2134fda9279dSmrg  $RM conftest*
2135fda9279dSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2136fda9279dSmrg  touch conftest.a
2137fda9279dSmrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2138fda9279dSmrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2139fda9279dSmrg  AC_MSG_RESULT([$hard_links])
214016ee1e9aSmrg  if test no = "$hard_links"; then
214116ee1e9aSmrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2142fda9279dSmrg    need_locks=warn
2143fda9279dSmrg  fi
2144fda9279dSmrgelse
2145fda9279dSmrg  need_locks=no
2146fda9279dSmrgfi
2147fda9279dSmrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2148fda9279dSmrg])# _LT_COMPILER_FILE_LOCKS
2149fda9279dSmrg
2150fda9279dSmrg
2151fda9279dSmrg# _LT_CHECK_OBJDIR
2152fda9279dSmrg# ----------------
2153fda9279dSmrgm4_defun([_LT_CHECK_OBJDIR],
2154fda9279dSmrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2155fda9279dSmrg[rm -f .libs 2>/dev/null
2156fda9279dSmrgmkdir .libs 2>/dev/null
2157fda9279dSmrgif test -d .libs; then
2158fda9279dSmrg  lt_cv_objdir=.libs
2159fda9279dSmrgelse
2160fda9279dSmrg  # MS-DOS does not allow filenames that begin with a dot.
2161fda9279dSmrg  lt_cv_objdir=_libs
2162fda9279dSmrgfi
2163fda9279dSmrgrmdir .libs 2>/dev/null])
2164fda9279dSmrgobjdir=$lt_cv_objdir
2165fda9279dSmrg_LT_DECL([], [objdir], [0],
2166fda9279dSmrg         [The name of the directory that contains temporary libtool files])dnl
2167fda9279dSmrgm4_pattern_allow([LT_OBJDIR])dnl
216816ee1e9aSmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
216916ee1e9aSmrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2170fda9279dSmrg])# _LT_CHECK_OBJDIR
2171fda9279dSmrg
2172fda9279dSmrg
2173fda9279dSmrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2174fda9279dSmrg# --------------------------------------
2175fda9279dSmrg# Check hardcoding attributes.
2176fda9279dSmrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2177fda9279dSmrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2178fda9279dSmrg_LT_TAGVAR(hardcode_action, $1)=
2179fda9279dSmrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2180fda9279dSmrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
218116ee1e9aSmrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
2182fda9279dSmrg
2183fda9279dSmrg  # We can hardcode non-existent directories.
218416ee1e9aSmrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2185fda9279dSmrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2186fda9279dSmrg     # have to relink, otherwise we might link with an installed library
2187fda9279dSmrg     # when we should be linking with a yet-to-be-installed one
218816ee1e9aSmrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
218916ee1e9aSmrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2190fda9279dSmrg    # Linking always hardcodes the temporary library directory.
2191fda9279dSmrg    _LT_TAGVAR(hardcode_action, $1)=relink
2192fda9279dSmrg  else
2193fda9279dSmrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2194fda9279dSmrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2195fda9279dSmrg  fi
2196fda9279dSmrgelse
2197fda9279dSmrg  # We cannot hardcode anything, or else we can only hardcode existing
2198fda9279dSmrg  # directories.
2199fda9279dSmrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2200fda9279dSmrgfi
2201fda9279dSmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
2202fda9279dSmrg
220316ee1e9aSmrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
220416ee1e9aSmrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2205fda9279dSmrg  # Fast installation is not supported
2206fda9279dSmrg  enable_fast_install=no
220716ee1e9aSmrgelif test yes = "$shlibpath_overrides_runpath" ||
220816ee1e9aSmrg     test no = "$enable_shared"; then
2209fda9279dSmrg  # Fast installation is not necessary
2210fda9279dSmrg  enable_fast_install=needless
2211fda9279dSmrgfi
2212fda9279dSmrg_LT_TAGDECL([], [hardcode_action], [0],
2213fda9279dSmrg    [How to hardcode a shared library path into an executable])
2214fda9279dSmrg])# _LT_LINKER_HARDCODE_LIBPATH
2215fda9279dSmrg
2216fda9279dSmrg
2217fda9279dSmrg# _LT_CMD_STRIPLIB
2218fda9279dSmrg# ----------------
2219fda9279dSmrgm4_defun([_LT_CMD_STRIPLIB],
2220fda9279dSmrg[m4_require([_LT_DECL_EGREP])
2221fda9279dSmrgstriplib=
2222fda9279dSmrgold_striplib=
2223fda9279dSmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2224fda9279dSmrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2225fda9279dSmrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2226fda9279dSmrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2227fda9279dSmrg  AC_MSG_RESULT([yes])
2228fda9279dSmrgelse
2229fda9279dSmrg# FIXME - insert some real tests, host_os isn't really good enough
2230fda9279dSmrg  case $host_os in
2231fda9279dSmrg  darwin*)
223216ee1e9aSmrg    if test -n "$STRIP"; then
2233fda9279dSmrg      striplib="$STRIP -x"
2234fda9279dSmrg      old_striplib="$STRIP -S"
2235fda9279dSmrg      AC_MSG_RESULT([yes])
2236fda9279dSmrg    else
2237fda9279dSmrg      AC_MSG_RESULT([no])
2238fda9279dSmrg    fi
2239fda9279dSmrg    ;;
2240fda9279dSmrg  *)
2241fda9279dSmrg    AC_MSG_RESULT([no])
2242fda9279dSmrg    ;;
2243fda9279dSmrg  esac
2244fda9279dSmrgfi
2245fda9279dSmrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2246fda9279dSmrg_LT_DECL([], [striplib], [1])
2247fda9279dSmrg])# _LT_CMD_STRIPLIB
2248fda9279dSmrg
2249fda9279dSmrg
225016ee1e9aSmrg# _LT_PREPARE_MUNGE_PATH_LIST
225116ee1e9aSmrg# ---------------------------
225216ee1e9aSmrg# Make sure func_munge_path_list() is defined correctly.
225316ee1e9aSmrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
225416ee1e9aSmrg[[# func_munge_path_list VARIABLE PATH
225516ee1e9aSmrg# -----------------------------------
225616ee1e9aSmrg# VARIABLE is name of variable containing _space_ separated list of
225716ee1e9aSmrg# directories to be munged by the contents of PATH, which is string
225816ee1e9aSmrg# having a format:
225916ee1e9aSmrg# "DIR[:DIR]:"
226016ee1e9aSmrg#       string "DIR[ DIR]" will be prepended to VARIABLE
226116ee1e9aSmrg# ":DIR[:DIR]"
226216ee1e9aSmrg#       string "DIR[ DIR]" will be appended to VARIABLE
226316ee1e9aSmrg# "DIRP[:DIRP]::[DIRA:]DIRA"
226416ee1e9aSmrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
226516ee1e9aSmrg#       "DIRA[ DIRA]" will be appended to VARIABLE
226616ee1e9aSmrg# "DIR[:DIR]"
226716ee1e9aSmrg#       VARIABLE will be replaced by "DIR[ DIR]"
226816ee1e9aSmrgfunc_munge_path_list ()
226916ee1e9aSmrg{
227016ee1e9aSmrg    case x@S|@2 in
227116ee1e9aSmrg    x)
227216ee1e9aSmrg        ;;
227316ee1e9aSmrg    *:)
227416ee1e9aSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
227516ee1e9aSmrg        ;;
227616ee1e9aSmrg    x:*)
227716ee1e9aSmrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
227816ee1e9aSmrg        ;;
227916ee1e9aSmrg    *::*)
228016ee1e9aSmrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
228116ee1e9aSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
228216ee1e9aSmrg        ;;
228316ee1e9aSmrg    *)
228416ee1e9aSmrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
228516ee1e9aSmrg        ;;
228616ee1e9aSmrg    esac
228716ee1e9aSmrg}
228816ee1e9aSmrg]])# _LT_PREPARE_PATH_LIST
228916ee1e9aSmrg
229016ee1e9aSmrg
2291fda9279dSmrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2292fda9279dSmrg# -----------------------------
2293fda9279dSmrg# PORTME Fill in your ld.so characteristics
2294fda9279dSmrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2295fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2296fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
2297fda9279dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2298fda9279dSmrgm4_require([_LT_DECL_OBJDUMP])dnl
2299fda9279dSmrgm4_require([_LT_DECL_SED])dnl
2300fda9279dSmrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
230116ee1e9aSmrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2302fda9279dSmrgAC_MSG_CHECKING([dynamic linker characteristics])
2303fda9279dSmrgm4_if([$1],
2304fda9279dSmrg	[], [
230516ee1e9aSmrgif test yes = "$GCC"; then
2306fda9279dSmrg  case $host_os in
230716ee1e9aSmrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
230816ee1e9aSmrg    *) lt_awk_arg='/^libraries:/' ;;
2309fda9279dSmrg  esac
2310fda9279dSmrg  case $host_os in
231116ee1e9aSmrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
231216ee1e9aSmrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2313fda9279dSmrg  esac
2314fda9279dSmrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2315fda9279dSmrg  case $lt_search_path_spec in
2316fda9279dSmrg  *\;*)
2317fda9279dSmrg    # if the path contains ";" then we assume it to be the separator
2318fda9279dSmrg    # otherwise default to the standard path separator (i.e. ":") - it is
2319fda9279dSmrg    # assumed that no part of a normal pathname contains ";" but that should
2320fda9279dSmrg    # okay in the real world where ";" in dirpaths is itself problematic.
2321fda9279dSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2322fda9279dSmrg    ;;
2323fda9279dSmrg  *)
2324fda9279dSmrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2325fda9279dSmrg    ;;
2326fda9279dSmrg  esac
2327fda9279dSmrg  # Ok, now we have the path, separated by spaces, we can step through it
232816ee1e9aSmrg  # and add multilib dir if necessary...
2329fda9279dSmrg  lt_tmp_lt_search_path_spec=
233016ee1e9aSmrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
233116ee1e9aSmrg  # ...but if some path component already ends with the multilib dir we assume
233216ee1e9aSmrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
233316ee1e9aSmrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
233416ee1e9aSmrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
233516ee1e9aSmrg    lt_multi_os_dir=
233616ee1e9aSmrg    ;;
233716ee1e9aSmrg  esac
2338fda9279dSmrg  for lt_sys_path in $lt_search_path_spec; do
233916ee1e9aSmrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
234016ee1e9aSmrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
234116ee1e9aSmrg    elif test -n "$lt_multi_os_dir"; then
2342fda9279dSmrg      test -d "$lt_sys_path" && \
2343fda9279dSmrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2344fda9279dSmrg    fi
2345fda9279dSmrg  done
2346fda9279dSmrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
234716ee1e9aSmrgBEGIN {RS = " "; FS = "/|\n";} {
234816ee1e9aSmrg  lt_foo = "";
234916ee1e9aSmrg  lt_count = 0;
2350fda9279dSmrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2351fda9279dSmrg    if ($lt_i != "" && $lt_i != ".") {
2352fda9279dSmrg      if ($lt_i == "..") {
2353fda9279dSmrg        lt_count++;
2354fda9279dSmrg      } else {
2355fda9279dSmrg        if (lt_count == 0) {
235616ee1e9aSmrg          lt_foo = "/" $lt_i lt_foo;
2357fda9279dSmrg        } else {
2358fda9279dSmrg          lt_count--;
2359fda9279dSmrg        }
2360fda9279dSmrg      }
2361fda9279dSmrg    }
2362fda9279dSmrg  }
2363fda9279dSmrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2364fda9279dSmrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2365fda9279dSmrg}'`
2366fda9279dSmrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2367fda9279dSmrg  # for these hosts.
2368fda9279dSmrg  case $host_os in
2369fda9279dSmrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
237016ee1e9aSmrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2371fda9279dSmrg  esac
2372fda9279dSmrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2373fda9279dSmrgelse
2374fda9279dSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2375fda9279dSmrgfi])
2376fda9279dSmrglibrary_names_spec=
2377fda9279dSmrglibname_spec='lib$name'
2378fda9279dSmrgsoname_spec=
237916ee1e9aSmrgshrext_cmds=.so
2380fda9279dSmrgpostinstall_cmds=
2381fda9279dSmrgpostuninstall_cmds=
2382fda9279dSmrgfinish_cmds=
2383fda9279dSmrgfinish_eval=
2384fda9279dSmrgshlibpath_var=
2385fda9279dSmrgshlibpath_overrides_runpath=unknown
2386fda9279dSmrgversion_type=none
2387fda9279dSmrgdynamic_linker="$host_os ld.so"
2388fda9279dSmrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2389fda9279dSmrgneed_lib_prefix=unknown
2390fda9279dSmrghardcode_into_libs=no
2391fda9279dSmrg
2392fda9279dSmrg# when you set need_version to no, make sure it does not cause -set_version
2393fda9279dSmrg# flags to be left without arguments
2394fda9279dSmrgneed_version=unknown
2395fda9279dSmrg
239616ee1e9aSmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
239716ee1e9aSmrg[User-defined run-time library search path.])
239816ee1e9aSmrg
2399fda9279dSmrgcase $host_os in
2400fda9279dSmrgaix3*)
2401fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
240216ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2403fda9279dSmrg  shlibpath_var=LIBPATH
2404fda9279dSmrg
2405fda9279dSmrg  # AIX 3 has no versioning support, so we append a major version to the name.
240616ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2407fda9279dSmrg  ;;
2408fda9279dSmrg
2409fda9279dSmrgaix[[4-9]]*)
2410fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2411fda9279dSmrg  need_lib_prefix=no
2412fda9279dSmrg  need_version=no
2413fda9279dSmrg  hardcode_into_libs=yes
241416ee1e9aSmrg  if test ia64 = "$host_cpu"; then
2415fda9279dSmrg    # AIX 5 supports IA64
241616ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2417fda9279dSmrg    shlibpath_var=LD_LIBRARY_PATH
2418fda9279dSmrg  else
2419fda9279dSmrg    # With GCC up to 2.95.x, collect2 would create an import file
2420fda9279dSmrg    # for dependence libraries.  The import file would start with
242116ee1e9aSmrg    # the line '#! .'.  This would cause the generated library to
242216ee1e9aSmrg    # depend on '.', always an invalid library.  This was fixed in
2423fda9279dSmrg    # development snapshots of GCC prior to 3.0.
2424fda9279dSmrg    case $host_os in
2425fda9279dSmrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2426fda9279dSmrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2427fda9279dSmrg	   echo ' yes '
242816ee1e9aSmrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2429fda9279dSmrg	:
2430fda9279dSmrg      else
2431fda9279dSmrg	can_build_shared=no
2432fda9279dSmrg      fi
2433fda9279dSmrg      ;;
2434fda9279dSmrg    esac
243516ee1e9aSmrg    # Using Import Files as archive members, it is possible to support
243616ee1e9aSmrg    # filename-based versioning of shared library archives on AIX. While
243716ee1e9aSmrg    # this would work for both with and without runtime linking, it will
243816ee1e9aSmrg    # prevent static linking of such archives. So we do filename-based
243916ee1e9aSmrg    # shared library versioning with .so extension only, which is used
244016ee1e9aSmrg    # when both runtime linking and shared linking is enabled.
244116ee1e9aSmrg    # Unfortunately, runtime linking may impact performance, so we do
244216ee1e9aSmrg    # not want this to be the default eventually. Also, we use the
244316ee1e9aSmrg    # versioned .so libs for executables only if there is the -brtl
244416ee1e9aSmrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
244516ee1e9aSmrg    # To allow for filename-based versioning support, we need to create
244616ee1e9aSmrg    # libNAME.so.V as an archive file, containing:
244716ee1e9aSmrg    # *) an Import File, referring to the versioned filename of the
244816ee1e9aSmrg    #    archive as well as the shared archive member, telling the
244916ee1e9aSmrg    #    bitwidth (32 or 64) of that shared object, and providing the
245016ee1e9aSmrg    #    list of exported symbols of that shared object, eventually
245116ee1e9aSmrg    #    decorated with the 'weak' keyword
245216ee1e9aSmrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
245316ee1e9aSmrg    #    it being seen by the linker.
245416ee1e9aSmrg    # At run time we better use the real file rather than another symlink,
245516ee1e9aSmrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
245616ee1e9aSmrg
245716ee1e9aSmrg    case $with_aix_soname,$aix_use_runtimelinking in
245816ee1e9aSmrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2459fda9279dSmrg    # soname into executable. Probably we can add versioning support to
2460fda9279dSmrg    # collect2, so additional links can be useful in future.
246116ee1e9aSmrg    aix,yes) # traditional libtool
246216ee1e9aSmrg      dynamic_linker='AIX unversionable lib.so'
2463fda9279dSmrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2464fda9279dSmrg      # instead of lib<name>.a to let people know that these are not
2465fda9279dSmrg      # typical AIX shared libraries.
246616ee1e9aSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
246716ee1e9aSmrg      ;;
246816ee1e9aSmrg    aix,no) # traditional AIX only
246916ee1e9aSmrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2470fda9279dSmrg      # We preserve .a as extension for shared libraries through AIX4.2
2471fda9279dSmrg      # and later when we are not doing run time linking.
247216ee1e9aSmrg      library_names_spec='$libname$release.a $libname.a'
247316ee1e9aSmrg      soname_spec='$libname$release$shared_ext$major'
247416ee1e9aSmrg      ;;
247516ee1e9aSmrg    svr4,*) # full svr4 only
247616ee1e9aSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
247716ee1e9aSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
247816ee1e9aSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
247916ee1e9aSmrg      shlibpath_overrides_runpath=yes
248016ee1e9aSmrg      ;;
248116ee1e9aSmrg    *,yes) # both, prefer svr4
248216ee1e9aSmrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
248316ee1e9aSmrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
248416ee1e9aSmrg      # unpreferred sharedlib libNAME.a needs extra handling
248516ee1e9aSmrg      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"'
248616ee1e9aSmrg      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"'
248716ee1e9aSmrg      # We do not specify a path in Import Files, so LIBPATH fires.
248816ee1e9aSmrg      shlibpath_overrides_runpath=yes
248916ee1e9aSmrg      ;;
249016ee1e9aSmrg    *,no) # both, prefer aix
249116ee1e9aSmrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
249216ee1e9aSmrg      library_names_spec='$libname$release.a $libname.a'
249316ee1e9aSmrg      soname_spec='$libname$release$shared_ext$major'
249416ee1e9aSmrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
249516ee1e9aSmrg      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)'
249616ee1e9aSmrg      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"'
249716ee1e9aSmrg      ;;
249816ee1e9aSmrg    esac
2499fda9279dSmrg    shlibpath_var=LIBPATH
2500fda9279dSmrg  fi
2501fda9279dSmrg  ;;
2502fda9279dSmrg
2503fda9279dSmrgamigaos*)
2504fda9279dSmrg  case $host_cpu in
2505fda9279dSmrg  powerpc)
2506fda9279dSmrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2507fda9279dSmrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
250816ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2509fda9279dSmrg    ;;
2510fda9279dSmrg  m68k)
2511fda9279dSmrg    library_names_spec='$libname.ixlibrary $libname.a'
2512fda9279dSmrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
251316ee1e9aSmrg    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'
2514fda9279dSmrg    ;;
2515fda9279dSmrg  esac
2516fda9279dSmrg  ;;
2517fda9279dSmrg
2518fda9279dSmrgbeos*)
251916ee1e9aSmrg  library_names_spec='$libname$shared_ext'
2520fda9279dSmrg  dynamic_linker="$host_os ld.so"
2521fda9279dSmrg  shlibpath_var=LIBRARY_PATH
2522fda9279dSmrg  ;;
2523fda9279dSmrg
2524fda9279dSmrgbsdi[[45]]*)
2525fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2526fda9279dSmrg  need_version=no
252716ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
252816ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2529fda9279dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2530fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2531fda9279dSmrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2532fda9279dSmrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2533fda9279dSmrg  # the default ld.so.conf also contains /usr/contrib/lib and
2534fda9279dSmrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2535fda9279dSmrg  # libtool to hard-code these into programs
2536fda9279dSmrg  ;;
2537fda9279dSmrg
2538fda9279dSmrgcygwin* | mingw* | pw32* | cegcc*)
2539fda9279dSmrg  version_type=windows
254016ee1e9aSmrg  shrext_cmds=.dll
2541fda9279dSmrg  need_version=no
2542fda9279dSmrg  need_lib_prefix=no
2543fda9279dSmrg
2544fda9279dSmrg  case $GCC,$cc_basename in
2545fda9279dSmrg  yes,*)
2546fda9279dSmrg    # gcc
2547fda9279dSmrg    library_names_spec='$libname.dll.a'
2548fda9279dSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
254916ee1e9aSmrg    postinstall_cmds='base_file=`basename \$file`~
255016ee1e9aSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2551fda9279dSmrg      dldir=$destdir/`dirname \$dlpath`~
2552fda9279dSmrg      test -d \$dldir || mkdir -p \$dldir~
2553fda9279dSmrg      $install_prog $dir/$dlname \$dldir/$dlname~
2554fda9279dSmrg      chmod a+x \$dldir/$dlname~
2555fda9279dSmrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2556fda9279dSmrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2557fda9279dSmrg      fi'
2558fda9279dSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2559fda9279dSmrg      dlpath=$dir/\$dldll~
2560fda9279dSmrg       $RM \$dlpath'
2561fda9279dSmrg    shlibpath_overrides_runpath=yes
2562fda9279dSmrg
2563fda9279dSmrg    case $host_os in
2564fda9279dSmrg    cygwin*)
2565fda9279dSmrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
256616ee1e9aSmrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2567fda9279dSmrgm4_if([$1], [],[
2568fda9279dSmrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2569fda9279dSmrg      ;;
2570fda9279dSmrg    mingw* | cegcc*)
2571fda9279dSmrg      # MinGW DLLs use traditional 'lib' prefix
257216ee1e9aSmrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2573fda9279dSmrg      ;;
2574fda9279dSmrg    pw32*)
2575fda9279dSmrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
257616ee1e9aSmrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2577fda9279dSmrg      ;;
2578fda9279dSmrg    esac
2579fda9279dSmrg    dynamic_linker='Win32 ld.exe'
2580fda9279dSmrg    ;;
2581fda9279dSmrg
2582fda9279dSmrg  *,cl*)
2583fda9279dSmrg    # Native MSVC
2584fda9279dSmrg    libname_spec='$name'
258516ee1e9aSmrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
258616ee1e9aSmrg    library_names_spec='$libname.dll.lib'
2587fda9279dSmrg
2588fda9279dSmrg    case $build_os in
2589fda9279dSmrg    mingw*)
2590fda9279dSmrg      sys_lib_search_path_spec=
2591fda9279dSmrg      lt_save_ifs=$IFS
2592fda9279dSmrg      IFS=';'
2593fda9279dSmrg      for lt_path in $LIB
2594fda9279dSmrg      do
2595fda9279dSmrg        IFS=$lt_save_ifs
2596fda9279dSmrg        # Let DOS variable expansion print the short 8.3 style file name.
2597fda9279dSmrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2598fda9279dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2599fda9279dSmrg      done
2600fda9279dSmrg      IFS=$lt_save_ifs
2601fda9279dSmrg      # Convert to MSYS style.
2602fda9279dSmrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2603fda9279dSmrg      ;;
2604fda9279dSmrg    cygwin*)
2605fda9279dSmrg      # Convert to unix form, then to dos form, then back to unix form
2606fda9279dSmrg      # but this time dos style (no spaces!) so that the unix form looks
2607fda9279dSmrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2608fda9279dSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2609fda9279dSmrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2610fda9279dSmrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2611fda9279dSmrg      ;;
2612fda9279dSmrg    *)
261316ee1e9aSmrg      sys_lib_search_path_spec=$LIB
2614fda9279dSmrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2615fda9279dSmrg        # It is most probably a Windows format PATH.
2616fda9279dSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2617fda9279dSmrg      else
2618fda9279dSmrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2619fda9279dSmrg      fi
2620fda9279dSmrg      # FIXME: find the short name or the path components, as spaces are
2621fda9279dSmrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2622fda9279dSmrg      ;;
2623fda9279dSmrg    esac
2624fda9279dSmrg
2625fda9279dSmrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
262616ee1e9aSmrg    postinstall_cmds='base_file=`basename \$file`~
262716ee1e9aSmrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2628fda9279dSmrg      dldir=$destdir/`dirname \$dlpath`~
2629fda9279dSmrg      test -d \$dldir || mkdir -p \$dldir~
2630fda9279dSmrg      $install_prog $dir/$dlname \$dldir/$dlname'
2631fda9279dSmrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2632fda9279dSmrg      dlpath=$dir/\$dldll~
2633fda9279dSmrg       $RM \$dlpath'
2634fda9279dSmrg    shlibpath_overrides_runpath=yes
2635fda9279dSmrg    dynamic_linker='Win32 link.exe'
2636fda9279dSmrg    ;;
2637fda9279dSmrg
2638fda9279dSmrg  *)
2639fda9279dSmrg    # Assume MSVC wrapper
264016ee1e9aSmrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2641fda9279dSmrg    dynamic_linker='Win32 ld.exe'
2642fda9279dSmrg    ;;
2643fda9279dSmrg  esac
2644fda9279dSmrg  # FIXME: first we should search . and the directory the executable is in
2645fda9279dSmrg  shlibpath_var=PATH
2646fda9279dSmrg  ;;
2647fda9279dSmrg
2648fda9279dSmrgdarwin* | rhapsody*)
2649fda9279dSmrg  dynamic_linker="$host_os dyld"
2650fda9279dSmrg  version_type=darwin
2651fda9279dSmrg  need_lib_prefix=no
2652fda9279dSmrg  need_version=no
265316ee1e9aSmrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
265416ee1e9aSmrg  soname_spec='$libname$release$major$shared_ext'
2655fda9279dSmrg  shlibpath_overrides_runpath=yes
2656fda9279dSmrg  shlibpath_var=DYLD_LIBRARY_PATH
2657fda9279dSmrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2658fda9279dSmrgm4_if([$1], [],[
2659fda9279dSmrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2660fda9279dSmrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2661fda9279dSmrg  ;;
2662fda9279dSmrg
2663fda9279dSmrgdgux*)
2664fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2665fda9279dSmrg  need_lib_prefix=no
2666fda9279dSmrg  need_version=no
266716ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
266816ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2669fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2670fda9279dSmrg  ;;
2671fda9279dSmrg
2672fda9279dSmrgfreebsd* | dragonfly*)
2673fda9279dSmrg  # DragonFly does not have aout.  When/if they implement a new
2674fda9279dSmrg  # versioning mechanism, adjust this.
2675fda9279dSmrg  if test -x /usr/bin/objformat; then
2676fda9279dSmrg    objformat=`/usr/bin/objformat`
2677fda9279dSmrg  else
2678fda9279dSmrg    case $host_os in
2679fda9279dSmrg    freebsd[[23]].*) objformat=aout ;;
2680fda9279dSmrg    *) objformat=elf ;;
2681fda9279dSmrg    esac
2682fda9279dSmrg  fi
2683fda9279dSmrg  version_type=freebsd-$objformat
2684fda9279dSmrg  case $version_type in
2685fda9279dSmrg    freebsd-elf*)
268616ee1e9aSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
268716ee1e9aSmrg      soname_spec='$libname$release$shared_ext$major'
2688fda9279dSmrg      need_version=no
2689fda9279dSmrg      need_lib_prefix=no
2690fda9279dSmrg      ;;
2691fda9279dSmrg    freebsd-*)
269216ee1e9aSmrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2693fda9279dSmrg      need_version=yes
2694fda9279dSmrg      ;;
2695fda9279dSmrg  esac
2696fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2697fda9279dSmrg  case $host_os in
2698fda9279dSmrg  freebsd2.*)
2699fda9279dSmrg    shlibpath_overrides_runpath=yes
2700fda9279dSmrg    ;;
2701fda9279dSmrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2702fda9279dSmrg    shlibpath_overrides_runpath=yes
2703fda9279dSmrg    hardcode_into_libs=yes
2704fda9279dSmrg    ;;
2705fda9279dSmrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2706fda9279dSmrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2707fda9279dSmrg    shlibpath_overrides_runpath=no
2708fda9279dSmrg    hardcode_into_libs=yes
2709fda9279dSmrg    ;;
2710fda9279dSmrg  *) # from 4.6 on, and DragonFly
2711fda9279dSmrg    shlibpath_overrides_runpath=yes
2712fda9279dSmrg    hardcode_into_libs=yes
2713fda9279dSmrg    ;;
2714fda9279dSmrg  esac
2715fda9279dSmrg  ;;
2716fda9279dSmrg
2717fda9279dSmrghaiku*)
2718fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2719fda9279dSmrg  need_lib_prefix=no
2720fda9279dSmrg  need_version=no
2721fda9279dSmrg  dynamic_linker="$host_os runtime_loader"
272216ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
272316ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2724fda9279dSmrg  shlibpath_var=LIBRARY_PATH
272516ee1e9aSmrg  shlibpath_overrides_runpath=no
2726fda9279dSmrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2727fda9279dSmrg  hardcode_into_libs=yes
2728fda9279dSmrg  ;;
2729fda9279dSmrg
2730fda9279dSmrghpux9* | hpux10* | hpux11*)
2731fda9279dSmrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2732fda9279dSmrg  # link against other versions.
2733fda9279dSmrg  version_type=sunos
2734fda9279dSmrg  need_lib_prefix=no
2735fda9279dSmrg  need_version=no
2736fda9279dSmrg  case $host_cpu in
2737fda9279dSmrg  ia64*)
2738fda9279dSmrg    shrext_cmds='.so'
2739fda9279dSmrg    hardcode_into_libs=yes
2740fda9279dSmrg    dynamic_linker="$host_os dld.so"
2741fda9279dSmrg    shlibpath_var=LD_LIBRARY_PATH
2742fda9279dSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
274316ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
274416ee1e9aSmrg    soname_spec='$libname$release$shared_ext$major'
274516ee1e9aSmrg    if test 32 = "$HPUX_IA64_MODE"; then
2746fda9279dSmrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
274716ee1e9aSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2748fda9279dSmrg    else
2749fda9279dSmrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
275016ee1e9aSmrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2751fda9279dSmrg    fi
2752fda9279dSmrg    ;;
2753fda9279dSmrg  hppa*64*)
2754fda9279dSmrg    shrext_cmds='.sl'
2755fda9279dSmrg    hardcode_into_libs=yes
2756fda9279dSmrg    dynamic_linker="$host_os dld.sl"
2757fda9279dSmrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2758fda9279dSmrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
275916ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
276016ee1e9aSmrg    soname_spec='$libname$release$shared_ext$major'
2761fda9279dSmrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2762fda9279dSmrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2763fda9279dSmrg    ;;
2764fda9279dSmrg  *)
2765fda9279dSmrg    shrext_cmds='.sl'
2766fda9279dSmrg    dynamic_linker="$host_os dld.sl"
2767fda9279dSmrg    shlibpath_var=SHLIB_PATH
2768fda9279dSmrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
276916ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
277016ee1e9aSmrg    soname_spec='$libname$release$shared_ext$major'
2771fda9279dSmrg    ;;
2772fda9279dSmrg  esac
2773fda9279dSmrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2774fda9279dSmrg  postinstall_cmds='chmod 555 $lib'
2775fda9279dSmrg  # or fails outright, so override atomically:
2776fda9279dSmrg  install_override_mode=555
2777fda9279dSmrg  ;;
2778fda9279dSmrg
2779fda9279dSmrginterix[[3-9]]*)
2780fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2781fda9279dSmrg  need_lib_prefix=no
2782fda9279dSmrg  need_version=no
278316ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
278416ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2785fda9279dSmrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2786fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2787fda9279dSmrg  shlibpath_overrides_runpath=no
2788fda9279dSmrg  hardcode_into_libs=yes
2789fda9279dSmrg  ;;
2790fda9279dSmrg
2791fda9279dSmrgirix5* | irix6* | nonstopux*)
2792fda9279dSmrg  case $host_os in
2793fda9279dSmrg    nonstopux*) version_type=nonstopux ;;
2794fda9279dSmrg    *)
279516ee1e9aSmrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2796fda9279dSmrg		version_type=linux # correct to gnu/linux during the next big refactor
2797fda9279dSmrg	else
2798fda9279dSmrg		version_type=irix
2799fda9279dSmrg	fi ;;
2800fda9279dSmrg  esac
2801fda9279dSmrg  need_lib_prefix=no
2802fda9279dSmrg  need_version=no
280316ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
280416ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2805fda9279dSmrg  case $host_os in
2806fda9279dSmrg  irix5* | nonstopux*)
2807fda9279dSmrg    libsuff= shlibsuff=
2808fda9279dSmrg    ;;
2809fda9279dSmrg  *)
2810fda9279dSmrg    case $LD in # libtool.m4 will add one of these switches to LD
2811fda9279dSmrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2812fda9279dSmrg      libsuff= shlibsuff= libmagic=32-bit;;
2813fda9279dSmrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2814fda9279dSmrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2815fda9279dSmrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2816fda9279dSmrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2817fda9279dSmrg    *) libsuff= shlibsuff= libmagic=never-match;;
2818fda9279dSmrg    esac
2819fda9279dSmrg    ;;
2820fda9279dSmrg  esac
2821fda9279dSmrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2822fda9279dSmrg  shlibpath_overrides_runpath=no
282316ee1e9aSmrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
282416ee1e9aSmrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2825fda9279dSmrg  hardcode_into_libs=yes
2826fda9279dSmrg  ;;
2827fda9279dSmrg
2828fda9279dSmrg# No shared lib support for Linux oldld, aout, or coff.
2829fda9279dSmrglinux*oldld* | linux*aout* | linux*coff*)
2830fda9279dSmrg  dynamic_linker=no
2831fda9279dSmrg  ;;
2832fda9279dSmrg
283316ee1e9aSmrglinux*android*)
283416ee1e9aSmrg  version_type=none # Android doesn't support versioned libraries.
283516ee1e9aSmrg  need_lib_prefix=no
283616ee1e9aSmrg  need_version=no
283716ee1e9aSmrg  library_names_spec='$libname$release$shared_ext'
283816ee1e9aSmrg  soname_spec='$libname$release$shared_ext'
283916ee1e9aSmrg  finish_cmds=
284016ee1e9aSmrg  shlibpath_var=LD_LIBRARY_PATH
284116ee1e9aSmrg  shlibpath_overrides_runpath=yes
284216ee1e9aSmrg
284316ee1e9aSmrg  # This implies no fast_install, which is unacceptable.
284416ee1e9aSmrg  # Some rework will be needed to allow for fast_install
284516ee1e9aSmrg  # before this can be enabled.
284616ee1e9aSmrg  hardcode_into_libs=yes
284716ee1e9aSmrg
284816ee1e9aSmrg  dynamic_linker='Android linker'
284916ee1e9aSmrg  # Don't embed -rpath directories since the linker doesn't support them.
285016ee1e9aSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
285116ee1e9aSmrg  ;;
285216ee1e9aSmrg
2853fda9279dSmrg# This must be glibc/ELF.
2854fda9279dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2855fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
2856fda9279dSmrg  need_lib_prefix=no
2857fda9279dSmrg  need_version=no
285816ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
285916ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2860fda9279dSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2861fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2862fda9279dSmrg  shlibpath_overrides_runpath=no
2863fda9279dSmrg
2864fda9279dSmrg  # Some binutils ld are patched to set DT_RUNPATH
2865fda9279dSmrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2866fda9279dSmrg    [lt_cv_shlibpath_overrides_runpath=no
2867fda9279dSmrg    save_LDFLAGS=$LDFLAGS
2868fda9279dSmrg    save_libdir=$libdir
2869fda9279dSmrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2870fda9279dSmrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2871fda9279dSmrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2872fda9279dSmrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2873fda9279dSmrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2874fda9279dSmrg    LDFLAGS=$save_LDFLAGS
2875fda9279dSmrg    libdir=$save_libdir
2876fda9279dSmrg    ])
2877fda9279dSmrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2878fda9279dSmrg
2879fda9279dSmrg  # This implies no fast_install, which is unacceptable.
2880fda9279dSmrg  # Some rework will be needed to allow for fast_install
2881fda9279dSmrg  # before this can be enabled.
2882fda9279dSmrg  hardcode_into_libs=yes
2883fda9279dSmrg
288416ee1e9aSmrg  # Add ABI-specific directories to the system library path.
288516ee1e9aSmrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
288616ee1e9aSmrg
288716ee1e9aSmrg  # Ideally, we could use ldconfig to report *all* directores which are
288816ee1e9aSmrg  # searched for libraries, however this is still not possible.  Aside from not
288916ee1e9aSmrg  # being certain /sbin/ldconfig is available, command
289016ee1e9aSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
289116ee1e9aSmrg  # even though it is searched at run-time.  Try to do the best guess by
289216ee1e9aSmrg  # appending ld.so.conf contents (and includes) to the search path.
2893fda9279dSmrg  if test -f /etc/ld.so.conf; then
2894fda9279dSmrg    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' ' '`
289516ee1e9aSmrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2896fda9279dSmrg  fi
2897fda9279dSmrg
2898fda9279dSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2899fda9279dSmrg  # powerpc, because MkLinux only supported shared libraries with the
2900fda9279dSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2901fda9279dSmrg  # most powerpc-linux boxes support dynamic linking these days and
2902fda9279dSmrg  # people can always --disable-shared, the test was removed, and we
2903fda9279dSmrg  # assume the GNU/Linux dynamic linker is in use.
2904fda9279dSmrg  dynamic_linker='GNU/Linux ld.so'
2905fda9279dSmrg  ;;
2906fda9279dSmrg
2907fda9279dSmrgnetbsd*)
2908fda9279dSmrg  version_type=sunos
2909fda9279dSmrg  need_lib_prefix=no
2910fda9279dSmrg  need_version=no
2911fda9279dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
291216ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2913fda9279dSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2914fda9279dSmrg    dynamic_linker='NetBSD (a.out) ld.so'
2915fda9279dSmrg  else
291616ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
291716ee1e9aSmrg    soname_spec='$libname$release$shared_ext$major'
2918fda9279dSmrg    dynamic_linker='NetBSD ld.elf_so'
2919fda9279dSmrg  fi
2920fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2921fda9279dSmrg  shlibpath_overrides_runpath=yes
2922fda9279dSmrg  hardcode_into_libs=yes
2923fda9279dSmrg  ;;
2924fda9279dSmrg
2925fda9279dSmrgnewsos6)
2926fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
292716ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2928fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2929fda9279dSmrg  shlibpath_overrides_runpath=yes
2930fda9279dSmrg  ;;
2931fda9279dSmrg
2932fda9279dSmrg*nto* | *qnx*)
2933fda9279dSmrg  version_type=qnx
2934fda9279dSmrg  need_lib_prefix=no
2935fda9279dSmrg  need_version=no
293616ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
293716ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2938fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2939fda9279dSmrg  shlibpath_overrides_runpath=no
2940fda9279dSmrg  hardcode_into_libs=yes
2941fda9279dSmrg  dynamic_linker='ldqnx.so'
2942fda9279dSmrg  ;;
2943fda9279dSmrg
294416ee1e9aSmrgopenbsd* | bitrig*)
2945fda9279dSmrg  version_type=sunos
294616ee1e9aSmrg  sys_lib_dlsearch_path_spec=/usr/lib
2947fda9279dSmrg  need_lib_prefix=no
294816ee1e9aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
294916ee1e9aSmrg    need_version=no
2950fda9279dSmrg  else
295116ee1e9aSmrg    need_version=yes
2952fda9279dSmrg  fi
295316ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
295416ee1e9aSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
295516ee1e9aSmrg  shlibpath_var=LD_LIBRARY_PATH
295616ee1e9aSmrg  shlibpath_overrides_runpath=yes
2957fda9279dSmrg  ;;
2958fda9279dSmrg
2959fda9279dSmrgos2*)
2960fda9279dSmrg  libname_spec='$name'
296116ee1e9aSmrg  version_type=windows
296216ee1e9aSmrg  shrext_cmds=.dll
296316ee1e9aSmrg  need_version=no
2964fda9279dSmrg  need_lib_prefix=no
296516ee1e9aSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
296616ee1e9aSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
296716ee1e9aSmrg    v=$($ECHO $release$versuffix | tr -d .-);
296816ee1e9aSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
296916ee1e9aSmrg    $ECHO $n$v`$shared_ext'
297016ee1e9aSmrg  library_names_spec='${libname}_dll.$libext'
2971fda9279dSmrg  dynamic_linker='OS/2 ld.exe'
297216ee1e9aSmrg  shlibpath_var=BEGINLIBPATH
297316ee1e9aSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
297416ee1e9aSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
297516ee1e9aSmrg  postinstall_cmds='base_file=`basename \$file`~
297616ee1e9aSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
297716ee1e9aSmrg    dldir=$destdir/`dirname \$dlpath`~
297816ee1e9aSmrg    test -d \$dldir || mkdir -p \$dldir~
297916ee1e9aSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
298016ee1e9aSmrg    chmod a+x \$dldir/$dlname~
298116ee1e9aSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
298216ee1e9aSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
298316ee1e9aSmrg    fi'
298416ee1e9aSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
298516ee1e9aSmrg    dlpath=$dir/\$dldll~
298616ee1e9aSmrg    $RM \$dlpath'
2987fda9279dSmrg  ;;
2988fda9279dSmrg
2989fda9279dSmrgosf3* | osf4* | osf5*)
2990fda9279dSmrg  version_type=osf
2991fda9279dSmrg  need_lib_prefix=no
2992fda9279dSmrg  need_version=no
299316ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
299416ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2995fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2996fda9279dSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
299716ee1e9aSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2998fda9279dSmrg  ;;
2999fda9279dSmrg
3000fda9279dSmrgrdos*)
3001fda9279dSmrg  dynamic_linker=no
3002fda9279dSmrg  ;;
3003fda9279dSmrg
3004fda9279dSmrgsolaris*)
3005fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3006fda9279dSmrg  need_lib_prefix=no
3007fda9279dSmrg  need_version=no
300816ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
300916ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3010fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3011fda9279dSmrg  shlibpath_overrides_runpath=yes
3012fda9279dSmrg  hardcode_into_libs=yes
3013fda9279dSmrg  # ldd complains unless libraries are executable
3014fda9279dSmrg  postinstall_cmds='chmod +x $lib'
3015fda9279dSmrg  ;;
3016fda9279dSmrg
3017fda9279dSmrgsunos4*)
3018fda9279dSmrg  version_type=sunos
301916ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3020fda9279dSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3021fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3022fda9279dSmrg  shlibpath_overrides_runpath=yes
302316ee1e9aSmrg  if test yes = "$with_gnu_ld"; then
3024fda9279dSmrg    need_lib_prefix=no
3025fda9279dSmrg  fi
3026fda9279dSmrg  need_version=yes
3027fda9279dSmrg  ;;
3028fda9279dSmrg
3029fda9279dSmrgsysv4 | sysv4.3*)
3030fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
303116ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
303216ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3033fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3034fda9279dSmrg  case $host_vendor in
3035fda9279dSmrg    sni)
3036fda9279dSmrg      shlibpath_overrides_runpath=no
3037fda9279dSmrg      need_lib_prefix=no
3038fda9279dSmrg      runpath_var=LD_RUN_PATH
3039fda9279dSmrg      ;;
3040fda9279dSmrg    siemens)
3041fda9279dSmrg      need_lib_prefix=no
3042fda9279dSmrg      ;;
3043fda9279dSmrg    motorola)
3044fda9279dSmrg      need_lib_prefix=no
3045fda9279dSmrg      need_version=no
3046fda9279dSmrg      shlibpath_overrides_runpath=no
3047fda9279dSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3048fda9279dSmrg      ;;
3049fda9279dSmrg  esac
3050fda9279dSmrg  ;;
3051fda9279dSmrg
3052fda9279dSmrgsysv4*MP*)
305316ee1e9aSmrg  if test -d /usr/nec; then
3054fda9279dSmrg    version_type=linux # correct to gnu/linux during the next big refactor
305516ee1e9aSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
305616ee1e9aSmrg    soname_spec='$libname$shared_ext.$major'
3057fda9279dSmrg    shlibpath_var=LD_LIBRARY_PATH
3058fda9279dSmrg  fi
3059fda9279dSmrg  ;;
3060fda9279dSmrg
3061fda9279dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
306216ee1e9aSmrg  version_type=sco
3063fda9279dSmrg  need_lib_prefix=no
3064fda9279dSmrg  need_version=no
306516ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
306616ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3067fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3068fda9279dSmrg  shlibpath_overrides_runpath=yes
3069fda9279dSmrg  hardcode_into_libs=yes
307016ee1e9aSmrg  if test yes = "$with_gnu_ld"; then
3071fda9279dSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3072fda9279dSmrg  else
3073fda9279dSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3074fda9279dSmrg    case $host_os in
3075fda9279dSmrg      sco3.2v5*)
3076fda9279dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3077fda9279dSmrg	;;
3078fda9279dSmrg    esac
3079fda9279dSmrg  fi
3080fda9279dSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
3081fda9279dSmrg  ;;
3082fda9279dSmrg
3083fda9279dSmrgtpf*)
3084fda9279dSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3085fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3086fda9279dSmrg  need_lib_prefix=no
3087fda9279dSmrg  need_version=no
308816ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3089fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3090fda9279dSmrg  shlibpath_overrides_runpath=no
3091fda9279dSmrg  hardcode_into_libs=yes
3092fda9279dSmrg  ;;
3093fda9279dSmrg
3094fda9279dSmrguts4*)
3095fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
309616ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
309716ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3098fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3099fda9279dSmrg  ;;
3100fda9279dSmrg
3101fda9279dSmrg*)
3102fda9279dSmrg  dynamic_linker=no
3103fda9279dSmrg  ;;
3104fda9279dSmrgesac
3105fda9279dSmrgAC_MSG_RESULT([$dynamic_linker])
310616ee1e9aSmrgtest no = "$dynamic_linker" && can_build_shared=no
3107fda9279dSmrg
3108fda9279dSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
310916ee1e9aSmrgif test yes = "$GCC"; then
3110fda9279dSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3111fda9279dSmrgfi
3112fda9279dSmrg
311316ee1e9aSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
311416ee1e9aSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3115fda9279dSmrgfi
311616ee1e9aSmrg
311716ee1e9aSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
311816ee1e9aSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3119fda9279dSmrgfi
3120fda9279dSmrg
312116ee1e9aSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
312216ee1e9aSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
312316ee1e9aSmrg
312416ee1e9aSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
312516ee1e9aSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
312616ee1e9aSmrg
312716ee1e9aSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
312816ee1e9aSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
312916ee1e9aSmrg
3130fda9279dSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3131fda9279dSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3132fda9279dSmrg    restored at link time])
3133fda9279dSmrg_LT_DECL([], [need_lib_prefix], [0],
3134fda9279dSmrg    [Do we need the "lib" prefix for modules?])
3135fda9279dSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3136fda9279dSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3137fda9279dSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3138fda9279dSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3139fda9279dSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3140fda9279dSmrg    [Is shlibpath searched before the hard-coded library search path?])
3141fda9279dSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3142fda9279dSmrg_LT_DECL([], [library_names_spec], [1],
3143fda9279dSmrg    [[List of archive names.  First name is the real one, the rest are links.
3144fda9279dSmrg    The last name is the one that the linker finds with -lNAME]])
3145fda9279dSmrg_LT_DECL([], [soname_spec], [1],
3146fda9279dSmrg    [[The coded name of the library, if different from the real name]])
3147fda9279dSmrg_LT_DECL([], [install_override_mode], [1],
3148fda9279dSmrg    [Permission mode override for installation of shared libraries])
3149fda9279dSmrg_LT_DECL([], [postinstall_cmds], [2],
3150fda9279dSmrg    [Command to use after installation of a shared archive])
3151fda9279dSmrg_LT_DECL([], [postuninstall_cmds], [2],
3152fda9279dSmrg    [Command to use after uninstallation of a shared archive])
3153fda9279dSmrg_LT_DECL([], [finish_cmds], [2],
3154fda9279dSmrg    [Commands used to finish a libtool library installation in a directory])
3155fda9279dSmrg_LT_DECL([], [finish_eval], [1],
3156fda9279dSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3157fda9279dSmrg    not shown]])
3158fda9279dSmrg_LT_DECL([], [hardcode_into_libs], [0],
3159fda9279dSmrg    [Whether we should hardcode library paths into libraries])
3160fda9279dSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3161fda9279dSmrg    [Compile-time system search path for libraries])
316216ee1e9aSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
316316ee1e9aSmrg    [Detected run-time system search path for libraries])
316416ee1e9aSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
316516ee1e9aSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3166fda9279dSmrg])# _LT_SYS_DYNAMIC_LINKER
3167fda9279dSmrg
3168fda9279dSmrg
3169fda9279dSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3170fda9279dSmrg# --------------------------
317116ee1e9aSmrg# find a file program that can recognize shared library
3172fda9279dSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3173fda9279dSmrg[m4_require([_LT_DECL_EGREP])dnl
3174fda9279dSmrgAC_MSG_CHECKING([for $1])
3175fda9279dSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3176fda9279dSmrg[case $MAGIC_CMD in
3177fda9279dSmrg[[\\/*] |  ?:[\\/]*])
317816ee1e9aSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3179fda9279dSmrg  ;;
3180fda9279dSmrg*)
318116ee1e9aSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
318216ee1e9aSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3183fda9279dSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3184fda9279dSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3185fda9279dSmrgdnl not every word.  This closes a longstanding sh security hole.
3186fda9279dSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3187fda9279dSmrg  for ac_dir in $ac_dummy; do
318816ee1e9aSmrg    IFS=$lt_save_ifs
3189fda9279dSmrg    test -z "$ac_dir" && ac_dir=.
319016ee1e9aSmrg    if test -f "$ac_dir/$1"; then
319116ee1e9aSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3192fda9279dSmrg      if test -n "$file_magic_test_file"; then
3193fda9279dSmrg	case $deplibs_check_method in
3194fda9279dSmrg	"file_magic "*)
3195fda9279dSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
319616ee1e9aSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3197fda9279dSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3198fda9279dSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3199fda9279dSmrg	    :
3200fda9279dSmrg	  else
3201fda9279dSmrg	    cat <<_LT_EOF 1>&2
3202fda9279dSmrg
3203fda9279dSmrg*** Warning: the command libtool uses to detect shared libraries,
3204fda9279dSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3205fda9279dSmrg*** The result is that libtool may fail to recognize shared libraries
3206fda9279dSmrg*** as such.  This will affect the creation of libtool libraries that
3207fda9279dSmrg*** depend on shared libraries, but programs linked with such libtool
3208fda9279dSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3209fda9279dSmrg*** may want to report the problem to your system manager and/or to
3210fda9279dSmrg*** bug-libtool@gnu.org
3211fda9279dSmrg
3212fda9279dSmrg_LT_EOF
3213fda9279dSmrg	  fi ;;
3214fda9279dSmrg	esac
3215fda9279dSmrg      fi
3216fda9279dSmrg      break
3217fda9279dSmrg    fi
3218fda9279dSmrg  done
321916ee1e9aSmrg  IFS=$lt_save_ifs
322016ee1e9aSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
3221fda9279dSmrg  ;;
3222fda9279dSmrgesac])
322316ee1e9aSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3224fda9279dSmrgif test -n "$MAGIC_CMD"; then
3225fda9279dSmrg  AC_MSG_RESULT($MAGIC_CMD)
3226fda9279dSmrgelse
3227fda9279dSmrg  AC_MSG_RESULT(no)
3228fda9279dSmrgfi
3229fda9279dSmrg_LT_DECL([], [MAGIC_CMD], [0],
3230fda9279dSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3231fda9279dSmrg])# _LT_PATH_TOOL_PREFIX
3232fda9279dSmrg
3233fda9279dSmrg# Old name:
3234fda9279dSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3235fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3236fda9279dSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3237fda9279dSmrg
3238fda9279dSmrg
3239fda9279dSmrg# _LT_PATH_MAGIC
3240fda9279dSmrg# --------------
324116ee1e9aSmrg# find a file program that can recognize a shared library
3242fda9279dSmrgm4_defun([_LT_PATH_MAGIC],
3243fda9279dSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3244fda9279dSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3245fda9279dSmrg  if test -n "$ac_tool_prefix"; then
3246fda9279dSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3247fda9279dSmrg  else
3248fda9279dSmrg    MAGIC_CMD=:
3249fda9279dSmrg  fi
3250fda9279dSmrgfi
3251fda9279dSmrg])# _LT_PATH_MAGIC
3252fda9279dSmrg
3253fda9279dSmrg
3254fda9279dSmrg# LT_PATH_LD
3255fda9279dSmrg# ----------
3256fda9279dSmrg# find the pathname to the GNU or non-GNU linker
3257fda9279dSmrgAC_DEFUN([LT_PATH_LD],
3258fda9279dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3259fda9279dSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3260fda9279dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3261fda9279dSmrgm4_require([_LT_DECL_SED])dnl
3262fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
3263fda9279dSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3264fda9279dSmrg
3265fda9279dSmrgAC_ARG_WITH([gnu-ld],
3266fda9279dSmrg    [AS_HELP_STRING([--with-gnu-ld],
3267fda9279dSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
326816ee1e9aSmrg    [test no = "$withval" || with_gnu_ld=yes],
3269fda9279dSmrg    [with_gnu_ld=no])dnl
3270fda9279dSmrg
3271fda9279dSmrgac_prog=ld
327216ee1e9aSmrgif test yes = "$GCC"; then
3273fda9279dSmrg  # Check if gcc -print-prog-name=ld gives a path.
3274fda9279dSmrg  AC_MSG_CHECKING([for ld used by $CC])
3275fda9279dSmrg  case $host in
3276fda9279dSmrg  *-*-mingw*)
327716ee1e9aSmrg    # gcc leaves a trailing carriage return, which upsets mingw
3278fda9279dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3279fda9279dSmrg  *)
3280fda9279dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3281fda9279dSmrg  esac
3282fda9279dSmrg  case $ac_prog in
3283fda9279dSmrg    # Accept absolute paths.
3284fda9279dSmrg    [[\\/]]* | ?:[[\\/]]*)
3285fda9279dSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3286fda9279dSmrg      # Canonicalize the pathname of ld
3287fda9279dSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3288fda9279dSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3289fda9279dSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3290fda9279dSmrg      done
329116ee1e9aSmrg      test -z "$LD" && LD=$ac_prog
3292fda9279dSmrg      ;;
3293fda9279dSmrg  "")
3294fda9279dSmrg    # If it fails, then pretend we aren't using GCC.
3295fda9279dSmrg    ac_prog=ld
3296fda9279dSmrg    ;;
3297fda9279dSmrg  *)
3298fda9279dSmrg    # If it is relative, then search for the first ld in PATH.
3299fda9279dSmrg    with_gnu_ld=unknown
3300fda9279dSmrg    ;;
3301fda9279dSmrg  esac
330216ee1e9aSmrgelif test yes = "$with_gnu_ld"; then
3303fda9279dSmrg  AC_MSG_CHECKING([for GNU ld])
3304fda9279dSmrgelse
3305fda9279dSmrg  AC_MSG_CHECKING([for non-GNU ld])
3306fda9279dSmrgfi
3307fda9279dSmrgAC_CACHE_VAL(lt_cv_path_LD,
3308fda9279dSmrg[if test -z "$LD"; then
330916ee1e9aSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3310fda9279dSmrg  for ac_dir in $PATH; do
331116ee1e9aSmrg    IFS=$lt_save_ifs
3312fda9279dSmrg    test -z "$ac_dir" && ac_dir=.
3313fda9279dSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
331416ee1e9aSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
3315fda9279dSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3316fda9279dSmrg      # but apparently some variants of GNU ld only accept -v.
3317fda9279dSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3318fda9279dSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3319fda9279dSmrg      *GNU* | *'with BFD'*)
332016ee1e9aSmrg	test no != "$with_gnu_ld" && break
3321fda9279dSmrg	;;
3322fda9279dSmrg      *)
332316ee1e9aSmrg	test yes != "$with_gnu_ld" && break
3324fda9279dSmrg	;;
3325fda9279dSmrg      esac
3326fda9279dSmrg    fi
3327fda9279dSmrg  done
332816ee1e9aSmrg  IFS=$lt_save_ifs
3329fda9279dSmrgelse
333016ee1e9aSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3331fda9279dSmrgfi])
333216ee1e9aSmrgLD=$lt_cv_path_LD
3333fda9279dSmrgif test -n "$LD"; then
3334fda9279dSmrg  AC_MSG_RESULT($LD)
3335fda9279dSmrgelse
3336fda9279dSmrg  AC_MSG_RESULT(no)
3337fda9279dSmrgfi
3338fda9279dSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3339fda9279dSmrg_LT_PATH_LD_GNU
3340fda9279dSmrgAC_SUBST([LD])
3341fda9279dSmrg
3342fda9279dSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3343fda9279dSmrg])# LT_PATH_LD
3344fda9279dSmrg
3345fda9279dSmrg# Old names:
3346fda9279dSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3347fda9279dSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3348fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3349fda9279dSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3350fda9279dSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3351fda9279dSmrg
3352fda9279dSmrg
3353fda9279dSmrg# _LT_PATH_LD_GNU
3354fda9279dSmrg#- --------------
3355fda9279dSmrgm4_defun([_LT_PATH_LD_GNU],
3356fda9279dSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3357fda9279dSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3358fda9279dSmrgcase `$LD -v 2>&1 </dev/null` in
3359fda9279dSmrg*GNU* | *'with BFD'*)
3360fda9279dSmrg  lt_cv_prog_gnu_ld=yes
3361fda9279dSmrg  ;;
3362fda9279dSmrg*)
3363fda9279dSmrg  lt_cv_prog_gnu_ld=no
3364fda9279dSmrg  ;;
3365fda9279dSmrgesac])
3366fda9279dSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3367fda9279dSmrg])# _LT_PATH_LD_GNU
3368fda9279dSmrg
3369fda9279dSmrg
3370fda9279dSmrg# _LT_CMD_RELOAD
3371fda9279dSmrg# --------------
3372fda9279dSmrg# find reload flag for linker
3373fda9279dSmrg#   -- PORTME Some linkers may need a different reload flag.
3374fda9279dSmrgm4_defun([_LT_CMD_RELOAD],
3375fda9279dSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3376fda9279dSmrg  lt_cv_ld_reload_flag,
3377fda9279dSmrg  [lt_cv_ld_reload_flag='-r'])
3378fda9279dSmrgreload_flag=$lt_cv_ld_reload_flag
3379fda9279dSmrgcase $reload_flag in
3380fda9279dSmrg"" | " "*) ;;
3381fda9279dSmrg*) reload_flag=" $reload_flag" ;;
3382fda9279dSmrgesac
3383fda9279dSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3384fda9279dSmrgcase $host_os in
3385fda9279dSmrg  cygwin* | mingw* | pw32* | cegcc*)
338616ee1e9aSmrg    if test yes != "$GCC"; then
3387fda9279dSmrg      reload_cmds=false
3388fda9279dSmrg    fi
3389fda9279dSmrg    ;;
3390fda9279dSmrg  darwin*)
339116ee1e9aSmrg    if test yes = "$GCC"; then
339216ee1e9aSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3393fda9279dSmrg    else
3394fda9279dSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3395fda9279dSmrg    fi
3396fda9279dSmrg    ;;
3397fda9279dSmrgesac
3398fda9279dSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3399fda9279dSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3400fda9279dSmrg])# _LT_CMD_RELOAD
3401fda9279dSmrg
3402fda9279dSmrg
340316ee1e9aSmrg# _LT_PATH_DD
340416ee1e9aSmrg# -----------
340516ee1e9aSmrg# find a working dd
340616ee1e9aSmrgm4_defun([_LT_PATH_DD],
340716ee1e9aSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
340816ee1e9aSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
340916ee1e9aSmrgcat conftest.i conftest.i >conftest2.i
341016ee1e9aSmrg: ${lt_DD:=$DD}
341116ee1e9aSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
341216ee1e9aSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
341316ee1e9aSmrg  cmp -s conftest.i conftest.out \
341416ee1e9aSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
341516ee1e9aSmrgfi])
341616ee1e9aSmrgrm -f conftest.i conftest2.i conftest.out])
341716ee1e9aSmrg])# _LT_PATH_DD
341816ee1e9aSmrg
341916ee1e9aSmrg
342016ee1e9aSmrg# _LT_CMD_TRUNCATE
342116ee1e9aSmrg# ----------------
342216ee1e9aSmrg# find command to truncate a binary pipe
342316ee1e9aSmrgm4_defun([_LT_CMD_TRUNCATE],
342416ee1e9aSmrg[m4_require([_LT_PATH_DD])
342516ee1e9aSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
342616ee1e9aSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
342716ee1e9aSmrgcat conftest.i conftest.i >conftest2.i
342816ee1e9aSmrglt_cv_truncate_bin=
342916ee1e9aSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
343016ee1e9aSmrg  cmp -s conftest.i conftest.out \
343116ee1e9aSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
343216ee1e9aSmrgfi
343316ee1e9aSmrgrm -f conftest.i conftest2.i conftest.out
343416ee1e9aSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
343516ee1e9aSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
343616ee1e9aSmrg  [Command to truncate a binary pipe])
343716ee1e9aSmrg])# _LT_CMD_TRUNCATE
343816ee1e9aSmrg
343916ee1e9aSmrg
3440fda9279dSmrg# _LT_CHECK_MAGIC_METHOD
3441fda9279dSmrg# ----------------------
3442fda9279dSmrg# how to check for library dependencies
3443fda9279dSmrg#  -- PORTME fill in with the dynamic library characteristics
3444fda9279dSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3445fda9279dSmrg[m4_require([_LT_DECL_EGREP])
3446fda9279dSmrgm4_require([_LT_DECL_OBJDUMP])
3447fda9279dSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3448fda9279dSmrglt_cv_deplibs_check_method,
3449fda9279dSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3450fda9279dSmrglt_cv_file_magic_test_file=
3451fda9279dSmrglt_cv_deplibs_check_method='unknown'
3452fda9279dSmrg# Need to set the preceding variable on all platforms that support
3453fda9279dSmrg# interlibrary dependencies.
3454fda9279dSmrg# 'none' -- dependencies not supported.
345516ee1e9aSmrg# 'unknown' -- same as none, but documents that we really don't know.
3456fda9279dSmrg# 'pass_all' -- all dependencies passed with no checks.
3457fda9279dSmrg# 'test_compile' -- check by making test program.
3458fda9279dSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
345916ee1e9aSmrg# that responds to the $file_magic_cmd with a given extended regex.
346016ee1e9aSmrg# If you have 'file' or equivalent on your system and you're not sure
346116ee1e9aSmrg# whether 'pass_all' will *always* work, you probably want this one.
3462fda9279dSmrg
3463fda9279dSmrgcase $host_os in
3464fda9279dSmrgaix[[4-9]]*)
3465fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3466fda9279dSmrg  ;;
3467fda9279dSmrg
3468fda9279dSmrgbeos*)
3469fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3470fda9279dSmrg  ;;
3471fda9279dSmrg
3472fda9279dSmrgbsdi[[45]]*)
3473fda9279dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3474fda9279dSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3475fda9279dSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3476fda9279dSmrg  ;;
3477fda9279dSmrg
3478fda9279dSmrgcygwin*)
3479fda9279dSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3480fda9279dSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3481fda9279dSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3482fda9279dSmrg  ;;
3483fda9279dSmrg
3484fda9279dSmrgmingw* | pw32*)
3485fda9279dSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3486fda9279dSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3487fda9279dSmrg  # unless we find 'file', for example because we are cross-compiling.
348816ee1e9aSmrg  if ( file / ) >/dev/null 2>&1; then
3489fda9279dSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3490fda9279dSmrg    lt_cv_file_magic_cmd='func_win32_libid'
3491fda9279dSmrg  else
3492fda9279dSmrg    # Keep this pattern in sync with the one in func_win32_libid.
3493fda9279dSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3494fda9279dSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3495fda9279dSmrg  fi
3496fda9279dSmrg  ;;
3497fda9279dSmrg
3498fda9279dSmrgcegcc*)
3499fda9279dSmrg  # use the weaker test based on 'objdump'. See mingw*.
3500fda9279dSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3501fda9279dSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3502fda9279dSmrg  ;;
3503fda9279dSmrg
3504fda9279dSmrgdarwin* | rhapsody*)
3505fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3506fda9279dSmrg  ;;
3507fda9279dSmrg
3508fda9279dSmrgfreebsd* | dragonfly*)
3509fda9279dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3510fda9279dSmrg    case $host_cpu in
3511fda9279dSmrg    i*86 )
3512fda9279dSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3513fda9279dSmrg      # Let's accept both of them until this is cleared up.
3514fda9279dSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3515fda9279dSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3516fda9279dSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3517fda9279dSmrg      ;;
3518fda9279dSmrg    esac
3519fda9279dSmrg  else
3520fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3521fda9279dSmrg  fi
3522fda9279dSmrg  ;;
3523fda9279dSmrg
3524fda9279dSmrghaiku*)
3525fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3526fda9279dSmrg  ;;
3527fda9279dSmrg
3528fda9279dSmrghpux10.20* | hpux11*)
3529fda9279dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3530fda9279dSmrg  case $host_cpu in
3531fda9279dSmrg  ia64*)
3532fda9279dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3533fda9279dSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3534fda9279dSmrg    ;;
3535fda9279dSmrg  hppa*64*)
3536fda9279dSmrg    [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]']
3537fda9279dSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3538fda9279dSmrg    ;;
3539fda9279dSmrg  *)
3540fda9279dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3541fda9279dSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3542fda9279dSmrg    ;;
3543fda9279dSmrg  esac
3544fda9279dSmrg  ;;
3545fda9279dSmrg
3546fda9279dSmrginterix[[3-9]]*)
3547fda9279dSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3548fda9279dSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3549fda9279dSmrg  ;;
3550fda9279dSmrg
3551fda9279dSmrgirix5* | irix6* | nonstopux*)
3552fda9279dSmrg  case $LD in
3553fda9279dSmrg  *-32|*"-32 ") libmagic=32-bit;;
3554fda9279dSmrg  *-n32|*"-n32 ") libmagic=N32;;
3555fda9279dSmrg  *-64|*"-64 ") libmagic=64-bit;;
3556fda9279dSmrg  *) libmagic=never-match;;
3557fda9279dSmrg  esac
3558fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3559fda9279dSmrg  ;;
3560fda9279dSmrg
3561fda9279dSmrg# This must be glibc/ELF.
3562fda9279dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3563fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3564fda9279dSmrg  ;;
3565fda9279dSmrg
356616ee1e9aSmrgnetbsd*)
3567fda9279dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3568fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3569fda9279dSmrg  else
3570fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3571fda9279dSmrg  fi
3572fda9279dSmrg  ;;
3573fda9279dSmrg
3574fda9279dSmrgnewos6*)
3575fda9279dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3576fda9279dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3577fda9279dSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3578fda9279dSmrg  ;;
3579fda9279dSmrg
3580fda9279dSmrg*nto* | *qnx*)
3581fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3582fda9279dSmrg  ;;
3583fda9279dSmrg
358416ee1e9aSmrgopenbsd* | bitrig*)
358516ee1e9aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3586fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3587fda9279dSmrg  else
3588fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3589fda9279dSmrg  fi
3590fda9279dSmrg  ;;
3591fda9279dSmrg
3592fda9279dSmrgosf3* | osf4* | osf5*)
3593fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3594fda9279dSmrg  ;;
3595fda9279dSmrg
3596fda9279dSmrgrdos*)
3597fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3598fda9279dSmrg  ;;
3599fda9279dSmrg
3600fda9279dSmrgsolaris*)
3601fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3602fda9279dSmrg  ;;
3603fda9279dSmrg
3604fda9279dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3605fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3606fda9279dSmrg  ;;
3607fda9279dSmrg
3608fda9279dSmrgsysv4 | sysv4.3*)
3609fda9279dSmrg  case $host_vendor in
3610fda9279dSmrg  motorola)
3611fda9279dSmrg    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]]'
3612fda9279dSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3613fda9279dSmrg    ;;
3614fda9279dSmrg  ncr)
3615fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3616fda9279dSmrg    ;;
3617fda9279dSmrg  sequent)
3618fda9279dSmrg    lt_cv_file_magic_cmd='/bin/file'
3619fda9279dSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3620fda9279dSmrg    ;;
3621fda9279dSmrg  sni)
3622fda9279dSmrg    lt_cv_file_magic_cmd='/bin/file'
3623fda9279dSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3624fda9279dSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3625fda9279dSmrg    ;;
3626fda9279dSmrg  siemens)
3627fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3628fda9279dSmrg    ;;
3629fda9279dSmrg  pc)
3630fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3631fda9279dSmrg    ;;
3632fda9279dSmrg  esac
3633fda9279dSmrg  ;;
3634fda9279dSmrg
3635fda9279dSmrgtpf*)
3636fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3637fda9279dSmrg  ;;
363816ee1e9aSmrgos2*)
363916ee1e9aSmrg  lt_cv_deplibs_check_method=pass_all
364016ee1e9aSmrg  ;;
3641fda9279dSmrgesac
3642fda9279dSmrg])
3643fda9279dSmrg
3644fda9279dSmrgfile_magic_glob=
3645fda9279dSmrgwant_nocaseglob=no
3646fda9279dSmrgif test "$build" = "$host"; then
3647fda9279dSmrg  case $host_os in
3648fda9279dSmrg  mingw* | pw32*)
3649fda9279dSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3650fda9279dSmrg      want_nocaseglob=yes
3651fda9279dSmrg    else
3652fda9279dSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3653fda9279dSmrg    fi
3654fda9279dSmrg    ;;
3655fda9279dSmrg  esac
3656fda9279dSmrgfi
3657fda9279dSmrg
3658fda9279dSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3659fda9279dSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3660fda9279dSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3661fda9279dSmrg
3662fda9279dSmrg_LT_DECL([], [deplibs_check_method], [1],
3663fda9279dSmrg    [Method to check whether dependent libraries are shared objects])
3664fda9279dSmrg_LT_DECL([], [file_magic_cmd], [1],
3665fda9279dSmrg    [Command to use when deplibs_check_method = "file_magic"])
3666fda9279dSmrg_LT_DECL([], [file_magic_glob], [1],
3667fda9279dSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
3668fda9279dSmrg_LT_DECL([], [want_nocaseglob], [1],
3669fda9279dSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3670fda9279dSmrg])# _LT_CHECK_MAGIC_METHOD
3671fda9279dSmrg
3672fda9279dSmrg
3673fda9279dSmrg# LT_PATH_NM
3674fda9279dSmrg# ----------
3675fda9279dSmrg# find the pathname to a BSD- or MS-compatible name lister
3676fda9279dSmrgAC_DEFUN([LT_PATH_NM],
3677fda9279dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3678fda9279dSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3679fda9279dSmrg[if test -n "$NM"; then
3680fda9279dSmrg  # Let the user override the test.
368116ee1e9aSmrg  lt_cv_path_NM=$NM
3682fda9279dSmrgelse
368316ee1e9aSmrg  lt_nm_to_check=${ac_tool_prefix}nm
3684fda9279dSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3685fda9279dSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3686fda9279dSmrg  fi
3687fda9279dSmrg  for lt_tmp_nm in $lt_nm_to_check; do
368816ee1e9aSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3689fda9279dSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
369016ee1e9aSmrg      IFS=$lt_save_ifs
3691fda9279dSmrg      test -z "$ac_dir" && ac_dir=.
369216ee1e9aSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
369316ee1e9aSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3694fda9279dSmrg	# Check to see if the nm accepts a BSD-compat flag.
369516ee1e9aSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3696fda9279dSmrg	#   nm: unknown option "B" ignored
3697fda9279dSmrg	# Tru64's nm complains that /dev/null is an invalid object file
369816ee1e9aSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
369916ee1e9aSmrg	case $build_os in
370016ee1e9aSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
370116ee1e9aSmrg	*) lt_bad_file=/dev/null ;;
370216ee1e9aSmrg	esac
370316ee1e9aSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
370416ee1e9aSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
3705fda9279dSmrg	  lt_cv_path_NM="$tmp_nm -B"
370616ee1e9aSmrg	  break 2
3707fda9279dSmrg	  ;;
3708fda9279dSmrg	*)
3709fda9279dSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3710fda9279dSmrg	  */dev/null*)
3711fda9279dSmrg	    lt_cv_path_NM="$tmp_nm -p"
371216ee1e9aSmrg	    break 2
3713fda9279dSmrg	    ;;
3714fda9279dSmrg	  *)
3715fda9279dSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3716fda9279dSmrg	    continue # so that we can try to find one that supports BSD flags
3717fda9279dSmrg	    ;;
3718fda9279dSmrg	  esac
3719fda9279dSmrg	  ;;
3720fda9279dSmrg	esac
3721fda9279dSmrg      fi
3722fda9279dSmrg    done
372316ee1e9aSmrg    IFS=$lt_save_ifs
3724fda9279dSmrg  done
3725fda9279dSmrg  : ${lt_cv_path_NM=no}
3726fda9279dSmrgfi])
372716ee1e9aSmrgif test no != "$lt_cv_path_NM"; then
372816ee1e9aSmrg  NM=$lt_cv_path_NM
3729fda9279dSmrgelse
3730fda9279dSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3731fda9279dSmrg  if test -n "$DUMPBIN"; then :
3732fda9279dSmrg    # Let the user override the test.
3733fda9279dSmrg  else
3734fda9279dSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
373516ee1e9aSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3736fda9279dSmrg    *COFF*)
373716ee1e9aSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3738fda9279dSmrg      ;;
3739fda9279dSmrg    *)
3740fda9279dSmrg      DUMPBIN=:
3741fda9279dSmrg      ;;
3742fda9279dSmrg    esac
3743fda9279dSmrg  fi
3744fda9279dSmrg  AC_SUBST([DUMPBIN])
374516ee1e9aSmrg  if test : != "$DUMPBIN"; then
374616ee1e9aSmrg    NM=$DUMPBIN
3747fda9279dSmrg  fi
3748fda9279dSmrgfi
3749fda9279dSmrgtest -z "$NM" && NM=nm
3750fda9279dSmrgAC_SUBST([NM])
3751fda9279dSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3752fda9279dSmrg
3753fda9279dSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3754fda9279dSmrg  [lt_cv_nm_interface="BSD nm"
3755fda9279dSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
3756fda9279dSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3757fda9279dSmrg  (eval "$ac_compile" 2>conftest.err)
3758fda9279dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3759fda9279dSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3760fda9279dSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3761fda9279dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3762fda9279dSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3763fda9279dSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3764fda9279dSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3765fda9279dSmrg    lt_cv_nm_interface="MS dumpbin"
3766fda9279dSmrg  fi
3767fda9279dSmrg  rm -f conftest*])
3768fda9279dSmrg])# LT_PATH_NM
3769fda9279dSmrg
3770fda9279dSmrg# Old names:
3771fda9279dSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3772fda9279dSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3773fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3774fda9279dSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3775fda9279dSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3776fda9279dSmrg
3777fda9279dSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3778fda9279dSmrg# --------------------------------
3779fda9279dSmrg# how to determine the name of the shared library
3780fda9279dSmrg# associated with a specific link library.
3781fda9279dSmrg#  -- PORTME fill in with the dynamic library characteristics
3782fda9279dSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3783fda9279dSmrg[m4_require([_LT_DECL_EGREP])
3784fda9279dSmrgm4_require([_LT_DECL_OBJDUMP])
3785fda9279dSmrgm4_require([_LT_DECL_DLLTOOL])
3786fda9279dSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3787fda9279dSmrglt_cv_sharedlib_from_linklib_cmd,
3788fda9279dSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3789fda9279dSmrg
3790fda9279dSmrgcase $host_os in
3791fda9279dSmrgcygwin* | mingw* | pw32* | cegcc*)
379216ee1e9aSmrg  # two different shell functions defined in ltmain.sh;
379316ee1e9aSmrg  # decide which one to use based on capabilities of $DLLTOOL
3794fda9279dSmrg  case `$DLLTOOL --help 2>&1` in
3795fda9279dSmrg  *--identify-strict*)
3796fda9279dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3797fda9279dSmrg    ;;
3798fda9279dSmrg  *)
3799fda9279dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3800fda9279dSmrg    ;;
3801fda9279dSmrg  esac
3802fda9279dSmrg  ;;
3803fda9279dSmrg*)
3804fda9279dSmrg  # fallback: assume linklib IS sharedlib
380516ee1e9aSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3806fda9279dSmrg  ;;
3807fda9279dSmrgesac
3808fda9279dSmrg])
3809fda9279dSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3810fda9279dSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3811fda9279dSmrg
3812fda9279dSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3813fda9279dSmrg    [Command to associate shared and link libraries])
3814fda9279dSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3815fda9279dSmrg
3816fda9279dSmrg
3817fda9279dSmrg# _LT_PATH_MANIFEST_TOOL
3818fda9279dSmrg# ----------------------
3819fda9279dSmrg# locate the manifest tool
3820fda9279dSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3821fda9279dSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3822fda9279dSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3823fda9279dSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3824fda9279dSmrg  [lt_cv_path_mainfest_tool=no
3825fda9279dSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3826fda9279dSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3827fda9279dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3828fda9279dSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3829fda9279dSmrg    lt_cv_path_mainfest_tool=yes
3830fda9279dSmrg  fi
3831fda9279dSmrg  rm -f conftest*])
383216ee1e9aSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
3833fda9279dSmrg  MANIFEST_TOOL=:
3834fda9279dSmrgfi
3835fda9279dSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3836fda9279dSmrg])# _LT_PATH_MANIFEST_TOOL
3837fda9279dSmrg
3838fda9279dSmrg
383916ee1e9aSmrg# _LT_DLL_DEF_P([FILE])
384016ee1e9aSmrg# ---------------------
384116ee1e9aSmrg# True iff FILE is a Windows DLL '.def' file.
384216ee1e9aSmrg# Keep in sync with func_dll_def_p in the libtool script
384316ee1e9aSmrgAC_DEFUN([_LT_DLL_DEF_P],
384416ee1e9aSmrg[dnl
384516ee1e9aSmrg  test DEF = "`$SED -n dnl
384616ee1e9aSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
384716ee1e9aSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
384816ee1e9aSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
384916ee1e9aSmrg    -e q dnl                          Only consider the first "real" line
385016ee1e9aSmrg    $1`" dnl
385116ee1e9aSmrg])# _LT_DLL_DEF_P
385216ee1e9aSmrg
385316ee1e9aSmrg
3854fda9279dSmrg# LT_LIB_M
3855fda9279dSmrg# --------
3856fda9279dSmrg# check for math library
3857fda9279dSmrgAC_DEFUN([LT_LIB_M],
3858fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3859fda9279dSmrgLIBM=
3860fda9279dSmrgcase $host in
3861fda9279dSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3862fda9279dSmrg  # These system don't have libm, or don't need it
3863fda9279dSmrg  ;;
3864fda9279dSmrg*-ncr-sysv4.3*)
386516ee1e9aSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3866fda9279dSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3867fda9279dSmrg  ;;
3868fda9279dSmrg*)
386916ee1e9aSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
3870fda9279dSmrg  ;;
3871fda9279dSmrgesac
3872fda9279dSmrgAC_SUBST([LIBM])
3873fda9279dSmrg])# LT_LIB_M
3874fda9279dSmrg
3875fda9279dSmrg# Old name:
3876fda9279dSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3877fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3878fda9279dSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3879fda9279dSmrg
3880fda9279dSmrg
3881fda9279dSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3882fda9279dSmrg# -------------------------------
3883fda9279dSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3884fda9279dSmrg[m4_require([_LT_TAG_COMPILER])dnl
3885fda9279dSmrg
3886fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3887fda9279dSmrg
388816ee1e9aSmrgif test yes = "$GCC"; then
3889fda9279dSmrg  case $cc_basename in
3890fda9279dSmrg  nvcc*)
3891fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3892fda9279dSmrg  *)
3893fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3894fda9279dSmrg  esac
3895fda9279dSmrg
3896fda9279dSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3897fda9279dSmrg    lt_cv_prog_compiler_rtti_exceptions,
3898fda9279dSmrg    [-fno-rtti -fno-exceptions], [],
3899fda9279dSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3900fda9279dSmrgfi
3901fda9279dSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3902fda9279dSmrg	[Compiler flag to turn off builtin functions])
3903fda9279dSmrg])# _LT_COMPILER_NO_RTTI
3904fda9279dSmrg
3905fda9279dSmrg
3906fda9279dSmrg# _LT_CMD_GLOBAL_SYMBOLS
3907fda9279dSmrg# ----------------------
3908fda9279dSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3909fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3910fda9279dSmrgAC_REQUIRE([AC_PROG_CC])dnl
3911fda9279dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
3912fda9279dSmrgAC_REQUIRE([LT_PATH_NM])dnl
3913fda9279dSmrgAC_REQUIRE([LT_PATH_LD])dnl
3914fda9279dSmrgm4_require([_LT_DECL_SED])dnl
3915fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
3916fda9279dSmrgm4_require([_LT_TAG_COMPILER])dnl
3917fda9279dSmrg
3918fda9279dSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3919fda9279dSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3920fda9279dSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3921fda9279dSmrg[
3922fda9279dSmrg# These are sane defaults that work on at least a few old systems.
3923fda9279dSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3924fda9279dSmrg
3925fda9279dSmrg# Character class describing NM global symbol codes.
3926fda9279dSmrgsymcode='[[BCDEGRST]]'
3927fda9279dSmrg
3928fda9279dSmrg# Regexp to match symbols that can be accessed directly from C.
3929fda9279dSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3930fda9279dSmrg
3931fda9279dSmrg# Define system-specific variables.
3932fda9279dSmrgcase $host_os in
3933fda9279dSmrgaix*)
3934fda9279dSmrg  symcode='[[BCDT]]'
3935fda9279dSmrg  ;;
3936fda9279dSmrgcygwin* | mingw* | pw32* | cegcc*)
3937fda9279dSmrg  symcode='[[ABCDGISTW]]'
3938fda9279dSmrg  ;;
3939fda9279dSmrghpux*)
394016ee1e9aSmrg  if test ia64 = "$host_cpu"; then
3941fda9279dSmrg    symcode='[[ABCDEGRST]]'
3942fda9279dSmrg  fi
3943fda9279dSmrg  ;;
3944fda9279dSmrgirix* | nonstopux*)
3945fda9279dSmrg  symcode='[[BCDEGRST]]'
3946fda9279dSmrg  ;;
3947fda9279dSmrgosf*)
3948fda9279dSmrg  symcode='[[BCDEGQRST]]'
3949fda9279dSmrg  ;;
3950fda9279dSmrgsolaris*)
3951fda9279dSmrg  symcode='[[BDRT]]'
3952fda9279dSmrg  ;;
3953fda9279dSmrgsco3.2v5*)
3954fda9279dSmrg  symcode='[[DT]]'
3955fda9279dSmrg  ;;
3956fda9279dSmrgsysv4.2uw2*)
3957fda9279dSmrg  symcode='[[DT]]'
3958fda9279dSmrg  ;;
3959fda9279dSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3960fda9279dSmrg  symcode='[[ABDT]]'
3961fda9279dSmrg  ;;
3962fda9279dSmrgsysv4)
3963fda9279dSmrg  symcode='[[DFNSTU]]'
3964fda9279dSmrg  ;;
3965fda9279dSmrgesac
3966fda9279dSmrg
3967fda9279dSmrg# If we're using GNU nm, then use its standard symbol codes.
3968fda9279dSmrgcase `$NM -V 2>&1` in
3969fda9279dSmrg*GNU* | *'with BFD'*)
3970fda9279dSmrg  symcode='[[ABCDGIRSTW]]' ;;
3971fda9279dSmrgesac
3972fda9279dSmrg
397316ee1e9aSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
397416ee1e9aSmrg  # Gets list of data symbols to import.
397516ee1e9aSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
397616ee1e9aSmrg  # Adjust the below global symbol transforms to fixup imported variables.
397716ee1e9aSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
397816ee1e9aSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
397916ee1e9aSmrg  lt_c_name_lib_hook="\
398016ee1e9aSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
398116ee1e9aSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
398216ee1e9aSmrgelse
398316ee1e9aSmrg  # Disable hooks by default.
398416ee1e9aSmrg  lt_cv_sys_global_symbol_to_import=
398516ee1e9aSmrg  lt_cdecl_hook=
398616ee1e9aSmrg  lt_c_name_hook=
398716ee1e9aSmrg  lt_c_name_lib_hook=
398816ee1e9aSmrgfi
398916ee1e9aSmrg
3990fda9279dSmrg# Transform an extracted symbol line into a proper C declaration.
3991fda9279dSmrg# Some systems (esp. on ia64) link data and code symbols differently,
3992fda9279dSmrg# so use this general approach.
399316ee1e9aSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
399416ee1e9aSmrg$lt_cdecl_hook\
399516ee1e9aSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
399616ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3997fda9279dSmrg
3998fda9279dSmrg# Transform an extracted symbol line into symbol name and symbol address
399916ee1e9aSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
400016ee1e9aSmrg$lt_c_name_hook\
400116ee1e9aSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
400216ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
400316ee1e9aSmrg
400416ee1e9aSmrg# Transform an extracted symbol line into symbol name with lib prefix and
400516ee1e9aSmrg# symbol address.
400616ee1e9aSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
400716ee1e9aSmrg$lt_c_name_lib_hook\
400816ee1e9aSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
400916ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
401016ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4011fda9279dSmrg
4012fda9279dSmrg# Handle CRLF in mingw tool chain
4013fda9279dSmrgopt_cr=
4014fda9279dSmrgcase $build_os in
4015fda9279dSmrgmingw*)
4016fda9279dSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4017fda9279dSmrg  ;;
4018fda9279dSmrgesac
4019fda9279dSmrg
4020fda9279dSmrg# Try without a prefix underscore, then with it.
4021fda9279dSmrgfor ac_symprfx in "" "_"; do
4022fda9279dSmrg
4023fda9279dSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4024fda9279dSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4025fda9279dSmrg
4026fda9279dSmrg  # Write the raw and C identifiers.
4027fda9279dSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
402816ee1e9aSmrg    # Fake it for dumpbin and say T for any non-static function,
402916ee1e9aSmrg    # D for any global variable and I for any imported variable.
4030fda9279dSmrg    # Also find C++ and __fastcall symbols from MSVC++,
4031fda9279dSmrg    # which start with @ or ?.
4032fda9279dSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4033fda9279dSmrg"     {last_section=section; section=\$ 3};"\
4034fda9279dSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4035fda9279dSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
403616ee1e9aSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
403716ee1e9aSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
403816ee1e9aSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4039fda9279dSmrg"     \$ 0!~/External *\|/{next};"\
4040fda9279dSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4041fda9279dSmrg"     {if(hide[section]) next};"\
404216ee1e9aSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
404316ee1e9aSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
404416ee1e9aSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
404516ee1e9aSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4046fda9279dSmrg"     ' prfx=^$ac_symprfx]"
4047fda9279dSmrg  else
4048fda9279dSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4049fda9279dSmrg  fi
4050fda9279dSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4051fda9279dSmrg
4052fda9279dSmrg  # Check to see that the pipe works correctly.
4053fda9279dSmrg  pipe_works=no
4054fda9279dSmrg
4055fda9279dSmrg  rm -f conftest*
4056fda9279dSmrg  cat > conftest.$ac_ext <<_LT_EOF
4057fda9279dSmrg#ifdef __cplusplus
4058fda9279dSmrgextern "C" {
4059fda9279dSmrg#endif
4060fda9279dSmrgchar nm_test_var;
4061fda9279dSmrgvoid nm_test_func(void);
4062fda9279dSmrgvoid nm_test_func(void){}
4063fda9279dSmrg#ifdef __cplusplus
4064fda9279dSmrg}
4065fda9279dSmrg#endif
4066fda9279dSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4067fda9279dSmrg_LT_EOF
4068fda9279dSmrg
4069fda9279dSmrg  if AC_TRY_EVAL(ac_compile); then
4070fda9279dSmrg    # Now try to grab the symbols.
4071fda9279dSmrg    nlist=conftest.nm
4072fda9279dSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4073fda9279dSmrg      # Try sorting and uniquifying the output.
4074fda9279dSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4075fda9279dSmrg	mv -f "$nlist"T "$nlist"
4076fda9279dSmrg      else
4077fda9279dSmrg	rm -f "$nlist"T
4078fda9279dSmrg      fi
4079fda9279dSmrg
4080fda9279dSmrg      # Make sure that we snagged all the symbols we need.
4081fda9279dSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4082fda9279dSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4083fda9279dSmrg	  cat <<_LT_EOF > conftest.$ac_ext
4084fda9279dSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
408516ee1e9aSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
408616ee1e9aSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4087fda9279dSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4088fda9279dSmrg# define LT@&t@_DLSYM_CONST
408916ee1e9aSmrg#elif defined __osf__
4090fda9279dSmrg/* This system does not cope well with relocations in const data.  */
4091fda9279dSmrg# define LT@&t@_DLSYM_CONST
4092fda9279dSmrg#else
4093fda9279dSmrg# define LT@&t@_DLSYM_CONST const
4094fda9279dSmrg#endif
4095fda9279dSmrg
4096fda9279dSmrg#ifdef __cplusplus
4097fda9279dSmrgextern "C" {
4098fda9279dSmrg#endif
4099fda9279dSmrg
4100fda9279dSmrg_LT_EOF
4101fda9279dSmrg	  # Now generate the symbol file.
4102fda9279dSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4103fda9279dSmrg
4104fda9279dSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4105fda9279dSmrg
4106fda9279dSmrg/* The mapping between symbol names and symbols.  */
4107fda9279dSmrgLT@&t@_DLSYM_CONST struct {
4108fda9279dSmrg  const char *name;
4109fda9279dSmrg  void       *address;
4110fda9279dSmrg}
4111fda9279dSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4112fda9279dSmrg{
4113fda9279dSmrg  { "@PROGRAM@", (void *) 0 },
4114fda9279dSmrg_LT_EOF
411516ee1e9aSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4116fda9279dSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4117fda9279dSmrg  {0, (void *) 0}
4118fda9279dSmrg};
4119fda9279dSmrg
4120fda9279dSmrg/* This works around a problem in FreeBSD linker */
4121fda9279dSmrg#ifdef FREEBSD_WORKAROUND
4122fda9279dSmrgstatic const void *lt_preloaded_setup() {
4123fda9279dSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4124fda9279dSmrg}
4125fda9279dSmrg#endif
4126fda9279dSmrg
4127fda9279dSmrg#ifdef __cplusplus
4128fda9279dSmrg}
4129fda9279dSmrg#endif
4130fda9279dSmrg_LT_EOF
4131fda9279dSmrg	  # Now try linking the two files.
4132fda9279dSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
4133fda9279dSmrg	  lt_globsym_save_LIBS=$LIBS
4134fda9279dSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
413516ee1e9aSmrg	  LIBS=conftstm.$ac_objext
4136fda9279dSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
413716ee1e9aSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4138fda9279dSmrg	    pipe_works=yes
4139fda9279dSmrg	  fi
4140fda9279dSmrg	  LIBS=$lt_globsym_save_LIBS
4141fda9279dSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
4142fda9279dSmrg	else
4143fda9279dSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4144fda9279dSmrg	fi
4145fda9279dSmrg      else
4146fda9279dSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4147fda9279dSmrg      fi
4148fda9279dSmrg    else
4149fda9279dSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4150fda9279dSmrg    fi
4151fda9279dSmrg  else
4152fda9279dSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4153fda9279dSmrg    cat conftest.$ac_ext >&5
4154fda9279dSmrg  fi
4155fda9279dSmrg  rm -rf conftest* conftst*
4156fda9279dSmrg
4157fda9279dSmrg  # Do not use the global_symbol_pipe unless it works.
415816ee1e9aSmrg  if test yes = "$pipe_works"; then
4159fda9279dSmrg    break
4160fda9279dSmrg  else
4161fda9279dSmrg    lt_cv_sys_global_symbol_pipe=
4162fda9279dSmrg  fi
4163fda9279dSmrgdone
4164fda9279dSmrg])
4165fda9279dSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4166fda9279dSmrg  lt_cv_sys_global_symbol_to_cdecl=
4167fda9279dSmrgfi
4168fda9279dSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4169fda9279dSmrg  AC_MSG_RESULT(failed)
4170fda9279dSmrgelse
4171fda9279dSmrg  AC_MSG_RESULT(ok)
4172fda9279dSmrgfi
4173fda9279dSmrg
4174fda9279dSmrg# Response file support.
4175fda9279dSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4176fda9279dSmrg  nm_file_list_spec='@'
4177fda9279dSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4178fda9279dSmrg  nm_file_list_spec='@'
4179fda9279dSmrgfi
4180fda9279dSmrg
4181fda9279dSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4182fda9279dSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4183fda9279dSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4184fda9279dSmrg    [Transform the output of nm in a proper C declaration])
418516ee1e9aSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
418616ee1e9aSmrg    [Transform the output of nm into a list of symbols to manually relocate])
4187fda9279dSmrg_LT_DECL([global_symbol_to_c_name_address],
4188fda9279dSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4189fda9279dSmrg    [Transform the output of nm in a C name address pair])
4190fda9279dSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4191fda9279dSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4192fda9279dSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
419316ee1e9aSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
419416ee1e9aSmrg    [The name lister interface])
4195fda9279dSmrg_LT_DECL([], [nm_file_list_spec], [1],
4196fda9279dSmrg    [Specify filename containing input files for $NM])
4197fda9279dSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4198fda9279dSmrg
4199fda9279dSmrg
4200fda9279dSmrg# _LT_COMPILER_PIC([TAGNAME])
4201fda9279dSmrg# ---------------------------
4202fda9279dSmrgm4_defun([_LT_COMPILER_PIC],
4203fda9279dSmrg[m4_require([_LT_TAG_COMPILER])dnl
4204fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4205fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4206fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4207fda9279dSmrg
4208fda9279dSmrgm4_if([$1], [CXX], [
4209fda9279dSmrg  # C++ specific cases for pic, static, wl, etc.
421016ee1e9aSmrg  if test yes = "$GXX"; then
4211fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4212fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4213fda9279dSmrg
4214fda9279dSmrg    case $host_os in
4215fda9279dSmrg    aix*)
4216fda9279dSmrg      # All AIX code is PIC.
421716ee1e9aSmrg      if test ia64 = "$host_cpu"; then
4218fda9279dSmrg	# AIX 5 now supports IA64 processor
4219fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4220fda9279dSmrg      fi
422116ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4222fda9279dSmrg      ;;
4223fda9279dSmrg
4224fda9279dSmrg    amigaos*)
4225fda9279dSmrg      case $host_cpu in
4226fda9279dSmrg      powerpc)
4227fda9279dSmrg            # see comment about AmigaOS4 .so support
4228fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4229fda9279dSmrg        ;;
4230fda9279dSmrg      m68k)
4231fda9279dSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
423216ee1e9aSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
423316ee1e9aSmrg            # like '-m68040'.
4234fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4235fda9279dSmrg        ;;
4236fda9279dSmrg      esac
4237fda9279dSmrg      ;;
4238fda9279dSmrg
4239fda9279dSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4240fda9279dSmrg      # PIC is the default for these OSes.
4241fda9279dSmrg      ;;
4242fda9279dSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4243fda9279dSmrg      # This hack is so that the source file can tell whether it is being
4244fda9279dSmrg      # built for inclusion in a dll (and should export symbols for example).
4245fda9279dSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4246fda9279dSmrg      # (--disable-auto-import) libraries
4247fda9279dSmrg      m4_if([$1], [GCJ], [],
4248fda9279dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
424916ee1e9aSmrg      case $host_os in
425016ee1e9aSmrg      os2*)
425116ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
425216ee1e9aSmrg	;;
425316ee1e9aSmrg      esac
4254fda9279dSmrg      ;;
4255fda9279dSmrg    darwin* | rhapsody*)
4256fda9279dSmrg      # PIC is the default on this platform
4257fda9279dSmrg      # Common symbols not allowed in MH_DYLIB files
4258fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4259fda9279dSmrg      ;;
4260fda9279dSmrg    *djgpp*)
4261fda9279dSmrg      # DJGPP does not support shared libraries at all
4262fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4263fda9279dSmrg      ;;
4264fda9279dSmrg    haiku*)
4265fda9279dSmrg      # PIC is the default for Haiku.
4266fda9279dSmrg      # The "-static" flag exists, but is broken.
4267fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4268fda9279dSmrg      ;;
4269fda9279dSmrg    interix[[3-9]]*)
4270fda9279dSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4271fda9279dSmrg      # Instead, we relocate shared libraries at runtime.
4272fda9279dSmrg      ;;
4273fda9279dSmrg    sysv4*MP*)
4274fda9279dSmrg      if test -d /usr/nec; then
4275fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4276fda9279dSmrg      fi
4277fda9279dSmrg      ;;
4278fda9279dSmrg    hpux*)
4279fda9279dSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4280fda9279dSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4281fda9279dSmrg      # sets the default TLS model and affects inlining.
4282fda9279dSmrg      case $host_cpu in
4283fda9279dSmrg      hppa*64*)
4284fda9279dSmrg	;;
4285fda9279dSmrg      *)
4286fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4287fda9279dSmrg	;;
4288fda9279dSmrg      esac
4289fda9279dSmrg      ;;
4290fda9279dSmrg    *qnx* | *nto*)
4291fda9279dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4292fda9279dSmrg      # it will coredump.
4293fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4294fda9279dSmrg      ;;
4295fda9279dSmrg    *)
4296fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4297fda9279dSmrg      ;;
4298fda9279dSmrg    esac
4299fda9279dSmrg  else
4300fda9279dSmrg    case $host_os in
4301fda9279dSmrg      aix[[4-9]]*)
4302fda9279dSmrg	# All AIX code is PIC.
430316ee1e9aSmrg	if test ia64 = "$host_cpu"; then
4304fda9279dSmrg	  # AIX 5 now supports IA64 processor
4305fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4306fda9279dSmrg	else
4307fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4308fda9279dSmrg	fi
4309fda9279dSmrg	;;
4310fda9279dSmrg      chorus*)
4311fda9279dSmrg	case $cc_basename in
4312fda9279dSmrg	cxch68*)
4313fda9279dSmrg	  # Green Hills C++ Compiler
4314fda9279dSmrg	  # _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"
4315fda9279dSmrg	  ;;
4316fda9279dSmrg	esac
4317fda9279dSmrg	;;
4318fda9279dSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
4319fda9279dSmrg	# This hack is so that the source file can tell whether it is being
4320fda9279dSmrg	# built for inclusion in a dll (and should export symbols for example).
4321fda9279dSmrg	m4_if([$1], [GCJ], [],
4322fda9279dSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4323fda9279dSmrg	;;
4324fda9279dSmrg      dgux*)
4325fda9279dSmrg	case $cc_basename in
4326fda9279dSmrg	  ec++*)
4327fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4328fda9279dSmrg	    ;;
4329fda9279dSmrg	  ghcx*)
4330fda9279dSmrg	    # Green Hills C++ Compiler
4331fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4332fda9279dSmrg	    ;;
4333fda9279dSmrg	  *)
4334fda9279dSmrg	    ;;
4335fda9279dSmrg	esac
4336fda9279dSmrg	;;
4337fda9279dSmrg      freebsd* | dragonfly*)
4338fda9279dSmrg	# FreeBSD uses GNU C++
4339fda9279dSmrg	;;
4340fda9279dSmrg      hpux9* | hpux10* | hpux11*)
4341fda9279dSmrg	case $cc_basename in
4342fda9279dSmrg	  CC*)
4343fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
434416ee1e9aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
434516ee1e9aSmrg	    if test ia64 != "$host_cpu"; then
4346fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4347fda9279dSmrg	    fi
4348fda9279dSmrg	    ;;
4349fda9279dSmrg	  aCC*)
4350fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
435116ee1e9aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4352fda9279dSmrg	    case $host_cpu in
4353fda9279dSmrg	    hppa*64*|ia64*)
4354fda9279dSmrg	      # +Z the default
4355fda9279dSmrg	      ;;
4356fda9279dSmrg	    *)
4357fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4358fda9279dSmrg	      ;;
4359fda9279dSmrg	    esac
4360fda9279dSmrg	    ;;
4361fda9279dSmrg	  *)
4362fda9279dSmrg	    ;;
4363fda9279dSmrg	esac
4364fda9279dSmrg	;;
4365fda9279dSmrg      interix*)
4366fda9279dSmrg	# This is c89, which is MS Visual C++ (no shared libs)
4367fda9279dSmrg	# Anyone wants to do a port?
4368fda9279dSmrg	;;
4369fda9279dSmrg      irix5* | irix6* | nonstopux*)
4370fda9279dSmrg	case $cc_basename in
4371fda9279dSmrg	  CC*)
4372fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4373fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4374fda9279dSmrg	    # CC pic flag -KPIC is the default.
4375fda9279dSmrg	    ;;
4376fda9279dSmrg	  *)
4377fda9279dSmrg	    ;;
4378fda9279dSmrg	esac
4379fda9279dSmrg	;;
4380fda9279dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4381fda9279dSmrg	case $cc_basename in
4382fda9279dSmrg	  KCC*)
4383fda9279dSmrg	    # KAI C++ Compiler
4384fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4385fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4386fda9279dSmrg	    ;;
4387fda9279dSmrg	  ecpc* )
438816ee1e9aSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
4389fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4390fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4391fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4392fda9279dSmrg	    ;;
4393fda9279dSmrg	  icpc* )
4394fda9279dSmrg	    # Intel C++, used to be incompatible with GCC.
4395fda9279dSmrg	    # ICC 10 doesn't accept -KPIC any more.
4396fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4397fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4398fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4399fda9279dSmrg	    ;;
4400fda9279dSmrg	  pgCC* | pgcpp*)
4401fda9279dSmrg	    # Portland Group C++ compiler
4402fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4403fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4404fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4405fda9279dSmrg	    ;;
4406fda9279dSmrg	  cxx*)
4407fda9279dSmrg	    # Compaq C++
4408fda9279dSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4409fda9279dSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4410fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4411fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4412fda9279dSmrg	    ;;
4413fda9279dSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4414fda9279dSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4415fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4416fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4417fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4418fda9279dSmrg	    ;;
4419fda9279dSmrg	  *)
4420fda9279dSmrg	    case `$CC -V 2>&1 | sed 5q` in
4421fda9279dSmrg	    *Sun\ C*)
4422fda9279dSmrg	      # Sun C++ 5.9
4423fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4424fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4425fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4426fda9279dSmrg	      ;;
4427fda9279dSmrg	    esac
4428fda9279dSmrg	    ;;
4429fda9279dSmrg	esac
4430fda9279dSmrg	;;
4431fda9279dSmrg      lynxos*)
4432fda9279dSmrg	;;
4433fda9279dSmrg      m88k*)
4434fda9279dSmrg	;;
4435fda9279dSmrg      mvs*)
4436fda9279dSmrg	case $cc_basename in
4437fda9279dSmrg	  cxx*)
4438fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4439fda9279dSmrg	    ;;
4440fda9279dSmrg	  *)
4441fda9279dSmrg	    ;;
4442fda9279dSmrg	esac
4443fda9279dSmrg	;;
444416ee1e9aSmrg      netbsd*)
4445fda9279dSmrg	;;
4446fda9279dSmrg      *qnx* | *nto*)
4447fda9279dSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4448fda9279dSmrg        # it will coredump.
4449fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4450fda9279dSmrg        ;;
4451fda9279dSmrg      osf3* | osf4* | osf5*)
4452fda9279dSmrg	case $cc_basename in
4453fda9279dSmrg	  KCC*)
4454fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4455fda9279dSmrg	    ;;
4456fda9279dSmrg	  RCC*)
4457fda9279dSmrg	    # Rational C++ 2.4.1
4458fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4459fda9279dSmrg	    ;;
4460fda9279dSmrg	  cxx*)
4461fda9279dSmrg	    # Digital/Compaq C++
4462fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4463fda9279dSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4464fda9279dSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4465fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4466fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4467fda9279dSmrg	    ;;
4468fda9279dSmrg	  *)
4469fda9279dSmrg	    ;;
4470fda9279dSmrg	esac
4471fda9279dSmrg	;;
4472fda9279dSmrg      psos*)
4473fda9279dSmrg	;;
4474fda9279dSmrg      solaris*)
4475fda9279dSmrg	case $cc_basename in
4476fda9279dSmrg	  CC* | sunCC*)
4477fda9279dSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
4478fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4479fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4480fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4481fda9279dSmrg	    ;;
4482fda9279dSmrg	  gcx*)
4483fda9279dSmrg	    # Green Hills C++ Compiler
4484fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4485fda9279dSmrg	    ;;
4486fda9279dSmrg	  *)
4487fda9279dSmrg	    ;;
4488fda9279dSmrg	esac
4489fda9279dSmrg	;;
4490fda9279dSmrg      sunos4*)
4491fda9279dSmrg	case $cc_basename in
4492fda9279dSmrg	  CC*)
4493fda9279dSmrg	    # Sun C++ 4.x
4494fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4495fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4496fda9279dSmrg	    ;;
4497fda9279dSmrg	  lcc*)
4498fda9279dSmrg	    # Lucid
4499fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4500fda9279dSmrg	    ;;
4501fda9279dSmrg	  *)
4502fda9279dSmrg	    ;;
4503fda9279dSmrg	esac
4504fda9279dSmrg	;;
4505fda9279dSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4506fda9279dSmrg	case $cc_basename in
4507fda9279dSmrg	  CC*)
4508fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4509fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4510fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4511fda9279dSmrg	    ;;
4512fda9279dSmrg	esac
4513fda9279dSmrg	;;
4514fda9279dSmrg      tandem*)
4515fda9279dSmrg	case $cc_basename in
4516fda9279dSmrg	  NCC*)
4517fda9279dSmrg	    # NonStop-UX NCC 3.20
4518fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4519fda9279dSmrg	    ;;
4520fda9279dSmrg	  *)
4521fda9279dSmrg	    ;;
4522fda9279dSmrg	esac
4523fda9279dSmrg	;;
4524fda9279dSmrg      vxworks*)
4525fda9279dSmrg	;;
4526fda9279dSmrg      *)
4527fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4528fda9279dSmrg	;;
4529fda9279dSmrg    esac
4530fda9279dSmrg  fi
4531fda9279dSmrg],
4532fda9279dSmrg[
453316ee1e9aSmrg  if test yes = "$GCC"; then
4534fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4535fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4536fda9279dSmrg
4537fda9279dSmrg    case $host_os in
4538fda9279dSmrg      aix*)
4539fda9279dSmrg      # All AIX code is PIC.
454016ee1e9aSmrg      if test ia64 = "$host_cpu"; then
4541fda9279dSmrg	# AIX 5 now supports IA64 processor
4542fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4543fda9279dSmrg      fi
454416ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4545fda9279dSmrg      ;;
4546fda9279dSmrg
4547fda9279dSmrg    amigaos*)
4548fda9279dSmrg      case $host_cpu in
4549fda9279dSmrg      powerpc)
4550fda9279dSmrg            # see comment about AmigaOS4 .so support
4551fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4552fda9279dSmrg        ;;
4553fda9279dSmrg      m68k)
4554fda9279dSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
455516ee1e9aSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
455616ee1e9aSmrg            # like '-m68040'.
4557fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4558fda9279dSmrg        ;;
4559fda9279dSmrg      esac
4560fda9279dSmrg      ;;
4561fda9279dSmrg
4562fda9279dSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4563fda9279dSmrg      # PIC is the default for these OSes.
4564fda9279dSmrg      ;;
4565fda9279dSmrg
4566fda9279dSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4567fda9279dSmrg      # This hack is so that the source file can tell whether it is being
4568fda9279dSmrg      # built for inclusion in a dll (and should export symbols for example).
4569fda9279dSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4570fda9279dSmrg      # (--disable-auto-import) libraries
4571fda9279dSmrg      m4_if([$1], [GCJ], [],
4572fda9279dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
457316ee1e9aSmrg      case $host_os in
457416ee1e9aSmrg      os2*)
457516ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
457616ee1e9aSmrg	;;
457716ee1e9aSmrg      esac
4578fda9279dSmrg      ;;
4579fda9279dSmrg
4580fda9279dSmrg    darwin* | rhapsody*)
4581fda9279dSmrg      # PIC is the default on this platform
4582fda9279dSmrg      # Common symbols not allowed in MH_DYLIB files
4583fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4584fda9279dSmrg      ;;
4585fda9279dSmrg
4586fda9279dSmrg    haiku*)
4587fda9279dSmrg      # PIC is the default for Haiku.
4588fda9279dSmrg      # The "-static" flag exists, but is broken.
4589fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4590fda9279dSmrg      ;;
4591fda9279dSmrg
4592fda9279dSmrg    hpux*)
4593fda9279dSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4594fda9279dSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4595fda9279dSmrg      # sets the default TLS model and affects inlining.
4596fda9279dSmrg      case $host_cpu in
4597fda9279dSmrg      hppa*64*)
4598fda9279dSmrg	# +Z the default
4599fda9279dSmrg	;;
4600fda9279dSmrg      *)
4601fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4602fda9279dSmrg	;;
4603fda9279dSmrg      esac
4604fda9279dSmrg      ;;
4605fda9279dSmrg
4606fda9279dSmrg    interix[[3-9]]*)
4607fda9279dSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4608fda9279dSmrg      # Instead, we relocate shared libraries at runtime.
4609fda9279dSmrg      ;;
4610fda9279dSmrg
4611fda9279dSmrg    msdosdjgpp*)
4612fda9279dSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4613fda9279dSmrg      # on systems that don't support them.
4614fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4615fda9279dSmrg      enable_shared=no
4616fda9279dSmrg      ;;
4617fda9279dSmrg
4618fda9279dSmrg    *nto* | *qnx*)
4619fda9279dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4620fda9279dSmrg      # it will coredump.
4621fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4622fda9279dSmrg      ;;
4623fda9279dSmrg
4624fda9279dSmrg    sysv4*MP*)
4625fda9279dSmrg      if test -d /usr/nec; then
4626fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4627fda9279dSmrg      fi
4628fda9279dSmrg      ;;
4629fda9279dSmrg
4630fda9279dSmrg    *)
4631fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4632fda9279dSmrg      ;;
4633fda9279dSmrg    esac
4634fda9279dSmrg
4635fda9279dSmrg    case $cc_basename in
4636fda9279dSmrg    nvcc*) # Cuda Compiler Driver 2.2
4637fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4638fda9279dSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4639fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4640fda9279dSmrg      fi
4641fda9279dSmrg      ;;
4642fda9279dSmrg    esac
4643fda9279dSmrg  else
4644fda9279dSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
4645fda9279dSmrg    case $host_os in
4646fda9279dSmrg    aix*)
4647fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
464816ee1e9aSmrg      if test ia64 = "$host_cpu"; then
4649fda9279dSmrg	# AIX 5 now supports IA64 processor
4650fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4651fda9279dSmrg      else
4652fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4653fda9279dSmrg      fi
4654fda9279dSmrg      ;;
4655fda9279dSmrg
465616ee1e9aSmrg    darwin* | rhapsody*)
465716ee1e9aSmrg      # PIC is the default on this platform
465816ee1e9aSmrg      # Common symbols not allowed in MH_DYLIB files
465916ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
466016ee1e9aSmrg      case $cc_basename in
466116ee1e9aSmrg      nagfor*)
466216ee1e9aSmrg        # NAG Fortran compiler
466316ee1e9aSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
466416ee1e9aSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
466516ee1e9aSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
466616ee1e9aSmrg        ;;
466716ee1e9aSmrg      esac
466816ee1e9aSmrg      ;;
466916ee1e9aSmrg
4670fda9279dSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4671fda9279dSmrg      # This hack is so that the source file can tell whether it is being
4672fda9279dSmrg      # built for inclusion in a dll (and should export symbols for example).
4673fda9279dSmrg      m4_if([$1], [GCJ], [],
4674fda9279dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
467516ee1e9aSmrg      case $host_os in
467616ee1e9aSmrg      os2*)
467716ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
467816ee1e9aSmrg	;;
467916ee1e9aSmrg      esac
4680fda9279dSmrg      ;;
4681fda9279dSmrg
4682fda9279dSmrg    hpux9* | hpux10* | hpux11*)
4683fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4684fda9279dSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4685fda9279dSmrg      # not for PA HP-UX.
4686fda9279dSmrg      case $host_cpu in
4687fda9279dSmrg      hppa*64*|ia64*)
4688fda9279dSmrg	# +Z the default
4689fda9279dSmrg	;;
4690fda9279dSmrg      *)
4691fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4692fda9279dSmrg	;;
4693fda9279dSmrg      esac
4694fda9279dSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
469516ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4696fda9279dSmrg      ;;
4697fda9279dSmrg
4698fda9279dSmrg    irix5* | irix6* | nonstopux*)
4699fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4700fda9279dSmrg      # PIC (with -KPIC) is the default.
4701fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4702fda9279dSmrg      ;;
4703fda9279dSmrg
4704fda9279dSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4705fda9279dSmrg      case $cc_basename in
470616ee1e9aSmrg      # old Intel for x86_64, which still supported -KPIC.
4707fda9279dSmrg      ecc*)
4708fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4709fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4710fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4711fda9279dSmrg        ;;
4712fda9279dSmrg      # icc used to be incompatible with GCC.
4713fda9279dSmrg      # ICC 10 doesn't accept -KPIC any more.
4714fda9279dSmrg      icc* | ifort*)
4715fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4716fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4717fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4718fda9279dSmrg        ;;
4719fda9279dSmrg      # Lahey Fortran 8.1.
4720fda9279dSmrg      lf95*)
4721fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4722fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4723fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4724fda9279dSmrg	;;
4725fda9279dSmrg      nagfor*)
4726fda9279dSmrg	# NAG Fortran compiler
4727fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4728fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4729fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4730fda9279dSmrg	;;
473116ee1e9aSmrg      tcc*)
473216ee1e9aSmrg	# Fabrice Bellard et al's Tiny C Compiler
473316ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473416ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
473516ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
473616ee1e9aSmrg	;;
4737fda9279dSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4738fda9279dSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4739fda9279dSmrg	# which looks to be a dead project)
4740fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4741fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4742fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4743fda9279dSmrg        ;;
4744fda9279dSmrg      ccc*)
4745fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4746fda9279dSmrg        # All Alpha code is PIC.
4747fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4748fda9279dSmrg        ;;
4749fda9279dSmrg      xl* | bgxl* | bgf* | mpixl*)
4750fda9279dSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4751fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4752fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4753fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4754fda9279dSmrg	;;
4755fda9279dSmrg      *)
4756fda9279dSmrg	case `$CC -V 2>&1 | sed 5q` in
4757fda9279dSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4758fda9279dSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4759fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4760fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4761fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4762fda9279dSmrg	  ;;
4763fda9279dSmrg	*Sun\ F* | *Sun*Fortran*)
4764fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4765fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4766fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4767fda9279dSmrg	  ;;
4768fda9279dSmrg	*Sun\ C*)
4769fda9279dSmrg	  # Sun C 5.9
4770fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4771fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4772fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4773fda9279dSmrg	  ;;
4774fda9279dSmrg        *Intel*\ [[CF]]*Compiler*)
4775fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4776fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4777fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4778fda9279dSmrg	  ;;
4779fda9279dSmrg	*Portland\ Group*)
4780fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4781fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4782fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4783fda9279dSmrg	  ;;
4784fda9279dSmrg	esac
4785fda9279dSmrg	;;
4786fda9279dSmrg      esac
4787fda9279dSmrg      ;;
4788fda9279dSmrg
4789fda9279dSmrg    newsos6)
4790fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4791fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4792fda9279dSmrg      ;;
4793fda9279dSmrg
4794fda9279dSmrg    *nto* | *qnx*)
4795fda9279dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4796fda9279dSmrg      # it will coredump.
4797fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4798fda9279dSmrg      ;;
4799fda9279dSmrg
4800fda9279dSmrg    osf3* | osf4* | osf5*)
4801fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4802fda9279dSmrg      # All OSF/1 code is PIC.
4803fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4804fda9279dSmrg      ;;
4805fda9279dSmrg
4806fda9279dSmrg    rdos*)
4807fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4808fda9279dSmrg      ;;
4809fda9279dSmrg
4810fda9279dSmrg    solaris*)
4811fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4812fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4813fda9279dSmrg      case $cc_basename in
4814fda9279dSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4815fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4816fda9279dSmrg      *)
4817fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4818fda9279dSmrg      esac
4819fda9279dSmrg      ;;
4820fda9279dSmrg
4821fda9279dSmrg    sunos4*)
4822fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4823fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4824fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4825fda9279dSmrg      ;;
4826fda9279dSmrg
4827fda9279dSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4828fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4829fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4830fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4831fda9279dSmrg      ;;
4832fda9279dSmrg
4833fda9279dSmrg    sysv4*MP*)
483416ee1e9aSmrg      if test -d /usr/nec; then
4835fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4836fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4837fda9279dSmrg      fi
4838fda9279dSmrg      ;;
4839fda9279dSmrg
4840fda9279dSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4841fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4842fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4843fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4844fda9279dSmrg      ;;
4845fda9279dSmrg
4846fda9279dSmrg    unicos*)
4847fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4848fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4849fda9279dSmrg      ;;
4850fda9279dSmrg
4851fda9279dSmrg    uts4*)
4852fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4853fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4854fda9279dSmrg      ;;
4855fda9279dSmrg
4856fda9279dSmrg    *)
4857fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4858fda9279dSmrg      ;;
4859fda9279dSmrg    esac
4860fda9279dSmrg  fi
4861fda9279dSmrg])
4862fda9279dSmrgcase $host_os in
486316ee1e9aSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
4864fda9279dSmrg  *djgpp*)
4865fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4866fda9279dSmrg    ;;
4867fda9279dSmrg  *)
4868fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4869fda9279dSmrg    ;;
4870fda9279dSmrgesac
4871fda9279dSmrg
4872fda9279dSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4873fda9279dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4874fda9279dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4875fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4876fda9279dSmrg
4877fda9279dSmrg#
4878fda9279dSmrg# Check to make sure the PIC flag actually works.
4879fda9279dSmrg#
4880fda9279dSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4881fda9279dSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4882fda9279dSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4883fda9279dSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4884fda9279dSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4885fda9279dSmrg     "" | " "*) ;;
4886fda9279dSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4887fda9279dSmrg     esac],
4888fda9279dSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4889fda9279dSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4890fda9279dSmrgfi
4891fda9279dSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4892fda9279dSmrg	[Additional compiler flags for building library objects])
4893fda9279dSmrg
4894fda9279dSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4895fda9279dSmrg	[How to pass a linker flag through the compiler])
4896fda9279dSmrg#
4897fda9279dSmrg# Check to make sure the static flag actually works.
4898fda9279dSmrg#
4899fda9279dSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4900fda9279dSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4901fda9279dSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4902fda9279dSmrg  $lt_tmp_static_flag,
4903fda9279dSmrg  [],
4904fda9279dSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4905fda9279dSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4906fda9279dSmrg	[Compiler flag to prevent dynamic linking])
4907fda9279dSmrg])# _LT_COMPILER_PIC
4908fda9279dSmrg
4909fda9279dSmrg
4910fda9279dSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4911fda9279dSmrg# ----------------------------
4912fda9279dSmrg# See if the linker supports building shared libraries.
4913fda9279dSmrgm4_defun([_LT_LINKER_SHLIBS],
4914fda9279dSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4915fda9279dSmrgAC_REQUIRE([LT_PATH_NM])dnl
4916fda9279dSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4917fda9279dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4918fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
4919fda9279dSmrgm4_require([_LT_DECL_SED])dnl
4920fda9279dSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4921fda9279dSmrgm4_require([_LT_TAG_COMPILER])dnl
4922fda9279dSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4923fda9279dSmrgm4_if([$1], [CXX], [
4924fda9279dSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4925fda9279dSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4926fda9279dSmrg  case $host_os in
4927fda9279dSmrg  aix[[4-9]]*)
4928fda9279dSmrg    # If we're using GNU nm, then we don't want the "-C" option.
492916ee1e9aSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
493016ee1e9aSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
493116ee1e9aSmrg    # weak defined symbols like other global defined symbols, whereas
493216ee1e9aSmrg    # GNU nm marks them as "W".
493316ee1e9aSmrg    # While the 'weak' keyword is ignored in the Export File, we need
493416ee1e9aSmrg    # it in the Import File for the 'aix-soname' feature, so we have
493516ee1e9aSmrg    # to replace the "-B" option with "-P" for AIX nm.
4936fda9279dSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
493716ee1e9aSmrg      _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'
4938fda9279dSmrg    else
493916ee1e9aSmrg      _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'
4940fda9279dSmrg    fi
4941fda9279dSmrg    ;;
4942fda9279dSmrg  pw32*)
494316ee1e9aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4944fda9279dSmrg    ;;
4945fda9279dSmrg  cygwin* | mingw* | cegcc*)
4946fda9279dSmrg    case $cc_basename in
4947fda9279dSmrg    cl*)
4948fda9279dSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4949fda9279dSmrg      ;;
4950fda9279dSmrg    *)
4951fda9279dSmrg      _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'
4952fda9279dSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4953fda9279dSmrg      ;;
4954fda9279dSmrg    esac
4955fda9279dSmrg    ;;
4956fda9279dSmrg  *)
4957fda9279dSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4958fda9279dSmrg    ;;
4959fda9279dSmrg  esac
4960fda9279dSmrg], [
4961fda9279dSmrg  runpath_var=
4962fda9279dSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4963fda9279dSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4964fda9279dSmrg  _LT_TAGVAR(archive_cmds, $1)=
4965fda9279dSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4966fda9279dSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4967fda9279dSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4968fda9279dSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4969fda9279dSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4970fda9279dSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4971fda9279dSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4972fda9279dSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4973fda9279dSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4974fda9279dSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4975fda9279dSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4976fda9279dSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4977fda9279dSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4978fda9279dSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4979fda9279dSmrg  _LT_TAGVAR(module_cmds, $1)=
4980fda9279dSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4981fda9279dSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4982fda9279dSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4983fda9279dSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4984fda9279dSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4985fda9279dSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4986fda9279dSmrg  # included in the symbol list
4987fda9279dSmrg  _LT_TAGVAR(include_expsyms, $1)=
4988fda9279dSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
498916ee1e9aSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
499016ee1e9aSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
499116ee1e9aSmrg  # as well as any symbol that contains 'd'.
4992fda9279dSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4993fda9279dSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4994fda9279dSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4995fda9279dSmrg  # the symbol is explicitly referenced.  Since portable code cannot
4996fda9279dSmrg  # rely on this symbol name, it's probably fine to never include it in
4997fda9279dSmrg  # preloaded symbol tables.
4998fda9279dSmrg  # Exclude shared library initialization/finalization symbols.
4999fda9279dSmrgdnl Note also adjust exclude_expsyms for C++ above.
5000fda9279dSmrg  extract_expsyms_cmds=
5001fda9279dSmrg
5002fda9279dSmrg  case $host_os in
5003fda9279dSmrg  cygwin* | mingw* | pw32* | cegcc*)
5004fda9279dSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5005fda9279dSmrg    # When not using gcc, we currently assume that we are using
5006fda9279dSmrg    # Microsoft Visual C++.
500716ee1e9aSmrg    if test yes != "$GCC"; then
5008fda9279dSmrg      with_gnu_ld=no
5009fda9279dSmrg    fi
5010fda9279dSmrg    ;;
5011fda9279dSmrg  interix*)
5012fda9279dSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5013fda9279dSmrg    with_gnu_ld=yes
5014fda9279dSmrg    ;;
501516ee1e9aSmrg  openbsd* | bitrig*)
5016fda9279dSmrg    with_gnu_ld=no
5017fda9279dSmrg    ;;
5018fda9279dSmrg  esac
5019fda9279dSmrg
5020fda9279dSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5021fda9279dSmrg
5022fda9279dSmrg  # On some targets, GNU ld is compatible enough with the native linker
5023fda9279dSmrg  # that we're better off using the native interface for both.
5024fda9279dSmrg  lt_use_gnu_ld_interface=no
502516ee1e9aSmrg  if test yes = "$with_gnu_ld"; then
5026fda9279dSmrg    case $host_os in
5027fda9279dSmrg      aix*)
5028fda9279dSmrg	# The AIX port of GNU ld has always aspired to compatibility
5029fda9279dSmrg	# with the native linker.  However, as the warning in the GNU ld
5030fda9279dSmrg	# block says, versions before 2.19.5* couldn't really create working
5031fda9279dSmrg	# shared libraries, regardless of the interface used.
5032fda9279dSmrg	case `$LD -v 2>&1` in
5033fda9279dSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5034fda9279dSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5035fda9279dSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5036fda9279dSmrg	  *)
5037fda9279dSmrg	    lt_use_gnu_ld_interface=yes
5038fda9279dSmrg	    ;;
5039fda9279dSmrg	esac
5040fda9279dSmrg	;;
5041fda9279dSmrg      *)
5042fda9279dSmrg	lt_use_gnu_ld_interface=yes
5043fda9279dSmrg	;;
5044fda9279dSmrg    esac
5045fda9279dSmrg  fi
5046fda9279dSmrg
504716ee1e9aSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
5048fda9279dSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
504916ee1e9aSmrg    wlarc='$wl'
5050fda9279dSmrg
5051fda9279dSmrg    # Set some defaults for GNU ld with shared library support. These
5052fda9279dSmrg    # are reset later if shared libraries are not supported. Putting them
5053fda9279dSmrg    # here allows them to be overridden if necessary.
5054fda9279dSmrg    runpath_var=LD_RUN_PATH
505516ee1e9aSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
505616ee1e9aSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5057fda9279dSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5058fda9279dSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
505916ee1e9aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5060fda9279dSmrg    else
5061fda9279dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5062fda9279dSmrg    fi
5063fda9279dSmrg    supports_anon_versioning=no
506416ee1e9aSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5065fda9279dSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5066fda9279dSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5067fda9279dSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5068fda9279dSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5069fda9279dSmrg      *\ 2.11.*) ;; # other 2.11 versions
5070fda9279dSmrg      *) supports_anon_versioning=yes ;;
5071fda9279dSmrg    esac
5072fda9279dSmrg
5073fda9279dSmrg    # See if GNU ld supports shared libraries.
5074fda9279dSmrg    case $host_os in
5075fda9279dSmrg    aix[[3-9]]*)
5076fda9279dSmrg      # On AIX/PPC, the GNU linker is very broken
507716ee1e9aSmrg      if test ia64 != "$host_cpu"; then
5078fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5079fda9279dSmrg	cat <<_LT_EOF 1>&2
5080fda9279dSmrg
5081fda9279dSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5082fda9279dSmrg*** to be unable to reliably create shared libraries on AIX.
5083fda9279dSmrg*** Therefore, libtool is disabling shared libraries support.  If you
5084fda9279dSmrg*** really care for shared libraries, you may want to install binutils
5085fda9279dSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5086fda9279dSmrg*** You will then need to restart the configuration process.
5087fda9279dSmrg
5088fda9279dSmrg_LT_EOF
5089fda9279dSmrg      fi
5090fda9279dSmrg      ;;
5091fda9279dSmrg
5092fda9279dSmrg    amigaos*)
5093fda9279dSmrg      case $host_cpu in
5094fda9279dSmrg      powerpc)
5095fda9279dSmrg            # see comment about AmigaOS4 .so support
509616ee1e9aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5097fda9279dSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5098fda9279dSmrg        ;;
5099fda9279dSmrg      m68k)
5100fda9279dSmrg            _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)'
5101fda9279dSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5102fda9279dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5103fda9279dSmrg        ;;
5104fda9279dSmrg      esac
5105fda9279dSmrg      ;;
5106fda9279dSmrg
5107fda9279dSmrg    beos*)
5108fda9279dSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5109fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5110fda9279dSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5111fda9279dSmrg	# support --undefined.  This deserves some investigation.  FIXME
511216ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5113fda9279dSmrg      else
5114fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5115fda9279dSmrg      fi
5116fda9279dSmrg      ;;
5117fda9279dSmrg
5118fda9279dSmrg    cygwin* | mingw* | pw32* | cegcc*)
5119fda9279dSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5120fda9279dSmrg      # as there is no search path for DLLs.
5121fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
512216ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5123fda9279dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5124fda9279dSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5125fda9279dSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5126fda9279dSmrg      _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'
5127fda9279dSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5128fda9279dSmrg
5129fda9279dSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
513016ee1e9aSmrg        _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'
513116ee1e9aSmrg	# If the export-symbols file already is a .def file, use it as
513216ee1e9aSmrg	# is; otherwise, prepend EXPORTS...
513316ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
513416ee1e9aSmrg          cp $export_symbols $output_objdir/$soname.def;
513516ee1e9aSmrg        else
513616ee1e9aSmrg          echo EXPORTS > $output_objdir/$soname.def;
513716ee1e9aSmrg          cat $export_symbols >> $output_objdir/$soname.def;
513816ee1e9aSmrg        fi~
513916ee1e9aSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5140fda9279dSmrg      else
5141fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5142fda9279dSmrg      fi
5143fda9279dSmrg      ;;
5144fda9279dSmrg
5145fda9279dSmrg    haiku*)
514616ee1e9aSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5147fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5148fda9279dSmrg      ;;
5149fda9279dSmrg
515016ee1e9aSmrg    os2*)
515116ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
515216ee1e9aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
515316ee1e9aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
515416ee1e9aSmrg      shrext_cmds=.dll
515516ee1e9aSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
515616ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
515716ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
515816ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
515916ee1e9aSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
516016ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
516116ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
516216ee1e9aSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
516316ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
516416ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
516516ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
516616ee1e9aSmrg	prefix_cmds="$SED"~
516716ee1e9aSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
516816ee1e9aSmrg	  prefix_cmds="$prefix_cmds -e 1d";
516916ee1e9aSmrg	fi~
517016ee1e9aSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
517116ee1e9aSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
517216ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
517316ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
517416ee1e9aSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
517516ee1e9aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
517616ee1e9aSmrg      ;;
517716ee1e9aSmrg
5178fda9279dSmrg    interix[[3-9]]*)
5179fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5180fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
518116ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
518216ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5183fda9279dSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5184fda9279dSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5185fda9279dSmrg      # default) and relocated if they conflict, which is a slow very memory
5186fda9279dSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5187fda9279dSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5188fda9279dSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
518916ee1e9aSmrg      _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'
519016ee1e9aSmrg      _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'
5191fda9279dSmrg      ;;
5192fda9279dSmrg
5193fda9279dSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5194fda9279dSmrg      tmp_diet=no
519516ee1e9aSmrg      if test linux-dietlibc = "$host_os"; then
5196fda9279dSmrg	case $cc_basename in
5197fda9279dSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5198fda9279dSmrg	esac
5199fda9279dSmrg      fi
5200fda9279dSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
520116ee1e9aSmrg	 && test no = "$tmp_diet"
5202fda9279dSmrg      then
5203fda9279dSmrg	tmp_addflag=' $pic_flag'
5204fda9279dSmrg	tmp_sharedflag='-shared'
5205fda9279dSmrg	case $cc_basename,$host_cpu in
5206fda9279dSmrg        pgcc*)				# Portland Group C compiler
520716ee1e9aSmrg	  _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'
5208fda9279dSmrg	  tmp_addflag=' $pic_flag'
5209fda9279dSmrg	  ;;
5210fda9279dSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5211fda9279dSmrg					# Portland Group f77 and f90 compilers
521216ee1e9aSmrg	  _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'
5213fda9279dSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5214fda9279dSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5215fda9279dSmrg	  tmp_addflag=' -i_dynamic' ;;
5216fda9279dSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5217fda9279dSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5218fda9279dSmrg	ifc* | ifort*)			# Intel Fortran compiler
5219fda9279dSmrg	  tmp_addflag=' -nofor_main' ;;
5220fda9279dSmrg	lf95*)				# Lahey Fortran 8.1
5221fda9279dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5222fda9279dSmrg	  tmp_sharedflag='--shared' ;;
522316ee1e9aSmrg        nagfor*)                        # NAGFOR 5.3
522416ee1e9aSmrg          tmp_sharedflag='-Wl,-shared' ;;
5225fda9279dSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5226fda9279dSmrg	  tmp_sharedflag='-qmkshrobj'
5227fda9279dSmrg	  tmp_addflag= ;;
5228fda9279dSmrg	nvcc*)	# Cuda Compiler Driver 2.2
522916ee1e9aSmrg	  _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'
5230fda9279dSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5231fda9279dSmrg	  ;;
5232fda9279dSmrg	esac
5233fda9279dSmrg	case `$CC -V 2>&1 | sed 5q` in
5234fda9279dSmrg	*Sun\ C*)			# Sun C 5.9
523516ee1e9aSmrg	  _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'
5236fda9279dSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5237fda9279dSmrg	  tmp_sharedflag='-G' ;;
5238fda9279dSmrg	*Sun\ F*)			# Sun Fortran 8.3
5239fda9279dSmrg	  tmp_sharedflag='-G' ;;
5240fda9279dSmrg	esac
524116ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5242fda9279dSmrg
524316ee1e9aSmrg        if test yes = "$supports_anon_versioning"; then
5244fda9279dSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
524516ee1e9aSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
524616ee1e9aSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
524716ee1e9aSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5248fda9279dSmrg        fi
5249fda9279dSmrg
5250fda9279dSmrg	case $cc_basename in
525116ee1e9aSmrg	tcc*)
525216ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
525316ee1e9aSmrg	  ;;
5254fda9279dSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5255fda9279dSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5256fda9279dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
525716ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5258fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
525916ee1e9aSmrg	  if test yes = "$supports_anon_versioning"; then
5260fda9279dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
526116ee1e9aSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
526216ee1e9aSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
526316ee1e9aSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5264fda9279dSmrg	  fi
5265fda9279dSmrg	  ;;
5266fda9279dSmrg	esac
5267fda9279dSmrg      else
5268fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5269fda9279dSmrg      fi
5270fda9279dSmrg      ;;
5271fda9279dSmrg
527216ee1e9aSmrg    netbsd*)
5273fda9279dSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5274fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5275fda9279dSmrg	wlarc=
5276fda9279dSmrg      else
527716ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
527816ee1e9aSmrg	_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'
5279fda9279dSmrg      fi
5280fda9279dSmrg      ;;
5281fda9279dSmrg
5282fda9279dSmrg    solaris*)
5283fda9279dSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5284fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5285fda9279dSmrg	cat <<_LT_EOF 1>&2
5286fda9279dSmrg
5287fda9279dSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5288fda9279dSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5289fda9279dSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5290fda9279dSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5291fda9279dSmrg*** your PATH or compiler configuration so that the native linker is
5292fda9279dSmrg*** used, and then restart.
5293fda9279dSmrg
5294fda9279dSmrg_LT_EOF
5295fda9279dSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
529616ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
529716ee1e9aSmrg	_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'
5298fda9279dSmrg      else
5299fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5300fda9279dSmrg      fi
5301fda9279dSmrg      ;;
5302fda9279dSmrg
5303fda9279dSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5304fda9279dSmrg      case `$LD -v 2>&1` in
5305fda9279dSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5306fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5307fda9279dSmrg	cat <<_LT_EOF 1>&2
5308fda9279dSmrg
530916ee1e9aSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5310fda9279dSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5311fda9279dSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5312fda9279dSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5313fda9279dSmrg*** your PATH or compiler configuration so that the native linker is
5314fda9279dSmrg*** used, and then restart.
5315fda9279dSmrg
5316fda9279dSmrg_LT_EOF
5317fda9279dSmrg	;;
5318fda9279dSmrg	*)
5319fda9279dSmrg	  # For security reasons, it is highly recommended that you always
5320fda9279dSmrg	  # use absolute paths for naming shared libraries, and exclude the
5321fda9279dSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5322fda9279dSmrg	  # requires that you compile everything twice, which is a pain.
5323fda9279dSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
532416ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
532516ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
532616ee1e9aSmrg	    _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'
5327fda9279dSmrg	  else
5328fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5329fda9279dSmrg	  fi
5330fda9279dSmrg	;;
5331fda9279dSmrg      esac
5332fda9279dSmrg      ;;
5333fda9279dSmrg
5334fda9279dSmrg    sunos4*)
5335fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5336fda9279dSmrg      wlarc=
5337fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5338fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5339fda9279dSmrg      ;;
5340fda9279dSmrg
5341fda9279dSmrg    *)
5342fda9279dSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
534316ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
534416ee1e9aSmrg	_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'
5345fda9279dSmrg      else
5346fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5347fda9279dSmrg      fi
5348fda9279dSmrg      ;;
5349fda9279dSmrg    esac
5350fda9279dSmrg
535116ee1e9aSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5352fda9279dSmrg      runpath_var=
5353fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5354fda9279dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5355fda9279dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5356fda9279dSmrg    fi
5357fda9279dSmrg  else
5358fda9279dSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5359fda9279dSmrg    case $host_os in
5360fda9279dSmrg    aix3*)
5361fda9279dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5362fda9279dSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5363fda9279dSmrg      _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'
5364fda9279dSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5365fda9279dSmrg      # are no directories specified by -L.
5366fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
536716ee1e9aSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5368fda9279dSmrg	# Neither direct hardcoding nor static linking is supported with a
5369fda9279dSmrg	# broken collect2.
5370fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5371fda9279dSmrg      fi
5372fda9279dSmrg      ;;
5373fda9279dSmrg
5374fda9279dSmrg    aix[[4-9]]*)
537516ee1e9aSmrg      if test ia64 = "$host_cpu"; then
5376fda9279dSmrg	# On IA64, the linker does run time linking by default, so we don't
5377fda9279dSmrg	# have to do anything special.
5378fda9279dSmrg	aix_use_runtimelinking=no
5379fda9279dSmrg	exp_sym_flag='-Bexport'
538016ee1e9aSmrg	no_entry_flag=
5381fda9279dSmrg      else
5382fda9279dSmrg	# If we're using GNU nm, then we don't want the "-C" option.
538316ee1e9aSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
538416ee1e9aSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
538516ee1e9aSmrg	# weak defined symbols like other global defined symbols, whereas
538616ee1e9aSmrg	# GNU nm marks them as "W".
538716ee1e9aSmrg	# While the 'weak' keyword is ignored in the Export File, we need
538816ee1e9aSmrg	# it in the Import File for the 'aix-soname' feature, so we have
538916ee1e9aSmrg	# to replace the "-B" option with "-P" for AIX nm.
5390fda9279dSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
539116ee1e9aSmrg	  _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'
5392fda9279dSmrg	else
539316ee1e9aSmrg	  _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'
5394fda9279dSmrg	fi
5395fda9279dSmrg	aix_use_runtimelinking=no
5396fda9279dSmrg
5397fda9279dSmrg	# Test if we are trying to use run time linking or normal
5398fda9279dSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
539916ee1e9aSmrg	# have runtime linking enabled, and use it for executables.
540016ee1e9aSmrg	# For shared libraries, we enable/disable runtime linking
540116ee1e9aSmrg	# depending on the kind of the shared library created -
540216ee1e9aSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
540316ee1e9aSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
540416ee1e9aSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
540516ee1e9aSmrg	#            lib.a           static archive
540616ee1e9aSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
540716ee1e9aSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
540816ee1e9aSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
540916ee1e9aSmrg	#            lib.a(lib.so.V) shared, rtl:no
541016ee1e9aSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
541116ee1e9aSmrg	#            lib.a           static archive
5412fda9279dSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5413fda9279dSmrg	  for ld_flag in $LDFLAGS; do
541416ee1e9aSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5415fda9279dSmrg	    aix_use_runtimelinking=yes
5416fda9279dSmrg	    break
5417fda9279dSmrg	  fi
5418fda9279dSmrg	  done
541916ee1e9aSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
542016ee1e9aSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
542116ee1e9aSmrg	    # so we don't have lib.a shared libs to link our executables.
542216ee1e9aSmrg	    # We have to force runtime linking in this case.
542316ee1e9aSmrg	    aix_use_runtimelinking=yes
542416ee1e9aSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
542516ee1e9aSmrg	  fi
5426fda9279dSmrg	  ;;
5427fda9279dSmrg	esac
5428fda9279dSmrg
5429fda9279dSmrg	exp_sym_flag='-bexport'
5430fda9279dSmrg	no_entry_flag='-bnoentry'
5431fda9279dSmrg      fi
5432fda9279dSmrg
5433fda9279dSmrg      # When large executables or shared objects are built, AIX ld can
5434fda9279dSmrg      # have problems creating the table of contents.  If linking a library
5435fda9279dSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
5436fda9279dSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5437fda9279dSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5438fda9279dSmrg
5439fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)=''
5440fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5441fda9279dSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5442fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5443fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
544416ee1e9aSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
544516ee1e9aSmrg      case $with_aix_soname,$aix_use_runtimelinking in
544616ee1e9aSmrg      aix,*) ;; # traditional, no import file
544716ee1e9aSmrg      svr4,* | *,yes) # use import file
544816ee1e9aSmrg	# The Import File defines what to hardcode.
544916ee1e9aSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
545016ee1e9aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
545116ee1e9aSmrg	;;
545216ee1e9aSmrg      esac
5453fda9279dSmrg
545416ee1e9aSmrg      if test yes = "$GCC"; then
5455fda9279dSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5456fda9279dSmrg	# We only want to do this on AIX 4.2 and lower, the check
5457fda9279dSmrg	# below for broken collect2 doesn't work under 4.3+
545816ee1e9aSmrg	  collect2name=`$CC -print-prog-name=collect2`
5459fda9279dSmrg	  if test -f "$collect2name" &&
5460fda9279dSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5461fda9279dSmrg	  then
5462fda9279dSmrg	  # We have reworked collect2
5463fda9279dSmrg	  :
5464fda9279dSmrg	  else
5465fda9279dSmrg	  # We have old collect2
5466fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5467fda9279dSmrg	  # It fails to find uninstalled libraries when the uninstalled
5468fda9279dSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5469fda9279dSmrg	  # to unsupported forces relinking
5470fda9279dSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5471fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5472fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5473fda9279dSmrg	  fi
5474fda9279dSmrg	  ;;
5475fda9279dSmrg	esac
5476fda9279dSmrg	shared_flag='-shared'
547716ee1e9aSmrg	if test yes = "$aix_use_runtimelinking"; then
547816ee1e9aSmrg	  shared_flag="$shared_flag "'$wl-G'
5479fda9279dSmrg	fi
548016ee1e9aSmrg	# Need to ensure runtime linking is disabled for the traditional
548116ee1e9aSmrg	# shared library, or the linker may eventually find shared libraries
548216ee1e9aSmrg	# /with/ Import File - we do not want to mix them.
548316ee1e9aSmrg	shared_flag_aix='-shared'
548416ee1e9aSmrg	shared_flag_svr4='-shared $wl-G'
5485fda9279dSmrg      else
5486fda9279dSmrg	# not using gcc
548716ee1e9aSmrg	if test ia64 = "$host_cpu"; then
5488fda9279dSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5489fda9279dSmrg	# chokes on -Wl,-G. The following line is correct:
5490fda9279dSmrg	  shared_flag='-G'
5491fda9279dSmrg	else
549216ee1e9aSmrg	  if test yes = "$aix_use_runtimelinking"; then
549316ee1e9aSmrg	    shared_flag='$wl-G'
5494fda9279dSmrg	  else
549516ee1e9aSmrg	    shared_flag='$wl-bM:SRE'
5496fda9279dSmrg	  fi
549716ee1e9aSmrg	  shared_flag_aix='$wl-bM:SRE'
549816ee1e9aSmrg	  shared_flag_svr4='$wl-G'
5499fda9279dSmrg	fi
5500fda9279dSmrg      fi
5501fda9279dSmrg
550216ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5503fda9279dSmrg      # It seems that -bexpall does not export symbols beginning with
5504fda9279dSmrg      # underscore (_), so it is better to generate a list of symbols to export.
5505fda9279dSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
550616ee1e9aSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5507fda9279dSmrg	# Warning - without using the other runtime loading flags (-brtl),
5508fda9279dSmrg	# -berok will link without error, but may produce a broken library.
5509fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5510fda9279dSmrg        # Determine the default libpath from the value encoded in an
5511fda9279dSmrg        # empty executable.
5512fda9279dSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
551316ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
551416ee1e9aSmrg        _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
5515fda9279dSmrg      else
551616ee1e9aSmrg	if test ia64 = "$host_cpu"; then
551716ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5518fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
551916ee1e9aSmrg	  _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"
5520fda9279dSmrg	else
5521fda9279dSmrg	 # Determine the default libpath from the value encoded in an
5522fda9279dSmrg	 # empty executable.
5523fda9279dSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
552416ee1e9aSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5525fda9279dSmrg	  # Warning - without using the other run time loading flags,
5526fda9279dSmrg	  # -berok will link without error, but may produce a broken library.
552716ee1e9aSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
552816ee1e9aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
552916ee1e9aSmrg	  if test yes = "$with_gnu_ld"; then
5530fda9279dSmrg	    # We only use this code for GNU lds that support --whole-archive.
553116ee1e9aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5532fda9279dSmrg	  else
5533fda9279dSmrg	    # Exported symbols can be pulled into shared objects from archives
5534fda9279dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5535fda9279dSmrg	  fi
5536fda9279dSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
553716ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
553816ee1e9aSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
553916ee1e9aSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
554016ee1e9aSmrg	  if test svr4 != "$with_aix_soname"; then
554116ee1e9aSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
554216ee1e9aSmrg	    _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'
554316ee1e9aSmrg	  fi
554416ee1e9aSmrg	  if test aix != "$with_aix_soname"; then
554516ee1e9aSmrg	    _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'
554616ee1e9aSmrg	  else
554716ee1e9aSmrg	    # used by -dlpreopen to get the symbols
554816ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
554916ee1e9aSmrg	  fi
555016ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5551fda9279dSmrg	fi
5552fda9279dSmrg      fi
5553fda9279dSmrg      ;;
5554fda9279dSmrg
5555fda9279dSmrg    amigaos*)
5556fda9279dSmrg      case $host_cpu in
5557fda9279dSmrg      powerpc)
5558fda9279dSmrg            # see comment about AmigaOS4 .so support
555916ee1e9aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5560fda9279dSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5561fda9279dSmrg        ;;
5562fda9279dSmrg      m68k)
5563fda9279dSmrg            _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)'
5564fda9279dSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5565fda9279dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5566fda9279dSmrg        ;;
5567fda9279dSmrg      esac
5568fda9279dSmrg      ;;
5569fda9279dSmrg
5570fda9279dSmrg    bsdi[[45]]*)
5571fda9279dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5572fda9279dSmrg      ;;
5573fda9279dSmrg
5574fda9279dSmrg    cygwin* | mingw* | pw32* | cegcc*)
5575fda9279dSmrg      # When not using gcc, we currently assume that we are using
5576fda9279dSmrg      # Microsoft Visual C++.
5577fda9279dSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5578fda9279dSmrg      # no search path for DLLs.
5579fda9279dSmrg      case $cc_basename in
5580fda9279dSmrg      cl*)
5581fda9279dSmrg	# Native MSVC
5582fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5583fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5584fda9279dSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5585fda9279dSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
5586fda9279dSmrg	# Tell ltmain to make .lib files, not .a files.
5587fda9279dSmrg	libext=lib
5588fda9279dSmrg	# Tell ltmain to make .dll files, not .so files.
558916ee1e9aSmrg	shrext_cmds=.dll
5590fda9279dSmrg	# FIXME: Setting linknames here is a bad hack.
559116ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
559216ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
559316ee1e9aSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
559416ee1e9aSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
559516ee1e9aSmrg          else
559616ee1e9aSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
559716ee1e9aSmrg          fi~
559816ee1e9aSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
559916ee1e9aSmrg          linknames='
5600fda9279dSmrg	# The linker will not automatically build a static lib if we build a DLL.
5601fda9279dSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5602fda9279dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5603fda9279dSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5604fda9279dSmrg	_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'
5605fda9279dSmrg	# Don't use ranlib
5606fda9279dSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5607fda9279dSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
560816ee1e9aSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
560916ee1e9aSmrg          case $lt_outputfile in
561016ee1e9aSmrg            *.exe|*.EXE) ;;
561116ee1e9aSmrg            *)
561216ee1e9aSmrg              lt_outputfile=$lt_outputfile.exe
561316ee1e9aSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
561416ee1e9aSmrg              ;;
561516ee1e9aSmrg          esac~
561616ee1e9aSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
561716ee1e9aSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
561816ee1e9aSmrg            $RM "$lt_outputfile.manifest";
561916ee1e9aSmrg          fi'
5620fda9279dSmrg	;;
5621fda9279dSmrg      *)
5622fda9279dSmrg	# Assume MSVC wrapper
5623fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5624fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5625fda9279dSmrg	# Tell ltmain to make .lib files, not .a files.
5626fda9279dSmrg	libext=lib
5627fda9279dSmrg	# Tell ltmain to make .dll files, not .so files.
562816ee1e9aSmrg	shrext_cmds=.dll
5629fda9279dSmrg	# FIXME: Setting linknames here is a bad hack.
5630fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5631fda9279dSmrg	# The linker will automatically build a .lib file if we build a DLL.
5632fda9279dSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5633fda9279dSmrg	# FIXME: Should let the user specify the lib program.
5634fda9279dSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5635fda9279dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5636fda9279dSmrg	;;
5637fda9279dSmrg      esac
5638fda9279dSmrg      ;;
5639fda9279dSmrg
5640fda9279dSmrg    darwin* | rhapsody*)
5641fda9279dSmrg      _LT_DARWIN_LINKER_FEATURES($1)
5642fda9279dSmrg      ;;
5643fda9279dSmrg
5644fda9279dSmrg    dgux*)
5645fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5646fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5647fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5648fda9279dSmrg      ;;
5649fda9279dSmrg
5650fda9279dSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5651fda9279dSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5652fda9279dSmrg    # does not break anything, and helps significantly (at the cost of a little
5653fda9279dSmrg    # extra space).
5654fda9279dSmrg    freebsd2.2*)
5655fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5656fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5657fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5658fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5659fda9279dSmrg      ;;
5660fda9279dSmrg
5661fda9279dSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5662fda9279dSmrg    freebsd2.*)
5663fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5664fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5665fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5666fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5667fda9279dSmrg      ;;
5668fda9279dSmrg
5669fda9279dSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5670fda9279dSmrg    freebsd* | dragonfly*)
5671fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5672fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5673fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5674fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5675fda9279dSmrg      ;;
5676fda9279dSmrg
5677fda9279dSmrg    hpux9*)
567816ee1e9aSmrg      if test yes = "$GCC"; then
567916ee1e9aSmrg	_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'
5680fda9279dSmrg      else
568116ee1e9aSmrg	_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'
5682fda9279dSmrg      fi
568316ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5684fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5685fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5686fda9279dSmrg
5687fda9279dSmrg      # hardcode_minus_L: Not really in the search PATH,
5688fda9279dSmrg      # but as the default location of the library.
5689fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
569016ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5691fda9279dSmrg      ;;
5692fda9279dSmrg
5693fda9279dSmrg    hpux10*)
569416ee1e9aSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
569516ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5696fda9279dSmrg      else
5697fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5698fda9279dSmrg      fi
569916ee1e9aSmrg      if test no = "$with_gnu_ld"; then
570016ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5701fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5702fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5703fda9279dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
570416ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5705fda9279dSmrg	# hardcode_minus_L: Not really in the search PATH,
5706fda9279dSmrg	# but as the default location of the library.
5707fda9279dSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5708fda9279dSmrg      fi
5709fda9279dSmrg      ;;
5710fda9279dSmrg
5711fda9279dSmrg    hpux11*)
571216ee1e9aSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5713fda9279dSmrg	case $host_cpu in
5714fda9279dSmrg	hppa*64*)
571516ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5716fda9279dSmrg	  ;;
5717fda9279dSmrg	ia64*)
571816ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5719fda9279dSmrg	  ;;
5720fda9279dSmrg	*)
572116ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5722fda9279dSmrg	  ;;
5723fda9279dSmrg	esac
5724fda9279dSmrg      else
5725fda9279dSmrg	case $host_cpu in
5726fda9279dSmrg	hppa*64*)
572716ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5728fda9279dSmrg	  ;;
5729fda9279dSmrg	ia64*)
573016ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5731fda9279dSmrg	  ;;
5732fda9279dSmrg	*)
5733fda9279dSmrg	m4_if($1, [], [
5734fda9279dSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
5735fda9279dSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5736fda9279dSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
5737fda9279dSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
573816ee1e9aSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5739fda9279dSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
574016ee1e9aSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5741fda9279dSmrg	  ;;
5742fda9279dSmrg	esac
5743fda9279dSmrg      fi
574416ee1e9aSmrg      if test no = "$with_gnu_ld"; then
574516ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5746fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5747fda9279dSmrg
5748fda9279dSmrg	case $host_cpu in
5749fda9279dSmrg	hppa*64*|ia64*)
5750fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5751fda9279dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5752fda9279dSmrg	  ;;
5753fda9279dSmrg	*)
5754fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5755fda9279dSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
575616ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5757fda9279dSmrg
5758fda9279dSmrg	  # hardcode_minus_L: Not really in the search PATH,
5759fda9279dSmrg	  # but as the default location of the library.
5760fda9279dSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5761fda9279dSmrg	  ;;
5762fda9279dSmrg	esac
5763fda9279dSmrg      fi
5764fda9279dSmrg      ;;
5765fda9279dSmrg
5766fda9279dSmrg    irix5* | irix6* | nonstopux*)
576716ee1e9aSmrg      if test yes = "$GCC"; then
576816ee1e9aSmrg	_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'
5769fda9279dSmrg	# Try to use the -exported_symbol ld option, if it does not
5770fda9279dSmrg	# work, assume that -exports_file does not work either and
5771fda9279dSmrg	# implicitly export all symbols.
5772fda9279dSmrg	# This should be the same for all languages, so no per-tag cache variable.
5773fda9279dSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5774fda9279dSmrg	  [lt_cv_irix_exported_symbol],
577516ee1e9aSmrg	  [save_LDFLAGS=$LDFLAGS
577616ee1e9aSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5777fda9279dSmrg	   AC_LINK_IFELSE(
5778fda9279dSmrg	     [AC_LANG_SOURCE(
5779fda9279dSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5780fda9279dSmrg			      [C++], [[int foo (void) { return 0; }]],
5781fda9279dSmrg			      [Fortran 77], [[
5782fda9279dSmrg      subroutine foo
5783fda9279dSmrg      end]],
5784fda9279dSmrg			      [Fortran], [[
5785fda9279dSmrg      subroutine foo
5786fda9279dSmrg      end]])])],
5787fda9279dSmrg	      [lt_cv_irix_exported_symbol=yes],
5788fda9279dSmrg	      [lt_cv_irix_exported_symbol=no])
578916ee1e9aSmrg           LDFLAGS=$save_LDFLAGS])
579016ee1e9aSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
579116ee1e9aSmrg          _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'
5792fda9279dSmrg	fi
5793fda9279dSmrg      else
579416ee1e9aSmrg	_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'
579516ee1e9aSmrg	_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'
5796fda9279dSmrg      fi
5797fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
579816ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5799fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5800fda9279dSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5801fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5802fda9279dSmrg      ;;
5803fda9279dSmrg
580416ee1e9aSmrg    linux*)
580516ee1e9aSmrg      case $cc_basename in
580616ee1e9aSmrg      tcc*)
580716ee1e9aSmrg	# Fabrice Bellard et al's Tiny C Compiler
580816ee1e9aSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
580916ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
581016ee1e9aSmrg	;;
581116ee1e9aSmrg      esac
581216ee1e9aSmrg      ;;
581316ee1e9aSmrg
581416ee1e9aSmrg    netbsd*)
5815fda9279dSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5816fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5817fda9279dSmrg      else
5818fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5819fda9279dSmrg      fi
5820fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5821fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5822fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5823fda9279dSmrg      ;;
5824fda9279dSmrg
5825fda9279dSmrg    newsos6)
5826fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5827fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
582816ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5829fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5830fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5831fda9279dSmrg      ;;
5832fda9279dSmrg
5833fda9279dSmrg    *nto* | *qnx*)
5834fda9279dSmrg      ;;
5835fda9279dSmrg
583616ee1e9aSmrg    openbsd* | bitrig*)
5837fda9279dSmrg      if test -f /usr/libexec/ld.so; then
5838fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5839fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5840fda9279dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
584116ee1e9aSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5842fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
584316ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
584416ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
584516ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5846fda9279dSmrg	else
584716ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
584816ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5849fda9279dSmrg	fi
5850fda9279dSmrg      else
5851fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5852fda9279dSmrg      fi
5853fda9279dSmrg      ;;
5854fda9279dSmrg
5855fda9279dSmrg    os2*)
5856fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5857fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5858fda9279dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
585916ee1e9aSmrg      shrext_cmds=.dll
586016ee1e9aSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
586116ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
586216ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
586316ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
586416ee1e9aSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
586516ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
586616ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
586716ee1e9aSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
586816ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
586916ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
587016ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
587116ee1e9aSmrg	prefix_cmds="$SED"~
587216ee1e9aSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
587316ee1e9aSmrg	  prefix_cmds="$prefix_cmds -e 1d";
587416ee1e9aSmrg	fi~
587516ee1e9aSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
587616ee1e9aSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
587716ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
587816ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
587916ee1e9aSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
588016ee1e9aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5881fda9279dSmrg      ;;
5882fda9279dSmrg
5883fda9279dSmrg    osf3*)
588416ee1e9aSmrg      if test yes = "$GCC"; then
588516ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
588616ee1e9aSmrg	_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'
5887fda9279dSmrg      else
5888fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
588916ee1e9aSmrg	_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'
5890fda9279dSmrg      fi
5891fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
589216ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5893fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5894fda9279dSmrg      ;;
5895fda9279dSmrg
5896fda9279dSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
589716ee1e9aSmrg      if test yes = "$GCC"; then
589816ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
589916ee1e9aSmrg	_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'
590016ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5901fda9279dSmrg      else
5902fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
590316ee1e9aSmrg	_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'
5904fda9279dSmrg	_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~
590516ee1e9aSmrg          $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'
5906fda9279dSmrg
5907fda9279dSmrg	# Both c and cxx compiler support -rpath directly
5908fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5909fda9279dSmrg      fi
5910fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5911fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5912fda9279dSmrg      ;;
5913fda9279dSmrg
5914fda9279dSmrg    solaris*)
5915fda9279dSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
591616ee1e9aSmrg      if test yes = "$GCC"; then
591716ee1e9aSmrg	wlarc='$wl'
591816ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5919fda9279dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
592016ee1e9aSmrg          $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'
5921fda9279dSmrg      else
5922fda9279dSmrg	case `$CC -V 2>&1` in
5923fda9279dSmrg	*"Compilers 5.0"*)
5924fda9279dSmrg	  wlarc=''
592516ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5926fda9279dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
592716ee1e9aSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5928fda9279dSmrg	  ;;
5929fda9279dSmrg	*)
593016ee1e9aSmrg	  wlarc='$wl'
593116ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5932fda9279dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
593316ee1e9aSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5934fda9279dSmrg	  ;;
5935fda9279dSmrg	esac
5936fda9279dSmrg      fi
5937fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5938fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5939fda9279dSmrg      case $host_os in
5940fda9279dSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5941fda9279dSmrg      *)
5942fda9279dSmrg	# The compiler driver will combine and reorder linker options,
594316ee1e9aSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5944fda9279dSmrg	# but is careful enough not to reorder.
5945fda9279dSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
594616ee1e9aSmrg	if test yes = "$GCC"; then
594716ee1e9aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5948fda9279dSmrg	else
5949fda9279dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5950fda9279dSmrg	fi
5951fda9279dSmrg	;;
5952fda9279dSmrg      esac
5953fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5954fda9279dSmrg      ;;
5955fda9279dSmrg
5956fda9279dSmrg    sunos4*)
595716ee1e9aSmrg      if test sequent = "$host_vendor"; then
5958fda9279dSmrg	# Use $CC to link under sequent, because it throws in some extra .o
5959fda9279dSmrg	# files that make .init and .fini sections work.
596016ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5961fda9279dSmrg      else
5962fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5963fda9279dSmrg      fi
5964fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5965fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5966fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5967fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5968fda9279dSmrg      ;;
5969fda9279dSmrg
5970fda9279dSmrg    sysv4)
5971fda9279dSmrg      case $host_vendor in
5972fda9279dSmrg	sni)
5973fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5974fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5975fda9279dSmrg	;;
5976fda9279dSmrg	siemens)
5977fda9279dSmrg	  ## LD is ld it makes a PLAMLIB
5978fda9279dSmrg	  ## CC just makes a GrossModule.
5979fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5980fda9279dSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5981fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5982fda9279dSmrg        ;;
5983fda9279dSmrg	motorola)
5984fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5985fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5986fda9279dSmrg	;;
5987fda9279dSmrg      esac
5988fda9279dSmrg      runpath_var='LD_RUN_PATH'
5989fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5990fda9279dSmrg      ;;
5991fda9279dSmrg
5992fda9279dSmrg    sysv4.3*)
5993fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5994fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5995fda9279dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5996fda9279dSmrg      ;;
5997fda9279dSmrg
5998fda9279dSmrg    sysv4*MP*)
5999fda9279dSmrg      if test -d /usr/nec; then
6000fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6001fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6002fda9279dSmrg	runpath_var=LD_RUN_PATH
6003fda9279dSmrg	hardcode_runpath_var=yes
6004fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6005fda9279dSmrg      fi
6006fda9279dSmrg      ;;
6007fda9279dSmrg
6008fda9279dSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
600916ee1e9aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6010fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6011fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6012fda9279dSmrg      runpath_var='LD_RUN_PATH'
6013fda9279dSmrg
601416ee1e9aSmrg      if test yes = "$GCC"; then
601516ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601616ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6017fda9279dSmrg      else
601816ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601916ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6020fda9279dSmrg      fi
6021fda9279dSmrg      ;;
6022fda9279dSmrg
6023fda9279dSmrg    sysv5* | sco3.2v5* | sco5v6*)
602416ee1e9aSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
6025fda9279dSmrg      # link with -lc, and that would cause any symbols used from libc to
6026fda9279dSmrg      # always be unresolved, which means just about no library would
6027fda9279dSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
6028fda9279dSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
6029fda9279dSmrg      # as -z defs.
603016ee1e9aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
603116ee1e9aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6032fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6033fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
603416ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6035fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6036fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
603716ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6038fda9279dSmrg      runpath_var='LD_RUN_PATH'
6039fda9279dSmrg
604016ee1e9aSmrg      if test yes = "$GCC"; then
604116ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604216ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6043fda9279dSmrg      else
604416ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604516ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6046fda9279dSmrg      fi
6047fda9279dSmrg      ;;
6048fda9279dSmrg
6049fda9279dSmrg    uts4*)
6050fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6051fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6052fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6053fda9279dSmrg      ;;
6054fda9279dSmrg
6055fda9279dSmrg    *)
6056fda9279dSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
6057fda9279dSmrg      ;;
6058fda9279dSmrg    esac
6059fda9279dSmrg
606016ee1e9aSmrg    if test sni = "$host_vendor"; then
6061fda9279dSmrg      case $host in
6062fda9279dSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
606316ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6064fda9279dSmrg	;;
6065fda9279dSmrg      esac
6066fda9279dSmrg    fi
6067fda9279dSmrg  fi
6068fda9279dSmrg])
6069fda9279dSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
607016ee1e9aSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6071fda9279dSmrg
6072fda9279dSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6073fda9279dSmrg
6074fda9279dSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6075fda9279dSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6076fda9279dSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
6077fda9279dSmrg    [The commands to extract the exported symbol list from a shared archive])
6078fda9279dSmrg
6079fda9279dSmrg#
6080fda9279dSmrg# Do we need to explicitly link libc?
6081fda9279dSmrg#
6082fda9279dSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6083fda9279dSmrgx|xyes)
6084fda9279dSmrg  # Assume -lc should be added
6085fda9279dSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6086fda9279dSmrg
608716ee1e9aSmrg  if test yes,yes = "$GCC,$enable_shared"; then
6088fda9279dSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
6089fda9279dSmrg    *'~'*)
6090fda9279dSmrg      # FIXME: we may have to deal with multi-command sequences.
6091fda9279dSmrg      ;;
6092fda9279dSmrg    '$CC '*)
6093fda9279dSmrg      # Test whether the compiler implicitly links with -lc since on some
6094fda9279dSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6095fda9279dSmrg      # to ld, don't add -lc before -lgcc.
6096fda9279dSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6097fda9279dSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6098fda9279dSmrg	[$RM conftest*
6099fda9279dSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6100fda9279dSmrg
6101fda9279dSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6102fda9279dSmrg	  soname=conftest
6103fda9279dSmrg	  lib=conftest
6104fda9279dSmrg	  libobjs=conftest.$ac_objext
6105fda9279dSmrg	  deplibs=
6106fda9279dSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6107fda9279dSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6108fda9279dSmrg	  compiler_flags=-v
6109fda9279dSmrg	  linker_flags=-v
6110fda9279dSmrg	  verstring=
6111fda9279dSmrg	  output_objdir=.
6112fda9279dSmrg	  libname=conftest
6113fda9279dSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6114fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6115fda9279dSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6116fda9279dSmrg	  then
6117fda9279dSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6118fda9279dSmrg	  else
6119fda9279dSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6120fda9279dSmrg	  fi
6121fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6122fda9279dSmrg	else
6123fda9279dSmrg	  cat conftest.err 1>&5
6124fda9279dSmrg	fi
6125fda9279dSmrg	$RM conftest*
6126fda9279dSmrg	])
6127fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6128fda9279dSmrg      ;;
6129fda9279dSmrg    esac
6130fda9279dSmrg  fi
6131fda9279dSmrg  ;;
6132fda9279dSmrgesac
6133fda9279dSmrg
6134fda9279dSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6135fda9279dSmrg    [Whether or not to add -lc for building shared libraries])
6136fda9279dSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6137fda9279dSmrg    [enable_shared_with_static_runtimes], [0],
6138fda9279dSmrg    [Whether or not to disallow shared libs when runtime libs are static])
6139fda9279dSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6140fda9279dSmrg    [Compiler flag to allow reflexive dlopens])
6141fda9279dSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6142fda9279dSmrg    [Compiler flag to generate shared objects directly from archives])
6143fda9279dSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
6144fda9279dSmrg    [Whether the compiler copes with passing no objects directly])
6145fda9279dSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6146fda9279dSmrg    [Create an old-style archive from a shared archive])
6147fda9279dSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6148fda9279dSmrg    [Create a temporary old-style archive to link instead of a shared archive])
6149fda9279dSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6150fda9279dSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6151fda9279dSmrg_LT_TAGDECL([], [module_cmds], [2],
6152fda9279dSmrg    [Commands used to build a loadable module if different from building
6153fda9279dSmrg    a shared archive.])
6154fda9279dSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6155fda9279dSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
6156fda9279dSmrg    [Whether we are building with GNU ld or not])
6157fda9279dSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6158fda9279dSmrg    [Flag that allows shared libraries with undefined symbols to be built])
6159fda9279dSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
6160fda9279dSmrg    [Flag that enforces no undefined symbols])
6161fda9279dSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6162fda9279dSmrg    [Flag to hardcode $libdir into a binary during linking.
6163fda9279dSmrg    This must work even if $libdir does not exist])
6164fda9279dSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6165fda9279dSmrg    [Whether we need a single "-rpath" flag with a separated argument])
6166fda9279dSmrg_LT_TAGDECL([], [hardcode_direct], [0],
616716ee1e9aSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6168fda9279dSmrg    DIR into the resulting binary])
6169fda9279dSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
617016ee1e9aSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6171fda9279dSmrg    DIR into the resulting binary and the resulting library dependency is
617216ee1e9aSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
6173fda9279dSmrg    library is relocated])
6174fda9279dSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6175fda9279dSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6176fda9279dSmrg    into the resulting binary])
6177fda9279dSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6178fda9279dSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6179fda9279dSmrg    into the resulting binary])
6180fda9279dSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
6181fda9279dSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6182fda9279dSmrg    into the library and all subsequent libraries and executables linked
6183fda9279dSmrg    against it])
6184fda9279dSmrg_LT_TAGDECL([], [inherit_rpath], [0],
6185fda9279dSmrg    [Set to yes if linker adds runtime paths of dependent libraries
6186fda9279dSmrg    to runtime path list])
6187fda9279dSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
6188fda9279dSmrg    [Whether libtool must link a program against all its dependency libraries])
6189fda9279dSmrg_LT_TAGDECL([], [always_export_symbols], [0],
6190fda9279dSmrg    [Set to "yes" if exported symbols are required])
6191fda9279dSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6192fda9279dSmrg    [The commands to list exported symbols])
6193fda9279dSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
6194fda9279dSmrg    [Symbols that should not be listed in the preloaded symbols])
6195fda9279dSmrg_LT_TAGDECL([], [include_expsyms], [1],
6196fda9279dSmrg    [Symbols that must always be exported])
6197fda9279dSmrg_LT_TAGDECL([], [prelink_cmds], [2],
6198fda9279dSmrg    [Commands necessary for linking programs (against libraries) with templates])
6199fda9279dSmrg_LT_TAGDECL([], [postlink_cmds], [2],
6200fda9279dSmrg    [Commands necessary for finishing linking programs])
6201fda9279dSmrg_LT_TAGDECL([], [file_list_spec], [1],
6202fda9279dSmrg    [Specify filename containing input files])
6203fda9279dSmrgdnl FIXME: Not yet implemented
6204fda9279dSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6205fda9279dSmrgdnl    [Compiler flag to generate thread safe objects])
6206fda9279dSmrg])# _LT_LINKER_SHLIBS
6207fda9279dSmrg
6208fda9279dSmrg
6209fda9279dSmrg# _LT_LANG_C_CONFIG([TAG])
6210fda9279dSmrg# ------------------------
6211fda9279dSmrg# Ensure that the configuration variables for a C compiler are suitably
6212fda9279dSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
621316ee1e9aSmrg# the compiler configuration to 'libtool'.
6214fda9279dSmrgm4_defun([_LT_LANG_C_CONFIG],
6215fda9279dSmrg[m4_require([_LT_DECL_EGREP])dnl
621616ee1e9aSmrglt_save_CC=$CC
6217fda9279dSmrgAC_LANG_PUSH(C)
6218fda9279dSmrg
6219fda9279dSmrg# Source file extension for C test sources.
6220fda9279dSmrgac_ext=c
6221fda9279dSmrg
6222fda9279dSmrg# Object file extension for compiled C test sources.
6223fda9279dSmrgobjext=o
6224fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
6225fda9279dSmrg
6226fda9279dSmrg# Code to be used in simple compile tests
6227fda9279dSmrglt_simple_compile_test_code="int some_variable = 0;"
6228fda9279dSmrg
6229fda9279dSmrg# Code to be used in simple link tests
6230fda9279dSmrglt_simple_link_test_code='int main(){return(0);}'
6231fda9279dSmrg
6232fda9279dSmrg_LT_TAG_COMPILER
6233fda9279dSmrg# Save the default compiler, since it gets overwritten when the other
6234fda9279dSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6235fda9279dSmrgcompiler_DEFAULT=$CC
6236fda9279dSmrg
6237fda9279dSmrg# save warnings/boilerplate of simple test code
6238fda9279dSmrg_LT_COMPILER_BOILERPLATE
6239fda9279dSmrg_LT_LINKER_BOILERPLATE
6240fda9279dSmrg
6241fda9279dSmrgif test -n "$compiler"; then
6242fda9279dSmrg  _LT_COMPILER_NO_RTTI($1)
6243fda9279dSmrg  _LT_COMPILER_PIC($1)
6244fda9279dSmrg  _LT_COMPILER_C_O($1)
6245fda9279dSmrg  _LT_COMPILER_FILE_LOCKS($1)
6246fda9279dSmrg  _LT_LINKER_SHLIBS($1)
6247fda9279dSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6248fda9279dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6249fda9279dSmrg  LT_SYS_DLOPEN_SELF
6250fda9279dSmrg  _LT_CMD_STRIPLIB
6251fda9279dSmrg
625216ee1e9aSmrg  # Report what library types will actually be built
6253fda9279dSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6254fda9279dSmrg  AC_MSG_RESULT([$can_build_shared])
6255fda9279dSmrg
6256fda9279dSmrg  AC_MSG_CHECKING([whether to build shared libraries])
625716ee1e9aSmrg  test no = "$can_build_shared" && enable_shared=no
6258fda9279dSmrg
6259fda9279dSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6260fda9279dSmrg  # are all built from PIC.
6261fda9279dSmrg  case $host_os in
6262fda9279dSmrg  aix3*)
626316ee1e9aSmrg    test yes = "$enable_shared" && enable_static=no
6264fda9279dSmrg    if test -n "$RANLIB"; then
6265fda9279dSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6266fda9279dSmrg      postinstall_cmds='$RANLIB $lib'
6267fda9279dSmrg    fi
6268fda9279dSmrg    ;;
6269fda9279dSmrg
6270fda9279dSmrg  aix[[4-9]]*)
627116ee1e9aSmrg    if test ia64 != "$host_cpu"; then
627216ee1e9aSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
627316ee1e9aSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
627416ee1e9aSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
627516ee1e9aSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
627616ee1e9aSmrg      esac
6277fda9279dSmrg    fi
6278fda9279dSmrg    ;;
6279fda9279dSmrg  esac
6280fda9279dSmrg  AC_MSG_RESULT([$enable_shared])
6281fda9279dSmrg
6282fda9279dSmrg  AC_MSG_CHECKING([whether to build static libraries])
6283fda9279dSmrg  # Make sure either enable_shared or enable_static is yes.
628416ee1e9aSmrg  test yes = "$enable_shared" || enable_static=yes
6285fda9279dSmrg  AC_MSG_RESULT([$enable_static])
6286fda9279dSmrg
6287fda9279dSmrg  _LT_CONFIG($1)
6288fda9279dSmrgfi
6289fda9279dSmrgAC_LANG_POP
629016ee1e9aSmrgCC=$lt_save_CC
6291fda9279dSmrg])# _LT_LANG_C_CONFIG
6292fda9279dSmrg
6293fda9279dSmrg
6294fda9279dSmrg# _LT_LANG_CXX_CONFIG([TAG])
6295fda9279dSmrg# --------------------------
6296fda9279dSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6297fda9279dSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
629816ee1e9aSmrg# the compiler configuration to 'libtool'.
6299fda9279dSmrgm4_defun([_LT_LANG_CXX_CONFIG],
6300fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6301fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
6302fda9279dSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
630316ee1e9aSmrgif test -n "$CXX" && ( test no != "$CXX" &&
630416ee1e9aSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
630516ee1e9aSmrg    (test g++ != "$CXX"))); then
6306fda9279dSmrg  AC_PROG_CXXCPP
6307fda9279dSmrgelse
6308fda9279dSmrg  _lt_caught_CXX_error=yes
6309fda9279dSmrgfi
6310fda9279dSmrg
6311fda9279dSmrgAC_LANG_PUSH(C++)
6312fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6313fda9279dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6314fda9279dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6315fda9279dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6316fda9279dSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6317fda9279dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6318fda9279dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6319fda9279dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6320fda9279dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6321fda9279dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6322fda9279dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6323fda9279dSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6324fda9279dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6325fda9279dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6326fda9279dSmrg_LT_TAGVAR(module_cmds, $1)=
6327fda9279dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6328fda9279dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6329fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6330fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6331fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6332fda9279dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6333fda9279dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6334fda9279dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6335fda9279dSmrg
6336fda9279dSmrg# Source file extension for C++ test sources.
6337fda9279dSmrgac_ext=cpp
6338fda9279dSmrg
6339fda9279dSmrg# Object file extension for compiled C++ test sources.
6340fda9279dSmrgobjext=o
6341fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
6342fda9279dSmrg
6343fda9279dSmrg# No sense in running all these tests if we already determined that
6344fda9279dSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6345fda9279dSmrg# are currently assumed to apply to all compilers on this platform,
6346fda9279dSmrg# and will be corrupted by setting them based on a non-working compiler.
634716ee1e9aSmrgif test yes != "$_lt_caught_CXX_error"; then
6348fda9279dSmrg  # Code to be used in simple compile tests
6349fda9279dSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6350fda9279dSmrg
6351fda9279dSmrg  # Code to be used in simple link tests
6352fda9279dSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6353fda9279dSmrg
6354fda9279dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6355fda9279dSmrg  _LT_TAG_COMPILER
6356fda9279dSmrg
6357fda9279dSmrg  # save warnings/boilerplate of simple test code
6358fda9279dSmrg  _LT_COMPILER_BOILERPLATE
6359fda9279dSmrg  _LT_LINKER_BOILERPLATE
6360fda9279dSmrg
6361fda9279dSmrg  # Allow CC to be a program name with arguments.
6362fda9279dSmrg  lt_save_CC=$CC
6363fda9279dSmrg  lt_save_CFLAGS=$CFLAGS
6364fda9279dSmrg  lt_save_LD=$LD
6365fda9279dSmrg  lt_save_GCC=$GCC
6366fda9279dSmrg  GCC=$GXX
6367fda9279dSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6368fda9279dSmrg  lt_save_path_LD=$lt_cv_path_LD
6369fda9279dSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6370fda9279dSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6371fda9279dSmrg  else
6372fda9279dSmrg    $as_unset lt_cv_prog_gnu_ld
6373fda9279dSmrg  fi
6374fda9279dSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6375fda9279dSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6376fda9279dSmrg  else
6377fda9279dSmrg    $as_unset lt_cv_path_LD
6378fda9279dSmrg  fi
6379fda9279dSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6380fda9279dSmrg  CC=${CXX-"c++"}
6381fda9279dSmrg  CFLAGS=$CXXFLAGS
6382fda9279dSmrg  compiler=$CC
6383fda9279dSmrg  _LT_TAGVAR(compiler, $1)=$CC
6384fda9279dSmrg  _LT_CC_BASENAME([$compiler])
6385fda9279dSmrg
6386fda9279dSmrg  if test -n "$compiler"; then
6387fda9279dSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6388fda9279dSmrg    # no_builtin_flag separately
638916ee1e9aSmrg    if test yes = "$GXX"; then
6390fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6391fda9279dSmrg    else
6392fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6393fda9279dSmrg    fi
6394fda9279dSmrg
639516ee1e9aSmrg    if test yes = "$GXX"; then
6396fda9279dSmrg      # Set up default GNU C++ configuration
6397fda9279dSmrg
6398fda9279dSmrg      LT_PATH_LD
6399fda9279dSmrg
6400fda9279dSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6401fda9279dSmrg      # archiving commands below assume that GNU ld is being used.
640216ee1e9aSmrg      if test yes = "$with_gnu_ld"; then
640316ee1e9aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
640416ee1e9aSmrg        _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'
6405fda9279dSmrg
640616ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
640716ee1e9aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6408fda9279dSmrg
6409fda9279dSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6410fda9279dSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6411fda9279dSmrg        #     investigate it a little bit more. (MM)
641216ee1e9aSmrg        wlarc='$wl'
6413fda9279dSmrg
6414fda9279dSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6415fda9279dSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6416fda9279dSmrg	  $GREP 'no-whole-archive' > /dev/null; then
641716ee1e9aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6418fda9279dSmrg        else
6419fda9279dSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6420fda9279dSmrg        fi
6421fda9279dSmrg      else
6422fda9279dSmrg        with_gnu_ld=no
6423fda9279dSmrg        wlarc=
6424fda9279dSmrg
6425fda9279dSmrg        # A generic and very simple default shared library creation
6426fda9279dSmrg        # command for GNU C++ for the case where it uses the native
6427fda9279dSmrg        # linker, instead of GNU ld.  If possible, this setting should
6428fda9279dSmrg        # overridden to take advantage of the native linker features on
6429fda9279dSmrg        # the platform it is being used on.
6430fda9279dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6431fda9279dSmrg      fi
6432fda9279dSmrg
6433fda9279dSmrg      # Commands to make compiler produce verbose output that lists
6434fda9279dSmrg      # what "hidden" libraries, object files and flags are used when
6435fda9279dSmrg      # linking a shared library.
6436fda9279dSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6437fda9279dSmrg
6438fda9279dSmrg    else
6439fda9279dSmrg      GXX=no
6440fda9279dSmrg      with_gnu_ld=no
6441fda9279dSmrg      wlarc=
6442fda9279dSmrg    fi
6443fda9279dSmrg
6444fda9279dSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6445fda9279dSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6446fda9279dSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6447fda9279dSmrg    case $host_os in
6448fda9279dSmrg      aix3*)
6449fda9279dSmrg        # FIXME: insert proper C++ library support
6450fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6451fda9279dSmrg        ;;
6452fda9279dSmrg      aix[[4-9]]*)
645316ee1e9aSmrg        if test ia64 = "$host_cpu"; then
6454fda9279dSmrg          # On IA64, the linker does run time linking by default, so we don't
6455fda9279dSmrg          # have to do anything special.
6456fda9279dSmrg          aix_use_runtimelinking=no
6457fda9279dSmrg          exp_sym_flag='-Bexport'
645816ee1e9aSmrg          no_entry_flag=
6459fda9279dSmrg        else
6460fda9279dSmrg          aix_use_runtimelinking=no
6461fda9279dSmrg
6462fda9279dSmrg          # Test if we are trying to use run time linking or normal
6463fda9279dSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
646416ee1e9aSmrg          # have runtime linking enabled, and use it for executables.
646516ee1e9aSmrg          # For shared libraries, we enable/disable runtime linking
646616ee1e9aSmrg          # depending on the kind of the shared library created -
646716ee1e9aSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
646816ee1e9aSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
646916ee1e9aSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
647016ee1e9aSmrg          #            lib.a           static archive
647116ee1e9aSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
647216ee1e9aSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
647316ee1e9aSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
647416ee1e9aSmrg          #            lib.a(lib.so.V) shared, rtl:no
647516ee1e9aSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
647616ee1e9aSmrg          #            lib.a           static archive
6477fda9279dSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6478fda9279dSmrg	    for ld_flag in $LDFLAGS; do
6479fda9279dSmrg	      case $ld_flag in
6480fda9279dSmrg	      *-brtl*)
6481fda9279dSmrg	        aix_use_runtimelinking=yes
6482fda9279dSmrg	        break
6483fda9279dSmrg	        ;;
6484fda9279dSmrg	      esac
6485fda9279dSmrg	    done
648616ee1e9aSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
648716ee1e9aSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
648816ee1e9aSmrg	      # so we don't have lib.a shared libs to link our executables.
648916ee1e9aSmrg	      # We have to force runtime linking in this case.
649016ee1e9aSmrg	      aix_use_runtimelinking=yes
649116ee1e9aSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
649216ee1e9aSmrg	    fi
6493fda9279dSmrg	    ;;
6494fda9279dSmrg          esac
6495fda9279dSmrg
6496fda9279dSmrg          exp_sym_flag='-bexport'
6497fda9279dSmrg          no_entry_flag='-bnoentry'
6498fda9279dSmrg        fi
6499fda9279dSmrg
6500fda9279dSmrg        # When large executables or shared objects are built, AIX ld can
6501fda9279dSmrg        # have problems creating the table of contents.  If linking a library
6502fda9279dSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
6503fda9279dSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6504fda9279dSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6505fda9279dSmrg
6506fda9279dSmrg        _LT_TAGVAR(archive_cmds, $1)=''
6507fda9279dSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6508fda9279dSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6509fda9279dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6510fda9279dSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
651116ee1e9aSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
651216ee1e9aSmrg        case $with_aix_soname,$aix_use_runtimelinking in
651316ee1e9aSmrg        aix,*) ;;	# no import file
651416ee1e9aSmrg        svr4,* | *,yes) # use import file
651516ee1e9aSmrg          # The Import File defines what to hardcode.
651616ee1e9aSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
651716ee1e9aSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
651816ee1e9aSmrg          ;;
651916ee1e9aSmrg        esac
6520fda9279dSmrg
652116ee1e9aSmrg        if test yes = "$GXX"; then
6522fda9279dSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6523fda9279dSmrg          # We only want to do this on AIX 4.2 and lower, the check
6524fda9279dSmrg          # below for broken collect2 doesn't work under 4.3+
652516ee1e9aSmrg	  collect2name=`$CC -print-prog-name=collect2`
6526fda9279dSmrg	  if test -f "$collect2name" &&
6527fda9279dSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6528fda9279dSmrg	  then
6529fda9279dSmrg	    # We have reworked collect2
6530fda9279dSmrg	    :
6531fda9279dSmrg	  else
6532fda9279dSmrg	    # We have old collect2
6533fda9279dSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6534fda9279dSmrg	    # It fails to find uninstalled libraries when the uninstalled
6535fda9279dSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6536fda9279dSmrg	    # to unsupported forces relinking
6537fda9279dSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6538fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6539fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6540fda9279dSmrg	  fi
6541fda9279dSmrg          esac
6542fda9279dSmrg          shared_flag='-shared'
654316ee1e9aSmrg	  if test yes = "$aix_use_runtimelinking"; then
654416ee1e9aSmrg	    shared_flag=$shared_flag' $wl-G'
6545fda9279dSmrg	  fi
654616ee1e9aSmrg	  # Need to ensure runtime linking is disabled for the traditional
654716ee1e9aSmrg	  # shared library, or the linker may eventually find shared libraries
654816ee1e9aSmrg	  # /with/ Import File - we do not want to mix them.
654916ee1e9aSmrg	  shared_flag_aix='-shared'
655016ee1e9aSmrg	  shared_flag_svr4='-shared $wl-G'
6551fda9279dSmrg        else
6552fda9279dSmrg          # not using gcc
655316ee1e9aSmrg          if test ia64 = "$host_cpu"; then
6554fda9279dSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6555fda9279dSmrg	  # chokes on -Wl,-G. The following line is correct:
6556fda9279dSmrg	  shared_flag='-G'
6557fda9279dSmrg          else
655816ee1e9aSmrg	    if test yes = "$aix_use_runtimelinking"; then
655916ee1e9aSmrg	      shared_flag='$wl-G'
6560fda9279dSmrg	    else
656116ee1e9aSmrg	      shared_flag='$wl-bM:SRE'
6562fda9279dSmrg	    fi
656316ee1e9aSmrg	    shared_flag_aix='$wl-bM:SRE'
656416ee1e9aSmrg	    shared_flag_svr4='$wl-G'
6565fda9279dSmrg          fi
6566fda9279dSmrg        fi
6567fda9279dSmrg
656816ee1e9aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6569fda9279dSmrg        # It seems that -bexpall does not export symbols beginning with
6570fda9279dSmrg        # underscore (_), so it is better to generate a list of symbols to
6571fda9279dSmrg	# export.
6572fda9279dSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
657316ee1e9aSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6574fda9279dSmrg          # Warning - without using the other runtime loading flags (-brtl),
6575fda9279dSmrg          # -berok will link without error, but may produce a broken library.
657616ee1e9aSmrg          # The "-G" linker flag allows undefined symbols.
657716ee1e9aSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6578fda9279dSmrg          # Determine the default libpath from the value encoded in an empty
6579fda9279dSmrg          # executable.
6580fda9279dSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
658116ee1e9aSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6582fda9279dSmrg
658316ee1e9aSmrg          _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
6584fda9279dSmrg        else
658516ee1e9aSmrg          if test ia64 = "$host_cpu"; then
658616ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6587fda9279dSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
658816ee1e9aSmrg	    _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"
6589fda9279dSmrg          else
6590fda9279dSmrg	    # Determine the default libpath from the value encoded in an
6591fda9279dSmrg	    # empty executable.
6592fda9279dSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
659316ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6594fda9279dSmrg	    # Warning - without using the other run time loading flags,
6595fda9279dSmrg	    # -berok will link without error, but may produce a broken library.
659616ee1e9aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
659716ee1e9aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
659816ee1e9aSmrg	    if test yes = "$with_gnu_ld"; then
6599fda9279dSmrg	      # We only use this code for GNU lds that support --whole-archive.
660016ee1e9aSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6601fda9279dSmrg	    else
6602fda9279dSmrg	      # Exported symbols can be pulled into shared objects from archives
6603fda9279dSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6604fda9279dSmrg	    fi
6605fda9279dSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
660616ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
660716ee1e9aSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
660816ee1e9aSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
660916ee1e9aSmrg	    if test svr4 != "$with_aix_soname"; then
661016ee1e9aSmrg	      # This is similar to how AIX traditionally builds its shared
661116ee1e9aSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
661216ee1e9aSmrg	      _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'
661316ee1e9aSmrg	    fi
661416ee1e9aSmrg	    if test aix != "$with_aix_soname"; then
661516ee1e9aSmrg	      _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'
661616ee1e9aSmrg	    else
661716ee1e9aSmrg	      # used by -dlpreopen to get the symbols
661816ee1e9aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
661916ee1e9aSmrg	    fi
662016ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6621fda9279dSmrg          fi
6622fda9279dSmrg        fi
6623fda9279dSmrg        ;;
6624fda9279dSmrg
6625fda9279dSmrg      beos*)
6626fda9279dSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6627fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6628fda9279dSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6629fda9279dSmrg	  # support --undefined.  This deserves some investigation.  FIXME
663016ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6631fda9279dSmrg	else
6632fda9279dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6633fda9279dSmrg	fi
6634fda9279dSmrg	;;
6635fda9279dSmrg
6636fda9279dSmrg      chorus*)
6637fda9279dSmrg        case $cc_basename in
6638fda9279dSmrg          *)
6639fda9279dSmrg	  # FIXME: insert proper C++ library support
6640fda9279dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6641fda9279dSmrg	  ;;
6642fda9279dSmrg        esac
6643fda9279dSmrg        ;;
6644fda9279dSmrg
6645fda9279dSmrg      cygwin* | mingw* | pw32* | cegcc*)
6646fda9279dSmrg	case $GXX,$cc_basename in
6647fda9279dSmrg	,cl* | no,cl*)
6648fda9279dSmrg	  # Native MSVC
6649fda9279dSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6650fda9279dSmrg	  # no search path for DLLs.
6651fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6652fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6653fda9279dSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6654fda9279dSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6655fda9279dSmrg	  # Tell ltmain to make .lib files, not .a files.
6656fda9279dSmrg	  libext=lib
6657fda9279dSmrg	  # Tell ltmain to make .dll files, not .so files.
665816ee1e9aSmrg	  shrext_cmds=.dll
6659fda9279dSmrg	  # FIXME: Setting linknames here is a bad hack.
666016ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
666116ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
666216ee1e9aSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
666316ee1e9aSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
666416ee1e9aSmrg            else
666516ee1e9aSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
666616ee1e9aSmrg            fi~
666716ee1e9aSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
666816ee1e9aSmrg            linknames='
6669fda9279dSmrg	  # The linker will not automatically build a static lib if we build a DLL.
6670fda9279dSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6671fda9279dSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6672fda9279dSmrg	  # Don't use ranlib
6673fda9279dSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6674fda9279dSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
667516ee1e9aSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
667616ee1e9aSmrg            case $lt_outputfile in
667716ee1e9aSmrg              *.exe|*.EXE) ;;
667816ee1e9aSmrg              *)
667916ee1e9aSmrg                lt_outputfile=$lt_outputfile.exe
668016ee1e9aSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
668116ee1e9aSmrg                ;;
668216ee1e9aSmrg            esac~
668316ee1e9aSmrg            func_to_tool_file "$lt_outputfile"~
668416ee1e9aSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
668516ee1e9aSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
668616ee1e9aSmrg              $RM "$lt_outputfile.manifest";
668716ee1e9aSmrg            fi'
6688fda9279dSmrg	  ;;
6689fda9279dSmrg	*)
6690fda9279dSmrg	  # g++
6691fda9279dSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6692fda9279dSmrg	  # as there is no search path for DLLs.
6693fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
669416ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6695fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6696fda9279dSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6697fda9279dSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6698fda9279dSmrg
6699fda9279dSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
670016ee1e9aSmrg	    _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'
670116ee1e9aSmrg	    # If the export-symbols file already is a .def file, use it as
670216ee1e9aSmrg	    # is; otherwise, prepend EXPORTS...
670316ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
670416ee1e9aSmrg              cp $export_symbols $output_objdir/$soname.def;
670516ee1e9aSmrg            else
670616ee1e9aSmrg              echo EXPORTS > $output_objdir/$soname.def;
670716ee1e9aSmrg              cat $export_symbols >> $output_objdir/$soname.def;
670816ee1e9aSmrg            fi~
670916ee1e9aSmrg            $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'
6710fda9279dSmrg	  else
6711fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6712fda9279dSmrg	  fi
6713fda9279dSmrg	  ;;
6714fda9279dSmrg	esac
6715fda9279dSmrg	;;
6716fda9279dSmrg      darwin* | rhapsody*)
6717fda9279dSmrg        _LT_DARWIN_LINKER_FEATURES($1)
6718fda9279dSmrg	;;
6719fda9279dSmrg
672016ee1e9aSmrg      os2*)
672116ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
672216ee1e9aSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
672316ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
672416ee1e9aSmrg	shrext_cmds=.dll
672516ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
672616ee1e9aSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
672716ee1e9aSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
672816ee1e9aSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
672916ee1e9aSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
673016ee1e9aSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
673116ee1e9aSmrg	  emximp -o $lib $output_objdir/$libname.def'
673216ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
673316ee1e9aSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
673416ee1e9aSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
673516ee1e9aSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
673616ee1e9aSmrg	  prefix_cmds="$SED"~
673716ee1e9aSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
673816ee1e9aSmrg	    prefix_cmds="$prefix_cmds -e 1d";
673916ee1e9aSmrg	  fi~
674016ee1e9aSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
674116ee1e9aSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
674216ee1e9aSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
674316ee1e9aSmrg	  emximp -o $lib $output_objdir/$libname.def'
674416ee1e9aSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
674516ee1e9aSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
674616ee1e9aSmrg	;;
674716ee1e9aSmrg
6748fda9279dSmrg      dgux*)
6749fda9279dSmrg        case $cc_basename in
6750fda9279dSmrg          ec++*)
6751fda9279dSmrg	    # FIXME: insert proper C++ library support
6752fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6753fda9279dSmrg	    ;;
6754fda9279dSmrg          ghcx*)
6755fda9279dSmrg	    # Green Hills C++ Compiler
6756fda9279dSmrg	    # FIXME: insert proper C++ library support
6757fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6758fda9279dSmrg	    ;;
6759fda9279dSmrg          *)
6760fda9279dSmrg	    # FIXME: insert proper C++ library support
6761fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6762fda9279dSmrg	    ;;
6763fda9279dSmrg        esac
6764fda9279dSmrg        ;;
6765fda9279dSmrg
6766fda9279dSmrg      freebsd2.*)
6767fda9279dSmrg        # C++ shared libraries reported to be fairly broken before
6768fda9279dSmrg	# switch to ELF
6769fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6770fda9279dSmrg        ;;
6771fda9279dSmrg
6772fda9279dSmrg      freebsd-elf*)
6773fda9279dSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6774fda9279dSmrg        ;;
6775fda9279dSmrg
6776fda9279dSmrg      freebsd* | dragonfly*)
6777fda9279dSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6778fda9279dSmrg        # conventions
6779fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6780fda9279dSmrg        ;;
6781fda9279dSmrg
6782fda9279dSmrg      haiku*)
678316ee1e9aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6784fda9279dSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6785fda9279dSmrg        ;;
6786fda9279dSmrg
6787fda9279dSmrg      hpux9*)
678816ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6789fda9279dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
679016ee1e9aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6791fda9279dSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6792fda9279dSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6793fda9279dSmrg				             # but as the default
6794fda9279dSmrg				             # location of the library.
6795fda9279dSmrg
6796fda9279dSmrg        case $cc_basename in
6797fda9279dSmrg          CC*)
6798fda9279dSmrg            # FIXME: insert proper C++ library support
6799fda9279dSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
6800fda9279dSmrg            ;;
6801fda9279dSmrg          aCC*)
680216ee1e9aSmrg            _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'
6803fda9279dSmrg            # Commands to make compiler produce verbose output that lists
6804fda9279dSmrg            # what "hidden" libraries, object files and flags are used when
6805fda9279dSmrg            # linking a shared library.
6806fda9279dSmrg            #
6807fda9279dSmrg            # There doesn't appear to be a way to prevent this compiler from
6808fda9279dSmrg            # explicitly linking system object files so we need to strip them
6809fda9279dSmrg            # from the output so that they don't get included in the library
6810fda9279dSmrg            # dependencies.
681116ee1e9aSmrg            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"'
6812fda9279dSmrg            ;;
6813fda9279dSmrg          *)
681416ee1e9aSmrg            if test yes = "$GXX"; then
681516ee1e9aSmrg              _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'
6816fda9279dSmrg            else
6817fda9279dSmrg              # FIXME: insert proper C++ library support
6818fda9279dSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
6819fda9279dSmrg            fi
6820fda9279dSmrg            ;;
6821fda9279dSmrg        esac
6822fda9279dSmrg        ;;
6823fda9279dSmrg
6824fda9279dSmrg      hpux10*|hpux11*)
682516ee1e9aSmrg        if test no = "$with_gnu_ld"; then
682616ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6827fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6828fda9279dSmrg
6829fda9279dSmrg          case $host_cpu in
6830fda9279dSmrg            hppa*64*|ia64*)
6831fda9279dSmrg              ;;
6832fda9279dSmrg            *)
683316ee1e9aSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6834fda9279dSmrg              ;;
6835fda9279dSmrg          esac
6836fda9279dSmrg        fi
6837fda9279dSmrg        case $host_cpu in
6838fda9279dSmrg          hppa*64*|ia64*)
6839fda9279dSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
6840fda9279dSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6841fda9279dSmrg            ;;
6842fda9279dSmrg          *)
6843fda9279dSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6844fda9279dSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6845fda9279dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6846fda9279dSmrg					         # but as the default
6847fda9279dSmrg					         # location of the library.
6848fda9279dSmrg            ;;
6849fda9279dSmrg        esac
6850fda9279dSmrg
6851fda9279dSmrg        case $cc_basename in
6852fda9279dSmrg          CC*)
6853fda9279dSmrg	    # FIXME: insert proper C++ library support
6854fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6855fda9279dSmrg	    ;;
6856fda9279dSmrg          aCC*)
6857fda9279dSmrg	    case $host_cpu in
6858fda9279dSmrg	      hppa*64*)
685916ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6860fda9279dSmrg	        ;;
6861fda9279dSmrg	      ia64*)
686216ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6863fda9279dSmrg	        ;;
6864fda9279dSmrg	      *)
686516ee1e9aSmrg	        _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'
6866fda9279dSmrg	        ;;
6867fda9279dSmrg	    esac
6868fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
6869fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
6870fda9279dSmrg	    # linking a shared library.
6871fda9279dSmrg	    #
6872fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
6873fda9279dSmrg	    # explicitly linking system object files so we need to strip them
6874fda9279dSmrg	    # from the output so that they don't get included in the library
6875fda9279dSmrg	    # dependencies.
687616ee1e9aSmrg	    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"'
6877fda9279dSmrg	    ;;
6878fda9279dSmrg          *)
687916ee1e9aSmrg	    if test yes = "$GXX"; then
688016ee1e9aSmrg	      if test no = "$with_gnu_ld"; then
6881fda9279dSmrg	        case $host_cpu in
6882fda9279dSmrg	          hppa*64*)
688316ee1e9aSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6884fda9279dSmrg	            ;;
6885fda9279dSmrg	          ia64*)
688616ee1e9aSmrg	            _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'
6887fda9279dSmrg	            ;;
6888fda9279dSmrg	          *)
688916ee1e9aSmrg	            _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'
6890fda9279dSmrg	            ;;
6891fda9279dSmrg	        esac
6892fda9279dSmrg	      fi
6893fda9279dSmrg	    else
6894fda9279dSmrg	      # FIXME: insert proper C++ library support
6895fda9279dSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6896fda9279dSmrg	    fi
6897fda9279dSmrg	    ;;
6898fda9279dSmrg        esac
6899fda9279dSmrg        ;;
6900fda9279dSmrg
6901fda9279dSmrg      interix[[3-9]]*)
6902fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
6903fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
690416ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
690516ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6906fda9279dSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6907fda9279dSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6908fda9279dSmrg	# default) and relocated if they conflict, which is a slow very memory
6909fda9279dSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6910fda9279dSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6911fda9279dSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
691216ee1e9aSmrg	_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'
691316ee1e9aSmrg	_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'
6914fda9279dSmrg	;;
6915fda9279dSmrg      irix5* | irix6*)
6916fda9279dSmrg        case $cc_basename in
6917fda9279dSmrg          CC*)
6918fda9279dSmrg	    # SGI C++
691916ee1e9aSmrg	    _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'
6920fda9279dSmrg
6921fda9279dSmrg	    # Archives containing C++ object files must be created using
6922fda9279dSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6923fda9279dSmrg	    # necessary to make sure instantiated templates are included
6924fda9279dSmrg	    # in the archive.
6925fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6926fda9279dSmrg	    ;;
6927fda9279dSmrg          *)
692816ee1e9aSmrg	    if test yes = "$GXX"; then
692916ee1e9aSmrg	      if test no = "$with_gnu_ld"; then
693016ee1e9aSmrg	        _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'
6931fda9279dSmrg	      else
693216ee1e9aSmrg	        _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'
6933fda9279dSmrg	      fi
6934fda9279dSmrg	    fi
6935fda9279dSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6936fda9279dSmrg	    ;;
6937fda9279dSmrg        esac
693816ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6939fda9279dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6940fda9279dSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6941fda9279dSmrg        ;;
6942fda9279dSmrg
6943fda9279dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6944fda9279dSmrg        case $cc_basename in
6945fda9279dSmrg          KCC*)
6946fda9279dSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6947fda9279dSmrg
6948fda9279dSmrg	    # KCC will only create a shared library if the output file
6949fda9279dSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6950fda9279dSmrg	    # to its proper name (with version) after linking.
695116ee1e9aSmrg	    _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'
695216ee1e9aSmrg	    _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'
6953fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
6954fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
6955fda9279dSmrg	    # linking a shared library.
6956fda9279dSmrg	    #
6957fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
6958fda9279dSmrg	    # explicitly linking system object files so we need to strip them
6959fda9279dSmrg	    # from the output so that they don't get included in the library
6960fda9279dSmrg	    # dependencies.
696116ee1e9aSmrg	    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"'
6962fda9279dSmrg
696316ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
696416ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6965fda9279dSmrg
6966fda9279dSmrg	    # Archives containing C++ object files must be created using
6967fda9279dSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6968fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6969fda9279dSmrg	    ;;
6970fda9279dSmrg	  icpc* | ecpc* )
6971fda9279dSmrg	    # Intel C++
6972fda9279dSmrg	    with_gnu_ld=yes
6973fda9279dSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6974fda9279dSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6975fda9279dSmrg	    # earlier do not add the objects themselves.
6976fda9279dSmrg	    case `$CC -V 2>&1` in
6977fda9279dSmrg	      *"Version 7."*)
697816ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
697916ee1e9aSmrg		_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'
6980fda9279dSmrg		;;
6981fda9279dSmrg	      *)  # Version 8.0 or newer
6982fda9279dSmrg	        tmp_idyn=
6983fda9279dSmrg	        case $host_cpu in
6984fda9279dSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
6985fda9279dSmrg		esac
698616ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
698716ee1e9aSmrg		_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'
6988fda9279dSmrg		;;
6989fda9279dSmrg	    esac
6990fda9279dSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
699116ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
699216ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
699316ee1e9aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6994fda9279dSmrg	    ;;
6995fda9279dSmrg          pgCC* | pgcpp*)
6996fda9279dSmrg            # Portland Group C++ compiler
6997fda9279dSmrg	    case `$CC -V` in
6998fda9279dSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6999fda9279dSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
700016ee1e9aSmrg               rm -rf $tpldir~
700116ee1e9aSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
700216ee1e9aSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7003fda9279dSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
700416ee1e9aSmrg                rm -rf $tpldir~
700516ee1e9aSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
700616ee1e9aSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
700716ee1e9aSmrg                $RANLIB $oldlib'
7008fda9279dSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
700916ee1e9aSmrg                rm -rf $tpldir~
701016ee1e9aSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
701116ee1e9aSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7012fda9279dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
701316ee1e9aSmrg                rm -rf $tpldir~
701416ee1e9aSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
701516ee1e9aSmrg                $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'
7016fda9279dSmrg	      ;;
7017fda9279dSmrg	    *) # Version 6 and above use weak symbols
701816ee1e9aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
701916ee1e9aSmrg	      _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'
7020fda9279dSmrg	      ;;
7021fda9279dSmrg	    esac
7022fda9279dSmrg
702316ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
702416ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
702516ee1e9aSmrg	    _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'
7026fda9279dSmrg            ;;
7027fda9279dSmrg	  cxx*)
7028fda9279dSmrg	    # Compaq C++
702916ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
703016ee1e9aSmrg	    _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'
7031fda9279dSmrg
7032fda9279dSmrg	    runpath_var=LD_RUN_PATH
7033fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7034fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7035fda9279dSmrg
7036fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
7037fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
7038fda9279dSmrg	    # linking a shared library.
7039fda9279dSmrg	    #
7040fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
7041fda9279dSmrg	    # explicitly linking system object files so we need to strip them
7042fda9279dSmrg	    # from the output so that they don't get included in the library
7043fda9279dSmrg	    # dependencies.
704416ee1e9aSmrg	    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'
7045fda9279dSmrg	    ;;
7046fda9279dSmrg	  xl* | mpixl* | bgxl*)
7047fda9279dSmrg	    # IBM XL 8.0 on PPC, with GNU ld
704816ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
704916ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
705016ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
705116ee1e9aSmrg	    if test yes = "$supports_anon_versioning"; then
7052fda9279dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
705316ee1e9aSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
705416ee1e9aSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
705516ee1e9aSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7056fda9279dSmrg	    fi
7057fda9279dSmrg	    ;;
7058fda9279dSmrg	  *)
7059fda9279dSmrg	    case `$CC -V 2>&1 | sed 5q` in
7060fda9279dSmrg	    *Sun\ C*)
7061fda9279dSmrg	      # Sun C++ 5.9
7062fda9279dSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
706316ee1e9aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
706416ee1e9aSmrg	      _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'
7065fda9279dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
706616ee1e9aSmrg	      _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'
7067fda9279dSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7068fda9279dSmrg
7069fda9279dSmrg	      # Not sure whether something based on
7070fda9279dSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7071fda9279dSmrg	      # would be better.
7072fda9279dSmrg	      output_verbose_link_cmd='func_echo_all'
7073fda9279dSmrg
7074fda9279dSmrg	      # Archives containing C++ object files must be created using
7075fda9279dSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7076fda9279dSmrg	      # necessary to make sure instantiated templates are included
7077fda9279dSmrg	      # in the archive.
7078fda9279dSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7079fda9279dSmrg	      ;;
7080fda9279dSmrg	    esac
7081fda9279dSmrg	    ;;
7082fda9279dSmrg	esac
7083fda9279dSmrg	;;
7084fda9279dSmrg
7085fda9279dSmrg      lynxos*)
7086fda9279dSmrg        # FIXME: insert proper C++ library support
7087fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7088fda9279dSmrg	;;
7089fda9279dSmrg
7090fda9279dSmrg      m88k*)
7091fda9279dSmrg        # FIXME: insert proper C++ library support
7092fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7093fda9279dSmrg	;;
7094fda9279dSmrg
7095fda9279dSmrg      mvs*)
7096fda9279dSmrg        case $cc_basename in
7097fda9279dSmrg          cxx*)
7098fda9279dSmrg	    # FIXME: insert proper C++ library support
7099fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7100fda9279dSmrg	    ;;
7101fda9279dSmrg	  *)
7102fda9279dSmrg	    # FIXME: insert proper C++ library support
7103fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7104fda9279dSmrg	    ;;
7105fda9279dSmrg	esac
7106fda9279dSmrg	;;
7107fda9279dSmrg
7108fda9279dSmrg      netbsd*)
7109fda9279dSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7110fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7111fda9279dSmrg	  wlarc=
7112fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7113fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7114fda9279dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7115fda9279dSmrg	fi
7116fda9279dSmrg	# Workaround some broken pre-1.5 toolchains
7117fda9279dSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7118fda9279dSmrg	;;
7119fda9279dSmrg
7120fda9279dSmrg      *nto* | *qnx*)
7121fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7122fda9279dSmrg	;;
7123fda9279dSmrg
712416ee1e9aSmrg      openbsd* | bitrig*)
7125fda9279dSmrg	if test -f /usr/libexec/ld.so; then
7126fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7127fda9279dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7128fda9279dSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7129fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
713016ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
713116ee1e9aSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
713216ee1e9aSmrg	    _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'
713316ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
713416ee1e9aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7135fda9279dSmrg	  fi
7136fda9279dSmrg	  output_verbose_link_cmd=func_echo_all
7137fda9279dSmrg	else
7138fda9279dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7139fda9279dSmrg	fi
7140fda9279dSmrg	;;
7141fda9279dSmrg
7142fda9279dSmrg      osf3* | osf4* | osf5*)
7143fda9279dSmrg        case $cc_basename in
7144fda9279dSmrg          KCC*)
7145fda9279dSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7146fda9279dSmrg
7147fda9279dSmrg	    # KCC will only create a shared library if the output file
7148fda9279dSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7149fda9279dSmrg	    # to its proper name (with version) after linking.
715016ee1e9aSmrg	    _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'
7151fda9279dSmrg
715216ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7153fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7154fda9279dSmrg
7155fda9279dSmrg	    # Archives containing C++ object files must be created using
7156fda9279dSmrg	    # the KAI C++ compiler.
7157fda9279dSmrg	    case $host in
7158fda9279dSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7159fda9279dSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7160fda9279dSmrg	    esac
7161fda9279dSmrg	    ;;
7162fda9279dSmrg          RCC*)
7163fda9279dSmrg	    # Rational C++ 2.4.1
7164fda9279dSmrg	    # FIXME: insert proper C++ library support
7165fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7166fda9279dSmrg	    ;;
7167fda9279dSmrg          cxx*)
7168fda9279dSmrg	    case $host in
7169fda9279dSmrg	      osf3*)
717016ee1e9aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
717116ee1e9aSmrg	        _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'
717216ee1e9aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7173fda9279dSmrg		;;
7174fda9279dSmrg	      *)
7175fda9279dSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
717616ee1e9aSmrg	        _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'
7177fda9279dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
717816ee1e9aSmrg                  echo "-hidden">> $lib.exp~
717916ee1e9aSmrg                  $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~
718016ee1e9aSmrg                  $RM $lib.exp'
7181fda9279dSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7182fda9279dSmrg		;;
7183fda9279dSmrg	    esac
7184fda9279dSmrg
7185fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7186fda9279dSmrg
7187fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
7188fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
7189fda9279dSmrg	    # linking a shared library.
7190fda9279dSmrg	    #
7191fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
7192fda9279dSmrg	    # explicitly linking system object files so we need to strip them
7193fda9279dSmrg	    # from the output so that they don't get included in the library
7194fda9279dSmrg	    # dependencies.
719516ee1e9aSmrg	    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"'
7196fda9279dSmrg	    ;;
7197fda9279dSmrg	  *)
719816ee1e9aSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
719916ee1e9aSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7200fda9279dSmrg	      case $host in
7201fda9279dSmrg	        osf3*)
720216ee1e9aSmrg	          _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'
7203fda9279dSmrg		  ;;
7204fda9279dSmrg	        *)
720516ee1e9aSmrg	          _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'
7206fda9279dSmrg		  ;;
7207fda9279dSmrg	      esac
7208fda9279dSmrg
720916ee1e9aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7210fda9279dSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7211fda9279dSmrg
7212fda9279dSmrg	      # Commands to make compiler produce verbose output that lists
7213fda9279dSmrg	      # what "hidden" libraries, object files and flags are used when
7214fda9279dSmrg	      # linking a shared library.
7215fda9279dSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7216fda9279dSmrg
7217fda9279dSmrg	    else
7218fda9279dSmrg	      # FIXME: insert proper C++ library support
7219fda9279dSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7220fda9279dSmrg	    fi
7221fda9279dSmrg	    ;;
7222fda9279dSmrg        esac
7223fda9279dSmrg        ;;
7224fda9279dSmrg
7225fda9279dSmrg      psos*)
7226fda9279dSmrg        # FIXME: insert proper C++ library support
7227fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7228fda9279dSmrg        ;;
7229fda9279dSmrg
7230fda9279dSmrg      sunos4*)
7231fda9279dSmrg        case $cc_basename in
7232fda9279dSmrg          CC*)
7233fda9279dSmrg	    # Sun C++ 4.x
7234fda9279dSmrg	    # FIXME: insert proper C++ library support
7235fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7236fda9279dSmrg	    ;;
7237fda9279dSmrg          lcc*)
7238fda9279dSmrg	    # Lucid
7239fda9279dSmrg	    # FIXME: insert proper C++ library support
7240fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7241fda9279dSmrg	    ;;
7242fda9279dSmrg          *)
7243fda9279dSmrg	    # FIXME: insert proper C++ library support
7244fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7245fda9279dSmrg	    ;;
7246fda9279dSmrg        esac
7247fda9279dSmrg        ;;
7248fda9279dSmrg
7249fda9279dSmrg      solaris*)
7250fda9279dSmrg        case $cc_basename in
7251fda9279dSmrg          CC* | sunCC*)
7252fda9279dSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7253fda9279dSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7254fda9279dSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
725516ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7256fda9279dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
725716ee1e9aSmrg              $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'
7258fda9279dSmrg
7259fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7260fda9279dSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7261fda9279dSmrg	    case $host_os in
7262fda9279dSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7263fda9279dSmrg	      *)
7264fda9279dSmrg		# The compiler driver will combine and reorder linker options,
726516ee1e9aSmrg		# but understands '-z linker_flag'.
7266fda9279dSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7267fda9279dSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7268fda9279dSmrg	        ;;
7269fda9279dSmrg	    esac
7270fda9279dSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7271fda9279dSmrg
7272fda9279dSmrg	    output_verbose_link_cmd='func_echo_all'
7273fda9279dSmrg
7274fda9279dSmrg	    # Archives containing C++ object files must be created using
7275fda9279dSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7276fda9279dSmrg	    # necessary to make sure instantiated templates are included
7277fda9279dSmrg	    # in the archive.
7278fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7279fda9279dSmrg	    ;;
7280fda9279dSmrg          gcx*)
7281fda9279dSmrg	    # Green Hills C++ Compiler
728216ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7283fda9279dSmrg
7284fda9279dSmrg	    # The C++ compiler must be used to create the archive.
7285fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7286fda9279dSmrg	    ;;
7287fda9279dSmrg          *)
7288fda9279dSmrg	    # GNU C++ compiler with Solaris linker
728916ee1e9aSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
729016ee1e9aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7291fda9279dSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
729216ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7293fda9279dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
729416ee1e9aSmrg                  $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'
7295fda9279dSmrg
7296fda9279dSmrg	        # Commands to make compiler produce verbose output that lists
7297fda9279dSmrg	        # what "hidden" libraries, object files and flags are used when
7298fda9279dSmrg	        # linking a shared library.
7299fda9279dSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7300fda9279dSmrg	      else
730116ee1e9aSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7302fda9279dSmrg	        # platform.
730316ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7304fda9279dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
730516ee1e9aSmrg                  $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'
7306fda9279dSmrg
7307fda9279dSmrg	        # Commands to make compiler produce verbose output that lists
7308fda9279dSmrg	        # what "hidden" libraries, object files and flags are used when
7309fda9279dSmrg	        # linking a shared library.
7310fda9279dSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7311fda9279dSmrg	      fi
7312fda9279dSmrg
731316ee1e9aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7314fda9279dSmrg	      case $host_os in
7315fda9279dSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7316fda9279dSmrg		*)
731716ee1e9aSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7318fda9279dSmrg		  ;;
7319fda9279dSmrg	      esac
7320fda9279dSmrg	    fi
7321fda9279dSmrg	    ;;
7322fda9279dSmrg        esac
7323fda9279dSmrg        ;;
7324fda9279dSmrg
7325fda9279dSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
732616ee1e9aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7327fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7328fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7329fda9279dSmrg      runpath_var='LD_RUN_PATH'
7330fda9279dSmrg
7331fda9279dSmrg      case $cc_basename in
7332fda9279dSmrg        CC*)
733316ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
733416ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7335fda9279dSmrg	  ;;
7336fda9279dSmrg	*)
733716ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
733816ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7339fda9279dSmrg	  ;;
7340fda9279dSmrg      esac
7341fda9279dSmrg      ;;
7342fda9279dSmrg
7343fda9279dSmrg      sysv5* | sco3.2v5* | sco5v6*)
734416ee1e9aSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7345fda9279dSmrg	# link with -lc, and that would cause any symbols used from libc to
7346fda9279dSmrg	# always be unresolved, which means just about no library would
7347fda9279dSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7348fda9279dSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7349fda9279dSmrg	# as -z defs.
735016ee1e9aSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
735116ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7352fda9279dSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7353fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
735416ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7355fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7356fda9279dSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
735716ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7358fda9279dSmrg	runpath_var='LD_RUN_PATH'
7359fda9279dSmrg
7360fda9279dSmrg	case $cc_basename in
7361fda9279dSmrg          CC*)
736216ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
736316ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7364fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
736516ee1e9aSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7366fda9279dSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
736716ee1e9aSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7368fda9279dSmrg	    ;;
7369fda9279dSmrg	  *)
737016ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737116ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7372fda9279dSmrg	    ;;
7373fda9279dSmrg	esac
7374fda9279dSmrg      ;;
7375fda9279dSmrg
7376fda9279dSmrg      tandem*)
7377fda9279dSmrg        case $cc_basename in
7378fda9279dSmrg          NCC*)
7379fda9279dSmrg	    # NonStop-UX NCC 3.20
7380fda9279dSmrg	    # FIXME: insert proper C++ library support
7381fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7382fda9279dSmrg	    ;;
7383fda9279dSmrg          *)
7384fda9279dSmrg	    # FIXME: insert proper C++ library support
7385fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7386fda9279dSmrg	    ;;
7387fda9279dSmrg        esac
7388fda9279dSmrg        ;;
7389fda9279dSmrg
7390fda9279dSmrg      vxworks*)
7391fda9279dSmrg        # FIXME: insert proper C++ library support
7392fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7393fda9279dSmrg        ;;
7394fda9279dSmrg
7395fda9279dSmrg      *)
7396fda9279dSmrg        # FIXME: insert proper C++ library support
7397fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7398fda9279dSmrg        ;;
7399fda9279dSmrg    esac
7400fda9279dSmrg
7401fda9279dSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
740216ee1e9aSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7403fda9279dSmrg
740416ee1e9aSmrg    _LT_TAGVAR(GCC, $1)=$GXX
740516ee1e9aSmrg    _LT_TAGVAR(LD, $1)=$LD
7406fda9279dSmrg
7407fda9279dSmrg    ## CAVEAT EMPTOR:
7408fda9279dSmrg    ## There is no encapsulation within the following macros, do not change
7409fda9279dSmrg    ## the running order or otherwise move them around unless you know exactly
7410fda9279dSmrg    ## what you are doing...
7411fda9279dSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7412fda9279dSmrg    _LT_COMPILER_PIC($1)
7413fda9279dSmrg    _LT_COMPILER_C_O($1)
7414fda9279dSmrg    _LT_COMPILER_FILE_LOCKS($1)
7415fda9279dSmrg    _LT_LINKER_SHLIBS($1)
7416fda9279dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7417fda9279dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7418fda9279dSmrg
7419fda9279dSmrg    _LT_CONFIG($1)
7420fda9279dSmrg  fi # test -n "$compiler"
7421fda9279dSmrg
7422fda9279dSmrg  CC=$lt_save_CC
7423fda9279dSmrg  CFLAGS=$lt_save_CFLAGS
7424fda9279dSmrg  LDCXX=$LD
7425fda9279dSmrg  LD=$lt_save_LD
7426fda9279dSmrg  GCC=$lt_save_GCC
7427fda9279dSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7428fda9279dSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7429fda9279dSmrg  lt_cv_path_LD=$lt_save_path_LD
7430fda9279dSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7431fda9279dSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
743216ee1e9aSmrgfi # test yes != "$_lt_caught_CXX_error"
7433fda9279dSmrg
7434fda9279dSmrgAC_LANG_POP
7435fda9279dSmrg])# _LT_LANG_CXX_CONFIG
7436fda9279dSmrg
7437fda9279dSmrg
7438fda9279dSmrg# _LT_FUNC_STRIPNAME_CNF
7439fda9279dSmrg# ----------------------
7440fda9279dSmrg# func_stripname_cnf prefix suffix name
7441fda9279dSmrg# strip PREFIX and SUFFIX off of NAME.
7442fda9279dSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7443fda9279dSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7444fda9279dSmrg# dot (in which case that matches only a dot).
7445fda9279dSmrg#
7446fda9279dSmrg# This function is identical to the (non-XSI) version of func_stripname,
7447fda9279dSmrg# except this one can be used by m4 code that may be executed by configure,
7448fda9279dSmrg# rather than the libtool script.
7449fda9279dSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7450fda9279dSmrgAC_REQUIRE([_LT_DECL_SED])
7451fda9279dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7452fda9279dSmrgfunc_stripname_cnf ()
7453fda9279dSmrg{
745416ee1e9aSmrg  case @S|@2 in
745516ee1e9aSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
745616ee1e9aSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7457fda9279dSmrg  esac
7458fda9279dSmrg} # func_stripname_cnf
7459fda9279dSmrg])# _LT_FUNC_STRIPNAME_CNF
7460fda9279dSmrg
746116ee1e9aSmrg
7462fda9279dSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7463fda9279dSmrg# ---------------------------------
7464fda9279dSmrg# Figure out "hidden" library dependencies from verbose
7465fda9279dSmrg# compiler output when linking a shared library.
7466fda9279dSmrg# Parse the compiler output and extract the necessary
7467fda9279dSmrg# objects, libraries and library flags.
7468fda9279dSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7469fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7470fda9279dSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7471fda9279dSmrg# Dependencies to place before and after the object being linked:
7472fda9279dSmrg_LT_TAGVAR(predep_objects, $1)=
7473fda9279dSmrg_LT_TAGVAR(postdep_objects, $1)=
7474fda9279dSmrg_LT_TAGVAR(predeps, $1)=
7475fda9279dSmrg_LT_TAGVAR(postdeps, $1)=
7476fda9279dSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7477fda9279dSmrg
7478fda9279dSmrgdnl we can't use the lt_simple_compile_test_code here,
7479fda9279dSmrgdnl because it contains code intended for an executable,
7480fda9279dSmrgdnl not a library.  It's possible we should let each
7481fda9279dSmrgdnl tag define a new lt_????_link_test_code variable,
7482fda9279dSmrgdnl but it's only used here...
7483fda9279dSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7484fda9279dSmrgint a;
7485fda9279dSmrgvoid foo (void) { a = 0; }
7486fda9279dSmrg_LT_EOF
7487fda9279dSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7488fda9279dSmrgclass Foo
7489fda9279dSmrg{
7490fda9279dSmrgpublic:
7491fda9279dSmrg  Foo (void) { a = 0; }
7492fda9279dSmrgprivate:
7493fda9279dSmrg  int a;
7494fda9279dSmrg};
7495fda9279dSmrg_LT_EOF
7496fda9279dSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7497fda9279dSmrg      subroutine foo
7498fda9279dSmrg      implicit none
7499fda9279dSmrg      integer*4 a
7500fda9279dSmrg      a=0
7501fda9279dSmrg      return
7502fda9279dSmrg      end
7503fda9279dSmrg_LT_EOF
7504fda9279dSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7505fda9279dSmrg      subroutine foo
7506fda9279dSmrg      implicit none
7507fda9279dSmrg      integer a
7508fda9279dSmrg      a=0
7509fda9279dSmrg      return
7510fda9279dSmrg      end
7511fda9279dSmrg_LT_EOF
7512fda9279dSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7513fda9279dSmrgpublic class foo {
7514fda9279dSmrg  private int a;
7515fda9279dSmrg  public void bar (void) {
7516fda9279dSmrg    a = 0;
7517fda9279dSmrg  }
7518fda9279dSmrg};
7519fda9279dSmrg_LT_EOF
7520fda9279dSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7521fda9279dSmrgpackage foo
7522fda9279dSmrgfunc foo() {
7523fda9279dSmrg}
7524fda9279dSmrg_LT_EOF
7525fda9279dSmrg])
7526fda9279dSmrg
7527fda9279dSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
7528fda9279dSmrgcase "$CC $CFLAGS " in #(
7529fda9279dSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7530fda9279dSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7531fda9279dSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7532fda9279dSmrgesac
7533fda9279dSmrg
7534fda9279dSmrgdnl Parse the compiler output and extract the necessary
7535fda9279dSmrgdnl objects, libraries and library flags.
7536fda9279dSmrgif AC_TRY_EVAL(ac_compile); then
7537fda9279dSmrg  # Parse the compiler output and extract the necessary
7538fda9279dSmrg  # objects, libraries and library flags.
7539fda9279dSmrg
7540fda9279dSmrg  # Sentinel used to keep track of whether or not we are before
7541fda9279dSmrg  # the conftest object file.
7542fda9279dSmrg  pre_test_object_deps_done=no
7543fda9279dSmrg
7544fda9279dSmrg  for p in `eval "$output_verbose_link_cmd"`; do
754516ee1e9aSmrg    case $prev$p in
7546fda9279dSmrg
7547fda9279dSmrg    -L* | -R* | -l*)
7548fda9279dSmrg       # Some compilers place space between "-{L,R}" and the path.
7549fda9279dSmrg       # Remove the space.
755016ee1e9aSmrg       if test x-L = "$p" ||
755116ee1e9aSmrg          test x-R = "$p"; then
7552fda9279dSmrg	 prev=$p
7553fda9279dSmrg	 continue
7554fda9279dSmrg       fi
7555fda9279dSmrg
7556fda9279dSmrg       # Expand the sysroot to ease extracting the directories later.
7557fda9279dSmrg       if test -z "$prev"; then
7558fda9279dSmrg         case $p in
7559fda9279dSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7560fda9279dSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7561fda9279dSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7562fda9279dSmrg         esac
7563fda9279dSmrg       fi
7564fda9279dSmrg       case $p in
7565fda9279dSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7566fda9279dSmrg       esac
756716ee1e9aSmrg       if test no = "$pre_test_object_deps_done"; then
756816ee1e9aSmrg	 case $prev in
7569fda9279dSmrg	 -L | -R)
7570fda9279dSmrg	   # Internal compiler library paths should come after those
7571fda9279dSmrg	   # provided the user.  The postdeps already come after the
7572fda9279dSmrg	   # user supplied libs so there is no need to process them.
7573fda9279dSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
757416ee1e9aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7575fda9279dSmrg	   else
757616ee1e9aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7577fda9279dSmrg	   fi
7578fda9279dSmrg	   ;;
7579fda9279dSmrg	 # The "-l" case would never come before the object being
7580fda9279dSmrg	 # linked, so don't bother handling this case.
7581fda9279dSmrg	 esac
7582fda9279dSmrg       else
7583fda9279dSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
758416ee1e9aSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7585fda9279dSmrg	 else
758616ee1e9aSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7587fda9279dSmrg	 fi
7588fda9279dSmrg       fi
7589fda9279dSmrg       prev=
7590fda9279dSmrg       ;;
7591fda9279dSmrg
7592fda9279dSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7593fda9279dSmrg    *.$objext)
7594fda9279dSmrg       # This assumes that the test object file only shows up
7595fda9279dSmrg       # once in the compiler output.
7596fda9279dSmrg       if test "$p" = "conftest.$objext"; then
7597fda9279dSmrg	 pre_test_object_deps_done=yes
7598fda9279dSmrg	 continue
7599fda9279dSmrg       fi
7600fda9279dSmrg
760116ee1e9aSmrg       if test no = "$pre_test_object_deps_done"; then
7602fda9279dSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
760316ee1e9aSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
7604fda9279dSmrg	 else
7605fda9279dSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7606fda9279dSmrg	 fi
7607fda9279dSmrg       else
7608fda9279dSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
760916ee1e9aSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7610fda9279dSmrg	 else
7611fda9279dSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7612fda9279dSmrg	 fi
7613fda9279dSmrg       fi
7614fda9279dSmrg       ;;
7615fda9279dSmrg
7616fda9279dSmrg    *) ;; # Ignore the rest.
7617fda9279dSmrg
7618fda9279dSmrg    esac
7619fda9279dSmrg  done
7620fda9279dSmrg
7621fda9279dSmrg  # Clean up.
7622fda9279dSmrg  rm -f a.out a.exe
7623fda9279dSmrgelse
7624fda9279dSmrg  echo "libtool.m4: error: problem compiling $1 test program"
7625fda9279dSmrgfi
7626fda9279dSmrg
7627fda9279dSmrg$RM -f confest.$objext
7628fda9279dSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7629fda9279dSmrg
7630fda9279dSmrg# PORTME: override above test on systems where it is broken
7631fda9279dSmrgm4_if([$1], [CXX],
7632fda9279dSmrg[case $host_os in
7633fda9279dSmrginterix[[3-9]]*)
7634fda9279dSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7635fda9279dSmrg  # hack all around it, let's just trust "g++" to DTRT.
7636fda9279dSmrg  _LT_TAGVAR(predep_objects,$1)=
7637fda9279dSmrg  _LT_TAGVAR(postdep_objects,$1)=
7638fda9279dSmrg  _LT_TAGVAR(postdeps,$1)=
7639fda9279dSmrg  ;;
7640fda9279dSmrgesac
7641fda9279dSmrg])
7642fda9279dSmrg
7643fda9279dSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
7644fda9279dSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7645fda9279dSmrgesac
7646fda9279dSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7647fda9279dSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
764816ee1e9aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7649fda9279dSmrgfi
7650fda9279dSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7651fda9279dSmrg    [The directories searched by this compiler when creating a shared library])
7652fda9279dSmrg_LT_TAGDECL([], [predep_objects], [1],
7653fda9279dSmrg    [Dependencies to place before and after the objects being linked to
7654fda9279dSmrg    create a shared library])
7655fda9279dSmrg_LT_TAGDECL([], [postdep_objects], [1])
7656fda9279dSmrg_LT_TAGDECL([], [predeps], [1])
7657fda9279dSmrg_LT_TAGDECL([], [postdeps], [1])
7658fda9279dSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7659fda9279dSmrg    [The library search path used internally by the compiler when linking
7660fda9279dSmrg    a shared library])
7661fda9279dSmrg])# _LT_SYS_HIDDEN_LIBDEPS
7662fda9279dSmrg
7663fda9279dSmrg
7664fda9279dSmrg# _LT_LANG_F77_CONFIG([TAG])
7665fda9279dSmrg# --------------------------
7666fda9279dSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
7667fda9279dSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
766816ee1e9aSmrg# to write the compiler configuration to 'libtool'.
7669fda9279dSmrgm4_defun([_LT_LANG_F77_CONFIG],
7670fda9279dSmrg[AC_LANG_PUSH(Fortran 77)
767116ee1e9aSmrgif test -z "$F77" || test no = "$F77"; then
7672fda9279dSmrg  _lt_disable_F77=yes
7673fda9279dSmrgfi
7674fda9279dSmrg
7675fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7676fda9279dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7677fda9279dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7678fda9279dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7679fda9279dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7680fda9279dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7681fda9279dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7682fda9279dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7683fda9279dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7684fda9279dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7685fda9279dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7686fda9279dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7687fda9279dSmrg_LT_TAGVAR(module_cmds, $1)=
7688fda9279dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7689fda9279dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7690fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7691fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7692fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7693fda9279dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7694fda9279dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7695fda9279dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7696fda9279dSmrg
7697fda9279dSmrg# Source file extension for f77 test sources.
7698fda9279dSmrgac_ext=f
7699fda9279dSmrg
7700fda9279dSmrg# Object file extension for compiled f77 test sources.
7701fda9279dSmrgobjext=o
7702fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
7703fda9279dSmrg
7704fda9279dSmrg# No sense in running all these tests if we already determined that
7705fda9279dSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7706fda9279dSmrg# are currently assumed to apply to all compilers on this platform,
7707fda9279dSmrg# and will be corrupted by setting them based on a non-working compiler.
770816ee1e9aSmrgif test yes != "$_lt_disable_F77"; then
7709fda9279dSmrg  # Code to be used in simple compile tests
7710fda9279dSmrg  lt_simple_compile_test_code="\
7711fda9279dSmrg      subroutine t
7712fda9279dSmrg      return
7713fda9279dSmrg      end
7714fda9279dSmrg"
7715fda9279dSmrg
7716fda9279dSmrg  # Code to be used in simple link tests
7717fda9279dSmrg  lt_simple_link_test_code="\
7718fda9279dSmrg      program t
7719fda9279dSmrg      end
7720fda9279dSmrg"
7721fda9279dSmrg
7722fda9279dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7723fda9279dSmrg  _LT_TAG_COMPILER
7724fda9279dSmrg
7725fda9279dSmrg  # save warnings/boilerplate of simple test code
7726fda9279dSmrg  _LT_COMPILER_BOILERPLATE
7727fda9279dSmrg  _LT_LINKER_BOILERPLATE
7728fda9279dSmrg
7729fda9279dSmrg  # Allow CC to be a program name with arguments.
773016ee1e9aSmrg  lt_save_CC=$CC
7731fda9279dSmrg  lt_save_GCC=$GCC
7732fda9279dSmrg  lt_save_CFLAGS=$CFLAGS
7733fda9279dSmrg  CC=${F77-"f77"}
7734fda9279dSmrg  CFLAGS=$FFLAGS
7735fda9279dSmrg  compiler=$CC
7736fda9279dSmrg  _LT_TAGVAR(compiler, $1)=$CC
7737fda9279dSmrg  _LT_CC_BASENAME([$compiler])
7738fda9279dSmrg  GCC=$G77
7739fda9279dSmrg  if test -n "$compiler"; then
7740fda9279dSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7741fda9279dSmrg    AC_MSG_RESULT([$can_build_shared])
7742fda9279dSmrg
7743fda9279dSmrg    AC_MSG_CHECKING([whether to build shared libraries])
774416ee1e9aSmrg    test no = "$can_build_shared" && enable_shared=no
7745fda9279dSmrg
7746fda9279dSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7747fda9279dSmrg    # are all built from PIC.
7748fda9279dSmrg    case $host_os in
7749fda9279dSmrg      aix3*)
775016ee1e9aSmrg        test yes = "$enable_shared" && enable_static=no
7751fda9279dSmrg        if test -n "$RANLIB"; then
7752fda9279dSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7753fda9279dSmrg          postinstall_cmds='$RANLIB $lib'
7754fda9279dSmrg        fi
7755fda9279dSmrg        ;;
7756fda9279dSmrg      aix[[4-9]]*)
775716ee1e9aSmrg	if test ia64 != "$host_cpu"; then
775816ee1e9aSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
775916ee1e9aSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
776016ee1e9aSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
776116ee1e9aSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
776216ee1e9aSmrg	  esac
7763fda9279dSmrg	fi
7764fda9279dSmrg        ;;
7765fda9279dSmrg    esac
7766fda9279dSmrg    AC_MSG_RESULT([$enable_shared])
7767fda9279dSmrg
7768fda9279dSmrg    AC_MSG_CHECKING([whether to build static libraries])
7769fda9279dSmrg    # Make sure either enable_shared or enable_static is yes.
777016ee1e9aSmrg    test yes = "$enable_shared" || enable_static=yes
7771fda9279dSmrg    AC_MSG_RESULT([$enable_static])
7772fda9279dSmrg
777316ee1e9aSmrg    _LT_TAGVAR(GCC, $1)=$G77
777416ee1e9aSmrg    _LT_TAGVAR(LD, $1)=$LD
7775fda9279dSmrg
7776fda9279dSmrg    ## CAVEAT EMPTOR:
7777fda9279dSmrg    ## There is no encapsulation within the following macros, do not change
7778fda9279dSmrg    ## the running order or otherwise move them around unless you know exactly
7779fda9279dSmrg    ## what you are doing...
7780fda9279dSmrg    _LT_COMPILER_PIC($1)
7781fda9279dSmrg    _LT_COMPILER_C_O($1)
7782fda9279dSmrg    _LT_COMPILER_FILE_LOCKS($1)
7783fda9279dSmrg    _LT_LINKER_SHLIBS($1)
7784fda9279dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7785fda9279dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7786fda9279dSmrg
7787fda9279dSmrg    _LT_CONFIG($1)
7788fda9279dSmrg  fi # test -n "$compiler"
7789fda9279dSmrg
7790fda9279dSmrg  GCC=$lt_save_GCC
779116ee1e9aSmrg  CC=$lt_save_CC
779216ee1e9aSmrg  CFLAGS=$lt_save_CFLAGS
779316ee1e9aSmrgfi # test yes != "$_lt_disable_F77"
7794fda9279dSmrg
7795fda9279dSmrgAC_LANG_POP
7796fda9279dSmrg])# _LT_LANG_F77_CONFIG
7797fda9279dSmrg
7798fda9279dSmrg
7799fda9279dSmrg# _LT_LANG_FC_CONFIG([TAG])
7800fda9279dSmrg# -------------------------
7801fda9279dSmrg# Ensure that the configuration variables for a Fortran compiler are
7802fda9279dSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
780316ee1e9aSmrg# to write the compiler configuration to 'libtool'.
7804fda9279dSmrgm4_defun([_LT_LANG_FC_CONFIG],
7805fda9279dSmrg[AC_LANG_PUSH(Fortran)
7806fda9279dSmrg
780716ee1e9aSmrgif test -z "$FC" || test no = "$FC"; then
7808fda9279dSmrg  _lt_disable_FC=yes
7809fda9279dSmrgfi
7810fda9279dSmrg
7811fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7812fda9279dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7813fda9279dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7814fda9279dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7815fda9279dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7816fda9279dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7817fda9279dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7818fda9279dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7819fda9279dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7820fda9279dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7821fda9279dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7822fda9279dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7823fda9279dSmrg_LT_TAGVAR(module_cmds, $1)=
7824fda9279dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7825fda9279dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7826fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7827fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7828fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7829fda9279dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7830fda9279dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7831fda9279dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7832fda9279dSmrg
7833fda9279dSmrg# Source file extension for fc test sources.
7834fda9279dSmrgac_ext=${ac_fc_srcext-f}
7835fda9279dSmrg
7836fda9279dSmrg# Object file extension for compiled fc test sources.
7837fda9279dSmrgobjext=o
7838fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
7839fda9279dSmrg
7840fda9279dSmrg# No sense in running all these tests if we already determined that
7841fda9279dSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
7842fda9279dSmrg# are currently assumed to apply to all compilers on this platform,
7843fda9279dSmrg# and will be corrupted by setting them based on a non-working compiler.
784416ee1e9aSmrgif test yes != "$_lt_disable_FC"; then
7845fda9279dSmrg  # Code to be used in simple compile tests
7846fda9279dSmrg  lt_simple_compile_test_code="\
7847fda9279dSmrg      subroutine t
7848fda9279dSmrg      return
7849fda9279dSmrg      end
7850fda9279dSmrg"
7851fda9279dSmrg
7852fda9279dSmrg  # Code to be used in simple link tests
7853fda9279dSmrg  lt_simple_link_test_code="\
7854fda9279dSmrg      program t
7855fda9279dSmrg      end
7856fda9279dSmrg"
7857fda9279dSmrg
7858fda9279dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7859fda9279dSmrg  _LT_TAG_COMPILER
7860fda9279dSmrg
7861fda9279dSmrg  # save warnings/boilerplate of simple test code
7862fda9279dSmrg  _LT_COMPILER_BOILERPLATE
7863fda9279dSmrg  _LT_LINKER_BOILERPLATE
7864fda9279dSmrg
7865fda9279dSmrg  # Allow CC to be a program name with arguments.
786616ee1e9aSmrg  lt_save_CC=$CC
7867fda9279dSmrg  lt_save_GCC=$GCC
7868fda9279dSmrg  lt_save_CFLAGS=$CFLAGS
7869fda9279dSmrg  CC=${FC-"f95"}
7870fda9279dSmrg  CFLAGS=$FCFLAGS
7871fda9279dSmrg  compiler=$CC
7872fda9279dSmrg  GCC=$ac_cv_fc_compiler_gnu
7873fda9279dSmrg
7874fda9279dSmrg  _LT_TAGVAR(compiler, $1)=$CC
7875fda9279dSmrg  _LT_CC_BASENAME([$compiler])
7876fda9279dSmrg
7877fda9279dSmrg  if test -n "$compiler"; then
7878fda9279dSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7879fda9279dSmrg    AC_MSG_RESULT([$can_build_shared])
7880fda9279dSmrg
7881fda9279dSmrg    AC_MSG_CHECKING([whether to build shared libraries])
788216ee1e9aSmrg    test no = "$can_build_shared" && enable_shared=no
7883fda9279dSmrg
7884fda9279dSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7885fda9279dSmrg    # are all built from PIC.
7886fda9279dSmrg    case $host_os in
7887fda9279dSmrg      aix3*)
788816ee1e9aSmrg        test yes = "$enable_shared" && enable_static=no
7889fda9279dSmrg        if test -n "$RANLIB"; then
7890fda9279dSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7891fda9279dSmrg          postinstall_cmds='$RANLIB $lib'
7892fda9279dSmrg        fi
7893fda9279dSmrg        ;;
7894fda9279dSmrg      aix[[4-9]]*)
789516ee1e9aSmrg	if test ia64 != "$host_cpu"; then
789616ee1e9aSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
789716ee1e9aSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
789816ee1e9aSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
789916ee1e9aSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
790016ee1e9aSmrg	  esac
7901fda9279dSmrg	fi
7902fda9279dSmrg        ;;
7903fda9279dSmrg    esac
7904fda9279dSmrg    AC_MSG_RESULT([$enable_shared])
7905fda9279dSmrg
7906fda9279dSmrg    AC_MSG_CHECKING([whether to build static libraries])
7907fda9279dSmrg    # Make sure either enable_shared or enable_static is yes.
790816ee1e9aSmrg    test yes = "$enable_shared" || enable_static=yes
7909fda9279dSmrg    AC_MSG_RESULT([$enable_static])
7910fda9279dSmrg
791116ee1e9aSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
791216ee1e9aSmrg    _LT_TAGVAR(LD, $1)=$LD
7913fda9279dSmrg
7914fda9279dSmrg    ## CAVEAT EMPTOR:
7915fda9279dSmrg    ## There is no encapsulation within the following macros, do not change
7916fda9279dSmrg    ## the running order or otherwise move them around unless you know exactly
7917fda9279dSmrg    ## what you are doing...
7918fda9279dSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7919fda9279dSmrg    _LT_COMPILER_PIC($1)
7920fda9279dSmrg    _LT_COMPILER_C_O($1)
7921fda9279dSmrg    _LT_COMPILER_FILE_LOCKS($1)
7922fda9279dSmrg    _LT_LINKER_SHLIBS($1)
7923fda9279dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7924fda9279dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7925fda9279dSmrg
7926fda9279dSmrg    _LT_CONFIG($1)
7927fda9279dSmrg  fi # test -n "$compiler"
7928fda9279dSmrg
7929fda9279dSmrg  GCC=$lt_save_GCC
7930fda9279dSmrg  CC=$lt_save_CC
7931fda9279dSmrg  CFLAGS=$lt_save_CFLAGS
793216ee1e9aSmrgfi # test yes != "$_lt_disable_FC"
7933fda9279dSmrg
7934fda9279dSmrgAC_LANG_POP
7935fda9279dSmrg])# _LT_LANG_FC_CONFIG
7936fda9279dSmrg
7937fda9279dSmrg
7938fda9279dSmrg# _LT_LANG_GCJ_CONFIG([TAG])
7939fda9279dSmrg# --------------------------
7940fda9279dSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7941fda9279dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
794216ee1e9aSmrg# to write the compiler configuration to 'libtool'.
7943fda9279dSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
7944fda9279dSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7945fda9279dSmrgAC_LANG_SAVE
7946fda9279dSmrg
7947fda9279dSmrg# Source file extension for Java test sources.
7948fda9279dSmrgac_ext=java
7949fda9279dSmrg
7950fda9279dSmrg# Object file extension for compiled Java test sources.
7951fda9279dSmrgobjext=o
7952fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
7953fda9279dSmrg
7954fda9279dSmrg# Code to be used in simple compile tests
7955fda9279dSmrglt_simple_compile_test_code="class foo {}"
7956fda9279dSmrg
7957fda9279dSmrg# Code to be used in simple link tests
7958fda9279dSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7959fda9279dSmrg
7960fda9279dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7961fda9279dSmrg_LT_TAG_COMPILER
7962fda9279dSmrg
7963fda9279dSmrg# save warnings/boilerplate of simple test code
7964fda9279dSmrg_LT_COMPILER_BOILERPLATE
7965fda9279dSmrg_LT_LINKER_BOILERPLATE
7966fda9279dSmrg
7967fda9279dSmrg# Allow CC to be a program name with arguments.
7968fda9279dSmrglt_save_CC=$CC
7969fda9279dSmrglt_save_CFLAGS=$CFLAGS
7970fda9279dSmrglt_save_GCC=$GCC
7971fda9279dSmrgGCC=yes
7972fda9279dSmrgCC=${GCJ-"gcj"}
7973fda9279dSmrgCFLAGS=$GCJFLAGS
7974fda9279dSmrgcompiler=$CC
7975fda9279dSmrg_LT_TAGVAR(compiler, $1)=$CC
797616ee1e9aSmrg_LT_TAGVAR(LD, $1)=$LD
7977fda9279dSmrg_LT_CC_BASENAME([$compiler])
7978fda9279dSmrg
7979fda9279dSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7980fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7981fda9279dSmrg
7982fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7983fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7984fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7985fda9279dSmrg
7986fda9279dSmrgif test -n "$compiler"; then
7987fda9279dSmrg  _LT_COMPILER_NO_RTTI($1)
7988fda9279dSmrg  _LT_COMPILER_PIC($1)
7989fda9279dSmrg  _LT_COMPILER_C_O($1)
7990fda9279dSmrg  _LT_COMPILER_FILE_LOCKS($1)
7991fda9279dSmrg  _LT_LINKER_SHLIBS($1)
7992fda9279dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7993fda9279dSmrg
7994fda9279dSmrg  _LT_CONFIG($1)
7995fda9279dSmrgfi
7996fda9279dSmrg
7997fda9279dSmrgAC_LANG_RESTORE
7998fda9279dSmrg
7999fda9279dSmrgGCC=$lt_save_GCC
8000fda9279dSmrgCC=$lt_save_CC
8001fda9279dSmrgCFLAGS=$lt_save_CFLAGS
8002fda9279dSmrg])# _LT_LANG_GCJ_CONFIG
8003fda9279dSmrg
8004fda9279dSmrg
8005fda9279dSmrg# _LT_LANG_GO_CONFIG([TAG])
8006fda9279dSmrg# --------------------------
8007fda9279dSmrg# Ensure that the configuration variables for the GNU Go compiler
8008fda9279dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
800916ee1e9aSmrg# to write the compiler configuration to 'libtool'.
8010fda9279dSmrgm4_defun([_LT_LANG_GO_CONFIG],
8011fda9279dSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8012fda9279dSmrgAC_LANG_SAVE
8013fda9279dSmrg
8014fda9279dSmrg# Source file extension for Go test sources.
8015fda9279dSmrgac_ext=go
8016fda9279dSmrg
8017fda9279dSmrg# Object file extension for compiled Go test sources.
8018fda9279dSmrgobjext=o
8019fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
8020fda9279dSmrg
8021fda9279dSmrg# Code to be used in simple compile tests
8022fda9279dSmrglt_simple_compile_test_code="package main; func main() { }"
8023fda9279dSmrg
8024fda9279dSmrg# Code to be used in simple link tests
8025fda9279dSmrglt_simple_link_test_code='package main; func main() { }'
8026fda9279dSmrg
8027fda9279dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8028fda9279dSmrg_LT_TAG_COMPILER
8029fda9279dSmrg
8030fda9279dSmrg# save warnings/boilerplate of simple test code
8031fda9279dSmrg_LT_COMPILER_BOILERPLATE
8032fda9279dSmrg_LT_LINKER_BOILERPLATE
8033fda9279dSmrg
8034fda9279dSmrg# Allow CC to be a program name with arguments.
8035fda9279dSmrglt_save_CC=$CC
8036fda9279dSmrglt_save_CFLAGS=$CFLAGS
8037fda9279dSmrglt_save_GCC=$GCC
8038fda9279dSmrgGCC=yes
8039fda9279dSmrgCC=${GOC-"gccgo"}
8040fda9279dSmrgCFLAGS=$GOFLAGS
8041fda9279dSmrgcompiler=$CC
8042fda9279dSmrg_LT_TAGVAR(compiler, $1)=$CC
804316ee1e9aSmrg_LT_TAGVAR(LD, $1)=$LD
8044fda9279dSmrg_LT_CC_BASENAME([$compiler])
8045fda9279dSmrg
8046fda9279dSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8047fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8048fda9279dSmrg
8049fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8050fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8051fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8052fda9279dSmrg
8053fda9279dSmrgif test -n "$compiler"; then
8054fda9279dSmrg  _LT_COMPILER_NO_RTTI($1)
8055fda9279dSmrg  _LT_COMPILER_PIC($1)
8056fda9279dSmrg  _LT_COMPILER_C_O($1)
8057fda9279dSmrg  _LT_COMPILER_FILE_LOCKS($1)
8058fda9279dSmrg  _LT_LINKER_SHLIBS($1)
8059fda9279dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8060fda9279dSmrg
8061fda9279dSmrg  _LT_CONFIG($1)
8062fda9279dSmrgfi
8063fda9279dSmrg
8064fda9279dSmrgAC_LANG_RESTORE
8065fda9279dSmrg
8066fda9279dSmrgGCC=$lt_save_GCC
8067fda9279dSmrgCC=$lt_save_CC
8068fda9279dSmrgCFLAGS=$lt_save_CFLAGS
8069fda9279dSmrg])# _LT_LANG_GO_CONFIG
8070fda9279dSmrg
8071fda9279dSmrg
8072fda9279dSmrg# _LT_LANG_RC_CONFIG([TAG])
8073fda9279dSmrg# -------------------------
8074fda9279dSmrg# Ensure that the configuration variables for the Windows resource compiler
8075fda9279dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
807616ee1e9aSmrg# to write the compiler configuration to 'libtool'.
8077fda9279dSmrgm4_defun([_LT_LANG_RC_CONFIG],
8078fda9279dSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8079fda9279dSmrgAC_LANG_SAVE
8080fda9279dSmrg
8081fda9279dSmrg# Source file extension for RC test sources.
8082fda9279dSmrgac_ext=rc
8083fda9279dSmrg
8084fda9279dSmrg# Object file extension for compiled RC test sources.
8085fda9279dSmrgobjext=o
8086fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
8087fda9279dSmrg
8088fda9279dSmrg# Code to be used in simple compile tests
8089fda9279dSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8090fda9279dSmrg
8091fda9279dSmrg# Code to be used in simple link tests
809216ee1e9aSmrglt_simple_link_test_code=$lt_simple_compile_test_code
8093fda9279dSmrg
8094fda9279dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8095fda9279dSmrg_LT_TAG_COMPILER
8096fda9279dSmrg
8097fda9279dSmrg# save warnings/boilerplate of simple test code
8098fda9279dSmrg_LT_COMPILER_BOILERPLATE
8099fda9279dSmrg_LT_LINKER_BOILERPLATE
8100fda9279dSmrg
8101fda9279dSmrg# Allow CC to be a program name with arguments.
810216ee1e9aSmrglt_save_CC=$CC
8103fda9279dSmrglt_save_CFLAGS=$CFLAGS
8104fda9279dSmrglt_save_GCC=$GCC
8105fda9279dSmrgGCC=
8106fda9279dSmrgCC=${RC-"windres"}
8107fda9279dSmrgCFLAGS=
8108fda9279dSmrgcompiler=$CC
8109fda9279dSmrg_LT_TAGVAR(compiler, $1)=$CC
8110fda9279dSmrg_LT_CC_BASENAME([$compiler])
8111fda9279dSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8112fda9279dSmrg
8113fda9279dSmrgif test -n "$compiler"; then
8114fda9279dSmrg  :
8115fda9279dSmrg  _LT_CONFIG($1)
8116fda9279dSmrgfi
8117fda9279dSmrg
8118fda9279dSmrgGCC=$lt_save_GCC
8119fda9279dSmrgAC_LANG_RESTORE
8120fda9279dSmrgCC=$lt_save_CC
8121fda9279dSmrgCFLAGS=$lt_save_CFLAGS
8122fda9279dSmrg])# _LT_LANG_RC_CONFIG
8123fda9279dSmrg
8124fda9279dSmrg
8125fda9279dSmrg# LT_PROG_GCJ
8126fda9279dSmrg# -----------
8127fda9279dSmrgAC_DEFUN([LT_PROG_GCJ],
8128fda9279dSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8129fda9279dSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8130fda9279dSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
813116ee1e9aSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8132fda9279dSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
8133fda9279dSmrg])
8134fda9279dSmrg
8135fda9279dSmrg# Old name:
8136fda9279dSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8137fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8138fda9279dSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8139fda9279dSmrg
8140fda9279dSmrg
8141fda9279dSmrg# LT_PROG_GO
8142fda9279dSmrg# ----------
8143fda9279dSmrgAC_DEFUN([LT_PROG_GO],
8144fda9279dSmrg[AC_CHECK_TOOL(GOC, gccgo,)
8145fda9279dSmrg])
8146fda9279dSmrg
8147fda9279dSmrg
8148fda9279dSmrg# LT_PROG_RC
8149fda9279dSmrg# ----------
8150fda9279dSmrgAC_DEFUN([LT_PROG_RC],
8151fda9279dSmrg[AC_CHECK_TOOL(RC, windres,)
8152fda9279dSmrg])
8153fda9279dSmrg
8154fda9279dSmrg# Old name:
8155fda9279dSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8156fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8157fda9279dSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8158fda9279dSmrg
8159fda9279dSmrg
8160fda9279dSmrg# _LT_DECL_EGREP
8161fda9279dSmrg# --------------
8162fda9279dSmrg# If we don't have a new enough Autoconf to choose the best grep
8163fda9279dSmrg# available, choose the one first in the user's PATH.
8164fda9279dSmrgm4_defun([_LT_DECL_EGREP],
8165fda9279dSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8166fda9279dSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8167fda9279dSmrgtest -z "$GREP" && GREP=grep
8168fda9279dSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8169fda9279dSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8170fda9279dSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8171fda9279dSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8172fda9279dSmrgAC_SUBST([GREP])
8173fda9279dSmrg])
8174fda9279dSmrg
8175fda9279dSmrg
8176fda9279dSmrg# _LT_DECL_OBJDUMP
8177fda9279dSmrg# --------------
8178fda9279dSmrg# If we don't have a new enough Autoconf to choose the best objdump
8179fda9279dSmrg# available, choose the one first in the user's PATH.
8180fda9279dSmrgm4_defun([_LT_DECL_OBJDUMP],
8181fda9279dSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8182fda9279dSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8183fda9279dSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8184fda9279dSmrgAC_SUBST([OBJDUMP])
8185fda9279dSmrg])
8186fda9279dSmrg
8187fda9279dSmrg# _LT_DECL_DLLTOOL
8188fda9279dSmrg# ----------------
8189fda9279dSmrg# Ensure DLLTOOL variable is set.
8190fda9279dSmrgm4_defun([_LT_DECL_DLLTOOL],
8191fda9279dSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8192fda9279dSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8193fda9279dSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8194fda9279dSmrgAC_SUBST([DLLTOOL])
8195fda9279dSmrg])
8196fda9279dSmrg
8197fda9279dSmrg# _LT_DECL_SED
8198fda9279dSmrg# ------------
8199fda9279dSmrg# Check for a fully-functional sed program, that truncates
8200fda9279dSmrg# as few characters as possible.  Prefer GNU sed if found.
8201fda9279dSmrgm4_defun([_LT_DECL_SED],
8202fda9279dSmrg[AC_PROG_SED
8203fda9279dSmrgtest -z "$SED" && SED=sed
8204fda9279dSmrgXsed="$SED -e 1s/^X//"
8205fda9279dSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8206fda9279dSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8207fda9279dSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8208fda9279dSmrg])# _LT_DECL_SED
8209fda9279dSmrg
8210fda9279dSmrgm4_ifndef([AC_PROG_SED], [
8211fda9279dSmrg# NOTE: This macro has been submitted for inclusion into   #
8212fda9279dSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8213fda9279dSmrg#  a released version of Autoconf we should remove this    #
8214fda9279dSmrg#  macro and use it instead.                               #
8215fda9279dSmrg
8216fda9279dSmrgm4_defun([AC_PROG_SED],
8217fda9279dSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8218fda9279dSmrgAC_CACHE_VAL(lt_cv_path_SED,
8219fda9279dSmrg[# Loop through the user's path and test for sed and gsed.
8220fda9279dSmrg# Then use that list of sed's as ones to test for truncation.
8221fda9279dSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8222fda9279dSmrgfor as_dir in $PATH
8223fda9279dSmrgdo
8224fda9279dSmrg  IFS=$as_save_IFS
8225fda9279dSmrg  test -z "$as_dir" && as_dir=.
8226fda9279dSmrg  for lt_ac_prog in sed gsed; do
8227fda9279dSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8228fda9279dSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8229fda9279dSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8230fda9279dSmrg      fi
8231fda9279dSmrg    done
8232fda9279dSmrg  done
8233fda9279dSmrgdone
8234fda9279dSmrgIFS=$as_save_IFS
8235fda9279dSmrglt_ac_max=0
8236fda9279dSmrglt_ac_count=0
8237fda9279dSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8238fda9279dSmrg# along with /bin/sed that truncates output.
8239fda9279dSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
824016ee1e9aSmrg  test ! -f "$lt_ac_sed" && continue
8241fda9279dSmrg  cat /dev/null > conftest.in
8242fda9279dSmrg  lt_ac_count=0
8243fda9279dSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8244fda9279dSmrg  # Check for GNU sed and select it if it is found.
8245fda9279dSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8246fda9279dSmrg    lt_cv_path_SED=$lt_ac_sed
8247fda9279dSmrg    break
8248fda9279dSmrg  fi
8249fda9279dSmrg  while true; do
8250fda9279dSmrg    cat conftest.in conftest.in >conftest.tmp
8251fda9279dSmrg    mv conftest.tmp conftest.in
8252fda9279dSmrg    cp conftest.in conftest.nl
8253fda9279dSmrg    echo >>conftest.nl
8254fda9279dSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8255fda9279dSmrg    cmp -s conftest.out conftest.nl || break
8256fda9279dSmrg    # 10000 chars as input seems more than enough
825716ee1e9aSmrg    test 10 -lt "$lt_ac_count" && break
8258fda9279dSmrg    lt_ac_count=`expr $lt_ac_count + 1`
825916ee1e9aSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8260fda9279dSmrg      lt_ac_max=$lt_ac_count
8261fda9279dSmrg      lt_cv_path_SED=$lt_ac_sed
8262fda9279dSmrg    fi
8263fda9279dSmrg  done
8264fda9279dSmrgdone
8265fda9279dSmrg])
8266fda9279dSmrgSED=$lt_cv_path_SED
8267fda9279dSmrgAC_SUBST([SED])
8268fda9279dSmrgAC_MSG_RESULT([$SED])
8269fda9279dSmrg])#AC_PROG_SED
8270fda9279dSmrg])#m4_ifndef
8271fda9279dSmrg
8272fda9279dSmrg# Old name:
8273fda9279dSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8274fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8275fda9279dSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8276fda9279dSmrg
8277fda9279dSmrg
8278fda9279dSmrg# _LT_CHECK_SHELL_FEATURES
8279fda9279dSmrg# ------------------------
8280fda9279dSmrg# Find out whether the shell is Bourne or XSI compatible,
8281fda9279dSmrg# or has some other useful features.
8282fda9279dSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
828316ee1e9aSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8284fda9279dSmrg  lt_unset=unset
8285fda9279dSmrgelse
8286fda9279dSmrg  lt_unset=false
8287fda9279dSmrgfi
8288fda9279dSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8289fda9279dSmrg
8290fda9279dSmrg# test EBCDIC or ASCII
8291fda9279dSmrgcase `echo X|tr X '\101'` in
8292fda9279dSmrg A) # ASCII based system
8293fda9279dSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8294fda9279dSmrg  lt_SP2NL='tr \040 \012'
8295fda9279dSmrg  lt_NL2SP='tr \015\012 \040\040'
8296fda9279dSmrg  ;;
8297fda9279dSmrg *) # EBCDIC based system
8298fda9279dSmrg  lt_SP2NL='tr \100 \n'
8299fda9279dSmrg  lt_NL2SP='tr \r\n \100\100'
8300fda9279dSmrg  ;;
8301fda9279dSmrgesac
8302fda9279dSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8303fda9279dSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8304fda9279dSmrg])# _LT_CHECK_SHELL_FEATURES
8305fda9279dSmrg
8306fda9279dSmrg
8307fda9279dSmrg# _LT_PATH_CONVERSION_FUNCTIONS
8308fda9279dSmrg# -----------------------------
830916ee1e9aSmrg# Determine what file name conversion functions should be used by
8310fda9279dSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8311fda9279dSmrg# for certain cross-compile configurations and native mingw.
8312fda9279dSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8313fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8314fda9279dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8315fda9279dSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8316fda9279dSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8317fda9279dSmrg[case $host in
8318fda9279dSmrg  *-*-mingw* )
8319fda9279dSmrg    case $build in
8320fda9279dSmrg      *-*-mingw* ) # actually msys
8321fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8322fda9279dSmrg        ;;
8323fda9279dSmrg      *-*-cygwin* )
8324fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8325fda9279dSmrg        ;;
8326fda9279dSmrg      * ) # otherwise, assume *nix
8327fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8328fda9279dSmrg        ;;
8329fda9279dSmrg    esac
8330fda9279dSmrg    ;;
8331fda9279dSmrg  *-*-cygwin* )
8332fda9279dSmrg    case $build in
8333fda9279dSmrg      *-*-mingw* ) # actually msys
8334fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8335fda9279dSmrg        ;;
8336fda9279dSmrg      *-*-cygwin* )
8337fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8338fda9279dSmrg        ;;
8339fda9279dSmrg      * ) # otherwise, assume *nix
8340fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8341fda9279dSmrg        ;;
8342fda9279dSmrg    esac
8343fda9279dSmrg    ;;
8344fda9279dSmrg  * ) # unhandled hosts (and "normal" native builds)
8345fda9279dSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8346fda9279dSmrg    ;;
8347fda9279dSmrgesac
8348fda9279dSmrg])
8349fda9279dSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8350fda9279dSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8351fda9279dSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8352fda9279dSmrg         [0], [convert $build file names to $host format])dnl
8353fda9279dSmrg
8354fda9279dSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8355fda9279dSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8356fda9279dSmrg[#assume ordinary cross tools, or native build.
8357fda9279dSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
8358fda9279dSmrgcase $host in
8359fda9279dSmrg  *-*-mingw* )
8360fda9279dSmrg    case $build in
8361fda9279dSmrg      *-*-mingw* ) # actually msys
8362fda9279dSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8363fda9279dSmrg        ;;
8364fda9279dSmrg    esac
8365fda9279dSmrg    ;;
8366fda9279dSmrgesac
8367fda9279dSmrg])
8368fda9279dSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8369fda9279dSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8370fda9279dSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8371fda9279dSmrg         [0], [convert $build files to toolchain format])dnl
8372fda9279dSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
8373fda9279dSmrg
8374fda9279dSmrg# Helper functions for option handling.                    -*- Autoconf -*-
8375fda9279dSmrg#
837616ee1e9aSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
837716ee1e9aSmrg#   Foundation, Inc.
8378fda9279dSmrg#   Written by Gary V. Vaughan, 2004
8379fda9279dSmrg#
8380fda9279dSmrg# This file is free software; the Free Software Foundation gives
8381fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8382fda9279dSmrg# modifications, as long as this notice is preserved.
8383fda9279dSmrg
838416ee1e9aSmrg# serial 8 ltoptions.m4
8385fda9279dSmrg
8386fda9279dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8387fda9279dSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8388fda9279dSmrg
8389fda9279dSmrg
8390fda9279dSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8391fda9279dSmrg# ------------------------------------------
8392fda9279dSmrgm4_define([_LT_MANGLE_OPTION],
8393fda9279dSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8394fda9279dSmrg
8395fda9279dSmrg
8396fda9279dSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8397fda9279dSmrg# ---------------------------------------
8398fda9279dSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8399fda9279dSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8400fda9279dSmrg# saved as a flag.
8401fda9279dSmrgm4_define([_LT_SET_OPTION],
8402fda9279dSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8403fda9279dSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8404fda9279dSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
840516ee1e9aSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
8406fda9279dSmrg])
8407fda9279dSmrg
8408fda9279dSmrg
8409fda9279dSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8410fda9279dSmrg# ------------------------------------------------------------
8411fda9279dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8412fda9279dSmrgm4_define([_LT_IF_OPTION],
8413fda9279dSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8414fda9279dSmrg
8415fda9279dSmrg
8416fda9279dSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8417fda9279dSmrg# -------------------------------------------------------
8418fda9279dSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8419fda9279dSmrg# are set.
8420fda9279dSmrgm4_define([_LT_UNLESS_OPTIONS],
8421fda9279dSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8422fda9279dSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8423fda9279dSmrg		      [m4_define([$0_found])])])[]dnl
8424fda9279dSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8425fda9279dSmrg])[]dnl
8426fda9279dSmrg])
8427fda9279dSmrg
8428fda9279dSmrg
8429fda9279dSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8430fda9279dSmrg# ----------------------------------------
8431fda9279dSmrg# OPTION-LIST is a space-separated list of Libtool options associated
8432fda9279dSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8433fda9279dSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8434fda9279dSmrg# the unknown option and exit.
8435fda9279dSmrgm4_defun([_LT_SET_OPTIONS],
8436fda9279dSmrg[# Set options
8437fda9279dSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8438fda9279dSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
8439fda9279dSmrg
8440fda9279dSmrgm4_if([$1],[LT_INIT],[
8441fda9279dSmrg  dnl
8442fda9279dSmrg  dnl Simply set some default values (i.e off) if boolean options were not
8443fda9279dSmrg  dnl specified:
8444fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8445fda9279dSmrg  ])
8446fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8447fda9279dSmrg  ])
8448fda9279dSmrg  dnl
8449fda9279dSmrg  dnl If no reference was made to various pairs of opposing options, then
8450fda9279dSmrg  dnl we run the default mode handler for the pair.  For example, if neither
845116ee1e9aSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8452fda9279dSmrg  dnl archives by default:
8453fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8454fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8455fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8456fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
845716ee1e9aSmrg		   [_LT_ENABLE_FAST_INSTALL])
845816ee1e9aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
845916ee1e9aSmrg		   [_LT_WITH_AIX_SONAME([aix])])
8460fda9279dSmrg  ])
8461fda9279dSmrg])# _LT_SET_OPTIONS
8462fda9279dSmrg
8463fda9279dSmrg
8464fda9279dSmrg
8465fda9279dSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8466fda9279dSmrg# -----------------------------------------
8467fda9279dSmrgm4_define([_LT_MANGLE_DEFUN],
8468fda9279dSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8469fda9279dSmrg
8470fda9279dSmrg
8471fda9279dSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8472fda9279dSmrg# -----------------------------------------------
8473fda9279dSmrgm4_define([LT_OPTION_DEFINE],
8474fda9279dSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8475fda9279dSmrg])# LT_OPTION_DEFINE
8476fda9279dSmrg
8477fda9279dSmrg
8478fda9279dSmrg# dlopen
8479fda9279dSmrg# ------
8480fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8481fda9279dSmrg])
8482fda9279dSmrg
8483fda9279dSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8484fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8485fda9279dSmrgAC_DIAGNOSE([obsolete],
8486fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
848716ee1e9aSmrgput the 'dlopen' option into LT_INIT's first parameter.])
8488fda9279dSmrg])
8489fda9279dSmrg
8490fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8491fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8492fda9279dSmrg
8493fda9279dSmrg
8494fda9279dSmrg# win32-dll
8495fda9279dSmrg# ---------
8496fda9279dSmrg# Declare package support for building win32 dll's.
8497fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8498fda9279dSmrg[enable_win32_dll=yes
8499fda9279dSmrg
8500fda9279dSmrgcase $host in
8501fda9279dSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8502fda9279dSmrg  AC_CHECK_TOOL(AS, as, false)
8503fda9279dSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8504fda9279dSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8505fda9279dSmrg  ;;
8506fda9279dSmrgesac
8507fda9279dSmrg
8508fda9279dSmrgtest -z "$AS" && AS=as
8509fda9279dSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8510fda9279dSmrg
8511fda9279dSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8512fda9279dSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8513fda9279dSmrg
8514fda9279dSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8515fda9279dSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8516fda9279dSmrg])# win32-dll
8517fda9279dSmrg
8518fda9279dSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8519fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8520fda9279dSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8521fda9279dSmrgAC_DIAGNOSE([obsolete],
8522fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
852316ee1e9aSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
8524fda9279dSmrg])
8525fda9279dSmrg
8526fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8527fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8528fda9279dSmrg
8529fda9279dSmrg
8530fda9279dSmrg# _LT_ENABLE_SHARED([DEFAULT])
8531fda9279dSmrg# ----------------------------
853216ee1e9aSmrg# implement the --enable-shared flag, and supports the 'shared' and
853316ee1e9aSmrg# 'disable-shared' LT_INIT options.
853416ee1e9aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8535fda9279dSmrgm4_define([_LT_ENABLE_SHARED],
8536fda9279dSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8537fda9279dSmrgAC_ARG_ENABLE([shared],
8538fda9279dSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8539fda9279dSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8540fda9279dSmrg    [p=${PACKAGE-default}
8541fda9279dSmrg    case $enableval in
8542fda9279dSmrg    yes) enable_shared=yes ;;
8543fda9279dSmrg    no) enable_shared=no ;;
8544fda9279dSmrg    *)
8545fda9279dSmrg      enable_shared=no
8546fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
854716ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8548fda9279dSmrg      for pkg in $enableval; do
854916ee1e9aSmrg	IFS=$lt_save_ifs
8550fda9279dSmrg	if test "X$pkg" = "X$p"; then
8551fda9279dSmrg	  enable_shared=yes
8552fda9279dSmrg	fi
8553fda9279dSmrg      done
855416ee1e9aSmrg      IFS=$lt_save_ifs
8555fda9279dSmrg      ;;
8556fda9279dSmrg    esac],
8557fda9279dSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8558fda9279dSmrg
8559fda9279dSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8560fda9279dSmrg	[Whether or not to build shared libraries])
8561fda9279dSmrg])# _LT_ENABLE_SHARED
8562fda9279dSmrg
8563fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8564fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8565fda9279dSmrg
8566fda9279dSmrg# Old names:
8567fda9279dSmrgAC_DEFUN([AC_ENABLE_SHARED],
8568fda9279dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8569fda9279dSmrg])
8570fda9279dSmrg
8571fda9279dSmrgAC_DEFUN([AC_DISABLE_SHARED],
8572fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8573fda9279dSmrg])
8574fda9279dSmrg
8575fda9279dSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8576fda9279dSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8577fda9279dSmrg
8578fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8579fda9279dSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8580fda9279dSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8581fda9279dSmrg
8582fda9279dSmrg
8583fda9279dSmrg
8584fda9279dSmrg# _LT_ENABLE_STATIC([DEFAULT])
8585fda9279dSmrg# ----------------------------
858616ee1e9aSmrg# implement the --enable-static flag, and support the 'static' and
858716ee1e9aSmrg# 'disable-static' LT_INIT options.
858816ee1e9aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8589fda9279dSmrgm4_define([_LT_ENABLE_STATIC],
8590fda9279dSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8591fda9279dSmrgAC_ARG_ENABLE([static],
8592fda9279dSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8593fda9279dSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8594fda9279dSmrg    [p=${PACKAGE-default}
8595fda9279dSmrg    case $enableval in
8596fda9279dSmrg    yes) enable_static=yes ;;
8597fda9279dSmrg    no) enable_static=no ;;
8598fda9279dSmrg    *)
8599fda9279dSmrg     enable_static=no
8600fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
860116ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8602fda9279dSmrg      for pkg in $enableval; do
860316ee1e9aSmrg	IFS=$lt_save_ifs
8604fda9279dSmrg	if test "X$pkg" = "X$p"; then
8605fda9279dSmrg	  enable_static=yes
8606fda9279dSmrg	fi
8607fda9279dSmrg      done
860816ee1e9aSmrg      IFS=$lt_save_ifs
8609fda9279dSmrg      ;;
8610fda9279dSmrg    esac],
8611fda9279dSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8612fda9279dSmrg
8613fda9279dSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
8614fda9279dSmrg	[Whether or not to build static libraries])
8615fda9279dSmrg])# _LT_ENABLE_STATIC
8616fda9279dSmrg
8617fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8618fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8619fda9279dSmrg
8620fda9279dSmrg# Old names:
8621fda9279dSmrgAC_DEFUN([AC_ENABLE_STATIC],
8622fda9279dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8623fda9279dSmrg])
8624fda9279dSmrg
8625fda9279dSmrgAC_DEFUN([AC_DISABLE_STATIC],
8626fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8627fda9279dSmrg])
8628fda9279dSmrg
8629fda9279dSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8630fda9279dSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8631fda9279dSmrg
8632fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8633fda9279dSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8634fda9279dSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8635fda9279dSmrg
8636fda9279dSmrg
8637fda9279dSmrg
8638fda9279dSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8639fda9279dSmrg# ----------------------------------
864016ee1e9aSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
864116ee1e9aSmrg# and 'disable-fast-install' LT_INIT options.
864216ee1e9aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8643fda9279dSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
8644fda9279dSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8645fda9279dSmrgAC_ARG_ENABLE([fast-install],
8646fda9279dSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8647fda9279dSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8648fda9279dSmrg    [p=${PACKAGE-default}
8649fda9279dSmrg    case $enableval in
8650fda9279dSmrg    yes) enable_fast_install=yes ;;
8651fda9279dSmrg    no) enable_fast_install=no ;;
8652fda9279dSmrg    *)
8653fda9279dSmrg      enable_fast_install=no
8654fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
865516ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8656fda9279dSmrg      for pkg in $enableval; do
865716ee1e9aSmrg	IFS=$lt_save_ifs
8658fda9279dSmrg	if test "X$pkg" = "X$p"; then
8659fda9279dSmrg	  enable_fast_install=yes
8660fda9279dSmrg	fi
8661fda9279dSmrg      done
866216ee1e9aSmrg      IFS=$lt_save_ifs
8663fda9279dSmrg      ;;
8664fda9279dSmrg    esac],
8665fda9279dSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8666fda9279dSmrg
8667fda9279dSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
8668fda9279dSmrg	 [Whether or not to optimize for fast installation])dnl
8669fda9279dSmrg])# _LT_ENABLE_FAST_INSTALL
8670fda9279dSmrg
8671fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8672fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8673fda9279dSmrg
8674fda9279dSmrg# Old names:
8675fda9279dSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8676fda9279dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8677fda9279dSmrgAC_DIAGNOSE([obsolete],
8678fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
867916ee1e9aSmrgthe 'fast-install' option into LT_INIT's first parameter.])
8680fda9279dSmrg])
8681fda9279dSmrg
8682fda9279dSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8683fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8684fda9279dSmrgAC_DIAGNOSE([obsolete],
8685fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
868616ee1e9aSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
8687fda9279dSmrg])
8688fda9279dSmrg
8689fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8690fda9279dSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8691fda9279dSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8692fda9279dSmrg
8693fda9279dSmrg
869416ee1e9aSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
869516ee1e9aSmrg# ----------------------------------
869616ee1e9aSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
869716ee1e9aSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
869816ee1e9aSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
869916ee1e9aSmrgm4_define([_LT_WITH_AIX_SONAME],
870016ee1e9aSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
870116ee1e9aSmrgshared_archive_member_spec=
870216ee1e9aSmrgcase $host,$enable_shared in
870316ee1e9aSmrgpower*-*-aix[[5-9]]*,yes)
870416ee1e9aSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
870516ee1e9aSmrg  AC_ARG_WITH([aix-soname],
870616ee1e9aSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
870716ee1e9aSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
870816ee1e9aSmrg    [case $withval in
870916ee1e9aSmrg    aix|svr4|both)
871016ee1e9aSmrg      ;;
871116ee1e9aSmrg    *)
871216ee1e9aSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
871316ee1e9aSmrg      ;;
871416ee1e9aSmrg    esac
871516ee1e9aSmrg    lt_cv_with_aix_soname=$with_aix_soname],
871616ee1e9aSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
871716ee1e9aSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
871816ee1e9aSmrg    with_aix_soname=$lt_cv_with_aix_soname])
871916ee1e9aSmrg  AC_MSG_RESULT([$with_aix_soname])
872016ee1e9aSmrg  if test aix != "$with_aix_soname"; then
872116ee1e9aSmrg    # For the AIX way of multilib, we name the shared archive member
872216ee1e9aSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
872316ee1e9aSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
872416ee1e9aSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
872516ee1e9aSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
872616ee1e9aSmrg    if test 64 = "${OBJECT_MODE-32}"; then
872716ee1e9aSmrg      shared_archive_member_spec=shr_64
872816ee1e9aSmrg    else
872916ee1e9aSmrg      shared_archive_member_spec=shr
873016ee1e9aSmrg    fi
873116ee1e9aSmrg  fi
873216ee1e9aSmrg  ;;
873316ee1e9aSmrg*)
873416ee1e9aSmrg  with_aix_soname=aix
873516ee1e9aSmrg  ;;
873616ee1e9aSmrgesac
873716ee1e9aSmrg
873816ee1e9aSmrg_LT_DECL([], [shared_archive_member_spec], [0],
873916ee1e9aSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
874016ee1e9aSmrg])# _LT_WITH_AIX_SONAME
874116ee1e9aSmrg
874216ee1e9aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
874316ee1e9aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
874416ee1e9aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
874516ee1e9aSmrg
874616ee1e9aSmrg
8747fda9279dSmrg# _LT_WITH_PIC([MODE])
8748fda9279dSmrg# --------------------
874916ee1e9aSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8750fda9279dSmrg# LT_INIT options.
875116ee1e9aSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8752fda9279dSmrgm4_define([_LT_WITH_PIC],
8753fda9279dSmrg[AC_ARG_WITH([pic],
8754fda9279dSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8755fda9279dSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8756fda9279dSmrg    [lt_p=${PACKAGE-default}
8757fda9279dSmrg    case $withval in
8758fda9279dSmrg    yes|no) pic_mode=$withval ;;
8759fda9279dSmrg    *)
8760fda9279dSmrg      pic_mode=default
8761fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
876216ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8763fda9279dSmrg      for lt_pkg in $withval; do
876416ee1e9aSmrg	IFS=$lt_save_ifs
8765fda9279dSmrg	if test "X$lt_pkg" = "X$lt_p"; then
8766fda9279dSmrg	  pic_mode=yes
8767fda9279dSmrg	fi
8768fda9279dSmrg      done
876916ee1e9aSmrg      IFS=$lt_save_ifs
8770fda9279dSmrg      ;;
8771fda9279dSmrg    esac],
877216ee1e9aSmrg    [pic_mode=m4_default([$1], [default])])
8773fda9279dSmrg
8774fda9279dSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8775fda9279dSmrg])# _LT_WITH_PIC
8776fda9279dSmrg
8777fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8778fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8779fda9279dSmrg
8780fda9279dSmrg# Old name:
8781fda9279dSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8782fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8783fda9279dSmrgAC_DIAGNOSE([obsolete],
8784fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
878516ee1e9aSmrgput the 'pic-only' option into LT_INIT's first parameter.])
8786fda9279dSmrg])
8787fda9279dSmrg
8788fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8789fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8790fda9279dSmrg
8791fda9279dSmrg
8792fda9279dSmrgm4_define([_LTDL_MODE], [])
8793fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8794fda9279dSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8795fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8796fda9279dSmrg		 [m4_define([_LTDL_MODE], [recursive])])
8797fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8798fda9279dSmrg		 [m4_define([_LTDL_MODE], [subproject])])
8799fda9279dSmrg
8800fda9279dSmrgm4_define([_LTDL_TYPE], [])
8801fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8802fda9279dSmrg		 [m4_define([_LTDL_TYPE], [installable])])
8803fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8804fda9279dSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
8805fda9279dSmrg
8806fda9279dSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8807fda9279dSmrg#
880816ee1e9aSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
880916ee1e9aSmrg# Foundation, Inc.
8810fda9279dSmrg# Written by Gary V. Vaughan, 2004
8811fda9279dSmrg#
8812fda9279dSmrg# This file is free software; the Free Software Foundation gives
8813fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8814fda9279dSmrg# modifications, as long as this notice is preserved.
8815fda9279dSmrg
8816fda9279dSmrg# serial 6 ltsugar.m4
8817fda9279dSmrg
8818fda9279dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8819fda9279dSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8820fda9279dSmrg
8821fda9279dSmrg
8822fda9279dSmrg# lt_join(SEP, ARG1, [ARG2...])
8823fda9279dSmrg# -----------------------------
8824fda9279dSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8825fda9279dSmrg# associated separator.
8826fda9279dSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8827fda9279dSmrg# versions in m4sugar had bugs.
8828fda9279dSmrgm4_define([lt_join],
8829fda9279dSmrg[m4_if([$#], [1], [],
8830fda9279dSmrg       [$#], [2], [[$2]],
8831fda9279dSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8832fda9279dSmrgm4_define([_lt_join],
8833fda9279dSmrg[m4_if([$#$2], [2], [],
8834fda9279dSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8835fda9279dSmrg
8836fda9279dSmrg
8837fda9279dSmrg# lt_car(LIST)
8838fda9279dSmrg# lt_cdr(LIST)
8839fda9279dSmrg# ------------
8840fda9279dSmrg# Manipulate m4 lists.
8841fda9279dSmrg# These macros are necessary as long as will still need to support
884216ee1e9aSmrg# Autoconf-2.59, which quotes differently.
8843fda9279dSmrgm4_define([lt_car], [[$1]])
8844fda9279dSmrgm4_define([lt_cdr],
8845fda9279dSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8846fda9279dSmrg       [$#], 1, [],
8847fda9279dSmrg       [m4_dquote(m4_shift($@))])])
8848fda9279dSmrgm4_define([lt_unquote], $1)
8849fda9279dSmrg
8850fda9279dSmrg
8851fda9279dSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8852fda9279dSmrg# ------------------------------------------
885316ee1e9aSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8854fda9279dSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8855fda9279dSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8856fda9279dSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8857fda9279dSmrg# than defined and empty).
8858fda9279dSmrg#
8859fda9279dSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8860fda9279dSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8861fda9279dSmrgm4_define([lt_append],
8862fda9279dSmrg[m4_define([$1],
8863fda9279dSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8864fda9279dSmrg
8865fda9279dSmrg
8866fda9279dSmrg
8867fda9279dSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8868fda9279dSmrg# ----------------------------------------------------------
8869fda9279dSmrg# Produce a SEP delimited list of all paired combinations of elements of
8870fda9279dSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8871fda9279dSmrg# has the form PREFIXmINFIXSUFFIXn.
8872fda9279dSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8873fda9279dSmrgm4_define([lt_combine],
8874fda9279dSmrg[m4_if(m4_eval([$# > 3]), [1],
8875fda9279dSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8876fda9279dSmrg[[m4_foreach([_Lt_prefix], [$2],
8877fda9279dSmrg	     [m4_foreach([_Lt_suffix],
8878fda9279dSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8879fda9279dSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8880fda9279dSmrg
8881fda9279dSmrg
8882fda9279dSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8883fda9279dSmrg# -----------------------------------------------------------------------
8884fda9279dSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8885fda9279dSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8886fda9279dSmrgm4_define([lt_if_append_uniq],
8887fda9279dSmrg[m4_ifdef([$1],
8888fda9279dSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8889fda9279dSmrg		 [lt_append([$1], [$2], [$3])$4],
8890fda9279dSmrg		 [$5])],
8891fda9279dSmrg	  [lt_append([$1], [$2], [$3])$4])])
8892fda9279dSmrg
8893fda9279dSmrg
8894fda9279dSmrg# lt_dict_add(DICT, KEY, VALUE)
8895fda9279dSmrg# -----------------------------
8896fda9279dSmrgm4_define([lt_dict_add],
8897fda9279dSmrg[m4_define([$1($2)], [$3])])
8898fda9279dSmrg
8899fda9279dSmrg
8900fda9279dSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8901fda9279dSmrg# --------------------------------------------
8902fda9279dSmrgm4_define([lt_dict_add_subkey],
8903fda9279dSmrg[m4_define([$1($2:$3)], [$4])])
8904fda9279dSmrg
8905fda9279dSmrg
8906fda9279dSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8907fda9279dSmrg# ----------------------------------
8908fda9279dSmrgm4_define([lt_dict_fetch],
8909fda9279dSmrg[m4_ifval([$3],
8910fda9279dSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8911fda9279dSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8912fda9279dSmrg
8913fda9279dSmrg
8914fda9279dSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8915fda9279dSmrg# -----------------------------------------------------------------
8916fda9279dSmrgm4_define([lt_if_dict_fetch],
8917fda9279dSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8918fda9279dSmrg	[$5],
8919fda9279dSmrg    [$6])])
8920fda9279dSmrg
8921fda9279dSmrg
8922fda9279dSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8923fda9279dSmrg# --------------------------------------------------------------
8924fda9279dSmrgm4_define([lt_dict_filter],
8925fda9279dSmrg[m4_if([$5], [], [],
8926fda9279dSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8927fda9279dSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8928fda9279dSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8929fda9279dSmrg])
8930fda9279dSmrg
8931fda9279dSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8932fda9279dSmrg#
893316ee1e9aSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
8934fda9279dSmrg#   Written by Scott James Remnant, 2004
8935fda9279dSmrg#
8936fda9279dSmrg# This file is free software; the Free Software Foundation gives
8937fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8938fda9279dSmrg# modifications, as long as this notice is preserved.
8939fda9279dSmrg
8940fda9279dSmrg# @configure_input@
8941fda9279dSmrg
894216ee1e9aSmrg# serial 4179 ltversion.m4
8943fda9279dSmrg# This file is part of GNU Libtool
8944fda9279dSmrg
894516ee1e9aSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
894616ee1e9aSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
8947fda9279dSmrg
8948fda9279dSmrgAC_DEFUN([LTVERSION_VERSION],
894916ee1e9aSmrg[macro_version='2.4.6'
895016ee1e9aSmrgmacro_revision='2.4.6'
8951fda9279dSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8952fda9279dSmrg_LT_DECL(, macro_revision, 0)
8953fda9279dSmrg])
8954fda9279dSmrg
8955fda9279dSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8956fda9279dSmrg#
895716ee1e9aSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
895816ee1e9aSmrg#   Foundation, Inc.
8959fda9279dSmrg#   Written by Scott James Remnant, 2004.
8960fda9279dSmrg#
8961fda9279dSmrg# This file is free software; the Free Software Foundation gives
8962fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8963fda9279dSmrg# modifications, as long as this notice is preserved.
8964fda9279dSmrg
8965fda9279dSmrg# serial 5 lt~obsolete.m4
8966fda9279dSmrg
8967fda9279dSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
8968fda9279dSmrg#
896916ee1e9aSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8970fda9279dSmrg# which have later been changed to m4_define as they aren't part of the
8971fda9279dSmrg# exported API, or moved to Autoconf or Automake where they belong.
8972fda9279dSmrg#
8973fda9279dSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8974fda9279dSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8975fda9279dSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
8976fda9279dSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8977fda9279dSmrg# and doesn't know about Autoconf macros at all.)
8978fda9279dSmrg#
8979fda9279dSmrg# So we provide this file, which has a silly filename so it's always
8980fda9279dSmrg# included after everything else.  This provides aclocal with the
8981fda9279dSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8982fda9279dSmrg# because those macros already exist, or will be overwritten later.
898316ee1e9aSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8984fda9279dSmrg#
8985fda9279dSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8986fda9279dSmrg# Yes, that means every name once taken will need to remain here until
8987fda9279dSmrg# we give up compatibility with versions before 1.7, at which point
8988fda9279dSmrg# we need to keep only those names which we still refer to.
8989fda9279dSmrg
8990fda9279dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8991fda9279dSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8992fda9279dSmrg
8993fda9279dSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8994fda9279dSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8995fda9279dSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8996fda9279dSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8997fda9279dSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8998fda9279dSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8999fda9279dSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9000fda9279dSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9001fda9279dSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9002fda9279dSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9003fda9279dSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9004fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9005fda9279dSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9006fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9007fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9008fda9279dSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9009fda9279dSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9010fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9011fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9012fda9279dSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9013fda9279dSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9014fda9279dSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9015fda9279dSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9016fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9017fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9018fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9019fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9020fda9279dSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9021fda9279dSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9022fda9279dSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9023fda9279dSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9024fda9279dSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9025fda9279dSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9026fda9279dSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9027fda9279dSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9028fda9279dSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9029fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9030fda9279dSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9031fda9279dSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9032fda9279dSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9033fda9279dSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9034fda9279dSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9035fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9036fda9279dSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9037fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9038fda9279dSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9039fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9040fda9279dSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9041fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9042fda9279dSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9043fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9044fda9279dSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9045fda9279dSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9046fda9279dSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9047fda9279dSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9048fda9279dSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9049fda9279dSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9050fda9279dSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9051fda9279dSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9052fda9279dSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9053fda9279dSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9054fda9279dSmrg
9055fda9279dSmrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9056fda9279dSmrg# serial 1 (pkg-config-0.24)
9057fda9279dSmrg# 
9058fda9279dSmrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9059fda9279dSmrg#
9060fda9279dSmrg# This program is free software; you can redistribute it and/or modify
9061fda9279dSmrg# it under the terms of the GNU General Public License as published by
9062fda9279dSmrg# the Free Software Foundation; either version 2 of the License, or
9063fda9279dSmrg# (at your option) any later version.
9064fda9279dSmrg#
9065fda9279dSmrg# This program is distributed in the hope that it will be useful, but
9066fda9279dSmrg# WITHOUT ANY WARRANTY; without even the implied warranty of
9067fda9279dSmrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9068fda9279dSmrg# General Public License for more details.
9069fda9279dSmrg#
9070fda9279dSmrg# You should have received a copy of the GNU General Public License
9071fda9279dSmrg# along with this program; if not, write to the Free Software
9072fda9279dSmrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9073fda9279dSmrg#
9074fda9279dSmrg# As a special exception to the GNU General Public License, if you
9075fda9279dSmrg# distribute this file as part of a program that contains a
9076fda9279dSmrg# configuration script generated by Autoconf, you may include it under
9077fda9279dSmrg# the same distribution terms that you use for the rest of that program.
9078fda9279dSmrg
9079fda9279dSmrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9080fda9279dSmrg# ----------------------------------
9081fda9279dSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9082fda9279dSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9083fda9279dSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9084fda9279dSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9085fda9279dSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9086fda9279dSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9087fda9279dSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9088fda9279dSmrg
9089fda9279dSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9090fda9279dSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9091fda9279dSmrgfi
9092fda9279dSmrgif test -n "$PKG_CONFIG"; then
9093fda9279dSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9094fda9279dSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9095fda9279dSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9096fda9279dSmrg		AC_MSG_RESULT([yes])
9097fda9279dSmrg	else
9098fda9279dSmrg		AC_MSG_RESULT([no])
9099fda9279dSmrg		PKG_CONFIG=""
9100fda9279dSmrg	fi
9101fda9279dSmrgfi[]dnl
9102fda9279dSmrg])# PKG_PROG_PKG_CONFIG
9103fda9279dSmrg
9104fda9279dSmrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9105fda9279dSmrg#
9106fda9279dSmrg# Check to see whether a particular set of modules exists.  Similar
9107fda9279dSmrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9108fda9279dSmrg#
9109fda9279dSmrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9110fda9279dSmrg# only at the first occurence in configure.ac, so if the first place
9111fda9279dSmrg# it's called might be skipped (such as if it is within an "if", you
9112fda9279dSmrg# have to call PKG_CHECK_EXISTS manually
9113fda9279dSmrg# --------------------------------------------------------------
9114fda9279dSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9115fda9279dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9116fda9279dSmrgif test -n "$PKG_CONFIG" && \
9117fda9279dSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9118fda9279dSmrg  m4_default([$2], [:])
9119fda9279dSmrgm4_ifvaln([$3], [else
9120fda9279dSmrg  $3])dnl
9121fda9279dSmrgfi])
9122fda9279dSmrg
9123fda9279dSmrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9124fda9279dSmrg# ---------------------------------------------
9125fda9279dSmrgm4_define([_PKG_CONFIG],
9126fda9279dSmrg[if test -n "$$1"; then
9127fda9279dSmrg    pkg_cv_[]$1="$$1"
9128fda9279dSmrg elif test -n "$PKG_CONFIG"; then
9129fda9279dSmrg    PKG_CHECK_EXISTS([$3],
9130fda9279dSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9131fda9279dSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9132fda9279dSmrg		     [pkg_failed=yes])
9133fda9279dSmrg else
9134fda9279dSmrg    pkg_failed=untried
9135fda9279dSmrgfi[]dnl
9136fda9279dSmrg])# _PKG_CONFIG
9137fda9279dSmrg
9138fda9279dSmrg# _PKG_SHORT_ERRORS_SUPPORTED
9139fda9279dSmrg# -----------------------------
9140fda9279dSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9141fda9279dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9142fda9279dSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9143fda9279dSmrg        _pkg_short_errors_supported=yes
9144fda9279dSmrgelse
9145fda9279dSmrg        _pkg_short_errors_supported=no
9146fda9279dSmrgfi[]dnl
9147fda9279dSmrg])# _PKG_SHORT_ERRORS_SUPPORTED
9148fda9279dSmrg
9149fda9279dSmrg
9150fda9279dSmrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9151fda9279dSmrg# [ACTION-IF-NOT-FOUND])
9152fda9279dSmrg#
9153fda9279dSmrg#
9154fda9279dSmrg# Note that if there is a possibility the first call to
9155fda9279dSmrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
9156fda9279dSmrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9157fda9279dSmrg#
9158fda9279dSmrg#
9159fda9279dSmrg# --------------------------------------------------------------
9160fda9279dSmrgAC_DEFUN([PKG_CHECK_MODULES],
9161fda9279dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9162fda9279dSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9163fda9279dSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9164fda9279dSmrg
9165fda9279dSmrgpkg_failed=no
9166fda9279dSmrgAC_MSG_CHECKING([for $1])
9167fda9279dSmrg
9168fda9279dSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9169fda9279dSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9170fda9279dSmrg
9171fda9279dSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9172fda9279dSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9173fda9279dSmrgSee the pkg-config man page for more details.])
9174fda9279dSmrg
9175fda9279dSmrgif test $pkg_failed = yes; then
9176fda9279dSmrg   	AC_MSG_RESULT([no])
9177fda9279dSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9178fda9279dSmrg        if test $_pkg_short_errors_supported = yes; then
9179fda9279dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9180fda9279dSmrg        else 
9181fda9279dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9182fda9279dSmrg        fi
9183fda9279dSmrg	# Put the nasty error message in config.log where it belongs
9184fda9279dSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9185fda9279dSmrg
9186fda9279dSmrg	m4_default([$4], [AC_MSG_ERROR(
9187fda9279dSmrg[Package requirements ($2) were not met:
9188fda9279dSmrg
9189fda9279dSmrg$$1_PKG_ERRORS
9190fda9279dSmrg
9191fda9279dSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9192fda9279dSmrginstalled software in a non-standard prefix.
9193fda9279dSmrg
9194fda9279dSmrg_PKG_TEXT])[]dnl
9195fda9279dSmrg        ])
9196fda9279dSmrgelif test $pkg_failed = untried; then
9197fda9279dSmrg     	AC_MSG_RESULT([no])
9198fda9279dSmrg	m4_default([$4], [AC_MSG_FAILURE(
9199fda9279dSmrg[The pkg-config script could not be found or is too old.  Make sure it
9200fda9279dSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9201fda9279dSmrgpath to pkg-config.
9202fda9279dSmrg
9203fda9279dSmrg_PKG_TEXT
9204fda9279dSmrg
9205fda9279dSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9206fda9279dSmrg        ])
9207fda9279dSmrgelse
9208fda9279dSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9209fda9279dSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9210fda9279dSmrg        AC_MSG_RESULT([yes])
9211fda9279dSmrg	$3
9212fda9279dSmrgfi[]dnl
9213fda9279dSmrg])# PKG_CHECK_MODULES
9214fda9279dSmrg
921516ee1e9aSmrg
921616ee1e9aSmrg# PKG_INSTALLDIR(DIRECTORY)
921716ee1e9aSmrg# -------------------------
921816ee1e9aSmrg# Substitutes the variable pkgconfigdir as the location where a module
921916ee1e9aSmrg# should install pkg-config .pc files. By default the directory is
922016ee1e9aSmrg# $libdir/pkgconfig, but the default can be changed by passing
922116ee1e9aSmrg# DIRECTORY. The user can override through the --with-pkgconfigdir
922216ee1e9aSmrg# parameter.
922316ee1e9aSmrgAC_DEFUN([PKG_INSTALLDIR],
922416ee1e9aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
922516ee1e9aSmrgm4_pushdef([pkg_description],
922616ee1e9aSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
922716ee1e9aSmrgAC_ARG_WITH([pkgconfigdir],
922816ee1e9aSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
922916ee1e9aSmrg    [with_pkgconfigdir=]pkg_default)
923016ee1e9aSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
923116ee1e9aSmrgm4_popdef([pkg_default])
923216ee1e9aSmrgm4_popdef([pkg_description])
923316ee1e9aSmrg]) dnl PKG_INSTALLDIR
923416ee1e9aSmrg
923516ee1e9aSmrg
923616ee1e9aSmrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
923716ee1e9aSmrg# -------------------------
923816ee1e9aSmrg# Substitutes the variable noarch_pkgconfigdir as the location where a
923916ee1e9aSmrg# module should install arch-independent pkg-config .pc files. By
924016ee1e9aSmrg# default the directory is $datadir/pkgconfig, but the default can be
924116ee1e9aSmrg# changed by passing DIRECTORY. The user can override through the
924216ee1e9aSmrg# --with-noarch-pkgconfigdir parameter.
924316ee1e9aSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
924416ee1e9aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
924516ee1e9aSmrgm4_pushdef([pkg_description],
924616ee1e9aSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
924716ee1e9aSmrgAC_ARG_WITH([noarch-pkgconfigdir],
924816ee1e9aSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
924916ee1e9aSmrg    [with_noarch_pkgconfigdir=]pkg_default)
925016ee1e9aSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
925116ee1e9aSmrgm4_popdef([pkg_default])
925216ee1e9aSmrgm4_popdef([pkg_description])
925316ee1e9aSmrg]) dnl PKG_NOARCH_INSTALLDIR
925416ee1e9aSmrg
925516ee1e9aSmrg
925616ee1e9aSmrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
925716ee1e9aSmrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
925816ee1e9aSmrg# -------------------------------------------
925916ee1e9aSmrg# Retrieves the value of the pkg-config variable for the given module.
926016ee1e9aSmrgAC_DEFUN([PKG_CHECK_VAR],
926116ee1e9aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
926216ee1e9aSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
926316ee1e9aSmrg
926416ee1e9aSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
926516ee1e9aSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
926616ee1e9aSmrg
926716ee1e9aSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
926816ee1e9aSmrg])# PKG_CHECK_VAR
926916ee1e9aSmrg
9270fda9279dSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9271fda9279dSmrgdnl
9272fda9279dSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
927316ee1e9aSmrgdnl
9274fda9279dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9275fda9279dSmrgdnl copy of this software and associated documentation files (the "Software"),
9276fda9279dSmrgdnl to deal in the Software without restriction, including without limitation
9277fda9279dSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9278fda9279dSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
9279fda9279dSmrgdnl Software is furnished to do so, subject to the following conditions:
9280fda9279dSmrgdnl
9281fda9279dSmrgdnl The above copyright notice and this permission notice (including the next
9282fda9279dSmrgdnl paragraph) shall be included in all copies or substantial portions of the
9283fda9279dSmrgdnl Software.
9284fda9279dSmrgdnl
9285fda9279dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9286fda9279dSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9287fda9279dSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9288fda9279dSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9289fda9279dSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9290fda9279dSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9291fda9279dSmrgdnl DEALINGS IN THE SOFTWARE.
9292fda9279dSmrg
9293fda9279dSmrg# XORG_MACROS_VERSION(required-version)
9294fda9279dSmrg# -------------------------------------
9295fda9279dSmrg# Minimum version: 1.1.0
9296fda9279dSmrg#
9297fda9279dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9298fda9279dSmrg# your configure.ac with the minimum required version, such as:
9299fda9279dSmrg# XORG_MACROS_VERSION(1.1)
9300fda9279dSmrg#
9301fda9279dSmrg# To ensure that this macro is defined, also add:
9302fda9279dSmrg# m4_ifndef([XORG_MACROS_VERSION],
9303fda9279dSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9304fda9279dSmrg#
9305fda9279dSmrg#
930616ee1e9aSmrg# See the "minimum version" comment for each macro you use to see what
9307fda9279dSmrg# version you require.
9308fda9279dSmrgm4_defun([XORG_MACROS_VERSION],[
930916ee1e9aSmrgm4_define([vers_have], [1.19.0])
9310fda9279dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9311fda9279dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9312fda9279dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9313fda9279dSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9314fda9279dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9315fda9279dSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9316fda9279dSmrgm4_undefine([vers_have])
9317fda9279dSmrgm4_undefine([maj_have])
9318fda9279dSmrgm4_undefine([maj_needed])
9319fda9279dSmrg]) # XORG_MACROS_VERSION
9320fda9279dSmrg
9321fda9279dSmrg# XORG_PROG_RAWCPP()
9322fda9279dSmrg# ------------------
9323fda9279dSmrg# Minimum version: 1.0.0
9324fda9279dSmrg#
9325fda9279dSmrg# Find cpp program and necessary flags for use in pre-processing text files
9326fda9279dSmrg# such as man pages and config files
9327fda9279dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9328fda9279dSmrgAC_REQUIRE([AC_PROG_CPP])
932916ee1e9aSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9330fda9279dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9331fda9279dSmrg
9332fda9279dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9333fda9279dSmrg# which is not the best choice for supporting other OS'es, but covers most
9334fda9279dSmrg# of the ones we need for now.
9335fda9279dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9336fda9279dSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9337fda9279dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9338fda9279dSmrg	AC_MSG_RESULT([no])
9339fda9279dSmrgelse
9340fda9279dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9341fda9279dSmrg		RAWCPPFLAGS=-undef
9342fda9279dSmrg		AC_MSG_RESULT([yes])
9343fda9279dSmrg	# under Cygwin unix is still defined even with -undef
9344fda9279dSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9345fda9279dSmrg		RAWCPPFLAGS="-undef -ansi"
9346fda9279dSmrg		AC_MSG_RESULT([yes, with -ansi])
9347fda9279dSmrg	else
9348fda9279dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9349fda9279dSmrg	fi
9350fda9279dSmrgfi
9351fda9279dSmrgrm -f conftest.$ac_ext
9352fda9279dSmrg
9353fda9279dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9354fda9279dSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9355fda9279dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9356fda9279dSmrg	AC_MSG_RESULT([no])
9357fda9279dSmrgelse
9358fda9279dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
935916ee1e9aSmrg		TRADITIONALCPPFLAGS="-traditional"
9360fda9279dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9361fda9279dSmrg		AC_MSG_RESULT([yes])
9362fda9279dSmrg	else
9363fda9279dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9364fda9279dSmrg	fi
9365fda9279dSmrgfi
9366fda9279dSmrgrm -f conftest.$ac_ext
9367fda9279dSmrgAC_SUBST(RAWCPPFLAGS)
936816ee1e9aSmrgAC_SUBST(TRADITIONALCPPFLAGS)
9369fda9279dSmrg]) # XORG_PROG_RAWCPP
9370fda9279dSmrg
9371fda9279dSmrg# XORG_MANPAGE_SECTIONS()
9372fda9279dSmrg# -----------------------
9373fda9279dSmrg# Minimum version: 1.0.0
9374fda9279dSmrg#
9375fda9279dSmrg# Determine which sections man pages go in for the different man page types
9376fda9279dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9377fda9279dSmrg# Not sure if there's any better way than just hardcoding by OS name.
9378fda9279dSmrg# Override default settings by setting environment variables
9379fda9279dSmrg# Added MAN_SUBSTS in version 1.8
9380fda9279dSmrg# Added AC_PROG_SED in version 1.8
9381fda9279dSmrg
9382fda9279dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9383fda9279dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9384fda9279dSmrgAC_REQUIRE([AC_PROG_SED])
9385fda9279dSmrg
9386fda9279dSmrgif test x$APP_MAN_SUFFIX = x    ; then
9387fda9279dSmrg    APP_MAN_SUFFIX=1
9388fda9279dSmrgfi
9389fda9279dSmrgif test x$APP_MAN_DIR = x    ; then
9390fda9279dSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9391fda9279dSmrgfi
9392fda9279dSmrg
9393fda9279dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
9394fda9279dSmrg    LIB_MAN_SUFFIX=3
9395fda9279dSmrgfi
9396fda9279dSmrgif test x$LIB_MAN_DIR = x    ; then
9397fda9279dSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9398fda9279dSmrgfi
9399fda9279dSmrg
9400fda9279dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
9401fda9279dSmrg    case $host_os in
9402fda9279dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9403fda9279dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
9404fda9279dSmrg    esac
9405fda9279dSmrgfi
9406fda9279dSmrgif test x$FILE_MAN_DIR = x    ; then
9407fda9279dSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9408fda9279dSmrgfi
9409fda9279dSmrg
9410fda9279dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
9411fda9279dSmrg    case $host_os in
9412fda9279dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9413fda9279dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
9414fda9279dSmrg    esac
9415fda9279dSmrgfi
9416fda9279dSmrgif test x$MISC_MAN_DIR = x    ; then
9417fda9279dSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9418fda9279dSmrgfi
9419fda9279dSmrg
9420fda9279dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9421fda9279dSmrg    case $host_os in
9422fda9279dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9423fda9279dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9424fda9279dSmrg    esac
9425fda9279dSmrgfi
9426fda9279dSmrgif test x$DRIVER_MAN_DIR = x    ; then
9427fda9279dSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9428fda9279dSmrgfi
9429fda9279dSmrg
9430fda9279dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9431fda9279dSmrg    case $host_os in
9432fda9279dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9433fda9279dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9434fda9279dSmrg    esac
9435fda9279dSmrgfi
9436fda9279dSmrgif test x$ADMIN_MAN_DIR = x    ; then
9437fda9279dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9438fda9279dSmrgfi
9439fda9279dSmrg
9440fda9279dSmrg
9441fda9279dSmrgAC_SUBST([APP_MAN_SUFFIX])
9442fda9279dSmrgAC_SUBST([LIB_MAN_SUFFIX])
9443fda9279dSmrgAC_SUBST([FILE_MAN_SUFFIX])
9444fda9279dSmrgAC_SUBST([MISC_MAN_SUFFIX])
9445fda9279dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9446fda9279dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9447fda9279dSmrgAC_SUBST([APP_MAN_DIR])
9448fda9279dSmrgAC_SUBST([LIB_MAN_DIR])
9449fda9279dSmrgAC_SUBST([FILE_MAN_DIR])
9450fda9279dSmrgAC_SUBST([MISC_MAN_DIR])
9451fda9279dSmrgAC_SUBST([DRIVER_MAN_DIR])
9452fda9279dSmrgAC_SUBST([ADMIN_MAN_DIR])
9453fda9279dSmrg
9454fda9279dSmrgXORG_MAN_PAGE="X Version 11"
9455fda9279dSmrgAC_SUBST([XORG_MAN_PAGE])
9456fda9279dSmrgMAN_SUBSTS="\
9457fda9279dSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9458fda9279dSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9459fda9279dSmrg	-e 's|__xservername__|Xorg|g' \
9460fda9279dSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
9461fda9279dSmrg	-e 's|__projectroot__|\$(prefix)|g' \
9462fda9279dSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9463fda9279dSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9464fda9279dSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9465fda9279dSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9466fda9279dSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9467fda9279dSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9468fda9279dSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9469fda9279dSmrgAC_SUBST([MAN_SUBSTS])
9470fda9279dSmrg
9471fda9279dSmrg]) # XORG_MANPAGE_SECTIONS
9472fda9279dSmrg
9473fda9279dSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9474fda9279dSmrg# ------------------------
9475fda9279dSmrg# Minimum version: 1.7.0
9476fda9279dSmrg#
9477fda9279dSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9478fda9279dSmrg# provided by xorg-sgml-doctools, if installed.
9479fda9279dSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9480fda9279dSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9481fda9279dSmrgXORG_SGML_PATH=
9482fda9279dSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9483fda9279dSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9484fda9279dSmrg    [m4_ifval([$1],[:],
9485fda9279dSmrg        [if test x"$cross_compiling" != x"yes" ; then
9486fda9279dSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9487fda9279dSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9488fda9279dSmrg         fi])
9489fda9279dSmrg    ])
9490fda9279dSmrg
9491fda9279dSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9492fda9279dSmrg# the path and the name of the doc stylesheet
9493fda9279dSmrgif test "x$XORG_SGML_PATH" != "x" ; then
9494fda9279dSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9495fda9279dSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9496fda9279dSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9497fda9279dSmrgelse
9498fda9279dSmrg   AC_MSG_RESULT([no])
9499fda9279dSmrgfi
9500fda9279dSmrg
9501fda9279dSmrgAC_SUBST(XORG_SGML_PATH)
9502fda9279dSmrgAC_SUBST(STYLESHEET_SRCDIR)
9503fda9279dSmrgAC_SUBST(XSL_STYLESHEET)
9504fda9279dSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9505fda9279dSmrg]) # XORG_CHECK_SGML_DOCTOOLS
9506fda9279dSmrg
9507fda9279dSmrg# XORG_CHECK_LINUXDOC
9508fda9279dSmrg# -------------------
9509fda9279dSmrg# Minimum version: 1.0.0
9510fda9279dSmrg#
9511fda9279dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
9512fda9279dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9513fda9279dSmrg# Whether or not the necessary tools and files are found can be checked
9514fda9279dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9515fda9279dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9516fda9279dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9517fda9279dSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9518fda9279dSmrg
9519fda9279dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9520fda9279dSmrg
9521fda9279dSmrgAC_MSG_CHECKING([whether to build documentation])
9522fda9279dSmrg
9523fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9524fda9279dSmrg   BUILDDOC=yes
9525fda9279dSmrgelse
9526fda9279dSmrg   BUILDDOC=no
9527fda9279dSmrgfi
9528fda9279dSmrg
9529fda9279dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9530fda9279dSmrg
9531fda9279dSmrgAC_MSG_RESULT([$BUILDDOC])
9532fda9279dSmrg
9533fda9279dSmrgAC_MSG_CHECKING([whether to build pdf documentation])
9534fda9279dSmrg
9535fda9279dSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9536fda9279dSmrg   BUILDPDFDOC=yes
9537fda9279dSmrgelse
9538fda9279dSmrg   BUILDPDFDOC=no
9539fda9279dSmrgfi
9540fda9279dSmrg
9541fda9279dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9542fda9279dSmrg
9543fda9279dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9544fda9279dSmrg
9545fda9279dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9546fda9279dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9547fda9279dSmrgMAKE_PDF="$PS2PDF"
9548fda9279dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9549fda9279dSmrg
9550fda9279dSmrgAC_SUBST(MAKE_TEXT)
9551fda9279dSmrgAC_SUBST(MAKE_PS)
9552fda9279dSmrgAC_SUBST(MAKE_PDF)
9553fda9279dSmrgAC_SUBST(MAKE_HTML)
9554fda9279dSmrg]) # XORG_CHECK_LINUXDOC
9555fda9279dSmrg
9556fda9279dSmrg# XORG_CHECK_DOCBOOK
9557fda9279dSmrg# -------------------
9558fda9279dSmrg# Minimum version: 1.0.0
9559fda9279dSmrg#
9560fda9279dSmrg# Checks for the ability to build output formats from SGML DocBook source.
9561fda9279dSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9562fda9279dSmrg# indicates whether the necessary tools and files are found and, if set,
9563fda9279dSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9564fda9279dSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9565fda9279dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9566fda9279dSmrg
9567fda9279dSmrgBUILDTXTDOC=no
9568fda9279dSmrgBUILDPDFDOC=no
9569fda9279dSmrgBUILDPSDOC=no
9570fda9279dSmrgBUILDHTMLDOC=no
9571fda9279dSmrg
9572fda9279dSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9573fda9279dSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9574fda9279dSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9575fda9279dSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9576fda9279dSmrg
9577fda9279dSmrgAC_MSG_CHECKING([whether to build text documentation])
9578fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9579fda9279dSmrg   test x$BUILD_TXTDOC != xno; then
9580fda9279dSmrg	BUILDTXTDOC=yes
9581fda9279dSmrgfi
9582fda9279dSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9583fda9279dSmrgAC_MSG_RESULT([$BUILDTXTDOC])
9584fda9279dSmrg
9585fda9279dSmrgAC_MSG_CHECKING([whether to build PDF documentation])
9586fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9587fda9279dSmrg   test x$BUILD_PDFDOC != xno; then
9588fda9279dSmrg	BUILDPDFDOC=yes
9589fda9279dSmrgfi
9590fda9279dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9591fda9279dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9592fda9279dSmrg
9593fda9279dSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9594fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9595fda9279dSmrg   test x$BUILD_PSDOC != xno; then
9596fda9279dSmrg	BUILDPSDOC=yes
9597fda9279dSmrgfi
9598fda9279dSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9599fda9279dSmrgAC_MSG_RESULT([$BUILDPSDOC])
9600fda9279dSmrg
9601fda9279dSmrgAC_MSG_CHECKING([whether to build HTML documentation])
9602fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9603fda9279dSmrg   test x$BUILD_HTMLDOC != xno; then
9604fda9279dSmrg	BUILDHTMLDOC=yes
9605fda9279dSmrgfi
9606fda9279dSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9607fda9279dSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9608fda9279dSmrg
9609fda9279dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9610fda9279dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9611fda9279dSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9612fda9279dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9613fda9279dSmrg
9614fda9279dSmrgAC_SUBST(MAKE_TEXT)
9615fda9279dSmrgAC_SUBST(MAKE_PS)
9616fda9279dSmrgAC_SUBST(MAKE_PDF)
9617fda9279dSmrgAC_SUBST(MAKE_HTML)
9618fda9279dSmrg]) # XORG_CHECK_DOCBOOK
9619fda9279dSmrg
9620fda9279dSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9621fda9279dSmrg# ----------------
9622fda9279dSmrg# Minimum version: 1.5.0
9623fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9624fda9279dSmrg#
9625fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9626fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9627fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9628fda9279dSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9629fda9279dSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9630fda9279dSmrg# --with-xmlto assumes 'auto'.
9631fda9279dSmrg#
9632fda9279dSmrg# Interface to module:
9633fda9279dSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9634fda9279dSmrg# XMLTO:	returns the path of the xmlto program found
9635fda9279dSmrg#		returns the path set by the user in the environment
9636fda9279dSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9637fda9279dSmrg#		'no' user instructs the module not to use xmlto
9638fda9279dSmrg#
9639fda9279dSmrg# Added in version 1.10.0
9640fda9279dSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9641fda9279dSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9642fda9279dSmrg#
9643fda9279dSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9644fda9279dSmrg#
9645fda9279dSmrgAC_DEFUN([XORG_WITH_XMLTO],[
9646fda9279dSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9647fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9648fda9279dSmrgAC_ARG_WITH(xmlto,
9649fda9279dSmrg	AS_HELP_STRING([--with-xmlto],
9650fda9279dSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9651fda9279dSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9652fda9279dSmrgm4_undefine([_defopt])
9653fda9279dSmrg
9654fda9279dSmrgif test "x$use_xmlto" = x"auto"; then
9655fda9279dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9656fda9279dSmrg   if test "x$XMLTO" = "x"; then
9657fda9279dSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9658fda9279dSmrg	have_xmlto=no
9659fda9279dSmrg   else
9660fda9279dSmrg        have_xmlto=yes
9661fda9279dSmrg   fi
9662fda9279dSmrgelif test "x$use_xmlto" = x"yes" ; then
9663fda9279dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9664fda9279dSmrg   if test "x$XMLTO" = "x"; then
9665fda9279dSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9666fda9279dSmrg   fi
9667fda9279dSmrg   have_xmlto=yes
9668fda9279dSmrgelif test "x$use_xmlto" = x"no" ; then
9669fda9279dSmrg   if test "x$XMLTO" != "x"; then
9670fda9279dSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9671fda9279dSmrg   fi
9672fda9279dSmrg   have_xmlto=no
9673fda9279dSmrgelse
9674fda9279dSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9675fda9279dSmrgfi
9676fda9279dSmrg
9677fda9279dSmrg# Test for a minimum version of xmlto, if provided.
9678fda9279dSmrgm4_ifval([$1],
9679fda9279dSmrg[if test "$have_xmlto" = yes; then
9680fda9279dSmrg    # scrape the xmlto version
9681fda9279dSmrg    AC_MSG_CHECKING([the xmlto version])
9682fda9279dSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9683fda9279dSmrg    AC_MSG_RESULT([$xmlto_version])
9684fda9279dSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9685fda9279dSmrg        [if test "x$use_xmlto" = xauto; then
9686fda9279dSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9687fda9279dSmrg            have_xmlto=no
9688fda9279dSmrg        else
9689fda9279dSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9690fda9279dSmrg        fi])
9691fda9279dSmrgfi])
9692fda9279dSmrg
9693fda9279dSmrg# Test for the ability of xmlto to generate a text target
9694fda9279dSmrghave_xmlto_text=no
9695fda9279dSmrgcat > conftest.xml << "EOF"
9696fda9279dSmrgEOF
9697fda9279dSmrgAS_IF([test "$have_xmlto" = yes],
9698fda9279dSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9699fda9279dSmrg             [have_xmlto_text=yes],
9700fda9279dSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9701fda9279dSmrgrm -f conftest.xml
9702fda9279dSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9703fda9279dSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9704fda9279dSmrg]) # XORG_WITH_XMLTO
9705fda9279dSmrg
9706fda9279dSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9707fda9279dSmrg# --------------------------------------------
9708fda9279dSmrg# Minimum version: 1.12.0
9709fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.12.0
9710fda9279dSmrg#
9711fda9279dSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9712fda9279dSmrg# XML-based language used for the transformation of XML documents.
9713fda9279dSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9714fda9279dSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9715fda9279dSmrg# The XSLT processor is often used as a standalone tool for transformations.
9716fda9279dSmrg# It should not be assumed that this tool is used only to work with documnetation.
9717fda9279dSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9718fda9279dSmrg#
9719fda9279dSmrg# Interface to module:
9720fda9279dSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9721fda9279dSmrg# XSLTPROC:	 returns the path of the xsltproc program found
9722fda9279dSmrg#		 returns the path set by the user in the environment
9723fda9279dSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9724fda9279dSmrg#		  'no' user instructs the module not to use xsltproc
9725fda9279dSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9726fda9279dSmrg#
9727fda9279dSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9728fda9279dSmrg#
9729fda9279dSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9730fda9279dSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9731fda9279dSmrg# Preserves the interface, should it be implemented later
9732fda9279dSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9733fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9734fda9279dSmrgAC_ARG_WITH(xsltproc,
9735fda9279dSmrg	AS_HELP_STRING([--with-xsltproc],
9736fda9279dSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9737fda9279dSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9738fda9279dSmrgm4_undefine([_defopt])
9739fda9279dSmrg
9740fda9279dSmrgif test "x$use_xsltproc" = x"auto"; then
9741fda9279dSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9742fda9279dSmrg   if test "x$XSLTPROC" = "x"; then
9743fda9279dSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9744fda9279dSmrg	have_xsltproc=no
9745fda9279dSmrg   else
9746fda9279dSmrg        have_xsltproc=yes
9747fda9279dSmrg   fi
9748fda9279dSmrgelif test "x$use_xsltproc" = x"yes" ; then
9749fda9279dSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9750fda9279dSmrg   if test "x$XSLTPROC" = "x"; then
9751fda9279dSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9752fda9279dSmrg   fi
9753fda9279dSmrg   have_xsltproc=yes
9754fda9279dSmrgelif test "x$use_xsltproc" = x"no" ; then
9755fda9279dSmrg   if test "x$XSLTPROC" != "x"; then
9756fda9279dSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9757fda9279dSmrg   fi
9758fda9279dSmrg   have_xsltproc=no
9759fda9279dSmrgelse
9760fda9279dSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9761fda9279dSmrgfi
9762fda9279dSmrg
9763fda9279dSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9764fda9279dSmrg]) # XORG_WITH_XSLTPROC
9765fda9279dSmrg
9766fda9279dSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9767fda9279dSmrg# ----------------------------------------
9768fda9279dSmrg# Minimum version: 1.15.0
9769fda9279dSmrg#
9770fda9279dSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
9771fda9279dSmrg# scanning arbitrary text files, extracting information from those text files,
9772fda9279dSmrg# and printing reports based on that information.
9773fda9279dSmrg#
9774fda9279dSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9775fda9279dSmrg#
9776fda9279dSmrg# Interface to module:
9777fda9279dSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
9778fda9279dSmrg# PERL:	     returns the path of the perl program found
9779fda9279dSmrg#	     returns the path set by the user in the environment
9780fda9279dSmrg# --with-perl: 'yes' user instructs the module to use perl
9781fda9279dSmrg#	       'no' user instructs the module not to use perl
9782fda9279dSmrg# have_perl: returns yes if perl found in PATH or no
9783fda9279dSmrg#
9784fda9279dSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9785fda9279dSmrg#
9786fda9279dSmrgAC_DEFUN([XORG_WITH_PERL],[
9787fda9279dSmrgAC_ARG_VAR([PERL], [Path to perl command])
9788fda9279dSmrg# Preserves the interface, should it be implemented later
9789fda9279dSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9790fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9791fda9279dSmrgAC_ARG_WITH(perl,
9792fda9279dSmrg	AS_HELP_STRING([--with-perl],
9793fda9279dSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9794fda9279dSmrg	   [use_perl=$withval], [use_perl=]_defopt)
9795fda9279dSmrgm4_undefine([_defopt])
9796fda9279dSmrg
9797fda9279dSmrgif test "x$use_perl" = x"auto"; then
9798fda9279dSmrg   AC_PATH_PROG([PERL], [perl])
9799fda9279dSmrg   if test "x$PERL" = "x"; then
9800fda9279dSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9801fda9279dSmrg	have_perl=no
9802fda9279dSmrg   else
9803fda9279dSmrg        have_perl=yes
9804fda9279dSmrg   fi
9805fda9279dSmrgelif test "x$use_perl" = x"yes" ; then
9806fda9279dSmrg   AC_PATH_PROG([PERL], [perl])
9807fda9279dSmrg   if test "x$PERL" = "x"; then
9808fda9279dSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9809fda9279dSmrg   fi
9810fda9279dSmrg   have_perl=yes
9811fda9279dSmrgelif test "x$use_perl" = x"no" ; then
9812fda9279dSmrg   if test "x$PERL" != "x"; then
9813fda9279dSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9814fda9279dSmrg   fi
9815fda9279dSmrg   have_perl=no
9816fda9279dSmrgelse
9817fda9279dSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9818fda9279dSmrgfi
9819fda9279dSmrg
9820fda9279dSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9821fda9279dSmrg]) # XORG_WITH_PERL
9822fda9279dSmrg
9823fda9279dSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9824fda9279dSmrg# ----------------
9825fda9279dSmrg# Minimum version: 1.5.0
9826fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9827fda9279dSmrg#
9828fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9829fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9830fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9831fda9279dSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9832fda9279dSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9833fda9279dSmrg# --with-asciidoc assumes 'auto'.
9834fda9279dSmrg#
9835fda9279dSmrg# Interface to module:
9836fda9279dSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9837fda9279dSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
9838fda9279dSmrg#		 returns the path set by the user in the environment
9839fda9279dSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9840fda9279dSmrg#		  'no' user instructs the module not to use asciidoc
9841fda9279dSmrg#
9842fda9279dSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9843fda9279dSmrg#
9844fda9279dSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9845fda9279dSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9846fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9847fda9279dSmrgAC_ARG_WITH(asciidoc,
9848fda9279dSmrg	AS_HELP_STRING([--with-asciidoc],
9849fda9279dSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9850fda9279dSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9851fda9279dSmrgm4_undefine([_defopt])
9852fda9279dSmrg
9853fda9279dSmrgif test "x$use_asciidoc" = x"auto"; then
9854fda9279dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9855fda9279dSmrg   if test "x$ASCIIDOC" = "x"; then
9856fda9279dSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9857fda9279dSmrg	have_asciidoc=no
9858fda9279dSmrg   else
9859fda9279dSmrg        have_asciidoc=yes
9860fda9279dSmrg   fi
9861fda9279dSmrgelif test "x$use_asciidoc" = x"yes" ; then
9862fda9279dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9863fda9279dSmrg   if test "x$ASCIIDOC" = "x"; then
9864fda9279dSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9865fda9279dSmrg   fi
9866fda9279dSmrg   have_asciidoc=yes
9867fda9279dSmrgelif test "x$use_asciidoc" = x"no" ; then
9868fda9279dSmrg   if test "x$ASCIIDOC" != "x"; then
9869fda9279dSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9870fda9279dSmrg   fi
9871fda9279dSmrg   have_asciidoc=no
9872fda9279dSmrgelse
9873fda9279dSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9874fda9279dSmrgfi
9875fda9279dSmrgm4_ifval([$1],
9876fda9279dSmrg[if test "$have_asciidoc" = yes; then
9877fda9279dSmrg    # scrape the asciidoc version
9878fda9279dSmrg    AC_MSG_CHECKING([the asciidoc version])
9879fda9279dSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9880fda9279dSmrg    AC_MSG_RESULT([$asciidoc_version])
9881fda9279dSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9882fda9279dSmrg        [if test "x$use_asciidoc" = xauto; then
9883fda9279dSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9884fda9279dSmrg            have_asciidoc=no
9885fda9279dSmrg        else
9886fda9279dSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9887fda9279dSmrg        fi])
9888fda9279dSmrgfi])
9889fda9279dSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9890fda9279dSmrg]) # XORG_WITH_ASCIIDOC
9891fda9279dSmrg
9892fda9279dSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
989316ee1e9aSmrg# -------------------------------------------
9894fda9279dSmrg# Minimum version: 1.5.0
9895fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
989616ee1e9aSmrg# Minimum version for optional DOT checking: 1.18.0
9897fda9279dSmrg#
9898fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9899fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9900fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9901fda9279dSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9902fda9279dSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9903fda9279dSmrg# --with-doxygen assumes 'auto'.
9904fda9279dSmrg#
9905fda9279dSmrg# Interface to module:
9906fda9279dSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9907fda9279dSmrg# DOXYGEN:	 returns the path of the doxygen program found
9908fda9279dSmrg#		 returns the path set by the user in the environment
9909fda9279dSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9910fda9279dSmrg#		  'no' user instructs the module not to use doxygen
9911fda9279dSmrg#
9912fda9279dSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9913fda9279dSmrg#
9914fda9279dSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9915fda9279dSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
991616ee1e9aSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
9917fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9918fda9279dSmrgAC_ARG_WITH(doxygen,
9919fda9279dSmrg	AS_HELP_STRING([--with-doxygen],
9920fda9279dSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
9921fda9279dSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
9922fda9279dSmrgm4_undefine([_defopt])
9923fda9279dSmrg
9924fda9279dSmrgif test "x$use_doxygen" = x"auto"; then
9925fda9279dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9926fda9279dSmrg   if test "x$DOXYGEN" = "x"; then
9927fda9279dSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9928fda9279dSmrg	have_doxygen=no
9929fda9279dSmrg   else
9930fda9279dSmrg        have_doxygen=yes
9931fda9279dSmrg   fi
9932fda9279dSmrgelif test "x$use_doxygen" = x"yes" ; then
9933fda9279dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9934fda9279dSmrg   if test "x$DOXYGEN" = "x"; then
9935fda9279dSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9936fda9279dSmrg   fi
9937fda9279dSmrg   have_doxygen=yes
9938fda9279dSmrgelif test "x$use_doxygen" = x"no" ; then
9939fda9279dSmrg   if test "x$DOXYGEN" != "x"; then
9940fda9279dSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9941fda9279dSmrg   fi
9942fda9279dSmrg   have_doxygen=no
9943fda9279dSmrgelse
9944fda9279dSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
9945fda9279dSmrgfi
9946fda9279dSmrgm4_ifval([$1],
9947fda9279dSmrg[if test "$have_doxygen" = yes; then
9948fda9279dSmrg    # scrape the doxygen version
9949fda9279dSmrg    AC_MSG_CHECKING([the doxygen version])
9950fda9279dSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9951fda9279dSmrg    AC_MSG_RESULT([$doxygen_version])
9952fda9279dSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9953fda9279dSmrg        [if test "x$use_doxygen" = xauto; then
9954fda9279dSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9955fda9279dSmrg            have_doxygen=no
9956fda9279dSmrg        else
9957fda9279dSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9958fda9279dSmrg        fi])
9959fda9279dSmrgfi])
996016ee1e9aSmrg
996116ee1e9aSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
996216ee1e9aSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
996316ee1e9aSmrgdnl 	HAVE_DOT = @HAVE_DOT@
996416ee1e9aSmrgHAVE_DOT=no
996516ee1e9aSmrgif test "x$have_doxygen" = "xyes"; then
996616ee1e9aSmrg  AC_PATH_PROG([DOT], [dot])
996716ee1e9aSmrg    if test "x$DOT" != "x"; then
996816ee1e9aSmrg      HAVE_DOT=yes
996916ee1e9aSmrg    fi
997016ee1e9aSmrgfi
997116ee1e9aSmrg
997216ee1e9aSmrgAC_SUBST([HAVE_DOT])
997316ee1e9aSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
9974fda9279dSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9975fda9279dSmrg]) # XORG_WITH_DOXYGEN
9976fda9279dSmrg
9977fda9279dSmrg# XORG_WITH_GROFF([DEFAULT])
9978fda9279dSmrg# ----------------
9979fda9279dSmrg# Minimum version: 1.6.0
9980fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9981fda9279dSmrg#
9982fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9983fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9984fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9985fda9279dSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
9986fda9279dSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
9987fda9279dSmrg# --with-groff assumes 'auto'.
9988fda9279dSmrg#
9989fda9279dSmrg# Interface to module:
9990fda9279dSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
9991fda9279dSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
9992fda9279dSmrg# HAVE_GROFF_MS: the -ms macros package
9993fda9279dSmrg# GROFF:	 returns the path of the groff program found
9994fda9279dSmrg#		 returns the path set by the user in the environment
9995fda9279dSmrg# --with-groff:	 'yes' user instructs the module to use groff
9996fda9279dSmrg#		 'no' user instructs the module not to use groff
9997fda9279dSmrg#
9998fda9279dSmrg# Added in version 1.9.0:
9999fda9279dSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10000fda9279dSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10001fda9279dSmrg#		   psselect from the psutils package.
10002fda9279dSmrg#		   the ghostcript package. Refer to the grohtml man pages
10003fda9279dSmrg#
10004fda9279dSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10005fda9279dSmrg#
10006fda9279dSmrg# OS and distros often splits groff in a basic and full package, the former
10007fda9279dSmrg# having the groff program and the later having devices, fonts and macros
10008fda9279dSmrg# Checking for the groff executable is not enough.
10009fda9279dSmrg#
10010fda9279dSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
10011fda9279dSmrg# unset HAVE_GROFF or GROFF env variables.
10012fda9279dSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10013fda9279dSmrg#
10014fda9279dSmrgAC_DEFUN([XORG_WITH_GROFF],[
10015fda9279dSmrgAC_ARG_VAR([GROFF], [Path to groff command])
10016fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10017fda9279dSmrgAC_ARG_WITH(groff,
10018fda9279dSmrg	AS_HELP_STRING([--with-groff],
10019fda9279dSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10020fda9279dSmrg	   [use_groff=$withval], [use_groff=]_defopt)
10021fda9279dSmrgm4_undefine([_defopt])
10022fda9279dSmrg
10023fda9279dSmrgif test "x$use_groff" = x"auto"; then
10024fda9279dSmrg   AC_PATH_PROG([GROFF], [groff])
10025fda9279dSmrg   if test "x$GROFF" = "x"; then
10026fda9279dSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10027fda9279dSmrg	have_groff=no
10028fda9279dSmrg   else
10029fda9279dSmrg        have_groff=yes
10030fda9279dSmrg   fi
10031fda9279dSmrgelif test "x$use_groff" = x"yes" ; then
10032fda9279dSmrg   AC_PATH_PROG([GROFF], [groff])
10033fda9279dSmrg   if test "x$GROFF" = "x"; then
10034fda9279dSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10035fda9279dSmrg   fi
10036fda9279dSmrg   have_groff=yes
10037fda9279dSmrgelif test "x$use_groff" = x"no" ; then
10038fda9279dSmrg   if test "x$GROFF" != "x"; then
10039fda9279dSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10040fda9279dSmrg   fi
10041fda9279dSmrg   have_groff=no
10042fda9279dSmrgelse
10043fda9279dSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10044fda9279dSmrgfi
10045fda9279dSmrg
10046fda9279dSmrg# We have groff, test for the presence of the macro packages
10047fda9279dSmrgif test "x$have_groff" = x"yes"; then
10048fda9279dSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10049fda9279dSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10050fda9279dSmrg        groff_ms_works=yes
10051fda9279dSmrg    else
10052fda9279dSmrg        groff_ms_works=no
10053fda9279dSmrg    fi
10054fda9279dSmrg    AC_MSG_RESULT([$groff_ms_works])
10055fda9279dSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10056fda9279dSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10057fda9279dSmrg        groff_mm_works=yes
10058fda9279dSmrg    else
10059fda9279dSmrg        groff_mm_works=no
10060fda9279dSmrg    fi
10061fda9279dSmrg    AC_MSG_RESULT([$groff_mm_works])
10062fda9279dSmrgfi
10063fda9279dSmrg
10064fda9279dSmrg# We have groff, test for HTML dependencies, one command per package
10065fda9279dSmrgif test "x$have_groff" = x"yes"; then
10066fda9279dSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10067fda9279dSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10068fda9279dSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10069fda9279dSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10070fda9279dSmrg      have_groff_html=yes
10071fda9279dSmrg   else
10072fda9279dSmrg      have_groff_html=no
10073fda9279dSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10074fda9279dSmrg   fi
10075fda9279dSmrgfi
10076fda9279dSmrg
10077fda9279dSmrg# Set Automake conditionals for Makefiles
10078fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10079fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10080fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10081fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10082fda9279dSmrg]) # XORG_WITH_GROFF
10083fda9279dSmrg
10084fda9279dSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10085fda9279dSmrg# ---------------------------------------
10086fda9279dSmrg# Minimum version: 1.6.0
10087fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10088fda9279dSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10089fda9279dSmrg#
10090fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10091fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
10092fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10093fda9279dSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
10094fda9279dSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
10095fda9279dSmrg# --with-fop assumes 'auto'.
10096fda9279dSmrg#
10097fda9279dSmrg# Interface to module:
10098fda9279dSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10099fda9279dSmrg# FOP:	 	returns the path of the fop program found
10100fda9279dSmrg#		returns the path set by the user in the environment
10101fda9279dSmrg# --with-fop: 	'yes' user instructs the module to use fop
10102fda9279dSmrg#		'no' user instructs the module not to use fop
10103fda9279dSmrg#
10104fda9279dSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10105fda9279dSmrg#
10106fda9279dSmrgAC_DEFUN([XORG_WITH_FOP],[
10107fda9279dSmrgAC_ARG_VAR([FOP], [Path to fop command])
10108fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
10109fda9279dSmrgAC_ARG_WITH(fop,
10110fda9279dSmrg	AS_HELP_STRING([--with-fop],
10111fda9279dSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10112fda9279dSmrg	   [use_fop=$withval], [use_fop=]_defopt)
10113fda9279dSmrgm4_undefine([_defopt])
10114fda9279dSmrg
10115fda9279dSmrgif test "x$use_fop" = x"auto"; then
10116fda9279dSmrg   AC_PATH_PROG([FOP], [fop])
10117fda9279dSmrg   if test "x$FOP" = "x"; then
10118fda9279dSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10119fda9279dSmrg	have_fop=no
10120fda9279dSmrg   else
10121fda9279dSmrg        have_fop=yes
10122fda9279dSmrg   fi
10123fda9279dSmrgelif test "x$use_fop" = x"yes" ; then
10124fda9279dSmrg   AC_PATH_PROG([FOP], [fop])
10125fda9279dSmrg   if test "x$FOP" = "x"; then
10126fda9279dSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10127fda9279dSmrg   fi
10128fda9279dSmrg   have_fop=yes
10129fda9279dSmrgelif test "x$use_fop" = x"no" ; then
10130fda9279dSmrg   if test "x$FOP" != "x"; then
10131fda9279dSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10132fda9279dSmrg   fi
10133fda9279dSmrg   have_fop=no
10134fda9279dSmrgelse
10135fda9279dSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10136fda9279dSmrgfi
10137fda9279dSmrg
10138fda9279dSmrg# Test for a minimum version of fop, if provided.
10139fda9279dSmrgm4_ifval([$1],
10140fda9279dSmrg[if test "$have_fop" = yes; then
10141fda9279dSmrg    # scrape the fop version
10142fda9279dSmrg    AC_MSG_CHECKING([for fop minimum version])
10143fda9279dSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10144fda9279dSmrg    AC_MSG_RESULT([$fop_version])
10145fda9279dSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
10146fda9279dSmrg        [if test "x$use_fop" = xauto; then
10147fda9279dSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10148fda9279dSmrg            have_fop=no
10149fda9279dSmrg        else
10150fda9279dSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10151fda9279dSmrg        fi])
10152fda9279dSmrgfi])
10153fda9279dSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10154fda9279dSmrg]) # XORG_WITH_FOP
10155fda9279dSmrg
1015616ee1e9aSmrg# XORG_WITH_M4([MIN-VERSION])
1015716ee1e9aSmrg# ---------------------------
1015816ee1e9aSmrg# Minimum version: 1.19.0
1015916ee1e9aSmrg#
1016016ee1e9aSmrg# This macro attempts to locate an m4 macro processor which supports
1016116ee1e9aSmrg# -I option and is only useful for modules relying on M4 in order to
1016216ee1e9aSmrg# expand macros in source code files.
1016316ee1e9aSmrg#
1016416ee1e9aSmrg# Interface to module:
1016516ee1e9aSmrg# M4:	 	returns the path of the m4 program found
1016616ee1e9aSmrg#		returns the path set by the user in the environment
1016716ee1e9aSmrg#
1016816ee1e9aSmrgAC_DEFUN([XORG_WITH_M4], [
1016916ee1e9aSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1017016ee1e9aSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1017116ee1e9aSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1017216ee1e9aSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1017316ee1e9aSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1017416ee1e9aSmrg   [$PATH:/usr/gnu/bin])])
1017516ee1e9aSmrg
1017616ee1e9aSmrgAC_SUBST([M4], [$ac_cv_path_M4])
1017716ee1e9aSmrg]) # XORG_WITH_M4
1017816ee1e9aSmrg
10179fda9279dSmrg# XORG_WITH_PS2PDF([DEFAULT])
10180fda9279dSmrg# ----------------
10181fda9279dSmrg# Minimum version: 1.6.0
10182fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10183fda9279dSmrg#
10184fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10185fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
10186fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10187fda9279dSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10188fda9279dSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10189fda9279dSmrg# --with-ps2pdf assumes 'auto'.
10190fda9279dSmrg#
10191fda9279dSmrg# Interface to module:
10192fda9279dSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10193fda9279dSmrg# PS2PDF:	returns the path of the ps2pdf program found
10194fda9279dSmrg#		returns the path set by the user in the environment
10195fda9279dSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10196fda9279dSmrg#		 'no' user instructs the module not to use ps2pdf
10197fda9279dSmrg#
10198fda9279dSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10199fda9279dSmrg#
10200fda9279dSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10201fda9279dSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10202fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10203fda9279dSmrgAC_ARG_WITH(ps2pdf,
10204fda9279dSmrg	AS_HELP_STRING([--with-ps2pdf],
10205fda9279dSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10206fda9279dSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10207fda9279dSmrgm4_undefine([_defopt])
10208fda9279dSmrg
10209fda9279dSmrgif test "x$use_ps2pdf" = x"auto"; then
10210fda9279dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10211fda9279dSmrg   if test "x$PS2PDF" = "x"; then
10212fda9279dSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10213fda9279dSmrg	have_ps2pdf=no
10214fda9279dSmrg   else
10215fda9279dSmrg        have_ps2pdf=yes
10216fda9279dSmrg   fi
10217fda9279dSmrgelif test "x$use_ps2pdf" = x"yes" ; then
10218fda9279dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10219fda9279dSmrg   if test "x$PS2PDF" = "x"; then
10220fda9279dSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10221fda9279dSmrg   fi
10222fda9279dSmrg   have_ps2pdf=yes
10223fda9279dSmrgelif test "x$use_ps2pdf" = x"no" ; then
10224fda9279dSmrg   if test "x$PS2PDF" != "x"; then
10225fda9279dSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10226fda9279dSmrg   fi
10227fda9279dSmrg   have_ps2pdf=no
10228fda9279dSmrgelse
10229fda9279dSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10230fda9279dSmrgfi
10231fda9279dSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10232fda9279dSmrg]) # XORG_WITH_PS2PDF
10233fda9279dSmrg
10234fda9279dSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
10235fda9279dSmrg# ----------------
10236fda9279dSmrg# Minimum version: 1.6.0
10237fda9279dSmrg#
10238fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10239fda9279dSmrg# not at the appropriate level. This macro enables a builder to skip all
10240fda9279dSmrg# documentation targets except traditional man pages.
10241fda9279dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10242fda9279dSmrg# maximum flexibilty in controlling documentation building.
10243fda9279dSmrg# Refer to:
10244fda9279dSmrg# XORG_WITH_XMLTO         --with-xmlto
10245fda9279dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10246fda9279dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10247fda9279dSmrg# XORG_WITH_FOP           --with-fop
10248fda9279dSmrg# XORG_WITH_GROFF         --with-groff
10249fda9279dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10250fda9279dSmrg#
10251fda9279dSmrg# Interface to module:
10252fda9279dSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10253fda9279dSmrg# --enable-docs: 'yes' user instructs the module to generate docs
10254fda9279dSmrg#		 'no' user instructs the module not to generate docs
10255fda9279dSmrg# parm1:	specify the default value, yes or no.
10256fda9279dSmrg#
10257fda9279dSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10258fda9279dSmrgm4_define([docs_default], m4_default([$1], [yes]))
10259fda9279dSmrgAC_ARG_ENABLE(docs,
10260fda9279dSmrg	AS_HELP_STRING([--enable-docs],
10261fda9279dSmrg	   [Enable building the documentation (default: ]docs_default[)]),
10262fda9279dSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
10263fda9279dSmrgm4_undefine([docs_default])
10264fda9279dSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10265fda9279dSmrgAC_MSG_CHECKING([whether to build documentation])
10266fda9279dSmrgAC_MSG_RESULT([$build_docs])
10267fda9279dSmrg]) # XORG_ENABLE_DOCS
10268fda9279dSmrg
10269fda9279dSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10270fda9279dSmrg# ----------------
10271fda9279dSmrg# Minimum version: 1.6.0
10272fda9279dSmrg#
10273fda9279dSmrg# This macro enables a builder to skip all developer documentation.
10274fda9279dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10275fda9279dSmrg# maximum flexibilty in controlling documentation building.
10276fda9279dSmrg# Refer to:
10277fda9279dSmrg# XORG_WITH_XMLTO         --with-xmlto
10278fda9279dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10279fda9279dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10280fda9279dSmrg# XORG_WITH_FOP           --with-fop
10281fda9279dSmrg# XORG_WITH_GROFF         --with-groff
10282fda9279dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10283fda9279dSmrg#
10284fda9279dSmrg# Interface to module:
10285fda9279dSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10286fda9279dSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10287fda9279dSmrg#			'no' user instructs the module not to generate developer docs
10288fda9279dSmrg# parm1:		specify the default value, yes or no.
10289fda9279dSmrg#
10290fda9279dSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10291fda9279dSmrgm4_define([devel_default], m4_default([$1], [yes]))
10292fda9279dSmrgAC_ARG_ENABLE(devel-docs,
10293fda9279dSmrg	AS_HELP_STRING([--enable-devel-docs],
10294fda9279dSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10295fda9279dSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10296fda9279dSmrgm4_undefine([devel_default])
10297fda9279dSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10298fda9279dSmrgAC_MSG_CHECKING([whether to build developer documentation])
10299fda9279dSmrgAC_MSG_RESULT([$build_devel_docs])
10300fda9279dSmrg]) # XORG_ENABLE_DEVEL_DOCS
10301fda9279dSmrg
10302fda9279dSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
10303fda9279dSmrg# ----------------
10304fda9279dSmrg# Minimum version: 1.6.0
10305fda9279dSmrg#
10306fda9279dSmrg# This macro enables a builder to skip all functional specification targets.
10307fda9279dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10308fda9279dSmrg# maximum flexibilty in controlling documentation building.
10309fda9279dSmrg# Refer to:
10310fda9279dSmrg# XORG_WITH_XMLTO         --with-xmlto
10311fda9279dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10312fda9279dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10313fda9279dSmrg# XORG_WITH_FOP           --with-fop
10314fda9279dSmrg# XORG_WITH_GROFF         --with-groff
10315fda9279dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10316fda9279dSmrg#
10317fda9279dSmrg# Interface to module:
10318fda9279dSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10319fda9279dSmrg# --enable-specs:	'yes' user instructs the module to generate specs
10320fda9279dSmrg#			'no' user instructs the module not to generate specs
10321fda9279dSmrg# parm1:		specify the default value, yes or no.
10322fda9279dSmrg#
10323fda9279dSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10324fda9279dSmrgm4_define([spec_default], m4_default([$1], [yes]))
10325fda9279dSmrgAC_ARG_ENABLE(specs,
10326fda9279dSmrg	AS_HELP_STRING([--enable-specs],
10327fda9279dSmrg	   [Enable building the specs (default: ]spec_default[)]),
10328fda9279dSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
10329fda9279dSmrgm4_undefine([spec_default])
10330fda9279dSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10331fda9279dSmrgAC_MSG_CHECKING([whether to build functional specifications])
10332fda9279dSmrgAC_MSG_RESULT([$build_specs])
10333fda9279dSmrg]) # XORG_ENABLE_SPECS
10334fda9279dSmrg
10335fda9279dSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10336fda9279dSmrg# ----------------------------------------------
10337fda9279dSmrg# Minimum version: 1.13.0
10338fda9279dSmrg#
10339fda9279dSmrg# This macro enables a builder to enable/disable unit testing
10340fda9279dSmrg# It makes no assumption about the test cases implementation
10341fda9279dSmrg# Test cases may or may not use Automake "Support for test suites"
10342fda9279dSmrg# They may or may not use the software utility library GLib
10343fda9279dSmrg#
10344fda9279dSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10345fda9279dSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10346fda9279dSmrg# The variable enable_unit_tests is used by other macros in this file.
10347fda9279dSmrg#
10348fda9279dSmrg# Interface to module:
10349fda9279dSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10350fda9279dSmrg# enable_unit_tests:    used in configure.ac for additional configuration
10351fda9279dSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10352fda9279dSmrg#			'no' user instructs the module not to build tests
10353fda9279dSmrg# parm1:		specify the default value, yes or no.
10354fda9279dSmrg#
10355fda9279dSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10356fda9279dSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10357fda9279dSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10358fda9279dSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10359fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10360fda9279dSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10361fda9279dSmrg	[Enable building unit test cases (default: ]_defopt[)]),
10362fda9279dSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10363fda9279dSmrgm4_undefine([_defopt])
10364fda9279dSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10365fda9279dSmrgAC_MSG_CHECKING([whether to build unit test cases])
10366fda9279dSmrgAC_MSG_RESULT([$enable_unit_tests])
10367fda9279dSmrg]) # XORG_ENABLE_UNIT_TESTS
10368fda9279dSmrg
10369fda9279dSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10370fda9279dSmrg# ------------------------------------------------------
10371fda9279dSmrg# Minimum version: 1.17.0
10372fda9279dSmrg#
10373fda9279dSmrg# This macro enables a builder to enable/disable integration testing
10374fda9279dSmrg# It makes no assumption about the test cases' implementation
10375fda9279dSmrg# Test cases may or may not use Automake "Support for test suites"
10376fda9279dSmrg#
10377fda9279dSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10378fda9279dSmrg# usually requires less dependencies and may be built and run under less
10379fda9279dSmrg# stringent environments than integration tests.
10380fda9279dSmrg#
10381fda9279dSmrg# Interface to module:
10382fda9279dSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10383fda9279dSmrg# enable_integration_tests:   used in configure.ac for additional configuration
10384fda9279dSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10385fda9279dSmrg#                             'no' user instructs the module not to build tests
10386fda9279dSmrg# parm1:                      specify the default value, yes or no.
10387fda9279dSmrg#
10388fda9279dSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10389fda9279dSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10390fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10391fda9279dSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10392fda9279dSmrg	[Enable building integration test cases (default: ]_defopt[)]),
10393fda9279dSmrg	[enable_integration_tests=$enableval],
10394fda9279dSmrg	[enable_integration_tests=]_defopt)
10395fda9279dSmrgm4_undefine([_defopt])
10396fda9279dSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10397fda9279dSmrg	[test "x$enable_integration_tests" != xno])
10398fda9279dSmrgAC_MSG_CHECKING([whether to build unit test cases])
10399fda9279dSmrgAC_MSG_RESULT([$enable_integration_tests])
10400fda9279dSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10401fda9279dSmrg
10402fda9279dSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10403fda9279dSmrg# ----------------------------------------
10404fda9279dSmrg# Minimum version: 1.13.0
10405fda9279dSmrg#
10406fda9279dSmrg# GLib is a library which provides advanced data structures and functions.
10407fda9279dSmrg# This macro enables a module to test for the presence of Glib.
10408fda9279dSmrg#
10409fda9279dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10410fda9279dSmrg# Otherwise the value of $enable_unit_tests is blank.
10411fda9279dSmrg#
10412fda9279dSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10413fda9279dSmrg# test support usually requires less dependencies and may be built and run under
10414fda9279dSmrg# less stringent environments than integration tests.
10415fda9279dSmrg#
10416fda9279dSmrg# Interface to module:
10417fda9279dSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
10418fda9279dSmrg# with_glib: used in configure.ac to know if GLib has been found
10419fda9279dSmrg# --with-glib:	'yes' user instructs the module to use glib
10420fda9279dSmrg#		'no' user instructs the module not to use glib
10421fda9279dSmrg#
10422fda9279dSmrgAC_DEFUN([XORG_WITH_GLIB],[
10423fda9279dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10424fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
10425fda9279dSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10426fda9279dSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10427fda9279dSmrg	[with_glib=$withval], [with_glib=]_defopt)
10428fda9279dSmrgm4_undefine([_defopt])
10429fda9279dSmrg
10430fda9279dSmrghave_glib=no
10431fda9279dSmrg# Do not probe GLib if user explicitly disabled unit testing
10432fda9279dSmrgif test "x$enable_unit_tests" != x"no"; then
10433fda9279dSmrg  # Do not probe GLib if user explicitly disabled it
10434fda9279dSmrg  if test "x$with_glib" != x"no"; then
10435fda9279dSmrg    m4_ifval(
10436fda9279dSmrg      [$1],
10437fda9279dSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10438fda9279dSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10439fda9279dSmrg    )
10440fda9279dSmrg  fi
10441fda9279dSmrgfi
10442fda9279dSmrg
10443fda9279dSmrg# Not having GLib when unit testing has been explicitly requested is an error
10444fda9279dSmrgif test "x$enable_unit_tests" = x"yes"; then
10445fda9279dSmrg  if test "x$have_glib" = x"no"; then
10446fda9279dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10447fda9279dSmrg  fi
10448fda9279dSmrgfi
10449fda9279dSmrg
10450fda9279dSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
10451fda9279dSmrgif test "x$enable_unit_tests" = x"no"; then
10452fda9279dSmrg  if test "x$with_glib" = x"yes"; then
10453fda9279dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10454fda9279dSmrg  fi
10455fda9279dSmrgfi
10456fda9279dSmrg
10457fda9279dSmrg# Not having GLib when it has been explicitly requested is an error
10458fda9279dSmrgif test "x$with_glib" = x"yes"; then
10459fda9279dSmrg  if test "x$have_glib" = x"no"; then
10460fda9279dSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10461fda9279dSmrg  fi
10462fda9279dSmrgfi
10463fda9279dSmrg
10464fda9279dSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10465fda9279dSmrg]) # XORG_WITH_GLIB
10466fda9279dSmrg
10467fda9279dSmrg# XORG_LD_WRAP([required|optional])
10468fda9279dSmrg# ---------------------------------
10469fda9279dSmrg# Minimum version: 1.13.0
10470fda9279dSmrg#
10471fda9279dSmrg# Check if linker supports -wrap, passed via compiler flags
10472fda9279dSmrg#
10473fda9279dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10474fda9279dSmrg# Otherwise the value of $enable_unit_tests is blank.
10475fda9279dSmrg#
10476fda9279dSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10477fda9279dSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10478fda9279dSmrg# available, an argument of "optional" allows use when some unit tests require
10479fda9279dSmrg# ld -wrap and others do not.
10480fda9279dSmrg#
10481fda9279dSmrgAC_DEFUN([XORG_LD_WRAP],[
10482fda9279dSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10483fda9279dSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10484fda9279dSmrg                      void __wrap_exit(int status) { return; }],
10485fda9279dSmrg                     [exit(0);])])
10486fda9279dSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
10487fda9279dSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10488fda9279dSmrg  if test "x$have_ld_wrap" = x"no"; then
10489fda9279dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10490fda9279dSmrg  fi
10491fda9279dSmrgfi
10492fda9279dSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10493fda9279dSmrg#
10494fda9279dSmrg]) # XORG_LD_WRAP
10495fda9279dSmrg
10496fda9279dSmrg# XORG_CHECK_LINKER_FLAGS
10497fda9279dSmrg# -----------------------
10498fda9279dSmrg# SYNOPSIS
10499fda9279dSmrg#
10500fda9279dSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10501fda9279dSmrg#
10502fda9279dSmrg# DESCRIPTION
10503fda9279dSmrg#
10504fda9279dSmrg#   Check whether the given linker FLAGS work with the current language's
10505fda9279dSmrg#   linker, or whether they give an error.
10506fda9279dSmrg#
10507fda9279dSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10508fda9279dSmrg#   success/failure.
10509fda9279dSmrg#
10510fda9279dSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
10511fda9279dSmrg#
10512fda9279dSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10513fda9279dSmrg#
10514fda9279dSmrg# LICENSE
10515fda9279dSmrg#
10516fda9279dSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10517fda9279dSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10518fda9279dSmrg#   Copyright (c) 2009 Matteo Frigo
10519fda9279dSmrg#
10520fda9279dSmrg#   This program is free software: you can redistribute it and/or modify it
10521fda9279dSmrg#   under the terms of the GNU General Public License as published by the
10522fda9279dSmrg#   Free Software Foundation, either version 3 of the License, or (at your
10523fda9279dSmrg#   option) any later version.
10524fda9279dSmrg#
10525fda9279dSmrg#   This program is distributed in the hope that it will be useful, but
10526fda9279dSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10527fda9279dSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10528fda9279dSmrg#   Public License for more details.
10529fda9279dSmrg#
10530fda9279dSmrg#   You should have received a copy of the GNU General Public License along
10531fda9279dSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10532fda9279dSmrg#
10533fda9279dSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
10534fda9279dSmrg#   gives unlimited permission to copy, distribute and modify the configure
10535fda9279dSmrg#   scripts that are the output of Autoconf when processing the Macro. You
10536fda9279dSmrg#   need not follow the terms of the GNU General Public License when using
10537fda9279dSmrg#   or distributing such scripts, even though portions of the text of the
10538fda9279dSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10539fda9279dSmrg#   all other use of the material that constitutes the Autoconf Macro.
10540fda9279dSmrg#
10541fda9279dSmrg#   This special exception to the GPL applies to versions of the Autoconf
10542fda9279dSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
10543fda9279dSmrg#   modified version of the Autoconf Macro, you may extend this special
10544fda9279dSmrg#   exception to the GPL to apply to your modified version as well.#
10545fda9279dSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10546fda9279dSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
10547fda9279dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10548fda9279dSmrgAS_LITERAL_IF([$1],
10549fda9279dSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10550fda9279dSmrg      ax_save_FLAGS=$LDFLAGS
10551fda9279dSmrg      LDFLAGS="$1"
10552fda9279dSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10553fda9279dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10554fda9279dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10555fda9279dSmrg      LDFLAGS=$ax_save_FLAGS])],
10556fda9279dSmrg  [ax_save_FLAGS=$LDFLAGS
10557fda9279dSmrg   LDFLAGS="$1"
10558fda9279dSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10559fda9279dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10560fda9279dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10561fda9279dSmrg   LDFLAGS=$ax_save_FLAGS])
10562fda9279dSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10563fda9279dSmrgAC_MSG_RESULT($xorg_check_linker_flags)
10564fda9279dSmrgif test "x$xorg_check_linker_flags" = xyes; then
10565fda9279dSmrg	m4_default([$2], :)
10566fda9279dSmrgelse
10567fda9279dSmrg	m4_default([$3], :)
10568fda9279dSmrgfi
10569fda9279dSmrg]) # XORG_CHECK_LINKER_FLAGS
10570fda9279dSmrg
10571fda9279dSmrg# XORG_MEMORY_CHECK_FLAGS
10572fda9279dSmrg# -----------------------
10573fda9279dSmrg# Minimum version: 1.16.0
10574fda9279dSmrg#
10575fda9279dSmrg# This macro attempts to find appropriate memory checking functionality
10576fda9279dSmrg# for various platforms which unit testing code may use to catch various
10577fda9279dSmrg# forms of memory allocation and access errors in testing.
10578fda9279dSmrg#
10579fda9279dSmrg# Interface to module:
10580fda9279dSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10581fda9279dSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10582fda9279dSmrg#
10583fda9279dSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10584fda9279dSmrg#
10585fda9279dSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10586fda9279dSmrg
10587fda9279dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
10588fda9279dSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10589fda9279dSmrg           [Environment variables to enable memory checking in tests])
10590fda9279dSmrg
10591fda9279dSmrg# Check for different types of support on different platforms
10592fda9279dSmrgcase $host_os in
10593fda9279dSmrg    solaris*)
10594fda9279dSmrg        AC_CHECK_LIB([umem], [umem_alloc],
10595fda9279dSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10596fda9279dSmrg        ;;
10597fda9279dSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10598fda9279dSmrg        # both directly and inverted, so should not be 0 or 255.
10599fda9279dSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
10600fda9279dSmrg        ;;
10601fda9279dSmrg    darwin*)
10602fda9279dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10603fda9279dSmrg        ;;
10604fda9279dSmrg    *bsd*)
10605fda9279dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10606fda9279dSmrg        ;;
10607fda9279dSmrgesac
10608fda9279dSmrg
10609fda9279dSmrg# User supplied flags override default flags
10610fda9279dSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10611fda9279dSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10612fda9279dSmrgfi
10613fda9279dSmrg
10614fda9279dSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10615fda9279dSmrg]) # XORG_WITH_LINT
10616fda9279dSmrg
10617fda9279dSmrg# XORG_CHECK_MALLOC_ZERO
10618fda9279dSmrg# ----------------------
10619fda9279dSmrg# Minimum version: 1.0.0
10620fda9279dSmrg#
10621fda9279dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10622fda9279dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10623fda9279dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10624fda9279dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10625fda9279dSmrgAC_ARG_ENABLE(malloc0returnsnull,
10626fda9279dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10627fda9279dSmrg		       [malloc(0) returns NULL (default: auto)]),
10628fda9279dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10629fda9279dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10630fda9279dSmrg
10631fda9279dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10632fda9279dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1063316ee1e9aSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1063416ee1e9aSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10635fda9279dSmrg#include <stdlib.h>
10636fda9279dSmrg],[
10637fda9279dSmrg    char *m0, *r0, *c0, *p;
10638fda9279dSmrg    m0 = malloc(0);
10639fda9279dSmrg    p = malloc(10);
10640fda9279dSmrg    r0 = realloc(p,0);
10641fda9279dSmrg    c0 = calloc(0,10);
10642fda9279dSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10643fda9279dSmrg])],
1064416ee1e9aSmrg		[xorg_cv_malloc0_returns_null=yes],
1064516ee1e9aSmrg		[xorg_cv_malloc0_returns_null=no])])
1064616ee1e9aSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10647fda9279dSmrgfi
10648fda9279dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10649fda9279dSmrg
10650fda9279dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10651fda9279dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10652fda9279dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10653fda9279dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10654fda9279dSmrgelse
10655fda9279dSmrg	MALLOC_ZERO_CFLAGS=""
10656fda9279dSmrg	XMALLOC_ZERO_CFLAGS=""
10657fda9279dSmrg	XTMALLOC_ZERO_CFLAGS=""
10658fda9279dSmrgfi
10659fda9279dSmrg
10660fda9279dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10661fda9279dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10662fda9279dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10663fda9279dSmrg]) # XORG_CHECK_MALLOC_ZERO
10664fda9279dSmrg
10665fda9279dSmrg# XORG_WITH_LINT()
10666fda9279dSmrg# ----------------
10667fda9279dSmrg# Minimum version: 1.1.0
10668fda9279dSmrg#
10669fda9279dSmrg# This macro enables the use of a tool that flags some suspicious and
10670fda9279dSmrg# non-portable constructs (likely to be bugs) in C language source code.
10671fda9279dSmrg# It will attempt to locate the tool and use appropriate options.
10672fda9279dSmrg# There are various lint type tools on different platforms.
10673fda9279dSmrg#
10674fda9279dSmrg# Interface to module:
10675fda9279dSmrg# LINT:		returns the path to the tool found on the platform
10676fda9279dSmrg#		or the value set to LINT on the configure cmd line
10677fda9279dSmrg#		also an Automake conditional
10678fda9279dSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
10679fda9279dSmrg#
10680fda9279dSmrg# --with-lint:	'yes' user instructs the module to use lint
10681fda9279dSmrg#		'no' user instructs the module not to use lint (default)
10682fda9279dSmrg#
10683fda9279dSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10684fda9279dSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10685fda9279dSmrg#
10686fda9279dSmrgAC_DEFUN([XORG_WITH_LINT],[
10687fda9279dSmrg
10688fda9279dSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10689fda9279dSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10690fda9279dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10691fda9279dSmrg		[Use a lint-style source code checker (default: disabled)])],
10692fda9279dSmrg		[use_lint=$withval], [use_lint=no])
10693fda9279dSmrg
10694fda9279dSmrg# Obtain platform specific info like program name and options
10695fda9279dSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10696fda9279dSmrgcase $host_os in
10697fda9279dSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10698fda9279dSmrg	lint_name=splint
10699fda9279dSmrg	lint_options="-badflag"
10700fda9279dSmrg	;;
10701fda9279dSmrg  *freebsd* | *netbsd*)
10702fda9279dSmrg	lint_name=lint
10703fda9279dSmrg	lint_options="-u -b"
10704fda9279dSmrg	;;
10705fda9279dSmrg  *solaris*)
10706fda9279dSmrg	lint_name=lint
10707fda9279dSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10708fda9279dSmrg	;;
10709fda9279dSmrgesac
10710fda9279dSmrg
10711fda9279dSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10712fda9279dSmrgif test "x$use_lint" = x"yes" ; then
10713fda9279dSmrg   AC_PATH_PROG([LINT], [$lint_name])
10714fda9279dSmrg   if test "x$LINT" = "x"; then
10715fda9279dSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10716fda9279dSmrg   fi
10717fda9279dSmrgelif test "x$use_lint" = x"no" ; then
10718fda9279dSmrg   if test "x$LINT" != "x"; then
10719fda9279dSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10720fda9279dSmrg   fi
10721fda9279dSmrgelse
10722fda9279dSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10723fda9279dSmrgfi
10724fda9279dSmrg
10725fda9279dSmrg# User supplied flags override default flags
10726fda9279dSmrgif test "x$LINT_FLAGS" != "x"; then
10727fda9279dSmrg   lint_options=$LINT_FLAGS
10728fda9279dSmrgfi
10729fda9279dSmrg
10730fda9279dSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10731fda9279dSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10732fda9279dSmrg
10733fda9279dSmrg]) # XORG_WITH_LINT
10734fda9279dSmrg
10735fda9279dSmrg# XORG_LINT_LIBRARY(LIBNAME)
10736fda9279dSmrg# --------------------------
10737fda9279dSmrg# Minimum version: 1.1.0
10738fda9279dSmrg#
10739fda9279dSmrg# Sets up flags for building lint libraries for checking programs that call
10740fda9279dSmrg# functions in the library.
10741fda9279dSmrg#
10742fda9279dSmrg# Interface to module:
10743fda9279dSmrg# LINTLIB		- Automake variable with the name of lint library file to make
10744fda9279dSmrg# MAKE_LINT_LIB		- Automake conditional
10745fda9279dSmrg#
10746fda9279dSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10747fda9279dSmrg#			  - 'no' user instructs the module not to create a lint library (default)
10748fda9279dSmrg
10749fda9279dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10750fda9279dSmrgAC_REQUIRE([XORG_WITH_LINT])
10751fda9279dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10752fda9279dSmrg	[Create lint library (default: disabled)])],
10753fda9279dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10754fda9279dSmrg
10755fda9279dSmrgif test "x$make_lint_lib" = x"yes" ; then
10756fda9279dSmrg   LINTLIB=llib-l$1.ln
10757fda9279dSmrg   if test "x$LINT" = "x"; then
10758fda9279dSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10759fda9279dSmrg   fi
10760fda9279dSmrgelif test "x$make_lint_lib" != x"no" ; then
10761fda9279dSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10762fda9279dSmrgfi
10763fda9279dSmrg
10764fda9279dSmrgAC_SUBST(LINTLIB)
10765fda9279dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10766fda9279dSmrg
10767fda9279dSmrg]) # XORG_LINT_LIBRARY
10768fda9279dSmrg
10769fda9279dSmrg# XORG_COMPILER_BRAND
10770fda9279dSmrg# -------------------
10771fda9279dSmrg# Minimum version: 1.14.0
10772fda9279dSmrg#
10773fda9279dSmrg# Checks for various brands of compilers and sets flags as appropriate:
10774fda9279dSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10775fda9279dSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10776fda9279dSmrg#   clang compiler - sets CLANGCC to "yes"
10777fda9279dSmrg#   Intel compiler - sets INTELCC to "yes"
10778fda9279dSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10779fda9279dSmrg#
10780fda9279dSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10781fda9279dSmrgAC_LANG_CASE(
10782fda9279dSmrg	[C], [
10783fda9279dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
10784fda9279dSmrg	],
10785fda9279dSmrg	[C++], [
10786fda9279dSmrg		AC_REQUIRE([AC_PROG_CXX])
10787fda9279dSmrg	]
10788fda9279dSmrg)
10789fda9279dSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10790fda9279dSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10791fda9279dSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10792fda9279dSmrg]) # XORG_COMPILER_BRAND
10793fda9279dSmrg
10794fda9279dSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10795fda9279dSmrg# ---------------
10796fda9279dSmrg# Minimum version: 1.16.0
10797fda9279dSmrg#
10798fda9279dSmrg# Test if the compiler works when passed the given flag as a command line argument.
10799fda9279dSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10800fda9279dSmrg# next flag in the list until there are no more options.
10801fda9279dSmrg#
10802fda9279dSmrg# Note that this does not guarantee that the compiler supports the flag as some
10803fda9279dSmrg# compilers will simply ignore arguments that they do not understand, but we do
10804fda9279dSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10805fda9279dSmrg# -Werror=unused-command-line-argument
10806fda9279dSmrg#
10807fda9279dSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10808fda9279dSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10809fda9279dSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10810fda9279dSmrg
10811fda9279dSmrgAC_LANG_COMPILER_REQUIRE
10812fda9279dSmrg
10813fda9279dSmrgAC_LANG_CASE(
10814fda9279dSmrg	[C], [
10815fda9279dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
10816fda9279dSmrg		define([PREFIX], [C])
10817fda9279dSmrg		define([CACHE_PREFIX], [cc])
10818fda9279dSmrg		define([COMPILER], [$CC])
10819fda9279dSmrg	],
10820fda9279dSmrg	[C++], [
10821fda9279dSmrg		define([PREFIX], [CXX])
10822fda9279dSmrg		define([CACHE_PREFIX], [cxx])
10823fda9279dSmrg		define([COMPILER], [$CXX])
10824fda9279dSmrg	]
10825fda9279dSmrg)
10826fda9279dSmrg
10827fda9279dSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10828fda9279dSmrg
10829fda9279dSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10830fda9279dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10831fda9279dSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10832fda9279dSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10833fda9279dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10834fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10835fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10836fda9279dSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10837fda9279dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10838fda9279dSmrgfi
10839fda9279dSmrg
10840fda9279dSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10841fda9279dSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10842fda9279dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10843fda9279dSmrg	fi
10844fda9279dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10845fda9279dSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10846fda9279dSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10847fda9279dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10848fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10849fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10850fda9279dSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10851fda9279dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10852fda9279dSmrgfi
10853fda9279dSmrg
10854fda9279dSmrgfound="no"
10855fda9279dSmrgm4_foreach([flag], m4_cdr($@), [
10856fda9279dSmrg	if test $found = "no" ; then
1085716ee1e9aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10858fda9279dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10859fda9279dSmrg		fi
10860fda9279dSmrg
1086116ee1e9aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10862fda9279dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10863fda9279dSmrg		fi
10864fda9279dSmrg
10865fda9279dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10866fda9279dSmrg
10867fda9279dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1086816ee1e9aSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10869fda9279dSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10870fda9279dSmrg		AC_CACHE_VAL($cacheid,
10871fda9279dSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10872fda9279dSmrg					     [eval $cacheid=yes],
10873fda9279dSmrg					     [eval $cacheid=no])])
10874fda9279dSmrg
10875fda9279dSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10876fda9279dSmrg
10877fda9279dSmrg		eval supported=\$$cacheid
10878fda9279dSmrg		AC_MSG_RESULT([$supported])
10879fda9279dSmrg		if test "$supported" = "yes" ; then
10880fda9279dSmrg			$1="$$1 ]flag["
10881fda9279dSmrg			found="yes"
10882fda9279dSmrg		fi
10883fda9279dSmrg	fi
10884fda9279dSmrg])
10885fda9279dSmrg]) # XORG_TESTSET_CFLAG
10886fda9279dSmrg
10887fda9279dSmrg# XORG_COMPILER_FLAGS
10888fda9279dSmrg# ---------------
10889fda9279dSmrg# Minimum version: 1.16.0
10890fda9279dSmrg#
10891fda9279dSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10892fda9279dSmrg# arguments supported by the selected compiler which do NOT alter the generated
10893fda9279dSmrg# code.  These arguments will cause the compiler to print various warnings
10894fda9279dSmrg# during compilation AND turn a conservative set of warnings into errors.
10895fda9279dSmrg#
10896fda9279dSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10897fda9279dSmrg# future versions of util-macros as options are added to new compilers.
10898fda9279dSmrg#
10899fda9279dSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10900fda9279dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10901fda9279dSmrg
10902fda9279dSmrgAC_ARG_ENABLE(selective-werror,
10903fda9279dSmrg              AS_HELP_STRING([--disable-selective-werror],
10904fda9279dSmrg                             [Turn off selective compiler errors. (default: enabled)]),
10905fda9279dSmrg              [SELECTIVE_WERROR=$enableval],
10906fda9279dSmrg              [SELECTIVE_WERROR=yes])
10907fda9279dSmrg
10908fda9279dSmrgAC_LANG_CASE(
10909fda9279dSmrg        [C], [
10910fda9279dSmrg                define([PREFIX], [C])
10911fda9279dSmrg        ],
10912fda9279dSmrg        [C++], [
10913fda9279dSmrg                define([PREFIX], [CXX])
10914fda9279dSmrg        ]
10915fda9279dSmrg)
10916fda9279dSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
10917fda9279dSmrgif test "x$SUNCC" = "xyes"; then
10918fda9279dSmrg    [BASE_]PREFIX[FLAGS]="-v"
10919fda9279dSmrgelse
10920fda9279dSmrg    [BASE_]PREFIX[FLAGS]=""
10921fda9279dSmrgfi
10922fda9279dSmrg
10923fda9279dSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
10924fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
10925fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
10926fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
10927fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
10928fda9279dSmrg
10929fda9279dSmrgAC_LANG_CASE(
10930fda9279dSmrg	[C], [
10931fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
10932fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
10933fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
10934fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1093516ee1e9aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
10936fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
10937fda9279dSmrg	]
10938fda9279dSmrg)
10939fda9279dSmrg
10940fda9279dSmrg# This chunk adds additional warnings that could catch undesired effects.
10941fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
10942fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
10943fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10944fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
10945fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
10946fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1094716ee1e9aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
10948fda9279dSmrg
10949fda9279dSmrg# These are currently disabled because they are noisy.  They will be enabled
10950fda9279dSmrg# in the future once the codebase is sufficiently modernized to silence
10951fda9279dSmrg# them.  For now, I don't want them to drown out the other warnings.
10952fda9279dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
10953fda9279dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1095416ee1e9aSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
10955fda9279dSmrg
10956fda9279dSmrg# Turn some warnings into errors, so we don't accidently get successful builds
10957fda9279dSmrg# when there are problems that should be fixed.
10958fda9279dSmrg
10959fda9279dSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
10960fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
10961fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
10962fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
10963fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
10964fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
10965fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
10966fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
10967fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
10968fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
10969fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
10970fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
10971fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
10972fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10973fda9279dSmrgelse
10974fda9279dSmrgAC_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])
10975fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
10976fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
10977fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
10978fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
10979fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
10980fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
10981fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
10982fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
10983fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
10984fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
10985fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
10986fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
10987fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10988fda9279dSmrgfi
10989fda9279dSmrg
10990fda9279dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
10991fda9279dSmrg]) # XORG_COMPILER_FLAGS
10992fda9279dSmrg
10993fda9279dSmrg# XORG_CWARNFLAGS
10994fda9279dSmrg# ---------------
10995fda9279dSmrg# Minimum version: 1.2.0
10996fda9279dSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
10997fda9279dSmrg#
10998fda9279dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
10999fda9279dSmrg#
11000fda9279dSmrg# This function is deprecated because it defines -fno-strict-aliasing
11001fda9279dSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11002fda9279dSmrg# is needed, then it should be added explicitly in the module when
11003fda9279dSmrg# it is updated to use BASE_CFLAGS.
11004fda9279dSmrg#
11005fda9279dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
11006fda9279dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11007fda9279dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11008fda9279dSmrgAC_LANG_CASE(
11009fda9279dSmrg	[C], [
11010fda9279dSmrg		CWARNFLAGS="$BASE_CFLAGS"
11011fda9279dSmrg		if  test "x$GCC" = xyes ; then
11012fda9279dSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11013fda9279dSmrg		fi
11014fda9279dSmrg		AC_SUBST(CWARNFLAGS)
11015fda9279dSmrg	]
11016fda9279dSmrg)
11017fda9279dSmrg]) # XORG_CWARNFLAGS
11018fda9279dSmrg
11019fda9279dSmrg# XORG_STRICT_OPTION
11020fda9279dSmrg# -----------------------
11021fda9279dSmrg# Minimum version: 1.3.0
11022fda9279dSmrg#
11023fda9279dSmrg# Add configure option to enable strict compilation flags, such as treating
11024fda9279dSmrg# warnings as fatal errors.
11025fda9279dSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11026fda9279dSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11027fda9279dSmrg#
11028fda9279dSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11029fda9279dSmrg# when strict compilation is unconditionally desired.
11030fda9279dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
11031fda9279dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
11032fda9279dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11033fda9279dSmrg
11034fda9279dSmrgAC_ARG_ENABLE(strict-compilation,
11035fda9279dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
11036fda9279dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11037fda9279dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11038fda9279dSmrg
11039fda9279dSmrgAC_LANG_CASE(
11040fda9279dSmrg        [C], [
11041fda9279dSmrg                define([PREFIX], [C])
11042fda9279dSmrg        ],
11043fda9279dSmrg        [C++], [
11044fda9279dSmrg                define([PREFIX], [CXX])
11045fda9279dSmrg        ]
11046fda9279dSmrg)
11047fda9279dSmrg
11048fda9279dSmrg[STRICT_]PREFIX[FLAGS]=""
11049fda9279dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11050fda9279dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11051fda9279dSmrg
11052fda9279dSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11053fda9279dSmrg# activate it with -Werror, so we add it here explicitly.
11054fda9279dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11055fda9279dSmrg
11056fda9279dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
11057fda9279dSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11058fda9279dSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11059fda9279dSmrgfi
11060fda9279dSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11061fda9279dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11062fda9279dSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11063fda9279dSmrg]) # XORG_STRICT_OPTION
11064fda9279dSmrg
11065fda9279dSmrg# XORG_DEFAULT_OPTIONS
11066fda9279dSmrg# --------------------
11067fda9279dSmrg# Minimum version: 1.3.0
11068fda9279dSmrg#
11069fda9279dSmrg# Defines default options for X.Org modules.
11070fda9279dSmrg#
11071fda9279dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11072fda9279dSmrgAC_REQUIRE([AC_PROG_INSTALL])
11073fda9279dSmrgXORG_COMPILER_FLAGS
11074fda9279dSmrgXORG_CWARNFLAGS
11075fda9279dSmrgXORG_STRICT_OPTION
11076fda9279dSmrgXORG_RELEASE_VERSION
11077fda9279dSmrgXORG_CHANGELOG
11078fda9279dSmrgXORG_INSTALL
11079fda9279dSmrgXORG_MANPAGE_SECTIONS
11080fda9279dSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11081fda9279dSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11082fda9279dSmrg]) # XORG_DEFAULT_OPTIONS
11083fda9279dSmrg
11084fda9279dSmrg# XORG_INSTALL()
11085fda9279dSmrg# ----------------
11086fda9279dSmrg# Minimum version: 1.4.0
11087fda9279dSmrg#
11088fda9279dSmrg# Defines the variable INSTALL_CMD as the command to copy
11089fda9279dSmrg# INSTALL from $prefix/share/util-macros.
11090fda9279dSmrg#
11091fda9279dSmrgAC_DEFUN([XORG_INSTALL], [
11092fda9279dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11093fda9279dSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11094fda9279dSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11095fda9279dSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11096fda9279dSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11097fda9279dSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11098fda9279dSmrgAC_SUBST([INSTALL_CMD])
11099fda9279dSmrg]) # XORG_INSTALL
11100fda9279dSmrgdnl Copyright 2005 Red Hat, Inc
11101fda9279dSmrgdnl
11102fda9279dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11103fda9279dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11104fda9279dSmrgdnl the above copyright notice appear in all copies and that both that
11105fda9279dSmrgdnl copyright notice and this permission notice appear in supporting
11106fda9279dSmrgdnl documentation.
11107fda9279dSmrgdnl
11108fda9279dSmrgdnl The above copyright notice and this permission notice shall be included
11109fda9279dSmrgdnl in all copies or substantial portions of the Software.
11110fda9279dSmrgdnl
11111fda9279dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11112fda9279dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11113fda9279dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11114fda9279dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11115fda9279dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11116fda9279dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11117fda9279dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11118fda9279dSmrgdnl
11119fda9279dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11120fda9279dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11121fda9279dSmrgdnl other dealings in this Software without prior written authorization
11122fda9279dSmrgdnl from the copyright holders.
11123fda9279dSmrgdnl
11124fda9279dSmrg
11125fda9279dSmrg# XORG_RELEASE_VERSION
11126fda9279dSmrg# --------------------
11127fda9279dSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1112816ee1e9aSmrg
11129fda9279dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11130fda9279dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11131fda9279dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11132fda9279dSmrg		[Major version of this package])
11133fda9279dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11134fda9279dSmrg	if test "x$PVM" = "x"; then
11135fda9279dSmrg		PVM="0"
11136fda9279dSmrg	fi
11137fda9279dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11138fda9279dSmrg		[$PVM],
11139fda9279dSmrg		[Minor version of this package])
11140fda9279dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11141fda9279dSmrg	if test "x$PVP" = "x"; then
11142fda9279dSmrg		PVP="0"
11143fda9279dSmrg	fi
11144fda9279dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11145fda9279dSmrg		[$PVP],
11146fda9279dSmrg		[Patch version of this package])
11147fda9279dSmrg])
11148fda9279dSmrg
11149fda9279dSmrg# XORG_CHANGELOG()
11150fda9279dSmrg# ----------------
11151fda9279dSmrg# Minimum version: 1.2.0
11152fda9279dSmrg#
11153fda9279dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11154fda9279dSmrg# ChangeLog from git.
11155fda9279dSmrg#
11156fda9279dSmrg#
11157fda9279dSmrgAC_DEFUN([XORG_CHANGELOG], [
11158fda9279dSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11159fda9279dSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11160fda9279dSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11161fda9279dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11162fda9279dSmrgAC_SUBST([CHANGELOG_CMD])
11163fda9279dSmrg]) # XORG_CHANGELOG
11164fda9279dSmrg
11165fda9279dSmrgdnl Copyright 2005 Red Hat, Inc
11166fda9279dSmrgdnl 
11167fda9279dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11168fda9279dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11169fda9279dSmrgdnl the above copyright notice appear in all copies and that both that
11170fda9279dSmrgdnl copyright notice and this permission notice appear in supporting
11171fda9279dSmrgdnl documentation.
11172fda9279dSmrgdnl 
11173fda9279dSmrgdnl The above copyright notice and this permission notice shall be included
11174fda9279dSmrgdnl in all copies or substantial portions of the Software.
11175fda9279dSmrgdnl 
11176fda9279dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11177fda9279dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11178fda9279dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11179fda9279dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11180fda9279dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11181fda9279dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11182fda9279dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11183fda9279dSmrgdnl 
11184fda9279dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11185fda9279dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11186fda9279dSmrgdnl other dealings in this Software without prior written authorization
11187fda9279dSmrgdnl from the copyright holders.
11188fda9279dSmrgdnl 
11189fda9279dSmrg
11190fda9279dSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
11191fda9279dSmrg# --------------------------
11192fda9279dSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11193fda9279dSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
11194fda9279dSmrg
11195fda9279dSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
11196fda9279dSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11197fda9279dSmrg	SAVE_CFLAGS="$CFLAGS"
11198fda9279dSmrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
11199fda9279dSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11200fda9279dSmrg#include "xorg-server.h"
11201fda9279dSmrg#if !defined $1
11202fda9279dSmrg#error $1 not defined
11203fda9279dSmrg#endif
11204fda9279dSmrg		]])],
11205fda9279dSmrg		[_EXT_CHECK=yes],
11206fda9279dSmrg		[_EXT_CHECK=no])
11207fda9279dSmrg	CFLAGS="$SAVE_CFLAGS"
11208fda9279dSmrg	AC_MSG_CHECKING([if $1 is defined])
11209fda9279dSmrg	AC_MSG_RESULT([$_EXT_CHECK])
11210fda9279dSmrg	if test "$_EXT_CHECK" != no; then
11211fda9279dSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
11212fda9279dSmrg	fi
11213fda9279dSmrg])
11214fda9279dSmrg
1121516ee1e9aSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
11216fda9279dSmrg#
11217fda9279dSmrg# This file is free software; the Free Software Foundation
11218fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11219fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11220fda9279dSmrg
11221fda9279dSmrg# AM_AUTOMAKE_VERSION(VERSION)
11222fda9279dSmrg# ----------------------------
11223fda9279dSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11224fda9279dSmrg# generated from the m4 files accompanying Automake X.Y.
11225fda9279dSmrg# (This private macro should not be called outside this file.)
11226fda9279dSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1122716ee1e9aSmrg[am__api_version='1.15'
11228fda9279dSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11229fda9279dSmrgdnl require some minimum version.  Point them to the right macro.
1123016ee1e9aSmrgm4_if([$1], [1.15], [],
11231fda9279dSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11232fda9279dSmrg])
11233fda9279dSmrg
11234fda9279dSmrg# _AM_AUTOCONF_VERSION(VERSION)
11235fda9279dSmrg# -----------------------------
11236fda9279dSmrg# aclocal traces this macro to find the Autoconf version.
11237fda9279dSmrg# This is a private macro too.  Using m4_define simplifies
11238fda9279dSmrg# the logic in aclocal, which can simply ignore this definition.
11239fda9279dSmrgm4_define([_AM_AUTOCONF_VERSION], [])
11240fda9279dSmrg
11241fda9279dSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11242fda9279dSmrg# -------------------------------
11243fda9279dSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11244fda9279dSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11245fda9279dSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1124616ee1e9aSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
11247fda9279dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
11248fda9279dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11249fda9279dSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11250fda9279dSmrg
11251fda9279dSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11252fda9279dSmrg
1125316ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11254fda9279dSmrg#
11255fda9279dSmrg# This file is free software; the Free Software Foundation
11256fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11257fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11258fda9279dSmrg
11259fda9279dSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11260fda9279dSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11261fda9279dSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
11262fda9279dSmrg#
11263fda9279dSmrg# Of course, Automake must honor this variable whenever it calls a
11264fda9279dSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11265fda9279dSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11266fda9279dSmrg# depending on how configure is run.  This is pretty annoying, since
11267fda9279dSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11268fda9279dSmrg# source directory, any form will work fine, but in subdirectories a
11269fda9279dSmrg# relative path needs to be adjusted first.
11270fda9279dSmrg#
11271fda9279dSmrg# $ac_aux_dir/missing
11272fda9279dSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11273fda9279dSmrg# $top_srcdir/$ac_aux_dir/missing
11274fda9279dSmrg#    fails if $ac_aux_dir is absolute,
11275fda9279dSmrg#    fails when called from a subdirectory in a VPATH build with
11276fda9279dSmrg#          a relative $ac_aux_dir
11277fda9279dSmrg#
11278fda9279dSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11279fda9279dSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
11280fda9279dSmrg# harmless because $srcdir is '.', but things will broke when you
11281fda9279dSmrg# start a VPATH build or use an absolute $srcdir.
11282fda9279dSmrg#
11283fda9279dSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11284fda9279dSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11285fda9279dSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11286fda9279dSmrg# and then we would define $MISSING as
11287fda9279dSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11288fda9279dSmrg# This will work as long as MISSING is not called from configure, because
11289fda9279dSmrg# unfortunately $(top_srcdir) has no meaning in configure.
11290fda9279dSmrg# However there are other variables, like CC, which are often used in
11291fda9279dSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
11292fda9279dSmrg#
11293fda9279dSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
11294fda9279dSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
11295fda9279dSmrg# configured tree to be moved without reconfiguration.
11296fda9279dSmrg
11297fda9279dSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1129816ee1e9aSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1129916ee1e9aSmrg# Expand $ac_aux_dir to an absolute path.
1130016ee1e9aSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11301fda9279dSmrg])
11302fda9279dSmrg
11303fda9279dSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11304fda9279dSmrg
1130516ee1e9aSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11306fda9279dSmrg#
11307fda9279dSmrg# This file is free software; the Free Software Foundation
11308fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11309fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11310fda9279dSmrg
11311fda9279dSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11312fda9279dSmrg# -------------------------------------
11313fda9279dSmrg# Define a conditional.
11314fda9279dSmrgAC_DEFUN([AM_CONDITIONAL],
11315fda9279dSmrg[AC_PREREQ([2.52])dnl
11316fda9279dSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11317fda9279dSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11318fda9279dSmrgAC_SUBST([$1_TRUE])dnl
11319fda9279dSmrgAC_SUBST([$1_FALSE])dnl
11320fda9279dSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11321fda9279dSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11322fda9279dSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11323fda9279dSmrgif $2; then
11324fda9279dSmrg  $1_TRUE=
11325fda9279dSmrg  $1_FALSE='#'
11326fda9279dSmrgelse
11327fda9279dSmrg  $1_TRUE='#'
11328fda9279dSmrg  $1_FALSE=
11329fda9279dSmrgfi
11330fda9279dSmrgAC_CONFIG_COMMANDS_PRE(
11331fda9279dSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11332fda9279dSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11333fda9279dSmrgUsually this means the macro was only invoked conditionally.]])
11334fda9279dSmrgfi])])
11335fda9279dSmrg
1133616ee1e9aSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11337fda9279dSmrg#
11338fda9279dSmrg# This file is free software; the Free Software Foundation
11339fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11340fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11341fda9279dSmrg
11342fda9279dSmrg
11343fda9279dSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11344fda9279dSmrg# written in clear, in which case automake, when reading aclocal.m4,
11345fda9279dSmrg# will think it sees a *use*, and therefore will trigger all it's
11346fda9279dSmrg# C support machinery.  Also note that it means that autoscan, seeing
11347fda9279dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11348fda9279dSmrg
11349fda9279dSmrg
11350fda9279dSmrg# _AM_DEPENDENCIES(NAME)
11351fda9279dSmrg# ----------------------
11352fda9279dSmrg# See how the compiler implements dependency checking.
11353fda9279dSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11354fda9279dSmrg# We try a few techniques and use that to set a single cache variable.
11355fda9279dSmrg#
11356fda9279dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11357fda9279dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11358fda9279dSmrg# dependency, and given that the user is not expected to run this macro,
11359fda9279dSmrg# just rely on AC_PROG_CC.
11360fda9279dSmrgAC_DEFUN([_AM_DEPENDENCIES],
11361fda9279dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11362fda9279dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11363fda9279dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11364fda9279dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11365fda9279dSmrg
11366fda9279dSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11367fda9279dSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11368fda9279dSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11369fda9279dSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11370fda9279dSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11371fda9279dSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11372fda9279dSmrg                    [depcc="$$1"   am_compiler_list=])
11373fda9279dSmrg
11374fda9279dSmrgAC_CACHE_CHECK([dependency style of $depcc],
11375fda9279dSmrg               [am_cv_$1_dependencies_compiler_type],
11376fda9279dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11377fda9279dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
11378fda9279dSmrg  # making bogus files that we don't know about and never remove.  For
11379fda9279dSmrg  # instance it was reported that on HP-UX the gcc test will end up
11380fda9279dSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11381fda9279dSmrg  # in D".
11382fda9279dSmrg  rm -rf conftest.dir
11383fda9279dSmrg  mkdir conftest.dir
11384fda9279dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11385fda9279dSmrg  # using a relative directory.
11386fda9279dSmrg  cp "$am_depcomp" conftest.dir
11387fda9279dSmrg  cd conftest.dir
11388fda9279dSmrg  # We will build objects and dependencies in a subdirectory because
11389fda9279dSmrg  # it helps to detect inapplicable dependency modes.  For instance
11390fda9279dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11391fda9279dSmrg  # side effect of compilation, but ICC will put the dependencies in
11392fda9279dSmrg  # the current directory while Tru64 will put them in the object
11393fda9279dSmrg  # directory.
11394fda9279dSmrg  mkdir sub
11395fda9279dSmrg
11396fda9279dSmrg  am_cv_$1_dependencies_compiler_type=none
11397fda9279dSmrg  if test "$am_compiler_list" = ""; then
11398fda9279dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11399fda9279dSmrg  fi
11400fda9279dSmrg  am__universal=false
11401fda9279dSmrg  m4_case([$1], [CC],
11402fda9279dSmrg    [case " $depcc " in #(
11403fda9279dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11404fda9279dSmrg     esac],
11405fda9279dSmrg    [CXX],
11406fda9279dSmrg    [case " $depcc " in #(
11407fda9279dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11408fda9279dSmrg     esac])
11409fda9279dSmrg
11410fda9279dSmrg  for depmode in $am_compiler_list; do
11411fda9279dSmrg    # Setup a source with many dependencies, because some compilers
11412fda9279dSmrg    # like to wrap large dependency lists on column 80 (with \), and
11413fda9279dSmrg    # we should not choose a depcomp mode which is confused by this.
11414fda9279dSmrg    #
11415fda9279dSmrg    # We need to recreate these files for each test, as the compiler may
11416fda9279dSmrg    # overwrite some of them when testing with obscure command lines.
11417fda9279dSmrg    # This happens at least with the AIX C compiler.
11418fda9279dSmrg    : > sub/conftest.c
11419fda9279dSmrg    for i in 1 2 3 4 5 6; do
11420fda9279dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11421fda9279dSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11422fda9279dSmrg      # Solaris 10 /bin/sh.
11423fda9279dSmrg      echo '/* dummy */' > sub/conftst$i.h
11424fda9279dSmrg    done
11425fda9279dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11426fda9279dSmrg
11427fda9279dSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11428fda9279dSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11429fda9279dSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11430fda9279dSmrg    # versions had trouble with output in subdirs.
11431fda9279dSmrg    am__obj=sub/conftest.${OBJEXT-o}
11432fda9279dSmrg    am__minus_obj="-o $am__obj"
11433fda9279dSmrg    case $depmode in
11434fda9279dSmrg    gcc)
11435fda9279dSmrg      # This depmode causes a compiler race in universal mode.
11436fda9279dSmrg      test "$am__universal" = false || continue
11437fda9279dSmrg      ;;
11438fda9279dSmrg    nosideeffect)
11439fda9279dSmrg      # After this tag, mechanisms are not by side-effect, so they'll
11440fda9279dSmrg      # only be used when explicitly requested.
11441fda9279dSmrg      if test "x$enable_dependency_tracking" = xyes; then
11442fda9279dSmrg	continue
11443fda9279dSmrg      else
11444fda9279dSmrg	break
11445fda9279dSmrg      fi
11446fda9279dSmrg      ;;
11447fda9279dSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11448fda9279dSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
11449fda9279dSmrg      # not run yet.  These depmodes are late enough in the game, and
11450fda9279dSmrg      # so weak that their functioning should not be impacted.
11451fda9279dSmrg      am__obj=conftest.${OBJEXT-o}
11452fda9279dSmrg      am__minus_obj=
11453fda9279dSmrg      ;;
11454fda9279dSmrg    none) break ;;
11455fda9279dSmrg    esac
11456fda9279dSmrg    if depmode=$depmode \
11457fda9279dSmrg       source=sub/conftest.c object=$am__obj \
11458fda9279dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11459fda9279dSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11460fda9279dSmrg         >/dev/null 2>conftest.err &&
11461fda9279dSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11462fda9279dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11463fda9279dSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11464fda9279dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11465fda9279dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
11466fda9279dSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
11467fda9279dSmrg      # that says an option was ignored or not supported.
11468fda9279dSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11469fda9279dSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11470fda9279dSmrg      # The diagnosis changed in icc 8.0:
11471fda9279dSmrg      #   icc: Command line remark: option '-MP' not supported
11472fda9279dSmrg      if (grep 'ignoring option' conftest.err ||
11473fda9279dSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11474fda9279dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
11475fda9279dSmrg        break
11476fda9279dSmrg      fi
11477fda9279dSmrg    fi
11478fda9279dSmrg  done
11479fda9279dSmrg
11480fda9279dSmrg  cd ..
11481fda9279dSmrg  rm -rf conftest.dir
11482fda9279dSmrgelse
11483fda9279dSmrg  am_cv_$1_dependencies_compiler_type=none
11484fda9279dSmrgfi
11485fda9279dSmrg])
11486fda9279dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11487fda9279dSmrgAM_CONDITIONAL([am__fastdep$1], [
11488fda9279dSmrg  test "x$enable_dependency_tracking" != xno \
11489fda9279dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11490fda9279dSmrg])
11491fda9279dSmrg
11492fda9279dSmrg
11493fda9279dSmrg# AM_SET_DEPDIR
11494fda9279dSmrg# -------------
11495fda9279dSmrg# Choose a directory name for dependency files.
11496fda9279dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11497fda9279dSmrgAC_DEFUN([AM_SET_DEPDIR],
11498fda9279dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11499fda9279dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11500fda9279dSmrg])
11501fda9279dSmrg
11502fda9279dSmrg
11503fda9279dSmrg# AM_DEP_TRACK
11504fda9279dSmrg# ------------
11505fda9279dSmrgAC_DEFUN([AM_DEP_TRACK],
11506fda9279dSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11507fda9279dSmrgAS_HELP_STRING(
11508fda9279dSmrg  [--enable-dependency-tracking],
11509fda9279dSmrg  [do not reject slow dependency extractors])
11510fda9279dSmrgAS_HELP_STRING(
11511fda9279dSmrg  [--disable-dependency-tracking],
11512fda9279dSmrg  [speeds up one-time build])])
11513fda9279dSmrgif test "x$enable_dependency_tracking" != xno; then
11514fda9279dSmrg  am_depcomp="$ac_aux_dir/depcomp"
11515fda9279dSmrg  AMDEPBACKSLASH='\'
11516fda9279dSmrg  am__nodep='_no'
11517fda9279dSmrgfi
11518fda9279dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11519fda9279dSmrgAC_SUBST([AMDEPBACKSLASH])dnl
11520fda9279dSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11521fda9279dSmrgAC_SUBST([am__nodep])dnl
11522fda9279dSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11523fda9279dSmrg])
11524fda9279dSmrg
11525fda9279dSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
11526fda9279dSmrg
1152716ee1e9aSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11528fda9279dSmrg#
11529fda9279dSmrg# This file is free software; the Free Software Foundation
11530fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11531fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11532fda9279dSmrg
11533fda9279dSmrg
11534fda9279dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11535fda9279dSmrg# ------------------------------
11536fda9279dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11537fda9279dSmrg[{
11538fda9279dSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
11539fda9279dSmrg  # are listed without --file.  Let's play safe and only enable the eval
11540fda9279dSmrg  # if we detect the quoting.
11541fda9279dSmrg  case $CONFIG_FILES in
11542fda9279dSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
11543fda9279dSmrg  *)   set x $CONFIG_FILES ;;
11544fda9279dSmrg  esac
11545fda9279dSmrg  shift
11546fda9279dSmrg  for mf
11547fda9279dSmrg  do
11548fda9279dSmrg    # Strip MF so we end up with the name of the file.
11549fda9279dSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11550fda9279dSmrg    # Check whether this is an Automake generated Makefile or not.
11551fda9279dSmrg    # We used to match only the files named 'Makefile.in', but
11552fda9279dSmrg    # some people rename them; so instead we look at the file content.
11553fda9279dSmrg    # Grep'ing the first line is not enough: some people post-process
11554fda9279dSmrg    # each Makefile.in and add a new line on top of each file to say so.
11555fda9279dSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
11556fda9279dSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
11557fda9279dSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11558fda9279dSmrg      dirpart=`AS_DIRNAME("$mf")`
11559fda9279dSmrg    else
11560fda9279dSmrg      continue
11561fda9279dSmrg    fi
11562fda9279dSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
11563fda9279dSmrg    # from the Makefile without running 'make'.
11564fda9279dSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11565fda9279dSmrg    test -z "$DEPDIR" && continue
11566fda9279dSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11567fda9279dSmrg    test -z "$am__include" && continue
11568fda9279dSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11569fda9279dSmrg    # Find all dependency output files, they are included files with
11570fda9279dSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11571fda9279dSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11572fda9279dSmrg    # expansion.
11573fda9279dSmrg    for file in `sed -n "
11574fda9279dSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11575fda9279dSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11576fda9279dSmrg      # Make sure the directory exists.
11577fda9279dSmrg      test -f "$dirpart/$file" && continue
11578fda9279dSmrg      fdir=`AS_DIRNAME(["$file"])`
11579fda9279dSmrg      AS_MKDIR_P([$dirpart/$fdir])
11580fda9279dSmrg      # echo "creating $dirpart/$file"
11581fda9279dSmrg      echo '# dummy' > "$dirpart/$file"
11582fda9279dSmrg    done
11583fda9279dSmrg  done
11584fda9279dSmrg}
11585fda9279dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11586fda9279dSmrg
11587fda9279dSmrg
11588fda9279dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11589fda9279dSmrg# -----------------------------
11590fda9279dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
11591fda9279dSmrg#
11592fda9279dSmrg# This code is only required when automatic dependency tracking
11593fda9279dSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
11594fda9279dSmrg# need in order to bootstrap the dependency handling code.
11595fda9279dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11596fda9279dSmrg[AC_CONFIG_COMMANDS([depfiles],
11597fda9279dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11598fda9279dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11599fda9279dSmrg])
11600fda9279dSmrg
11601fda9279dSmrg# Do all the work for Automake.                             -*- Autoconf -*-
11602fda9279dSmrg
1160316ee1e9aSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
11604fda9279dSmrg#
11605fda9279dSmrg# This file is free software; the Free Software Foundation
11606fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11607fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11608fda9279dSmrg
11609fda9279dSmrg# This macro actually does too much.  Some checks are only needed if
11610fda9279dSmrg# your package does certain things.  But this isn't really a big deal.
11611fda9279dSmrg
11612fda9279dSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11613fda9279dSmrgm4_define([AC_PROG_CC],
11614fda9279dSmrgm4_defn([AC_PROG_CC])
11615fda9279dSmrg[_AM_PROG_CC_C_O
11616fda9279dSmrg])
11617fda9279dSmrg
11618fda9279dSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11619fda9279dSmrg# AM_INIT_AUTOMAKE([OPTIONS])
11620fda9279dSmrg# -----------------------------------------------
11621fda9279dSmrg# The call with PACKAGE and VERSION arguments is the old style
11622fda9279dSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11623fda9279dSmrg# and VERSION should now be passed to AC_INIT and removed from
11624fda9279dSmrg# the call to AM_INIT_AUTOMAKE.
11625fda9279dSmrg# We support both call styles for the transition.  After
11626fda9279dSmrg# the next Automake release, Autoconf can make the AC_INIT
11627fda9279dSmrg# arguments mandatory, and then we can depend on a new Autoconf
11628fda9279dSmrg# release and drop the old call support.
11629fda9279dSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11630fda9279dSmrg[AC_PREREQ([2.65])dnl
11631fda9279dSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11632fda9279dSmrgdnl the ones we care about.
11633fda9279dSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11634fda9279dSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11635fda9279dSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11636fda9279dSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11637fda9279dSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11638fda9279dSmrg  # is not polluted with repeated "-I."
11639fda9279dSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11640fda9279dSmrg  # test to see if srcdir already configured
11641fda9279dSmrg  if test -f $srcdir/config.status; then
11642fda9279dSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11643fda9279dSmrg  fi
11644fda9279dSmrgfi
11645fda9279dSmrg
11646fda9279dSmrg# test whether we have cygpath
11647fda9279dSmrgif test -z "$CYGPATH_W"; then
11648fda9279dSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11649fda9279dSmrg    CYGPATH_W='cygpath -w'
11650fda9279dSmrg  else
11651fda9279dSmrg    CYGPATH_W=echo
11652fda9279dSmrg  fi
11653fda9279dSmrgfi
11654fda9279dSmrgAC_SUBST([CYGPATH_W])
11655fda9279dSmrg
11656fda9279dSmrg# Define the identity of the package.
11657fda9279dSmrgdnl Distinguish between old-style and new-style calls.
11658fda9279dSmrgm4_ifval([$2],
11659fda9279dSmrg[AC_DIAGNOSE([obsolete],
11660fda9279dSmrg             [$0: two- and three-arguments forms are deprecated.])
11661fda9279dSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11662fda9279dSmrg AC_SUBST([PACKAGE], [$1])dnl
11663fda9279dSmrg AC_SUBST([VERSION], [$2])],
11664fda9279dSmrg[_AM_SET_OPTIONS([$1])dnl
11665fda9279dSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11666fda9279dSmrgm4_if(
11667fda9279dSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11668fda9279dSmrg  [ok:ok],,
11669fda9279dSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11670fda9279dSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11671fda9279dSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11672fda9279dSmrg
11673fda9279dSmrg_AM_IF_OPTION([no-define],,
11674fda9279dSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11675fda9279dSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11676fda9279dSmrg
11677fda9279dSmrg# Some tools Automake needs.
11678fda9279dSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11679fda9279dSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11680fda9279dSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11681fda9279dSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11682fda9279dSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11683fda9279dSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11684fda9279dSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11685fda9279dSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11686fda9279dSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11687fda9279dSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11688fda9279dSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
11689fda9279dSmrg# dies out for good.  For more background, see:
11690fda9279dSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11691fda9279dSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11692fda9279dSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1169316ee1e9aSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
1169416ee1e9aSmrg# system "awk" is bad on some platforms.
11695fda9279dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
11696fda9279dSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11697fda9279dSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11698fda9279dSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11699fda9279dSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11700fda9279dSmrg			     [_AM_PROG_TAR([v7])])])
11701fda9279dSmrg_AM_IF_OPTION([no-dependencies],,
11702fda9279dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11703fda9279dSmrg		  [_AM_DEPENDENCIES([CC])],
11704fda9279dSmrg		  [m4_define([AC_PROG_CC],
11705fda9279dSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11706fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11707fda9279dSmrg		  [_AM_DEPENDENCIES([CXX])],
11708fda9279dSmrg		  [m4_define([AC_PROG_CXX],
11709fda9279dSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11710fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11711fda9279dSmrg		  [_AM_DEPENDENCIES([OBJC])],
11712fda9279dSmrg		  [m4_define([AC_PROG_OBJC],
11713fda9279dSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11714fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11715fda9279dSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
11716fda9279dSmrg		  [m4_define([AC_PROG_OBJCXX],
11717fda9279dSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11718fda9279dSmrg])
11719fda9279dSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11720fda9279dSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
11721fda9279dSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11722fda9279dSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11723fda9279dSmrgAC_CONFIG_COMMANDS_PRE(dnl
11724fda9279dSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11725fda9279dSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11726fda9279dSmrg
11727fda9279dSmrg# POSIX will say in a future version that running "rm -f" with no argument
11728fda9279dSmrg# is OK; and we want to be able to make that assumption in our Makefile
11729fda9279dSmrg# recipes.  So use an aggressive probe to check that the usage we want is
11730fda9279dSmrg# actually supported "in the wild" to an acceptable degree.
11731fda9279dSmrg# See automake bug#10828.
11732fda9279dSmrg# To make any issue more visible, cause the running configure to be aborted
11733fda9279dSmrg# by default if the 'rm' program in use doesn't match our expectations; the
11734fda9279dSmrg# user can still override this though.
11735fda9279dSmrgif rm -f && rm -fr && rm -rf; then : OK; else
11736fda9279dSmrg  cat >&2 <<'END'
11737fda9279dSmrgOops!
11738fda9279dSmrg
11739fda9279dSmrgYour 'rm' program seems unable to run without file operands specified
11740fda9279dSmrgon the command line, even when the '-f' option is present.  This is contrary
11741fda9279dSmrgto the behaviour of most rm programs out there, and not conforming with
11742fda9279dSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11743fda9279dSmrg
11744fda9279dSmrgPlease tell bug-automake@gnu.org about your system, including the value
11745fda9279dSmrgof your $PATH and any error possibly output before this message.  This
11746fda9279dSmrgcan help us improve future automake versions.
11747fda9279dSmrg
11748fda9279dSmrgEND
11749fda9279dSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11750fda9279dSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11751fda9279dSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11752fda9279dSmrg    echo >&2
11753fda9279dSmrg  else
11754fda9279dSmrg    cat >&2 <<'END'
11755fda9279dSmrgAborting the configuration process, to ensure you take notice of the issue.
11756fda9279dSmrg
11757fda9279dSmrgYou can download and install GNU coreutils to get an 'rm' implementation
11758fda9279dSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11759fda9279dSmrg
11760fda9279dSmrgIf you want to complete the configuration process using your problematic
11761fda9279dSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11762fda9279dSmrgto "yes", and re-run configure.
11763fda9279dSmrg
11764fda9279dSmrgEND
11765fda9279dSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11766fda9279dSmrg  fi
1176716ee1e9aSmrgfi
1176816ee1e9aSmrgdnl The trailing newline in this macro's definition is deliberate, for
1176916ee1e9aSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
1177016ee1e9aSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1177116ee1e9aSmrg])
11772fda9279dSmrg
11773fda9279dSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11774fda9279dSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11775fda9279dSmrgdnl mangled by Autoconf and run in a shell conditional statement.
11776fda9279dSmrgm4_define([_AC_COMPILER_EXEEXT],
11777fda9279dSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11778fda9279dSmrg
11779fda9279dSmrg# When config.status generates a header, we must update the stamp-h file.
11780fda9279dSmrg# This file resides in the same directory as the config header
11781fda9279dSmrg# that is generated.  The stamp files are numbered to have different names.
11782fda9279dSmrg
11783fda9279dSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11784fda9279dSmrg# loop where config.status creates the headers, so we can generate
11785fda9279dSmrg# our stamp files there.
11786fda9279dSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11787fda9279dSmrg[# Compute $1's index in $config_headers.
11788fda9279dSmrg_am_arg=$1
11789fda9279dSmrg_am_stamp_count=1
11790fda9279dSmrgfor _am_header in $config_headers :; do
11791fda9279dSmrg  case $_am_header in
11792fda9279dSmrg    $_am_arg | $_am_arg:* )
11793fda9279dSmrg      break ;;
11794fda9279dSmrg    * )
11795fda9279dSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11796fda9279dSmrg  esac
11797fda9279dSmrgdone
11798fda9279dSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11799fda9279dSmrg
1180016ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11801fda9279dSmrg#
11802fda9279dSmrg# This file is free software; the Free Software Foundation
11803fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11804fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11805fda9279dSmrg
11806fda9279dSmrg# AM_PROG_INSTALL_SH
11807fda9279dSmrg# ------------------
11808fda9279dSmrg# Define $install_sh.
11809fda9279dSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11810fda9279dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1181116ee1e9aSmrgif test x"${install_sh+set}" != xset; then
11812fda9279dSmrg  case $am_aux_dir in
11813fda9279dSmrg  *\ * | *\	*)
11814fda9279dSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11815fda9279dSmrg  *)
11816fda9279dSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11817fda9279dSmrg  esac
11818fda9279dSmrgfi
11819fda9279dSmrgAC_SUBST([install_sh])])
11820fda9279dSmrg
1182116ee1e9aSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
11822fda9279dSmrg#
11823fda9279dSmrg# This file is free software; the Free Software Foundation
11824fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11825fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11826fda9279dSmrg
11827fda9279dSmrg# Check whether the underlying file-system supports filenames
11828fda9279dSmrg# with a leading dot.  For instance MS-DOS doesn't.
11829fda9279dSmrgAC_DEFUN([AM_SET_LEADING_DOT],
11830fda9279dSmrg[rm -rf .tst 2>/dev/null
11831fda9279dSmrgmkdir .tst 2>/dev/null
11832fda9279dSmrgif test -d .tst; then
11833fda9279dSmrg  am__leading_dot=.
11834fda9279dSmrgelse
11835fda9279dSmrg  am__leading_dot=_
11836fda9279dSmrgfi
11837fda9279dSmrgrmdir .tst 2>/dev/null
11838fda9279dSmrgAC_SUBST([am__leading_dot])])
11839fda9279dSmrg
11840fda9279dSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11841fda9279dSmrg
1184216ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11843fda9279dSmrg#
11844fda9279dSmrg# This file is free software; the Free Software Foundation
11845fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11846fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11847fda9279dSmrg
11848fda9279dSmrg# AM_MAKE_INCLUDE()
11849fda9279dSmrg# -----------------
11850fda9279dSmrg# Check to see how make treats includes.
11851fda9279dSmrgAC_DEFUN([AM_MAKE_INCLUDE],
11852fda9279dSmrg[am_make=${MAKE-make}
11853fda9279dSmrgcat > confinc << 'END'
11854fda9279dSmrgam__doit:
11855fda9279dSmrg	@echo this is the am__doit target
11856fda9279dSmrg.PHONY: am__doit
11857fda9279dSmrgEND
11858fda9279dSmrg# If we don't find an include directive, just comment out the code.
11859fda9279dSmrgAC_MSG_CHECKING([for style of include used by $am_make])
11860fda9279dSmrgam__include="#"
11861fda9279dSmrgam__quote=
11862fda9279dSmrg_am_result=none
11863fda9279dSmrg# First try GNU make style include.
11864fda9279dSmrgecho "include confinc" > confmf
11865fda9279dSmrg# Ignore all kinds of additional output from 'make'.
11866fda9279dSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11867fda9279dSmrg*the\ am__doit\ target*)
11868fda9279dSmrg  am__include=include
11869fda9279dSmrg  am__quote=
11870fda9279dSmrg  _am_result=GNU
11871fda9279dSmrg  ;;
11872fda9279dSmrgesac
11873fda9279dSmrg# Now try BSD make style include.
11874fda9279dSmrgif test "$am__include" = "#"; then
11875fda9279dSmrg   echo '.include "confinc"' > confmf
11876fda9279dSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11877fda9279dSmrg   *the\ am__doit\ target*)
11878fda9279dSmrg     am__include=.include
11879fda9279dSmrg     am__quote="\""
11880fda9279dSmrg     _am_result=BSD
11881fda9279dSmrg     ;;
11882fda9279dSmrg   esac
11883fda9279dSmrgfi
11884fda9279dSmrgAC_SUBST([am__include])
11885fda9279dSmrgAC_SUBST([am__quote])
11886fda9279dSmrgAC_MSG_RESULT([$_am_result])
11887fda9279dSmrgrm -f confinc confmf
11888fda9279dSmrg])
11889fda9279dSmrg
11890fda9279dSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11891fda9279dSmrg
1189216ee1e9aSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11893fda9279dSmrg#
11894fda9279dSmrg# This file is free software; the Free Software Foundation
11895fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11896fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11897fda9279dSmrg
11898fda9279dSmrg# AM_MISSING_PROG(NAME, PROGRAM)
11899fda9279dSmrg# ------------------------------
11900fda9279dSmrgAC_DEFUN([AM_MISSING_PROG],
11901fda9279dSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11902fda9279dSmrg$1=${$1-"${am_missing_run}$2"}
11903fda9279dSmrgAC_SUBST($1)])
11904fda9279dSmrg
11905fda9279dSmrg# AM_MISSING_HAS_RUN
11906fda9279dSmrg# ------------------
11907fda9279dSmrg# Define MISSING if not defined so far and test if it is modern enough.
11908fda9279dSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
11909fda9279dSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11910fda9279dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11911fda9279dSmrgAC_REQUIRE_AUX_FILE([missing])dnl
11912fda9279dSmrgif test x"${MISSING+set}" != xset; then
11913fda9279dSmrg  case $am_aux_dir in
11914fda9279dSmrg  *\ * | *\	*)
11915fda9279dSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11916fda9279dSmrg  *)
11917fda9279dSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11918fda9279dSmrg  esac
11919fda9279dSmrgfi
11920fda9279dSmrg# Use eval to expand $SHELL
11921fda9279dSmrgif eval "$MISSING --is-lightweight"; then
11922fda9279dSmrg  am_missing_run="$MISSING "
11923fda9279dSmrgelse
11924fda9279dSmrg  am_missing_run=
11925fda9279dSmrg  AC_MSG_WARN(['missing' script is too old or missing])
11926fda9279dSmrgfi
11927fda9279dSmrg])
11928fda9279dSmrg
11929fda9279dSmrg# Helper functions for option handling.                     -*- Autoconf -*-
11930fda9279dSmrg
1193116ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11932fda9279dSmrg#
11933fda9279dSmrg# This file is free software; the Free Software Foundation
11934fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11935fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11936fda9279dSmrg
11937fda9279dSmrg# _AM_MANGLE_OPTION(NAME)
11938fda9279dSmrg# -----------------------
11939fda9279dSmrgAC_DEFUN([_AM_MANGLE_OPTION],
11940fda9279dSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
11941fda9279dSmrg
11942fda9279dSmrg# _AM_SET_OPTION(NAME)
11943fda9279dSmrg# --------------------
11944fda9279dSmrg# Set option NAME.  Presently that only means defining a flag for this option.
11945fda9279dSmrgAC_DEFUN([_AM_SET_OPTION],
11946fda9279dSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
11947fda9279dSmrg
11948fda9279dSmrg# _AM_SET_OPTIONS(OPTIONS)
11949fda9279dSmrg# ------------------------
11950fda9279dSmrg# OPTIONS is a space-separated list of Automake options.
11951fda9279dSmrgAC_DEFUN([_AM_SET_OPTIONS],
11952fda9279dSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
11953fda9279dSmrg
11954fda9279dSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
11955fda9279dSmrg# -------------------------------------------
11956fda9279dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
11957fda9279dSmrgAC_DEFUN([_AM_IF_OPTION],
11958fda9279dSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
11959fda9279dSmrg
1196016ee1e9aSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11961fda9279dSmrg#
11962fda9279dSmrg# This file is free software; the Free Software Foundation
11963fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11964fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11965fda9279dSmrg
11966fda9279dSmrg# _AM_PROG_CC_C_O
11967fda9279dSmrg# ---------------
11968fda9279dSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
11969fda9279dSmrg# to automatically call this.
11970fda9279dSmrgAC_DEFUN([_AM_PROG_CC_C_O],
11971fda9279dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11972fda9279dSmrgAC_REQUIRE_AUX_FILE([compile])dnl
11973fda9279dSmrgAC_LANG_PUSH([C])dnl
11974fda9279dSmrgAC_CACHE_CHECK(
11975fda9279dSmrg  [whether $CC understands -c and -o together],
11976fda9279dSmrg  [am_cv_prog_cc_c_o],
11977fda9279dSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
11978fda9279dSmrg  # Make sure it works both with $CC and with simple cc.
11979fda9279dSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
11980fda9279dSmrg  # compilers refuse to overwrite an existing .o file with -o,
11981fda9279dSmrg  # though they will create one.
11982fda9279dSmrg  am_cv_prog_cc_c_o=yes
11983fda9279dSmrg  for am_i in 1 2; do
11984fda9279dSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
11985fda9279dSmrg         && test -f conftest2.$ac_objext; then
11986fda9279dSmrg      : OK
11987fda9279dSmrg    else
11988fda9279dSmrg      am_cv_prog_cc_c_o=no
11989fda9279dSmrg      break
11990fda9279dSmrg    fi
11991fda9279dSmrg  done
11992fda9279dSmrg  rm -f core conftest*
11993fda9279dSmrg  unset am_i])
11994fda9279dSmrgif test "$am_cv_prog_cc_c_o" != yes; then
11995fda9279dSmrg   # Losing compiler, so override with the script.
11996fda9279dSmrg   # FIXME: It is wrong to rewrite CC.
11997fda9279dSmrg   # But if we don't then we get into trouble of one sort or another.
11998fda9279dSmrg   # A longer-term fix would be to have automake use am__CC in this case,
11999fda9279dSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12000fda9279dSmrg   CC="$am_aux_dir/compile $CC"
12001fda9279dSmrgfi
12002fda9279dSmrgAC_LANG_POP([C])])
12003fda9279dSmrg
12004fda9279dSmrg# For backward compatibility.
12005fda9279dSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12006fda9279dSmrg
1200716ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12008fda9279dSmrg#
12009fda9279dSmrg# This file is free software; the Free Software Foundation
12010fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12011fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12012fda9279dSmrg
12013fda9279dSmrg# AM_RUN_LOG(COMMAND)
12014fda9279dSmrg# -------------------
12015fda9279dSmrg# Run COMMAND, save the exit status in ac_status, and log it.
12016fda9279dSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12017fda9279dSmrgAC_DEFUN([AM_RUN_LOG],
12018fda9279dSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12019fda9279dSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12020fda9279dSmrg   ac_status=$?
12021fda9279dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12022fda9279dSmrg   (exit $ac_status); }])
12023fda9279dSmrg
12024fda9279dSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12025fda9279dSmrg
1202616ee1e9aSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
12027fda9279dSmrg#
12028fda9279dSmrg# This file is free software; the Free Software Foundation
12029fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12030fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12031fda9279dSmrg
12032fda9279dSmrg# AM_SANITY_CHECK
12033fda9279dSmrg# ---------------
12034fda9279dSmrgAC_DEFUN([AM_SANITY_CHECK],
12035fda9279dSmrg[AC_MSG_CHECKING([whether build environment is sane])
12036fda9279dSmrg# Reject unsafe characters in $srcdir or the absolute working directory
12037fda9279dSmrg# name.  Accept space and tab only in the latter.
12038fda9279dSmrgam_lf='
12039fda9279dSmrg'
12040fda9279dSmrgcase `pwd` in
12041fda9279dSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12042fda9279dSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12043fda9279dSmrgesac
12044fda9279dSmrgcase $srcdir in
12045fda9279dSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12046fda9279dSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12047fda9279dSmrgesac
12048fda9279dSmrg
12049fda9279dSmrg# Do 'set' in a subshell so we don't clobber the current shell's
12050fda9279dSmrg# arguments.  Must try -L first in case configure is actually a
12051fda9279dSmrg# symlink; some systems play weird games with the mod time of symlinks
12052fda9279dSmrg# (eg FreeBSD returns the mod time of the symlink's containing
12053fda9279dSmrg# directory).
12054fda9279dSmrgif (
12055fda9279dSmrg   am_has_slept=no
12056fda9279dSmrg   for am_try in 1 2; do
12057fda9279dSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12058fda9279dSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12059fda9279dSmrg     if test "$[*]" = "X"; then
12060fda9279dSmrg	# -L didn't work.
12061fda9279dSmrg	set X `ls -t "$srcdir/configure" conftest.file`
12062fda9279dSmrg     fi
12063fda9279dSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12064fda9279dSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12065fda9279dSmrg
12066fda9279dSmrg	# If neither matched, then we have a broken ls.  This can happen
12067fda9279dSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12068fda9279dSmrg	# broken ls alias from the environment.  This has actually
12069fda9279dSmrg	# happened.  Such a system could not be considered "sane".
12070fda9279dSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12071fda9279dSmrg  alias in your environment])
12072fda9279dSmrg     fi
12073fda9279dSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12074fda9279dSmrg       break
12075fda9279dSmrg     fi
12076fda9279dSmrg     # Just in case.
12077fda9279dSmrg     sleep 1
12078fda9279dSmrg     am_has_slept=yes
12079fda9279dSmrg   done
12080fda9279dSmrg   test "$[2]" = conftest.file
12081fda9279dSmrg   )
12082fda9279dSmrgthen
12083fda9279dSmrg   # Ok.
12084fda9279dSmrg   :
12085fda9279dSmrgelse
12086fda9279dSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
12087fda9279dSmrgCheck your system clock])
12088fda9279dSmrgfi
12089fda9279dSmrgAC_MSG_RESULT([yes])
12090fda9279dSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12091fda9279dSmrg# generated files are strictly newer.
12092fda9279dSmrgam_sleep_pid=
12093fda9279dSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12094fda9279dSmrg  ( sleep 1 ) &
12095fda9279dSmrg  am_sleep_pid=$!
12096fda9279dSmrgfi
12097fda9279dSmrgAC_CONFIG_COMMANDS_PRE(
12098fda9279dSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12099fda9279dSmrg   if test -n "$am_sleep_pid"; then
12100fda9279dSmrg     # Hide warnings about reused PIDs.
12101fda9279dSmrg     wait $am_sleep_pid 2>/dev/null
12102fda9279dSmrg   fi
12103fda9279dSmrg   AC_MSG_RESULT([done])])
12104fda9279dSmrgrm -f conftest.file
12105fda9279dSmrg])
12106fda9279dSmrg
1210716ee1e9aSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
12108fda9279dSmrg#
12109fda9279dSmrg# This file is free software; the Free Software Foundation
12110fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12111fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12112fda9279dSmrg
12113fda9279dSmrg# AM_SILENT_RULES([DEFAULT])
12114fda9279dSmrg# --------------------------
12115fda9279dSmrg# Enable less verbose build rules; with the default set to DEFAULT
12116fda9279dSmrg# ("yes" being less verbose, "no" or empty being verbose).
12117fda9279dSmrgAC_DEFUN([AM_SILENT_RULES],
12118fda9279dSmrg[AC_ARG_ENABLE([silent-rules], [dnl
12119fda9279dSmrgAS_HELP_STRING(
12120fda9279dSmrg  [--enable-silent-rules],
12121fda9279dSmrg  [less verbose build output (undo: "make V=1")])
12122fda9279dSmrgAS_HELP_STRING(
12123fda9279dSmrg  [--disable-silent-rules],
12124fda9279dSmrg  [verbose build output (undo: "make V=0")])dnl
12125fda9279dSmrg])
12126fda9279dSmrgcase $enable_silent_rules in @%:@ (((
12127fda9279dSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
12128fda9279dSmrg   no) AM_DEFAULT_VERBOSITY=1;;
12129fda9279dSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12130fda9279dSmrgesac
12131fda9279dSmrgdnl
12132fda9279dSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12133fda9279dSmrgdnl do not support nested variable expansions.
12134fda9279dSmrgdnl See automake bug#9928 and bug#10237.
12135fda9279dSmrgam_make=${MAKE-make}
12136fda9279dSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12137fda9279dSmrg   [am_cv_make_support_nested_variables],
12138fda9279dSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12139fda9279dSmrgBAR0=false
12140fda9279dSmrgBAR1=true
12141fda9279dSmrgV=1
12142fda9279dSmrgam__doit:
12143fda9279dSmrg	@$(TRUE)
12144fda9279dSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12145fda9279dSmrg  am_cv_make_support_nested_variables=yes
12146fda9279dSmrgelse
12147fda9279dSmrg  am_cv_make_support_nested_variables=no
12148fda9279dSmrgfi])
12149fda9279dSmrgif test $am_cv_make_support_nested_variables = yes; then
12150fda9279dSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12151fda9279dSmrg  AM_V='$(V)'
12152fda9279dSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12153fda9279dSmrgelse
12154fda9279dSmrg  AM_V=$AM_DEFAULT_VERBOSITY
12155fda9279dSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12156fda9279dSmrgfi
12157fda9279dSmrgAC_SUBST([AM_V])dnl
12158fda9279dSmrgAM_SUBST_NOTMAKE([AM_V])dnl
12159fda9279dSmrgAC_SUBST([AM_DEFAULT_V])dnl
12160fda9279dSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12161fda9279dSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12162fda9279dSmrgAM_BACKSLASH='\'
12163fda9279dSmrgAC_SUBST([AM_BACKSLASH])dnl
12164fda9279dSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12165fda9279dSmrg])
12166fda9279dSmrg
1216716ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12168fda9279dSmrg#
12169fda9279dSmrg# This file is free software; the Free Software Foundation
12170fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12171fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12172fda9279dSmrg
12173fda9279dSmrg# AM_PROG_INSTALL_STRIP
12174fda9279dSmrg# ---------------------
12175fda9279dSmrg# One issue with vendor 'install' (even GNU) is that you can't
12176fda9279dSmrg# specify the program used to strip binaries.  This is especially
12177fda9279dSmrg# annoying in cross-compiling environments, where the build's strip
12178fda9279dSmrg# is unlikely to handle the host's binaries.
12179fda9279dSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12180fda9279dSmrg# always use install-sh in "make install-strip", and initialize
12181fda9279dSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
12182fda9279dSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12183fda9279dSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12184fda9279dSmrg# Installed binaries are usually stripped using 'strip' when the user
12185fda9279dSmrg# run "make install-strip".  However 'strip' might not be the right
12186fda9279dSmrg# tool to use in cross-compilation environments, therefore Automake
12187fda9279dSmrg# will honor the 'STRIP' environment variable to overrule this program.
12188fda9279dSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12189fda9279dSmrgif test "$cross_compiling" != no; then
12190fda9279dSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
12191fda9279dSmrgfi
12192fda9279dSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12193fda9279dSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
12194fda9279dSmrg
1219516ee1e9aSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
12196fda9279dSmrg#
12197fda9279dSmrg# This file is free software; the Free Software Foundation
12198fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12199fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12200fda9279dSmrg
12201fda9279dSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
12202fda9279dSmrg# ---------------------------
12203fda9279dSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12204fda9279dSmrg# This macro is traced by Automake.
12205fda9279dSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
12206fda9279dSmrg
12207fda9279dSmrg# AM_SUBST_NOTMAKE(VARIABLE)
12208fda9279dSmrg# --------------------------
12209fda9279dSmrg# Public sister of _AM_SUBST_NOTMAKE.
12210fda9279dSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
12211fda9279dSmrg
12212fda9279dSmrg# Check how to create a tarball.                            -*- Autoconf -*-
12213fda9279dSmrg
1221416ee1e9aSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
12215fda9279dSmrg#
12216fda9279dSmrg# This file is free software; the Free Software Foundation
12217fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12218fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12219fda9279dSmrg
12220fda9279dSmrg# _AM_PROG_TAR(FORMAT)
12221fda9279dSmrg# --------------------
12222fda9279dSmrg# Check how to create a tarball in format FORMAT.
12223fda9279dSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12224fda9279dSmrg#
12225fda9279dSmrg# Substitute a variable $(am__tar) that is a command
12226fda9279dSmrg# writing to stdout a FORMAT-tarball containing the directory
12227fda9279dSmrg# $tardir.
12228fda9279dSmrg#     tardir=directory && $(am__tar) > result.tar
12229fda9279dSmrg#
12230fda9279dSmrg# Substitute a variable $(am__untar) that extract such
12231fda9279dSmrg# a tarball read from stdin.
12232fda9279dSmrg#     $(am__untar) < result.tar
12233fda9279dSmrg#
12234fda9279dSmrgAC_DEFUN([_AM_PROG_TAR],
12235fda9279dSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12236fda9279dSmrg# in the wild :-(  We should find a proper way to deprecate it ...
12237fda9279dSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
12238fda9279dSmrg
12239fda9279dSmrg# We'll loop over all known methods to create a tar archive until one works.
12240fda9279dSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12241fda9279dSmrg
12242fda9279dSmrgm4_if([$1], [v7],
12243fda9279dSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12244fda9279dSmrg
12245fda9279dSmrg  [m4_case([$1],
12246fda9279dSmrg    [ustar],
12247fda9279dSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12248fda9279dSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12249fda9279dSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12250fda9279dSmrg      # and bug#13588).
12251fda9279dSmrg      am_max_uid=2097151 # 2^21 - 1
12252fda9279dSmrg      am_max_gid=$am_max_uid
12253fda9279dSmrg      # The $UID and $GID variables are not portable, so we need to resort
12254fda9279dSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12255fda9279dSmrg      # below are definitely unexpected, so allow the users to see them
12256fda9279dSmrg      # (that is, avoid stderr redirection).
12257fda9279dSmrg      am_uid=`id -u || echo unknown`
12258fda9279dSmrg      am_gid=`id -g || echo unknown`
12259fda9279dSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12260fda9279dSmrg      if test $am_uid -le $am_max_uid; then
12261fda9279dSmrg         AC_MSG_RESULT([yes])
12262fda9279dSmrg      else
12263fda9279dSmrg         AC_MSG_RESULT([no])
12264fda9279dSmrg         _am_tools=none
12265fda9279dSmrg      fi
12266fda9279dSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12267fda9279dSmrg      if test $am_gid -le $am_max_gid; then
12268fda9279dSmrg         AC_MSG_RESULT([yes])
12269fda9279dSmrg      else
12270fda9279dSmrg        AC_MSG_RESULT([no])
12271fda9279dSmrg        _am_tools=none
12272fda9279dSmrg      fi],
12273fda9279dSmrg
12274fda9279dSmrg  [pax],
12275fda9279dSmrg    [],
12276fda9279dSmrg
12277fda9279dSmrg  [m4_fatal([Unknown tar format])])
12278fda9279dSmrg
12279fda9279dSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12280fda9279dSmrg
12281fda9279dSmrg  # Go ahead even if we have the value already cached.  We do so because we
12282fda9279dSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12283fda9279dSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12284fda9279dSmrg
12285fda9279dSmrg  for _am_tool in $_am_tools; do
12286fda9279dSmrg    case $_am_tool in
12287fda9279dSmrg    gnutar)
12288fda9279dSmrg      for _am_tar in tar gnutar gtar; do
12289fda9279dSmrg        AM_RUN_LOG([$_am_tar --version]) && break
12290fda9279dSmrg      done
12291fda9279dSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12292fda9279dSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12293fda9279dSmrg      am__untar="$_am_tar -xf -"
12294fda9279dSmrg      ;;
12295fda9279dSmrg    plaintar)
12296fda9279dSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12297fda9279dSmrg      # ustar tarball either.
12298fda9279dSmrg      (tar --version) >/dev/null 2>&1 && continue
12299fda9279dSmrg      am__tar='tar chf - "$$tardir"'
12300fda9279dSmrg      am__tar_='tar chf - "$tardir"'
12301fda9279dSmrg      am__untar='tar xf -'
12302fda9279dSmrg      ;;
12303fda9279dSmrg    pax)
12304fda9279dSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
12305fda9279dSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
12306fda9279dSmrg      am__untar='pax -r'
12307fda9279dSmrg      ;;
12308fda9279dSmrg    cpio)
12309fda9279dSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12310fda9279dSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12311fda9279dSmrg      am__untar='cpio -i -H $1 -d'
12312fda9279dSmrg      ;;
12313fda9279dSmrg    none)
12314fda9279dSmrg      am__tar=false
12315fda9279dSmrg      am__tar_=false
12316fda9279dSmrg      am__untar=false
12317fda9279dSmrg      ;;
12318fda9279dSmrg    esac
12319fda9279dSmrg
12320fda9279dSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
12321fda9279dSmrg    # and am__untar set.
12322fda9279dSmrg    test -n "${am_cv_prog_tar_$1}" && break
12323fda9279dSmrg
12324fda9279dSmrg    # tar/untar a dummy directory, and stop if the command works.
12325fda9279dSmrg    rm -rf conftest.dir
12326fda9279dSmrg    mkdir conftest.dir
12327fda9279dSmrg    echo GrepMe > conftest.dir/file
12328fda9279dSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12329fda9279dSmrg    rm -rf conftest.dir
12330fda9279dSmrg    if test -s conftest.tar; then
12331fda9279dSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
12332fda9279dSmrg      AM_RUN_LOG([cat conftest.dir/file])
12333fda9279dSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12334fda9279dSmrg    fi
12335fda9279dSmrg  done
12336fda9279dSmrg  rm -rf conftest.dir
12337fda9279dSmrg
12338fda9279dSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12339fda9279dSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12340fda9279dSmrg
12341fda9279dSmrgAC_SUBST([am__tar])
12342fda9279dSmrgAC_SUBST([am__untar])
12343fda9279dSmrg]) # _AM_PROG_TAR
12344fda9279dSmrg
12345