aclocal.m4 revision c2e4ac43
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  # Ideally, we could use ldconfig to report *all* directores which are
288516ee1e9aSmrg  # searched for libraries, however this is still not possible.  Aside from not
288616ee1e9aSmrg  # being certain /sbin/ldconfig is available, command
288716ee1e9aSmrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
288816ee1e9aSmrg  # even though it is searched at run-time.  Try to do the best guess by
288916ee1e9aSmrg  # appending ld.so.conf contents (and includes) to the search path.
2890fda9279dSmrg  if test -f /etc/ld.so.conf; then
2891fda9279dSmrg    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' ' '`
2892c2e4ac43Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2893fda9279dSmrg  fi
2894fda9279dSmrg
2895fda9279dSmrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2896fda9279dSmrg  # powerpc, because MkLinux only supported shared libraries with the
2897fda9279dSmrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2898fda9279dSmrg  # most powerpc-linux boxes support dynamic linking these days and
2899fda9279dSmrg  # people can always --disable-shared, the test was removed, and we
2900fda9279dSmrg  # assume the GNU/Linux dynamic linker is in use.
2901fda9279dSmrg  dynamic_linker='GNU/Linux ld.so'
2902fda9279dSmrg  ;;
2903fda9279dSmrg
2904c2e4ac43Smrgnetbsdelf*-gnu)
2905c2e4ac43Smrg  version_type=linux
2906c2e4ac43Smrg  need_lib_prefix=no
2907c2e4ac43Smrg  need_version=no
2908c2e4ac43Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2909c2e4ac43Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2910c2e4ac43Smrg  shlibpath_var=LD_LIBRARY_PATH
2911c2e4ac43Smrg  shlibpath_overrides_runpath=no
2912c2e4ac43Smrg  hardcode_into_libs=yes
2913c2e4ac43Smrg  dynamic_linker='NetBSD ld.elf_so'
2914c2e4ac43Smrg  ;;
2915c2e4ac43Smrg
2916fda9279dSmrgnetbsd*)
2917fda9279dSmrg  version_type=sunos
2918fda9279dSmrg  need_lib_prefix=no
2919fda9279dSmrg  need_version=no
2920fda9279dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
292116ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2922fda9279dSmrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2923fda9279dSmrg    dynamic_linker='NetBSD (a.out) ld.so'
2924fda9279dSmrg  else
292516ee1e9aSmrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
292616ee1e9aSmrg    soname_spec='$libname$release$shared_ext$major'
2927fda9279dSmrg    dynamic_linker='NetBSD ld.elf_so'
2928fda9279dSmrg  fi
2929fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2930fda9279dSmrg  shlibpath_overrides_runpath=yes
2931fda9279dSmrg  hardcode_into_libs=yes
2932fda9279dSmrg  ;;
2933fda9279dSmrg
2934fda9279dSmrgnewsos6)
2935fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
293616ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2937fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2938fda9279dSmrg  shlibpath_overrides_runpath=yes
2939fda9279dSmrg  ;;
2940fda9279dSmrg
2941fda9279dSmrg*nto* | *qnx*)
2942fda9279dSmrg  version_type=qnx
2943fda9279dSmrg  need_lib_prefix=no
2944fda9279dSmrg  need_version=no
294516ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
294616ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
2947fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
2948fda9279dSmrg  shlibpath_overrides_runpath=no
2949fda9279dSmrg  hardcode_into_libs=yes
2950fda9279dSmrg  dynamic_linker='ldqnx.so'
2951fda9279dSmrg  ;;
2952fda9279dSmrg
295316ee1e9aSmrgopenbsd* | bitrig*)
2954fda9279dSmrg  version_type=sunos
295516ee1e9aSmrg  sys_lib_dlsearch_path_spec=/usr/lib
2956fda9279dSmrg  need_lib_prefix=no
295716ee1e9aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
295816ee1e9aSmrg    need_version=no
2959fda9279dSmrg  else
296016ee1e9aSmrg    need_version=yes
2961fda9279dSmrg  fi
296216ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
296316ee1e9aSmrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
296416ee1e9aSmrg  shlibpath_var=LD_LIBRARY_PATH
296516ee1e9aSmrg  shlibpath_overrides_runpath=yes
2966fda9279dSmrg  ;;
2967fda9279dSmrg
2968fda9279dSmrgos2*)
2969fda9279dSmrg  libname_spec='$name'
297016ee1e9aSmrg  version_type=windows
297116ee1e9aSmrg  shrext_cmds=.dll
297216ee1e9aSmrg  need_version=no
2973fda9279dSmrg  need_lib_prefix=no
297416ee1e9aSmrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
297516ee1e9aSmrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
297616ee1e9aSmrg    v=$($ECHO $release$versuffix | tr -d .-);
297716ee1e9aSmrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
297816ee1e9aSmrg    $ECHO $n$v`$shared_ext'
297916ee1e9aSmrg  library_names_spec='${libname}_dll.$libext'
2980fda9279dSmrg  dynamic_linker='OS/2 ld.exe'
298116ee1e9aSmrg  shlibpath_var=BEGINLIBPATH
298216ee1e9aSmrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
298316ee1e9aSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
298416ee1e9aSmrg  postinstall_cmds='base_file=`basename \$file`~
298516ee1e9aSmrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
298616ee1e9aSmrg    dldir=$destdir/`dirname \$dlpath`~
298716ee1e9aSmrg    test -d \$dldir || mkdir -p \$dldir~
298816ee1e9aSmrg    $install_prog $dir/$dlname \$dldir/$dlname~
298916ee1e9aSmrg    chmod a+x \$dldir/$dlname~
299016ee1e9aSmrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
299116ee1e9aSmrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
299216ee1e9aSmrg    fi'
299316ee1e9aSmrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
299416ee1e9aSmrg    dlpath=$dir/\$dldll~
299516ee1e9aSmrg    $RM \$dlpath'
2996fda9279dSmrg  ;;
2997fda9279dSmrg
2998fda9279dSmrgosf3* | osf4* | osf5*)
2999fda9279dSmrg  version_type=osf
3000fda9279dSmrg  need_lib_prefix=no
3001fda9279dSmrg  need_version=no
300216ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
300316ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3004fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3005fda9279dSmrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
300616ee1e9aSmrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3007fda9279dSmrg  ;;
3008fda9279dSmrg
3009fda9279dSmrgrdos*)
3010fda9279dSmrg  dynamic_linker=no
3011fda9279dSmrg  ;;
3012fda9279dSmrg
3013fda9279dSmrgsolaris*)
3014fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3015fda9279dSmrg  need_lib_prefix=no
3016fda9279dSmrg  need_version=no
301716ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
301816ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3019fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3020fda9279dSmrg  shlibpath_overrides_runpath=yes
3021fda9279dSmrg  hardcode_into_libs=yes
3022fda9279dSmrg  # ldd complains unless libraries are executable
3023fda9279dSmrg  postinstall_cmds='chmod +x $lib'
3024fda9279dSmrg  ;;
3025fda9279dSmrg
3026fda9279dSmrgsunos4*)
3027fda9279dSmrg  version_type=sunos
302816ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3029fda9279dSmrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3030fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3031fda9279dSmrg  shlibpath_overrides_runpath=yes
303216ee1e9aSmrg  if test yes = "$with_gnu_ld"; then
3033fda9279dSmrg    need_lib_prefix=no
3034fda9279dSmrg  fi
3035fda9279dSmrg  need_version=yes
3036fda9279dSmrg  ;;
3037fda9279dSmrg
3038fda9279dSmrgsysv4 | sysv4.3*)
3039fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
304016ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
304116ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3042fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3043fda9279dSmrg  case $host_vendor in
3044fda9279dSmrg    sni)
3045fda9279dSmrg      shlibpath_overrides_runpath=no
3046fda9279dSmrg      need_lib_prefix=no
3047fda9279dSmrg      runpath_var=LD_RUN_PATH
3048fda9279dSmrg      ;;
3049fda9279dSmrg    siemens)
3050fda9279dSmrg      need_lib_prefix=no
3051fda9279dSmrg      ;;
3052fda9279dSmrg    motorola)
3053fda9279dSmrg      need_lib_prefix=no
3054fda9279dSmrg      need_version=no
3055fda9279dSmrg      shlibpath_overrides_runpath=no
3056fda9279dSmrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3057fda9279dSmrg      ;;
3058fda9279dSmrg  esac
3059fda9279dSmrg  ;;
3060fda9279dSmrg
3061fda9279dSmrgsysv4*MP*)
306216ee1e9aSmrg  if test -d /usr/nec; then
3063fda9279dSmrg    version_type=linux # correct to gnu/linux during the next big refactor
306416ee1e9aSmrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
306516ee1e9aSmrg    soname_spec='$libname$shared_ext.$major'
3066fda9279dSmrg    shlibpath_var=LD_LIBRARY_PATH
3067fda9279dSmrg  fi
3068fda9279dSmrg  ;;
3069fda9279dSmrg
3070fda9279dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
307116ee1e9aSmrg  version_type=sco
3072fda9279dSmrg  need_lib_prefix=no
3073fda9279dSmrg  need_version=no
307416ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
307516ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3076fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3077fda9279dSmrg  shlibpath_overrides_runpath=yes
3078fda9279dSmrg  hardcode_into_libs=yes
307916ee1e9aSmrg  if test yes = "$with_gnu_ld"; then
3080fda9279dSmrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3081fda9279dSmrg  else
3082fda9279dSmrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3083fda9279dSmrg    case $host_os in
3084fda9279dSmrg      sco3.2v5*)
3085fda9279dSmrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3086fda9279dSmrg	;;
3087fda9279dSmrg    esac
3088fda9279dSmrg  fi
3089fda9279dSmrg  sys_lib_dlsearch_path_spec='/usr/lib'
3090fda9279dSmrg  ;;
3091fda9279dSmrg
3092fda9279dSmrgtpf*)
3093fda9279dSmrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3094fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3095fda9279dSmrg  need_lib_prefix=no
3096fda9279dSmrg  need_version=no
309716ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3098fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3099fda9279dSmrg  shlibpath_overrides_runpath=no
3100fda9279dSmrg  hardcode_into_libs=yes
3101fda9279dSmrg  ;;
3102fda9279dSmrg
3103fda9279dSmrguts4*)
3104fda9279dSmrg  version_type=linux # correct to gnu/linux during the next big refactor
310516ee1e9aSmrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
310616ee1e9aSmrg  soname_spec='$libname$release$shared_ext$major'
3107fda9279dSmrg  shlibpath_var=LD_LIBRARY_PATH
3108fda9279dSmrg  ;;
3109fda9279dSmrg
3110fda9279dSmrg*)
3111fda9279dSmrg  dynamic_linker=no
3112fda9279dSmrg  ;;
3113fda9279dSmrgesac
3114fda9279dSmrgAC_MSG_RESULT([$dynamic_linker])
311516ee1e9aSmrgtest no = "$dynamic_linker" && can_build_shared=no
3116fda9279dSmrg
3117fda9279dSmrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
311816ee1e9aSmrgif test yes = "$GCC"; then
3119fda9279dSmrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3120fda9279dSmrgfi
3121fda9279dSmrg
312216ee1e9aSmrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
312316ee1e9aSmrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3124fda9279dSmrgfi
312516ee1e9aSmrg
312616ee1e9aSmrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
312716ee1e9aSmrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3128fda9279dSmrgfi
3129fda9279dSmrg
313016ee1e9aSmrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
313116ee1e9aSmrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
313216ee1e9aSmrg
313316ee1e9aSmrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
313416ee1e9aSmrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
313516ee1e9aSmrg
313616ee1e9aSmrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
313716ee1e9aSmrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
313816ee1e9aSmrg
3139fda9279dSmrg_LT_DECL([], [variables_saved_for_relink], [1],
3140fda9279dSmrg    [Variables whose values should be saved in libtool wrapper scripts and
3141fda9279dSmrg    restored at link time])
3142fda9279dSmrg_LT_DECL([], [need_lib_prefix], [0],
3143fda9279dSmrg    [Do we need the "lib" prefix for modules?])
3144fda9279dSmrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3145fda9279dSmrg_LT_DECL([], [version_type], [0], [Library versioning type])
3146fda9279dSmrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3147fda9279dSmrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3148fda9279dSmrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3149fda9279dSmrg    [Is shlibpath searched before the hard-coded library search path?])
3150fda9279dSmrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3151fda9279dSmrg_LT_DECL([], [library_names_spec], [1],
3152fda9279dSmrg    [[List of archive names.  First name is the real one, the rest are links.
3153fda9279dSmrg    The last name is the one that the linker finds with -lNAME]])
3154fda9279dSmrg_LT_DECL([], [soname_spec], [1],
3155fda9279dSmrg    [[The coded name of the library, if different from the real name]])
3156fda9279dSmrg_LT_DECL([], [install_override_mode], [1],
3157fda9279dSmrg    [Permission mode override for installation of shared libraries])
3158fda9279dSmrg_LT_DECL([], [postinstall_cmds], [2],
3159fda9279dSmrg    [Command to use after installation of a shared archive])
3160fda9279dSmrg_LT_DECL([], [postuninstall_cmds], [2],
3161fda9279dSmrg    [Command to use after uninstallation of a shared archive])
3162fda9279dSmrg_LT_DECL([], [finish_cmds], [2],
3163fda9279dSmrg    [Commands used to finish a libtool library installation in a directory])
3164fda9279dSmrg_LT_DECL([], [finish_eval], [1],
3165fda9279dSmrg    [[As "finish_cmds", except a single script fragment to be evaled but
3166fda9279dSmrg    not shown]])
3167fda9279dSmrg_LT_DECL([], [hardcode_into_libs], [0],
3168fda9279dSmrg    [Whether we should hardcode library paths into libraries])
3169fda9279dSmrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3170fda9279dSmrg    [Compile-time system search path for libraries])
317116ee1e9aSmrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
317216ee1e9aSmrg    [Detected run-time system search path for libraries])
317316ee1e9aSmrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
317416ee1e9aSmrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3175fda9279dSmrg])# _LT_SYS_DYNAMIC_LINKER
3176fda9279dSmrg
3177fda9279dSmrg
3178fda9279dSmrg# _LT_PATH_TOOL_PREFIX(TOOL)
3179fda9279dSmrg# --------------------------
318016ee1e9aSmrg# find a file program that can recognize shared library
3181fda9279dSmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3182fda9279dSmrg[m4_require([_LT_DECL_EGREP])dnl
3183fda9279dSmrgAC_MSG_CHECKING([for $1])
3184fda9279dSmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3185fda9279dSmrg[case $MAGIC_CMD in
3186fda9279dSmrg[[\\/*] |  ?:[\\/]*])
318716ee1e9aSmrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3188fda9279dSmrg  ;;
3189fda9279dSmrg*)
319016ee1e9aSmrg  lt_save_MAGIC_CMD=$MAGIC_CMD
319116ee1e9aSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3192fda9279dSmrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3193fda9279dSmrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3194fda9279dSmrgdnl not every word.  This closes a longstanding sh security hole.
3195fda9279dSmrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3196fda9279dSmrg  for ac_dir in $ac_dummy; do
319716ee1e9aSmrg    IFS=$lt_save_ifs
3198fda9279dSmrg    test -z "$ac_dir" && ac_dir=.
319916ee1e9aSmrg    if test -f "$ac_dir/$1"; then
320016ee1e9aSmrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3201fda9279dSmrg      if test -n "$file_magic_test_file"; then
3202fda9279dSmrg	case $deplibs_check_method in
3203fda9279dSmrg	"file_magic "*)
3204fda9279dSmrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
320516ee1e9aSmrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3206fda9279dSmrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3207fda9279dSmrg	    $EGREP "$file_magic_regex" > /dev/null; then
3208fda9279dSmrg	    :
3209fda9279dSmrg	  else
3210fda9279dSmrg	    cat <<_LT_EOF 1>&2
3211fda9279dSmrg
3212fda9279dSmrg*** Warning: the command libtool uses to detect shared libraries,
3213fda9279dSmrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3214fda9279dSmrg*** The result is that libtool may fail to recognize shared libraries
3215fda9279dSmrg*** as such.  This will affect the creation of libtool libraries that
3216fda9279dSmrg*** depend on shared libraries, but programs linked with such libtool
3217fda9279dSmrg*** libraries will work regardless of this problem.  Nevertheless, you
3218fda9279dSmrg*** may want to report the problem to your system manager and/or to
3219fda9279dSmrg*** bug-libtool@gnu.org
3220fda9279dSmrg
3221fda9279dSmrg_LT_EOF
3222fda9279dSmrg	  fi ;;
3223fda9279dSmrg	esac
3224fda9279dSmrg      fi
3225fda9279dSmrg      break
3226fda9279dSmrg    fi
3227fda9279dSmrg  done
322816ee1e9aSmrg  IFS=$lt_save_ifs
322916ee1e9aSmrg  MAGIC_CMD=$lt_save_MAGIC_CMD
3230fda9279dSmrg  ;;
3231fda9279dSmrgesac])
323216ee1e9aSmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3233fda9279dSmrgif test -n "$MAGIC_CMD"; then
3234fda9279dSmrg  AC_MSG_RESULT($MAGIC_CMD)
3235fda9279dSmrgelse
3236fda9279dSmrg  AC_MSG_RESULT(no)
3237fda9279dSmrgfi
3238fda9279dSmrg_LT_DECL([], [MAGIC_CMD], [0],
3239fda9279dSmrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3240fda9279dSmrg])# _LT_PATH_TOOL_PREFIX
3241fda9279dSmrg
3242fda9279dSmrg# Old name:
3243fda9279dSmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3244fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3245fda9279dSmrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3246fda9279dSmrg
3247fda9279dSmrg
3248fda9279dSmrg# _LT_PATH_MAGIC
3249fda9279dSmrg# --------------
325016ee1e9aSmrg# find a file program that can recognize a shared library
3251fda9279dSmrgm4_defun([_LT_PATH_MAGIC],
3252fda9279dSmrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3253fda9279dSmrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3254fda9279dSmrg  if test -n "$ac_tool_prefix"; then
3255fda9279dSmrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
3256fda9279dSmrg  else
3257fda9279dSmrg    MAGIC_CMD=:
3258fda9279dSmrg  fi
3259fda9279dSmrgfi
3260fda9279dSmrg])# _LT_PATH_MAGIC
3261fda9279dSmrg
3262fda9279dSmrg
3263fda9279dSmrg# LT_PATH_LD
3264fda9279dSmrg# ----------
3265fda9279dSmrg# find the pathname to the GNU or non-GNU linker
3266fda9279dSmrgAC_DEFUN([LT_PATH_LD],
3267fda9279dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3268fda9279dSmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3269fda9279dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3270fda9279dSmrgm4_require([_LT_DECL_SED])dnl
3271fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
3272fda9279dSmrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3273fda9279dSmrg
3274fda9279dSmrgAC_ARG_WITH([gnu-ld],
3275fda9279dSmrg    [AS_HELP_STRING([--with-gnu-ld],
3276fda9279dSmrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
327716ee1e9aSmrg    [test no = "$withval" || with_gnu_ld=yes],
3278fda9279dSmrg    [with_gnu_ld=no])dnl
3279fda9279dSmrg
3280fda9279dSmrgac_prog=ld
328116ee1e9aSmrgif test yes = "$GCC"; then
3282fda9279dSmrg  # Check if gcc -print-prog-name=ld gives a path.
3283fda9279dSmrg  AC_MSG_CHECKING([for ld used by $CC])
3284fda9279dSmrg  case $host in
3285fda9279dSmrg  *-*-mingw*)
328616ee1e9aSmrg    # gcc leaves a trailing carriage return, which upsets mingw
3287fda9279dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3288fda9279dSmrg  *)
3289fda9279dSmrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3290fda9279dSmrg  esac
3291fda9279dSmrg  case $ac_prog in
3292fda9279dSmrg    # Accept absolute paths.
3293fda9279dSmrg    [[\\/]]* | ?:[[\\/]]*)
3294fda9279dSmrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3295fda9279dSmrg      # Canonicalize the pathname of ld
3296fda9279dSmrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3297fda9279dSmrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3298fda9279dSmrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3299fda9279dSmrg      done
330016ee1e9aSmrg      test -z "$LD" && LD=$ac_prog
3301fda9279dSmrg      ;;
3302fda9279dSmrg  "")
3303fda9279dSmrg    # If it fails, then pretend we aren't using GCC.
3304fda9279dSmrg    ac_prog=ld
3305fda9279dSmrg    ;;
3306fda9279dSmrg  *)
3307fda9279dSmrg    # If it is relative, then search for the first ld in PATH.
3308fda9279dSmrg    with_gnu_ld=unknown
3309fda9279dSmrg    ;;
3310fda9279dSmrg  esac
331116ee1e9aSmrgelif test yes = "$with_gnu_ld"; then
3312fda9279dSmrg  AC_MSG_CHECKING([for GNU ld])
3313fda9279dSmrgelse
3314fda9279dSmrg  AC_MSG_CHECKING([for non-GNU ld])
3315fda9279dSmrgfi
3316fda9279dSmrgAC_CACHE_VAL(lt_cv_path_LD,
3317fda9279dSmrg[if test -z "$LD"; then
331816ee1e9aSmrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3319fda9279dSmrg  for ac_dir in $PATH; do
332016ee1e9aSmrg    IFS=$lt_save_ifs
3321fda9279dSmrg    test -z "$ac_dir" && ac_dir=.
3322fda9279dSmrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
332316ee1e9aSmrg      lt_cv_path_LD=$ac_dir/$ac_prog
3324fda9279dSmrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3325fda9279dSmrg      # but apparently some variants of GNU ld only accept -v.
3326fda9279dSmrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3327fda9279dSmrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3328fda9279dSmrg      *GNU* | *'with BFD'*)
332916ee1e9aSmrg	test no != "$with_gnu_ld" && break
3330fda9279dSmrg	;;
3331fda9279dSmrg      *)
333216ee1e9aSmrg	test yes != "$with_gnu_ld" && break
3333fda9279dSmrg	;;
3334fda9279dSmrg      esac
3335fda9279dSmrg    fi
3336fda9279dSmrg  done
333716ee1e9aSmrg  IFS=$lt_save_ifs
3338fda9279dSmrgelse
333916ee1e9aSmrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3340fda9279dSmrgfi])
334116ee1e9aSmrgLD=$lt_cv_path_LD
3342fda9279dSmrgif test -n "$LD"; then
3343fda9279dSmrg  AC_MSG_RESULT($LD)
3344fda9279dSmrgelse
3345fda9279dSmrg  AC_MSG_RESULT(no)
3346fda9279dSmrgfi
3347fda9279dSmrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3348fda9279dSmrg_LT_PATH_LD_GNU
3349fda9279dSmrgAC_SUBST([LD])
3350fda9279dSmrg
3351fda9279dSmrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3352fda9279dSmrg])# LT_PATH_LD
3353fda9279dSmrg
3354fda9279dSmrg# Old names:
3355fda9279dSmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3356fda9279dSmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3357fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3358fda9279dSmrgdnl AC_DEFUN([AM_PROG_LD], [])
3359fda9279dSmrgdnl AC_DEFUN([AC_PROG_LD], [])
3360fda9279dSmrg
3361fda9279dSmrg
3362fda9279dSmrg# _LT_PATH_LD_GNU
3363fda9279dSmrg#- --------------
3364fda9279dSmrgm4_defun([_LT_PATH_LD_GNU],
3365fda9279dSmrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3366fda9279dSmrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3367fda9279dSmrgcase `$LD -v 2>&1 </dev/null` in
3368fda9279dSmrg*GNU* | *'with BFD'*)
3369fda9279dSmrg  lt_cv_prog_gnu_ld=yes
3370fda9279dSmrg  ;;
3371fda9279dSmrg*)
3372fda9279dSmrg  lt_cv_prog_gnu_ld=no
3373fda9279dSmrg  ;;
3374fda9279dSmrgesac])
3375fda9279dSmrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3376fda9279dSmrg])# _LT_PATH_LD_GNU
3377fda9279dSmrg
3378fda9279dSmrg
3379fda9279dSmrg# _LT_CMD_RELOAD
3380fda9279dSmrg# --------------
3381fda9279dSmrg# find reload flag for linker
3382fda9279dSmrg#   -- PORTME Some linkers may need a different reload flag.
3383fda9279dSmrgm4_defun([_LT_CMD_RELOAD],
3384fda9279dSmrg[AC_CACHE_CHECK([for $LD option to reload object files],
3385fda9279dSmrg  lt_cv_ld_reload_flag,
3386fda9279dSmrg  [lt_cv_ld_reload_flag='-r'])
3387fda9279dSmrgreload_flag=$lt_cv_ld_reload_flag
3388fda9279dSmrgcase $reload_flag in
3389fda9279dSmrg"" | " "*) ;;
3390fda9279dSmrg*) reload_flag=" $reload_flag" ;;
3391fda9279dSmrgesac
3392fda9279dSmrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3393fda9279dSmrgcase $host_os in
3394fda9279dSmrg  cygwin* | mingw* | pw32* | cegcc*)
339516ee1e9aSmrg    if test yes != "$GCC"; then
3396fda9279dSmrg      reload_cmds=false
3397fda9279dSmrg    fi
3398fda9279dSmrg    ;;
3399fda9279dSmrg  darwin*)
340016ee1e9aSmrg    if test yes = "$GCC"; then
340116ee1e9aSmrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
3402fda9279dSmrg    else
3403fda9279dSmrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
3404fda9279dSmrg    fi
3405fda9279dSmrg    ;;
3406fda9279dSmrgesac
3407fda9279dSmrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3408fda9279dSmrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3409fda9279dSmrg])# _LT_CMD_RELOAD
3410fda9279dSmrg
3411fda9279dSmrg
341216ee1e9aSmrg# _LT_PATH_DD
341316ee1e9aSmrg# -----------
341416ee1e9aSmrg# find a working dd
341516ee1e9aSmrgm4_defun([_LT_PATH_DD],
341616ee1e9aSmrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
341716ee1e9aSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
341816ee1e9aSmrgcat conftest.i conftest.i >conftest2.i
341916ee1e9aSmrg: ${lt_DD:=$DD}
342016ee1e9aSmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
342116ee1e9aSmrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
342216ee1e9aSmrg  cmp -s conftest.i conftest.out \
342316ee1e9aSmrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
342416ee1e9aSmrgfi])
342516ee1e9aSmrgrm -f conftest.i conftest2.i conftest.out])
342616ee1e9aSmrg])# _LT_PATH_DD
342716ee1e9aSmrg
342816ee1e9aSmrg
342916ee1e9aSmrg# _LT_CMD_TRUNCATE
343016ee1e9aSmrg# ----------------
343116ee1e9aSmrg# find command to truncate a binary pipe
343216ee1e9aSmrgm4_defun([_LT_CMD_TRUNCATE],
343316ee1e9aSmrg[m4_require([_LT_PATH_DD])
343416ee1e9aSmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
343516ee1e9aSmrg[printf 0123456789abcdef0123456789abcdef >conftest.i
343616ee1e9aSmrgcat conftest.i conftest.i >conftest2.i
343716ee1e9aSmrglt_cv_truncate_bin=
343816ee1e9aSmrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
343916ee1e9aSmrg  cmp -s conftest.i conftest.out \
344016ee1e9aSmrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
344116ee1e9aSmrgfi
344216ee1e9aSmrgrm -f conftest.i conftest2.i conftest.out
344316ee1e9aSmrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
344416ee1e9aSmrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
344516ee1e9aSmrg  [Command to truncate a binary pipe])
344616ee1e9aSmrg])# _LT_CMD_TRUNCATE
344716ee1e9aSmrg
344816ee1e9aSmrg
3449fda9279dSmrg# _LT_CHECK_MAGIC_METHOD
3450fda9279dSmrg# ----------------------
3451fda9279dSmrg# how to check for library dependencies
3452fda9279dSmrg#  -- PORTME fill in with the dynamic library characteristics
3453fda9279dSmrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3454fda9279dSmrg[m4_require([_LT_DECL_EGREP])
3455fda9279dSmrgm4_require([_LT_DECL_OBJDUMP])
3456fda9279dSmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3457fda9279dSmrglt_cv_deplibs_check_method,
3458fda9279dSmrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3459fda9279dSmrglt_cv_file_magic_test_file=
3460fda9279dSmrglt_cv_deplibs_check_method='unknown'
3461fda9279dSmrg# Need to set the preceding variable on all platforms that support
3462fda9279dSmrg# interlibrary dependencies.
3463fda9279dSmrg# 'none' -- dependencies not supported.
346416ee1e9aSmrg# 'unknown' -- same as none, but documents that we really don't know.
3465fda9279dSmrg# 'pass_all' -- all dependencies passed with no checks.
3466fda9279dSmrg# 'test_compile' -- check by making test program.
3467fda9279dSmrg# 'file_magic [[regex]]' -- check by looking for files in library path
346816ee1e9aSmrg# that responds to the $file_magic_cmd with a given extended regex.
346916ee1e9aSmrg# If you have 'file' or equivalent on your system and you're not sure
347016ee1e9aSmrg# whether 'pass_all' will *always* work, you probably want this one.
3471fda9279dSmrg
3472fda9279dSmrgcase $host_os in
3473fda9279dSmrgaix[[4-9]]*)
3474fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3475fda9279dSmrg  ;;
3476fda9279dSmrg
3477fda9279dSmrgbeos*)
3478fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3479fda9279dSmrg  ;;
3480fda9279dSmrg
3481fda9279dSmrgbsdi[[45]]*)
3482fda9279dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3483fda9279dSmrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3484fda9279dSmrg  lt_cv_file_magic_test_file=/shlib/libc.so
3485fda9279dSmrg  ;;
3486fda9279dSmrg
3487fda9279dSmrgcygwin*)
3488fda9279dSmrg  # func_win32_libid is a shell function defined in ltmain.sh
3489fda9279dSmrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3490fda9279dSmrg  lt_cv_file_magic_cmd='func_win32_libid'
3491fda9279dSmrg  ;;
3492fda9279dSmrg
3493fda9279dSmrgmingw* | pw32*)
3494fda9279dSmrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3495fda9279dSmrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3496fda9279dSmrg  # unless we find 'file', for example because we are cross-compiling.
349716ee1e9aSmrg  if ( file / ) >/dev/null 2>&1; then
3498fda9279dSmrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3499fda9279dSmrg    lt_cv_file_magic_cmd='func_win32_libid'
3500fda9279dSmrg  else
3501fda9279dSmrg    # Keep this pattern in sync with the one in func_win32_libid.
3502fda9279dSmrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3503fda9279dSmrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3504fda9279dSmrg  fi
3505fda9279dSmrg  ;;
3506fda9279dSmrg
3507fda9279dSmrgcegcc*)
3508fda9279dSmrg  # use the weaker test based on 'objdump'. See mingw*.
3509fda9279dSmrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3510fda9279dSmrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3511fda9279dSmrg  ;;
3512fda9279dSmrg
3513fda9279dSmrgdarwin* | rhapsody*)
3514fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3515fda9279dSmrg  ;;
3516fda9279dSmrg
3517fda9279dSmrgfreebsd* | dragonfly*)
3518fda9279dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3519fda9279dSmrg    case $host_cpu in
3520fda9279dSmrg    i*86 )
3521fda9279dSmrg      # Not sure whether the presence of OpenBSD here was a mistake.
3522fda9279dSmrg      # Let's accept both of them until this is cleared up.
3523fda9279dSmrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3524fda9279dSmrg      lt_cv_file_magic_cmd=/usr/bin/file
3525fda9279dSmrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3526fda9279dSmrg      ;;
3527fda9279dSmrg    esac
3528fda9279dSmrg  else
3529fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3530fda9279dSmrg  fi
3531fda9279dSmrg  ;;
3532fda9279dSmrg
3533fda9279dSmrghaiku*)
3534fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3535fda9279dSmrg  ;;
3536fda9279dSmrg
3537fda9279dSmrghpux10.20* | hpux11*)
3538fda9279dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3539fda9279dSmrg  case $host_cpu in
3540fda9279dSmrg  ia64*)
3541fda9279dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3542fda9279dSmrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
3543fda9279dSmrg    ;;
3544fda9279dSmrg  hppa*64*)
3545fda9279dSmrg    [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]']
3546fda9279dSmrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3547fda9279dSmrg    ;;
3548fda9279dSmrg  *)
3549fda9279dSmrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3550fda9279dSmrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
3551fda9279dSmrg    ;;
3552fda9279dSmrg  esac
3553fda9279dSmrg  ;;
3554fda9279dSmrg
3555fda9279dSmrginterix[[3-9]]*)
3556fda9279dSmrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3557fda9279dSmrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
3558fda9279dSmrg  ;;
3559fda9279dSmrg
3560fda9279dSmrgirix5* | irix6* | nonstopux*)
3561fda9279dSmrg  case $LD in
3562fda9279dSmrg  *-32|*"-32 ") libmagic=32-bit;;
3563fda9279dSmrg  *-n32|*"-n32 ") libmagic=N32;;
3564fda9279dSmrg  *-64|*"-64 ") libmagic=64-bit;;
3565fda9279dSmrg  *) libmagic=never-match;;
3566fda9279dSmrg  esac
3567fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3568fda9279dSmrg  ;;
3569fda9279dSmrg
3570fda9279dSmrg# This must be glibc/ELF.
3571fda9279dSmrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3572fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3573fda9279dSmrg  ;;
3574fda9279dSmrg
3575c2e4ac43Smrgnetbsd* | netbsdelf*-gnu)
3576fda9279dSmrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3577fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3578fda9279dSmrg  else
3579fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3580fda9279dSmrg  fi
3581fda9279dSmrg  ;;
3582fda9279dSmrg
3583fda9279dSmrgnewos6*)
3584fda9279dSmrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3585fda9279dSmrg  lt_cv_file_magic_cmd=/usr/bin/file
3586fda9279dSmrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3587fda9279dSmrg  ;;
3588fda9279dSmrg
3589fda9279dSmrg*nto* | *qnx*)
3590fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3591fda9279dSmrg  ;;
3592fda9279dSmrg
359316ee1e9aSmrgopenbsd* | bitrig*)
359416ee1e9aSmrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3595fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3596fda9279dSmrg  else
3597fda9279dSmrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3598fda9279dSmrg  fi
3599fda9279dSmrg  ;;
3600fda9279dSmrg
3601fda9279dSmrgosf3* | osf4* | osf5*)
3602fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3603fda9279dSmrg  ;;
3604fda9279dSmrg
3605fda9279dSmrgrdos*)
3606fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3607fda9279dSmrg  ;;
3608fda9279dSmrg
3609fda9279dSmrgsolaris*)
3610fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3611fda9279dSmrg  ;;
3612fda9279dSmrg
3613fda9279dSmrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3614fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3615fda9279dSmrg  ;;
3616fda9279dSmrg
3617fda9279dSmrgsysv4 | sysv4.3*)
3618fda9279dSmrg  case $host_vendor in
3619fda9279dSmrg  motorola)
3620fda9279dSmrg    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]]'
3621fda9279dSmrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
3622fda9279dSmrg    ;;
3623fda9279dSmrg  ncr)
3624fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3625fda9279dSmrg    ;;
3626fda9279dSmrg  sequent)
3627fda9279dSmrg    lt_cv_file_magic_cmd='/bin/file'
3628fda9279dSmrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
3629fda9279dSmrg    ;;
3630fda9279dSmrg  sni)
3631fda9279dSmrg    lt_cv_file_magic_cmd='/bin/file'
3632fda9279dSmrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3633fda9279dSmrg    lt_cv_file_magic_test_file=/lib/libc.so
3634fda9279dSmrg    ;;
3635fda9279dSmrg  siemens)
3636fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3637fda9279dSmrg    ;;
3638fda9279dSmrg  pc)
3639fda9279dSmrg    lt_cv_deplibs_check_method=pass_all
3640fda9279dSmrg    ;;
3641fda9279dSmrg  esac
3642fda9279dSmrg  ;;
3643fda9279dSmrg
3644fda9279dSmrgtpf*)
3645fda9279dSmrg  lt_cv_deplibs_check_method=pass_all
3646fda9279dSmrg  ;;
364716ee1e9aSmrgos2*)
364816ee1e9aSmrg  lt_cv_deplibs_check_method=pass_all
364916ee1e9aSmrg  ;;
3650fda9279dSmrgesac
3651fda9279dSmrg])
3652fda9279dSmrg
3653fda9279dSmrgfile_magic_glob=
3654fda9279dSmrgwant_nocaseglob=no
3655fda9279dSmrgif test "$build" = "$host"; then
3656fda9279dSmrg  case $host_os in
3657fda9279dSmrg  mingw* | pw32*)
3658fda9279dSmrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3659fda9279dSmrg      want_nocaseglob=yes
3660fda9279dSmrg    else
3661fda9279dSmrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3662fda9279dSmrg    fi
3663fda9279dSmrg    ;;
3664fda9279dSmrg  esac
3665fda9279dSmrgfi
3666fda9279dSmrg
3667fda9279dSmrgfile_magic_cmd=$lt_cv_file_magic_cmd
3668fda9279dSmrgdeplibs_check_method=$lt_cv_deplibs_check_method
3669fda9279dSmrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3670fda9279dSmrg
3671fda9279dSmrg_LT_DECL([], [deplibs_check_method], [1],
3672fda9279dSmrg    [Method to check whether dependent libraries are shared objects])
3673fda9279dSmrg_LT_DECL([], [file_magic_cmd], [1],
3674fda9279dSmrg    [Command to use when deplibs_check_method = "file_magic"])
3675fda9279dSmrg_LT_DECL([], [file_magic_glob], [1],
3676fda9279dSmrg    [How to find potential files when deplibs_check_method = "file_magic"])
3677fda9279dSmrg_LT_DECL([], [want_nocaseglob], [1],
3678fda9279dSmrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3679fda9279dSmrg])# _LT_CHECK_MAGIC_METHOD
3680fda9279dSmrg
3681fda9279dSmrg
3682fda9279dSmrg# LT_PATH_NM
3683fda9279dSmrg# ----------
3684fda9279dSmrg# find the pathname to a BSD- or MS-compatible name lister
3685fda9279dSmrgAC_DEFUN([LT_PATH_NM],
3686fda9279dSmrg[AC_REQUIRE([AC_PROG_CC])dnl
3687fda9279dSmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3688fda9279dSmrg[if test -n "$NM"; then
3689fda9279dSmrg  # Let the user override the test.
369016ee1e9aSmrg  lt_cv_path_NM=$NM
3691fda9279dSmrgelse
369216ee1e9aSmrg  lt_nm_to_check=${ac_tool_prefix}nm
3693fda9279dSmrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3694fda9279dSmrg    lt_nm_to_check="$lt_nm_to_check nm"
3695fda9279dSmrg  fi
3696fda9279dSmrg  for lt_tmp_nm in $lt_nm_to_check; do
369716ee1e9aSmrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3698fda9279dSmrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
369916ee1e9aSmrg      IFS=$lt_save_ifs
3700fda9279dSmrg      test -z "$ac_dir" && ac_dir=.
370116ee1e9aSmrg      tmp_nm=$ac_dir/$lt_tmp_nm
370216ee1e9aSmrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3703fda9279dSmrg	# Check to see if the nm accepts a BSD-compat flag.
370416ee1e9aSmrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3705fda9279dSmrg	#   nm: unknown option "B" ignored
3706fda9279dSmrg	# Tru64's nm complains that /dev/null is an invalid object file
370716ee1e9aSmrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
370816ee1e9aSmrg	case $build_os in
370916ee1e9aSmrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
371016ee1e9aSmrg	*) lt_bad_file=/dev/null ;;
371116ee1e9aSmrg	esac
371216ee1e9aSmrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
371316ee1e9aSmrg	*$lt_bad_file* | *'Invalid file or object type'*)
3714fda9279dSmrg	  lt_cv_path_NM="$tmp_nm -B"
371516ee1e9aSmrg	  break 2
3716fda9279dSmrg	  ;;
3717fda9279dSmrg	*)
3718fda9279dSmrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3719fda9279dSmrg	  */dev/null*)
3720fda9279dSmrg	    lt_cv_path_NM="$tmp_nm -p"
372116ee1e9aSmrg	    break 2
3722fda9279dSmrg	    ;;
3723fda9279dSmrg	  *)
3724fda9279dSmrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3725fda9279dSmrg	    continue # so that we can try to find one that supports BSD flags
3726fda9279dSmrg	    ;;
3727fda9279dSmrg	  esac
3728fda9279dSmrg	  ;;
3729fda9279dSmrg	esac
3730fda9279dSmrg      fi
3731fda9279dSmrg    done
373216ee1e9aSmrg    IFS=$lt_save_ifs
3733fda9279dSmrg  done
3734fda9279dSmrg  : ${lt_cv_path_NM=no}
3735fda9279dSmrgfi])
373616ee1e9aSmrgif test no != "$lt_cv_path_NM"; then
373716ee1e9aSmrg  NM=$lt_cv_path_NM
3738fda9279dSmrgelse
3739fda9279dSmrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3740fda9279dSmrg  if test -n "$DUMPBIN"; then :
3741fda9279dSmrg    # Let the user override the test.
3742fda9279dSmrg  else
3743fda9279dSmrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
374416ee1e9aSmrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3745fda9279dSmrg    *COFF*)
374616ee1e9aSmrg      DUMPBIN="$DUMPBIN -symbols -headers"
3747fda9279dSmrg      ;;
3748fda9279dSmrg    *)
3749fda9279dSmrg      DUMPBIN=:
3750fda9279dSmrg      ;;
3751fda9279dSmrg    esac
3752fda9279dSmrg  fi
3753fda9279dSmrg  AC_SUBST([DUMPBIN])
375416ee1e9aSmrg  if test : != "$DUMPBIN"; then
375516ee1e9aSmrg    NM=$DUMPBIN
3756fda9279dSmrg  fi
3757fda9279dSmrgfi
3758fda9279dSmrgtest -z "$NM" && NM=nm
3759fda9279dSmrgAC_SUBST([NM])
3760fda9279dSmrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3761fda9279dSmrg
3762fda9279dSmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3763fda9279dSmrg  [lt_cv_nm_interface="BSD nm"
3764fda9279dSmrg  echo "int some_variable = 0;" > conftest.$ac_ext
3765fda9279dSmrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3766fda9279dSmrg  (eval "$ac_compile" 2>conftest.err)
3767fda9279dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3768fda9279dSmrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3769fda9279dSmrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3770fda9279dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3771fda9279dSmrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3772fda9279dSmrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3773fda9279dSmrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3774fda9279dSmrg    lt_cv_nm_interface="MS dumpbin"
3775fda9279dSmrg  fi
3776fda9279dSmrg  rm -f conftest*])
3777fda9279dSmrg])# LT_PATH_NM
3778fda9279dSmrg
3779fda9279dSmrg# Old names:
3780fda9279dSmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3781fda9279dSmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3782fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3783fda9279dSmrgdnl AC_DEFUN([AM_PROG_NM], [])
3784fda9279dSmrgdnl AC_DEFUN([AC_PROG_NM], [])
3785fda9279dSmrg
3786fda9279dSmrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3787fda9279dSmrg# --------------------------------
3788fda9279dSmrg# how to determine the name of the shared library
3789fda9279dSmrg# associated with a specific link library.
3790fda9279dSmrg#  -- PORTME fill in with the dynamic library characteristics
3791fda9279dSmrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3792fda9279dSmrg[m4_require([_LT_DECL_EGREP])
3793fda9279dSmrgm4_require([_LT_DECL_OBJDUMP])
3794fda9279dSmrgm4_require([_LT_DECL_DLLTOOL])
3795fda9279dSmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3796fda9279dSmrglt_cv_sharedlib_from_linklib_cmd,
3797fda9279dSmrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3798fda9279dSmrg
3799fda9279dSmrgcase $host_os in
3800fda9279dSmrgcygwin* | mingw* | pw32* | cegcc*)
380116ee1e9aSmrg  # two different shell functions defined in ltmain.sh;
380216ee1e9aSmrg  # decide which one to use based on capabilities of $DLLTOOL
3803fda9279dSmrg  case `$DLLTOOL --help 2>&1` in
3804fda9279dSmrg  *--identify-strict*)
3805fda9279dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3806fda9279dSmrg    ;;
3807fda9279dSmrg  *)
3808fda9279dSmrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3809fda9279dSmrg    ;;
3810fda9279dSmrg  esac
3811fda9279dSmrg  ;;
3812fda9279dSmrg*)
3813fda9279dSmrg  # fallback: assume linklib IS sharedlib
381416ee1e9aSmrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
3815fda9279dSmrg  ;;
3816fda9279dSmrgesac
3817fda9279dSmrg])
3818fda9279dSmrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3819fda9279dSmrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3820fda9279dSmrg
3821fda9279dSmrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3822fda9279dSmrg    [Command to associate shared and link libraries])
3823fda9279dSmrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3824fda9279dSmrg
3825fda9279dSmrg
3826fda9279dSmrg# _LT_PATH_MANIFEST_TOOL
3827fda9279dSmrg# ----------------------
3828fda9279dSmrg# locate the manifest tool
3829fda9279dSmrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3830fda9279dSmrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3831fda9279dSmrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3832fda9279dSmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3833fda9279dSmrg  [lt_cv_path_mainfest_tool=no
3834fda9279dSmrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3835fda9279dSmrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3836fda9279dSmrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3837fda9279dSmrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3838fda9279dSmrg    lt_cv_path_mainfest_tool=yes
3839fda9279dSmrg  fi
3840fda9279dSmrg  rm -f conftest*])
384116ee1e9aSmrgif test yes != "$lt_cv_path_mainfest_tool"; then
3842fda9279dSmrg  MANIFEST_TOOL=:
3843fda9279dSmrgfi
3844fda9279dSmrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3845fda9279dSmrg])# _LT_PATH_MANIFEST_TOOL
3846fda9279dSmrg
3847fda9279dSmrg
384816ee1e9aSmrg# _LT_DLL_DEF_P([FILE])
384916ee1e9aSmrg# ---------------------
385016ee1e9aSmrg# True iff FILE is a Windows DLL '.def' file.
385116ee1e9aSmrg# Keep in sync with func_dll_def_p in the libtool script
385216ee1e9aSmrgAC_DEFUN([_LT_DLL_DEF_P],
385316ee1e9aSmrg[dnl
385416ee1e9aSmrg  test DEF = "`$SED -n dnl
385516ee1e9aSmrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
385616ee1e9aSmrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
385716ee1e9aSmrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
385816ee1e9aSmrg    -e q dnl                          Only consider the first "real" line
385916ee1e9aSmrg    $1`" dnl
386016ee1e9aSmrg])# _LT_DLL_DEF_P
386116ee1e9aSmrg
386216ee1e9aSmrg
3863fda9279dSmrg# LT_LIB_M
3864fda9279dSmrg# --------
3865fda9279dSmrg# check for math library
3866fda9279dSmrgAC_DEFUN([LT_LIB_M],
3867fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3868fda9279dSmrgLIBM=
3869fda9279dSmrgcase $host in
3870fda9279dSmrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3871fda9279dSmrg  # These system don't have libm, or don't need it
3872fda9279dSmrg  ;;
3873fda9279dSmrg*-ncr-sysv4.3*)
387416ee1e9aSmrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3875fda9279dSmrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
3876fda9279dSmrg  ;;
3877fda9279dSmrg*)
387816ee1e9aSmrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
3879fda9279dSmrg  ;;
3880fda9279dSmrgesac
3881fda9279dSmrgAC_SUBST([LIBM])
3882fda9279dSmrg])# LT_LIB_M
3883fda9279dSmrg
3884fda9279dSmrg# Old name:
3885fda9279dSmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3886fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
3887fda9279dSmrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3888fda9279dSmrg
3889fda9279dSmrg
3890fda9279dSmrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3891fda9279dSmrg# -------------------------------
3892fda9279dSmrgm4_defun([_LT_COMPILER_NO_RTTI],
3893fda9279dSmrg[m4_require([_LT_TAG_COMPILER])dnl
3894fda9279dSmrg
3895fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3896fda9279dSmrg
389716ee1e9aSmrgif test yes = "$GCC"; then
3898fda9279dSmrg  case $cc_basename in
3899fda9279dSmrg  nvcc*)
3900fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3901fda9279dSmrg  *)
3902fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3903fda9279dSmrg  esac
3904fda9279dSmrg
3905fda9279dSmrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3906fda9279dSmrg    lt_cv_prog_compiler_rtti_exceptions,
3907fda9279dSmrg    [-fno-rtti -fno-exceptions], [],
3908fda9279dSmrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3909fda9279dSmrgfi
3910fda9279dSmrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3911fda9279dSmrg	[Compiler flag to turn off builtin functions])
3912fda9279dSmrg])# _LT_COMPILER_NO_RTTI
3913fda9279dSmrg
3914fda9279dSmrg
3915fda9279dSmrg# _LT_CMD_GLOBAL_SYMBOLS
3916fda9279dSmrg# ----------------------
3917fda9279dSmrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3918fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3919fda9279dSmrgAC_REQUIRE([AC_PROG_CC])dnl
3920fda9279dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
3921fda9279dSmrgAC_REQUIRE([LT_PATH_NM])dnl
3922fda9279dSmrgAC_REQUIRE([LT_PATH_LD])dnl
3923fda9279dSmrgm4_require([_LT_DECL_SED])dnl
3924fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
3925fda9279dSmrgm4_require([_LT_TAG_COMPILER])dnl
3926fda9279dSmrg
3927fda9279dSmrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3928fda9279dSmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3929fda9279dSmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3930fda9279dSmrg[
3931fda9279dSmrg# These are sane defaults that work on at least a few old systems.
3932fda9279dSmrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3933fda9279dSmrg
3934fda9279dSmrg# Character class describing NM global symbol codes.
3935fda9279dSmrgsymcode='[[BCDEGRST]]'
3936fda9279dSmrg
3937fda9279dSmrg# Regexp to match symbols that can be accessed directly from C.
3938fda9279dSmrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3939fda9279dSmrg
3940fda9279dSmrg# Define system-specific variables.
3941fda9279dSmrgcase $host_os in
3942fda9279dSmrgaix*)
3943fda9279dSmrg  symcode='[[BCDT]]'
3944fda9279dSmrg  ;;
3945fda9279dSmrgcygwin* | mingw* | pw32* | cegcc*)
3946fda9279dSmrg  symcode='[[ABCDGISTW]]'
3947fda9279dSmrg  ;;
3948fda9279dSmrghpux*)
394916ee1e9aSmrg  if test ia64 = "$host_cpu"; then
3950fda9279dSmrg    symcode='[[ABCDEGRST]]'
3951fda9279dSmrg  fi
3952fda9279dSmrg  ;;
3953fda9279dSmrgirix* | nonstopux*)
3954fda9279dSmrg  symcode='[[BCDEGRST]]'
3955fda9279dSmrg  ;;
3956fda9279dSmrgosf*)
3957fda9279dSmrg  symcode='[[BCDEGQRST]]'
3958fda9279dSmrg  ;;
3959fda9279dSmrgsolaris*)
3960fda9279dSmrg  symcode='[[BDRT]]'
3961fda9279dSmrg  ;;
3962fda9279dSmrgsco3.2v5*)
3963fda9279dSmrg  symcode='[[DT]]'
3964fda9279dSmrg  ;;
3965fda9279dSmrgsysv4.2uw2*)
3966fda9279dSmrg  symcode='[[DT]]'
3967fda9279dSmrg  ;;
3968fda9279dSmrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3969fda9279dSmrg  symcode='[[ABDT]]'
3970fda9279dSmrg  ;;
3971fda9279dSmrgsysv4)
3972fda9279dSmrg  symcode='[[DFNSTU]]'
3973fda9279dSmrg  ;;
3974fda9279dSmrgesac
3975fda9279dSmrg
3976fda9279dSmrg# If we're using GNU nm, then use its standard symbol codes.
3977fda9279dSmrgcase `$NM -V 2>&1` in
3978fda9279dSmrg*GNU* | *'with BFD'*)
3979fda9279dSmrg  symcode='[[ABCDGIRSTW]]' ;;
3980fda9279dSmrgesac
3981fda9279dSmrg
398216ee1e9aSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
398316ee1e9aSmrg  # Gets list of data symbols to import.
398416ee1e9aSmrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
398516ee1e9aSmrg  # Adjust the below global symbol transforms to fixup imported variables.
398616ee1e9aSmrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
398716ee1e9aSmrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
398816ee1e9aSmrg  lt_c_name_lib_hook="\
398916ee1e9aSmrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
399016ee1e9aSmrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
399116ee1e9aSmrgelse
399216ee1e9aSmrg  # Disable hooks by default.
399316ee1e9aSmrg  lt_cv_sys_global_symbol_to_import=
399416ee1e9aSmrg  lt_cdecl_hook=
399516ee1e9aSmrg  lt_c_name_hook=
399616ee1e9aSmrg  lt_c_name_lib_hook=
399716ee1e9aSmrgfi
399816ee1e9aSmrg
3999fda9279dSmrg# Transform an extracted symbol line into a proper C declaration.
4000fda9279dSmrg# Some systems (esp. on ia64) link data and code symbols differently,
4001fda9279dSmrg# so use this general approach.
400216ee1e9aSmrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
400316ee1e9aSmrg$lt_cdecl_hook\
400416ee1e9aSmrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
400516ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
4006fda9279dSmrg
4007fda9279dSmrg# Transform an extracted symbol line into symbol name and symbol address
400816ee1e9aSmrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
400916ee1e9aSmrg$lt_c_name_hook\
401016ee1e9aSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
401116ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
401216ee1e9aSmrg
401316ee1e9aSmrg# Transform an extracted symbol line into symbol name with lib prefix and
401416ee1e9aSmrg# symbol address.
401516ee1e9aSmrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
401616ee1e9aSmrg$lt_c_name_lib_hook\
401716ee1e9aSmrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
401816ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
401916ee1e9aSmrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4020fda9279dSmrg
4021fda9279dSmrg# Handle CRLF in mingw tool chain
4022fda9279dSmrgopt_cr=
4023fda9279dSmrgcase $build_os in
4024fda9279dSmrgmingw*)
4025fda9279dSmrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
4026fda9279dSmrg  ;;
4027fda9279dSmrgesac
4028fda9279dSmrg
4029fda9279dSmrg# Try without a prefix underscore, then with it.
4030fda9279dSmrgfor ac_symprfx in "" "_"; do
4031fda9279dSmrg
4032fda9279dSmrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4033fda9279dSmrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4034fda9279dSmrg
4035fda9279dSmrg  # Write the raw and C identifiers.
4036fda9279dSmrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
403716ee1e9aSmrg    # Fake it for dumpbin and say T for any non-static function,
403816ee1e9aSmrg    # D for any global variable and I for any imported variable.
4039fda9279dSmrg    # Also find C++ and __fastcall symbols from MSVC++,
4040fda9279dSmrg    # which start with @ or ?.
4041fda9279dSmrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4042fda9279dSmrg"     {last_section=section; section=\$ 3};"\
4043fda9279dSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4044fda9279dSmrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
404516ee1e9aSmrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
404616ee1e9aSmrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
404716ee1e9aSmrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4048fda9279dSmrg"     \$ 0!~/External *\|/{next};"\
4049fda9279dSmrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4050fda9279dSmrg"     {if(hide[section]) next};"\
405116ee1e9aSmrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
405216ee1e9aSmrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
405316ee1e9aSmrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
405416ee1e9aSmrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4055fda9279dSmrg"     ' prfx=^$ac_symprfx]"
4056fda9279dSmrg  else
4057fda9279dSmrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
4058fda9279dSmrg  fi
4059fda9279dSmrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4060fda9279dSmrg
4061fda9279dSmrg  # Check to see that the pipe works correctly.
4062fda9279dSmrg  pipe_works=no
4063fda9279dSmrg
4064fda9279dSmrg  rm -f conftest*
4065fda9279dSmrg  cat > conftest.$ac_ext <<_LT_EOF
4066fda9279dSmrg#ifdef __cplusplus
4067fda9279dSmrgextern "C" {
4068fda9279dSmrg#endif
4069fda9279dSmrgchar nm_test_var;
4070fda9279dSmrgvoid nm_test_func(void);
4071fda9279dSmrgvoid nm_test_func(void){}
4072fda9279dSmrg#ifdef __cplusplus
4073fda9279dSmrg}
4074fda9279dSmrg#endif
4075fda9279dSmrgint main(){nm_test_var='a';nm_test_func();return(0);}
4076fda9279dSmrg_LT_EOF
4077fda9279dSmrg
4078fda9279dSmrg  if AC_TRY_EVAL(ac_compile); then
4079fda9279dSmrg    # Now try to grab the symbols.
4080fda9279dSmrg    nlist=conftest.nm
4081fda9279dSmrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4082fda9279dSmrg      # Try sorting and uniquifying the output.
4083fda9279dSmrg      if sort "$nlist" | uniq > "$nlist"T; then
4084fda9279dSmrg	mv -f "$nlist"T "$nlist"
4085fda9279dSmrg      else
4086fda9279dSmrg	rm -f "$nlist"T
4087fda9279dSmrg      fi
4088fda9279dSmrg
4089fda9279dSmrg      # Make sure that we snagged all the symbols we need.
4090fda9279dSmrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4091fda9279dSmrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4092fda9279dSmrg	  cat <<_LT_EOF > conftest.$ac_ext
4093fda9279dSmrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
409416ee1e9aSmrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
409516ee1e9aSmrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4096fda9279dSmrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4097fda9279dSmrg# define LT@&t@_DLSYM_CONST
409816ee1e9aSmrg#elif defined __osf__
4099fda9279dSmrg/* This system does not cope well with relocations in const data.  */
4100fda9279dSmrg# define LT@&t@_DLSYM_CONST
4101fda9279dSmrg#else
4102fda9279dSmrg# define LT@&t@_DLSYM_CONST const
4103fda9279dSmrg#endif
4104fda9279dSmrg
4105fda9279dSmrg#ifdef __cplusplus
4106fda9279dSmrgextern "C" {
4107fda9279dSmrg#endif
4108fda9279dSmrg
4109fda9279dSmrg_LT_EOF
4110fda9279dSmrg	  # Now generate the symbol file.
4111fda9279dSmrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4112fda9279dSmrg
4113fda9279dSmrg	  cat <<_LT_EOF >> conftest.$ac_ext
4114fda9279dSmrg
4115fda9279dSmrg/* The mapping between symbol names and symbols.  */
4116fda9279dSmrgLT@&t@_DLSYM_CONST struct {
4117fda9279dSmrg  const char *name;
4118fda9279dSmrg  void       *address;
4119fda9279dSmrg}
4120fda9279dSmrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4121fda9279dSmrg{
4122fda9279dSmrg  { "@PROGRAM@", (void *) 0 },
4123fda9279dSmrg_LT_EOF
412416ee1e9aSmrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4125fda9279dSmrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4126fda9279dSmrg  {0, (void *) 0}
4127fda9279dSmrg};
4128fda9279dSmrg
4129fda9279dSmrg/* This works around a problem in FreeBSD linker */
4130fda9279dSmrg#ifdef FREEBSD_WORKAROUND
4131fda9279dSmrgstatic const void *lt_preloaded_setup() {
4132fda9279dSmrg  return lt__PROGRAM__LTX_preloaded_symbols;
4133fda9279dSmrg}
4134fda9279dSmrg#endif
4135fda9279dSmrg
4136fda9279dSmrg#ifdef __cplusplus
4137fda9279dSmrg}
4138fda9279dSmrg#endif
4139fda9279dSmrg_LT_EOF
4140fda9279dSmrg	  # Now try linking the two files.
4141fda9279dSmrg	  mv conftest.$ac_objext conftstm.$ac_objext
4142fda9279dSmrg	  lt_globsym_save_LIBS=$LIBS
4143fda9279dSmrg	  lt_globsym_save_CFLAGS=$CFLAGS
414416ee1e9aSmrg	  LIBS=conftstm.$ac_objext
4145fda9279dSmrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
414616ee1e9aSmrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4147fda9279dSmrg	    pipe_works=yes
4148fda9279dSmrg	  fi
4149fda9279dSmrg	  LIBS=$lt_globsym_save_LIBS
4150fda9279dSmrg	  CFLAGS=$lt_globsym_save_CFLAGS
4151fda9279dSmrg	else
4152fda9279dSmrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4153fda9279dSmrg	fi
4154fda9279dSmrg      else
4155fda9279dSmrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4156fda9279dSmrg      fi
4157fda9279dSmrg    else
4158fda9279dSmrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
4159fda9279dSmrg    fi
4160fda9279dSmrg  else
4161fda9279dSmrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4162fda9279dSmrg    cat conftest.$ac_ext >&5
4163fda9279dSmrg  fi
4164fda9279dSmrg  rm -rf conftest* conftst*
4165fda9279dSmrg
4166fda9279dSmrg  # Do not use the global_symbol_pipe unless it works.
416716ee1e9aSmrg  if test yes = "$pipe_works"; then
4168fda9279dSmrg    break
4169fda9279dSmrg  else
4170fda9279dSmrg    lt_cv_sys_global_symbol_pipe=
4171fda9279dSmrg  fi
4172fda9279dSmrgdone
4173fda9279dSmrg])
4174fda9279dSmrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4175fda9279dSmrg  lt_cv_sys_global_symbol_to_cdecl=
4176fda9279dSmrgfi
4177fda9279dSmrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4178fda9279dSmrg  AC_MSG_RESULT(failed)
4179fda9279dSmrgelse
4180fda9279dSmrg  AC_MSG_RESULT(ok)
4181fda9279dSmrgfi
4182fda9279dSmrg
4183fda9279dSmrg# Response file support.
4184fda9279dSmrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4185fda9279dSmrg  nm_file_list_spec='@'
4186fda9279dSmrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4187fda9279dSmrg  nm_file_list_spec='@'
4188fda9279dSmrgfi
4189fda9279dSmrg
4190fda9279dSmrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4191fda9279dSmrg    [Take the output of nm and produce a listing of raw symbols and C names])
4192fda9279dSmrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4193fda9279dSmrg    [Transform the output of nm in a proper C declaration])
419416ee1e9aSmrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
419516ee1e9aSmrg    [Transform the output of nm into a list of symbols to manually relocate])
4196fda9279dSmrg_LT_DECL([global_symbol_to_c_name_address],
4197fda9279dSmrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4198fda9279dSmrg    [Transform the output of nm in a C name address pair])
4199fda9279dSmrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4200fda9279dSmrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4201fda9279dSmrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
420216ee1e9aSmrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
420316ee1e9aSmrg    [The name lister interface])
4204fda9279dSmrg_LT_DECL([], [nm_file_list_spec], [1],
4205fda9279dSmrg    [Specify filename containing input files for $NM])
4206fda9279dSmrg]) # _LT_CMD_GLOBAL_SYMBOLS
4207fda9279dSmrg
4208fda9279dSmrg
4209fda9279dSmrg# _LT_COMPILER_PIC([TAGNAME])
4210fda9279dSmrg# ---------------------------
4211fda9279dSmrgm4_defun([_LT_COMPILER_PIC],
4212fda9279dSmrg[m4_require([_LT_TAG_COMPILER])dnl
4213fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4214fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4215fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4216fda9279dSmrg
4217fda9279dSmrgm4_if([$1], [CXX], [
4218fda9279dSmrg  # C++ specific cases for pic, static, wl, etc.
421916ee1e9aSmrg  if test yes = "$GXX"; then
4220fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4221fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4222fda9279dSmrg
4223fda9279dSmrg    case $host_os in
4224fda9279dSmrg    aix*)
4225fda9279dSmrg      # All AIX code is PIC.
422616ee1e9aSmrg      if test ia64 = "$host_cpu"; then
4227fda9279dSmrg	# AIX 5 now supports IA64 processor
4228fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4229fda9279dSmrg      fi
423016ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4231fda9279dSmrg      ;;
4232fda9279dSmrg
4233fda9279dSmrg    amigaos*)
4234fda9279dSmrg      case $host_cpu in
4235fda9279dSmrg      powerpc)
4236fda9279dSmrg            # see comment about AmigaOS4 .so support
4237fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4238fda9279dSmrg        ;;
4239fda9279dSmrg      m68k)
4240fda9279dSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
424116ee1e9aSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
424216ee1e9aSmrg            # like '-m68040'.
4243fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4244fda9279dSmrg        ;;
4245fda9279dSmrg      esac
4246fda9279dSmrg      ;;
4247fda9279dSmrg
4248fda9279dSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4249fda9279dSmrg      # PIC is the default for these OSes.
4250fda9279dSmrg      ;;
4251fda9279dSmrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
4252fda9279dSmrg      # This hack is so that the source file can tell whether it is being
4253fda9279dSmrg      # built for inclusion in a dll (and should export symbols for example).
4254fda9279dSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4255fda9279dSmrg      # (--disable-auto-import) libraries
4256fda9279dSmrg      m4_if([$1], [GCJ], [],
4257fda9279dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
425816ee1e9aSmrg      case $host_os in
425916ee1e9aSmrg      os2*)
426016ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
426116ee1e9aSmrg	;;
426216ee1e9aSmrg      esac
4263fda9279dSmrg      ;;
4264fda9279dSmrg    darwin* | rhapsody*)
4265fda9279dSmrg      # PIC is the default on this platform
4266fda9279dSmrg      # Common symbols not allowed in MH_DYLIB files
4267fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4268fda9279dSmrg      ;;
4269fda9279dSmrg    *djgpp*)
4270fda9279dSmrg      # DJGPP does not support shared libraries at all
4271fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4272fda9279dSmrg      ;;
4273fda9279dSmrg    haiku*)
4274fda9279dSmrg      # PIC is the default for Haiku.
4275fda9279dSmrg      # The "-static" flag exists, but is broken.
4276fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4277fda9279dSmrg      ;;
4278fda9279dSmrg    interix[[3-9]]*)
4279fda9279dSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4280fda9279dSmrg      # Instead, we relocate shared libraries at runtime.
4281fda9279dSmrg      ;;
4282fda9279dSmrg    sysv4*MP*)
4283fda9279dSmrg      if test -d /usr/nec; then
4284fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4285fda9279dSmrg      fi
4286fda9279dSmrg      ;;
4287fda9279dSmrg    hpux*)
4288fda9279dSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4289fda9279dSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4290fda9279dSmrg      # sets the default TLS model and affects inlining.
4291fda9279dSmrg      case $host_cpu in
4292fda9279dSmrg      hppa*64*)
4293fda9279dSmrg	;;
4294fda9279dSmrg      *)
4295fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4296fda9279dSmrg	;;
4297fda9279dSmrg      esac
4298fda9279dSmrg      ;;
4299fda9279dSmrg    *qnx* | *nto*)
4300fda9279dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4301fda9279dSmrg      # it will coredump.
4302fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4303fda9279dSmrg      ;;
4304fda9279dSmrg    *)
4305fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4306fda9279dSmrg      ;;
4307fda9279dSmrg    esac
4308fda9279dSmrg  else
4309fda9279dSmrg    case $host_os in
4310fda9279dSmrg      aix[[4-9]]*)
4311fda9279dSmrg	# All AIX code is PIC.
431216ee1e9aSmrg	if test ia64 = "$host_cpu"; then
4313fda9279dSmrg	  # AIX 5 now supports IA64 processor
4314fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4315fda9279dSmrg	else
4316fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4317fda9279dSmrg	fi
4318fda9279dSmrg	;;
4319fda9279dSmrg      chorus*)
4320fda9279dSmrg	case $cc_basename in
4321fda9279dSmrg	cxch68*)
4322fda9279dSmrg	  # Green Hills C++ Compiler
4323fda9279dSmrg	  # _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"
4324fda9279dSmrg	  ;;
4325fda9279dSmrg	esac
4326fda9279dSmrg	;;
4327fda9279dSmrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
4328fda9279dSmrg	# This hack is so that the source file can tell whether it is being
4329fda9279dSmrg	# built for inclusion in a dll (and should export symbols for example).
4330fda9279dSmrg	m4_if([$1], [GCJ], [],
4331fda9279dSmrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4332fda9279dSmrg	;;
4333fda9279dSmrg      dgux*)
4334fda9279dSmrg	case $cc_basename in
4335fda9279dSmrg	  ec++*)
4336fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4337fda9279dSmrg	    ;;
4338fda9279dSmrg	  ghcx*)
4339fda9279dSmrg	    # Green Hills C++ Compiler
4340fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4341fda9279dSmrg	    ;;
4342fda9279dSmrg	  *)
4343fda9279dSmrg	    ;;
4344fda9279dSmrg	esac
4345fda9279dSmrg	;;
4346fda9279dSmrg      freebsd* | dragonfly*)
4347fda9279dSmrg	# FreeBSD uses GNU C++
4348fda9279dSmrg	;;
4349fda9279dSmrg      hpux9* | hpux10* | hpux11*)
4350fda9279dSmrg	case $cc_basename in
4351fda9279dSmrg	  CC*)
4352fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
435316ee1e9aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
435416ee1e9aSmrg	    if test ia64 != "$host_cpu"; then
4355fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4356fda9279dSmrg	    fi
4357fda9279dSmrg	    ;;
4358fda9279dSmrg	  aCC*)
4359fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
436016ee1e9aSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4361fda9279dSmrg	    case $host_cpu in
4362fda9279dSmrg	    hppa*64*|ia64*)
4363fda9279dSmrg	      # +Z the default
4364fda9279dSmrg	      ;;
4365fda9279dSmrg	    *)
4366fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4367fda9279dSmrg	      ;;
4368fda9279dSmrg	    esac
4369fda9279dSmrg	    ;;
4370fda9279dSmrg	  *)
4371fda9279dSmrg	    ;;
4372fda9279dSmrg	esac
4373fda9279dSmrg	;;
4374fda9279dSmrg      interix*)
4375fda9279dSmrg	# This is c89, which is MS Visual C++ (no shared libs)
4376fda9279dSmrg	# Anyone wants to do a port?
4377fda9279dSmrg	;;
4378fda9279dSmrg      irix5* | irix6* | nonstopux*)
4379fda9279dSmrg	case $cc_basename in
4380fda9279dSmrg	  CC*)
4381fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4382fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4383fda9279dSmrg	    # CC pic flag -KPIC is the default.
4384fda9279dSmrg	    ;;
4385fda9279dSmrg	  *)
4386fda9279dSmrg	    ;;
4387fda9279dSmrg	esac
4388fda9279dSmrg	;;
4389fda9279dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4390fda9279dSmrg	case $cc_basename in
4391fda9279dSmrg	  KCC*)
4392fda9279dSmrg	    # KAI C++ Compiler
4393fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4394fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4395fda9279dSmrg	    ;;
4396fda9279dSmrg	  ecpc* )
439716ee1e9aSmrg	    # old Intel C++ for x86_64, which still supported -KPIC.
4398fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4399fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4400fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4401fda9279dSmrg	    ;;
4402fda9279dSmrg	  icpc* )
4403fda9279dSmrg	    # Intel C++, used to be incompatible with GCC.
4404fda9279dSmrg	    # ICC 10 doesn't accept -KPIC any more.
4405fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4406fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4407fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4408fda9279dSmrg	    ;;
4409fda9279dSmrg	  pgCC* | pgcpp*)
4410fda9279dSmrg	    # Portland Group C++ compiler
4411fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4412fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4413fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4414fda9279dSmrg	    ;;
4415fda9279dSmrg	  cxx*)
4416fda9279dSmrg	    # Compaq C++
4417fda9279dSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4418fda9279dSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4419fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4420fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4421fda9279dSmrg	    ;;
4422fda9279dSmrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4423fda9279dSmrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4424fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4425fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4426fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4427fda9279dSmrg	    ;;
4428fda9279dSmrg	  *)
4429fda9279dSmrg	    case `$CC -V 2>&1 | sed 5q` in
4430fda9279dSmrg	    *Sun\ C*)
4431fda9279dSmrg	      # Sun C++ 5.9
4432fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4433fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4434fda9279dSmrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4435fda9279dSmrg	      ;;
4436fda9279dSmrg	    esac
4437fda9279dSmrg	    ;;
4438fda9279dSmrg	esac
4439fda9279dSmrg	;;
4440fda9279dSmrg      lynxos*)
4441fda9279dSmrg	;;
4442fda9279dSmrg      m88k*)
4443fda9279dSmrg	;;
4444fda9279dSmrg      mvs*)
4445fda9279dSmrg	case $cc_basename in
4446fda9279dSmrg	  cxx*)
4447fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4448fda9279dSmrg	    ;;
4449fda9279dSmrg	  *)
4450fda9279dSmrg	    ;;
4451fda9279dSmrg	esac
4452fda9279dSmrg	;;
4453c2e4ac43Smrg      netbsd* | netbsdelf*-gnu)
4454fda9279dSmrg	;;
4455fda9279dSmrg      *qnx* | *nto*)
4456fda9279dSmrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4457fda9279dSmrg        # it will coredump.
4458fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4459fda9279dSmrg        ;;
4460fda9279dSmrg      osf3* | osf4* | osf5*)
4461fda9279dSmrg	case $cc_basename in
4462fda9279dSmrg	  KCC*)
4463fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4464fda9279dSmrg	    ;;
4465fda9279dSmrg	  RCC*)
4466fda9279dSmrg	    # Rational C++ 2.4.1
4467fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4468fda9279dSmrg	    ;;
4469fda9279dSmrg	  cxx*)
4470fda9279dSmrg	    # Digital/Compaq C++
4471fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4472fda9279dSmrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4473fda9279dSmrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4474fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4475fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4476fda9279dSmrg	    ;;
4477fda9279dSmrg	  *)
4478fda9279dSmrg	    ;;
4479fda9279dSmrg	esac
4480fda9279dSmrg	;;
4481fda9279dSmrg      psos*)
4482fda9279dSmrg	;;
4483fda9279dSmrg      solaris*)
4484fda9279dSmrg	case $cc_basename in
4485fda9279dSmrg	  CC* | sunCC*)
4486fda9279dSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
4487fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4488fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4489fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4490fda9279dSmrg	    ;;
4491fda9279dSmrg	  gcx*)
4492fda9279dSmrg	    # Green Hills C++ Compiler
4493fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4494fda9279dSmrg	    ;;
4495fda9279dSmrg	  *)
4496fda9279dSmrg	    ;;
4497fda9279dSmrg	esac
4498fda9279dSmrg	;;
4499fda9279dSmrg      sunos4*)
4500fda9279dSmrg	case $cc_basename in
4501fda9279dSmrg	  CC*)
4502fda9279dSmrg	    # Sun C++ 4.x
4503fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4504fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4505fda9279dSmrg	    ;;
4506fda9279dSmrg	  lcc*)
4507fda9279dSmrg	    # Lucid
4508fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4509fda9279dSmrg	    ;;
4510fda9279dSmrg	  *)
4511fda9279dSmrg	    ;;
4512fda9279dSmrg	esac
4513fda9279dSmrg	;;
4514fda9279dSmrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4515fda9279dSmrg	case $cc_basename in
4516fda9279dSmrg	  CC*)
4517fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4518fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4519fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4520fda9279dSmrg	    ;;
4521fda9279dSmrg	esac
4522fda9279dSmrg	;;
4523fda9279dSmrg      tandem*)
4524fda9279dSmrg	case $cc_basename in
4525fda9279dSmrg	  NCC*)
4526fda9279dSmrg	    # NonStop-UX NCC 3.20
4527fda9279dSmrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4528fda9279dSmrg	    ;;
4529fda9279dSmrg	  *)
4530fda9279dSmrg	    ;;
4531fda9279dSmrg	esac
4532fda9279dSmrg	;;
4533fda9279dSmrg      vxworks*)
4534fda9279dSmrg	;;
4535fda9279dSmrg      *)
4536fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4537fda9279dSmrg	;;
4538fda9279dSmrg    esac
4539fda9279dSmrg  fi
4540fda9279dSmrg],
4541fda9279dSmrg[
454216ee1e9aSmrg  if test yes = "$GCC"; then
4543fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4544fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4545fda9279dSmrg
4546fda9279dSmrg    case $host_os in
4547fda9279dSmrg      aix*)
4548fda9279dSmrg      # All AIX code is PIC.
454916ee1e9aSmrg      if test ia64 = "$host_cpu"; then
4550fda9279dSmrg	# AIX 5 now supports IA64 processor
4551fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4552fda9279dSmrg      fi
455316ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4554fda9279dSmrg      ;;
4555fda9279dSmrg
4556fda9279dSmrg    amigaos*)
4557fda9279dSmrg      case $host_cpu in
4558fda9279dSmrg      powerpc)
4559fda9279dSmrg            # see comment about AmigaOS4 .so support
4560fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4561fda9279dSmrg        ;;
4562fda9279dSmrg      m68k)
4563fda9279dSmrg            # FIXME: we need at least 68020 code to build shared libraries, but
456416ee1e9aSmrg            # adding the '-m68020' flag to GCC prevents building anything better,
456516ee1e9aSmrg            # like '-m68040'.
4566fda9279dSmrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4567fda9279dSmrg        ;;
4568fda9279dSmrg      esac
4569fda9279dSmrg      ;;
4570fda9279dSmrg
4571fda9279dSmrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4572fda9279dSmrg      # PIC is the default for these OSes.
4573fda9279dSmrg      ;;
4574fda9279dSmrg
4575fda9279dSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4576fda9279dSmrg      # This hack is so that the source file can tell whether it is being
4577fda9279dSmrg      # built for inclusion in a dll (and should export symbols for example).
4578fda9279dSmrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4579fda9279dSmrg      # (--disable-auto-import) libraries
4580fda9279dSmrg      m4_if([$1], [GCJ], [],
4581fda9279dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
458216ee1e9aSmrg      case $host_os in
458316ee1e9aSmrg      os2*)
458416ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
458516ee1e9aSmrg	;;
458616ee1e9aSmrg      esac
4587fda9279dSmrg      ;;
4588fda9279dSmrg
4589fda9279dSmrg    darwin* | rhapsody*)
4590fda9279dSmrg      # PIC is the default on this platform
4591fda9279dSmrg      # Common symbols not allowed in MH_DYLIB files
4592fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4593fda9279dSmrg      ;;
4594fda9279dSmrg
4595fda9279dSmrg    haiku*)
4596fda9279dSmrg      # PIC is the default for Haiku.
4597fda9279dSmrg      # The "-static" flag exists, but is broken.
4598fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4599fda9279dSmrg      ;;
4600fda9279dSmrg
4601fda9279dSmrg    hpux*)
4602fda9279dSmrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4603fda9279dSmrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4604fda9279dSmrg      # sets the default TLS model and affects inlining.
4605fda9279dSmrg      case $host_cpu in
4606fda9279dSmrg      hppa*64*)
4607fda9279dSmrg	# +Z the default
4608fda9279dSmrg	;;
4609fda9279dSmrg      *)
4610fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4611fda9279dSmrg	;;
4612fda9279dSmrg      esac
4613fda9279dSmrg      ;;
4614fda9279dSmrg
4615fda9279dSmrg    interix[[3-9]]*)
4616fda9279dSmrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4617fda9279dSmrg      # Instead, we relocate shared libraries at runtime.
4618fda9279dSmrg      ;;
4619fda9279dSmrg
4620fda9279dSmrg    msdosdjgpp*)
4621fda9279dSmrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4622fda9279dSmrg      # on systems that don't support them.
4623fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4624fda9279dSmrg      enable_shared=no
4625fda9279dSmrg      ;;
4626fda9279dSmrg
4627fda9279dSmrg    *nto* | *qnx*)
4628fda9279dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4629fda9279dSmrg      # it will coredump.
4630fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4631fda9279dSmrg      ;;
4632fda9279dSmrg
4633fda9279dSmrg    sysv4*MP*)
4634fda9279dSmrg      if test -d /usr/nec; then
4635fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4636fda9279dSmrg      fi
4637fda9279dSmrg      ;;
4638fda9279dSmrg
4639fda9279dSmrg    *)
4640fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4641fda9279dSmrg      ;;
4642fda9279dSmrg    esac
4643fda9279dSmrg
4644fda9279dSmrg    case $cc_basename in
4645fda9279dSmrg    nvcc*) # Cuda Compiler Driver 2.2
4646fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4647fda9279dSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4648fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4649fda9279dSmrg      fi
4650fda9279dSmrg      ;;
4651fda9279dSmrg    esac
4652fda9279dSmrg  else
4653fda9279dSmrg    # PORTME Check for flag to pass linker flags through the system compiler.
4654fda9279dSmrg    case $host_os in
4655fda9279dSmrg    aix*)
4656fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
465716ee1e9aSmrg      if test ia64 = "$host_cpu"; then
4658fda9279dSmrg	# AIX 5 now supports IA64 processor
4659fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4660fda9279dSmrg      else
4661fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4662fda9279dSmrg      fi
4663fda9279dSmrg      ;;
4664fda9279dSmrg
466516ee1e9aSmrg    darwin* | rhapsody*)
466616ee1e9aSmrg      # PIC is the default on this platform
466716ee1e9aSmrg      # Common symbols not allowed in MH_DYLIB files
466816ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
466916ee1e9aSmrg      case $cc_basename in
467016ee1e9aSmrg      nagfor*)
467116ee1e9aSmrg        # NAG Fortran compiler
467216ee1e9aSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
467316ee1e9aSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
467416ee1e9aSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
467516ee1e9aSmrg        ;;
467616ee1e9aSmrg      esac
467716ee1e9aSmrg      ;;
467816ee1e9aSmrg
4679fda9279dSmrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4680fda9279dSmrg      # This hack is so that the source file can tell whether it is being
4681fda9279dSmrg      # built for inclusion in a dll (and should export symbols for example).
4682fda9279dSmrg      m4_if([$1], [GCJ], [],
4683fda9279dSmrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
468416ee1e9aSmrg      case $host_os in
468516ee1e9aSmrg      os2*)
468616ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
468716ee1e9aSmrg	;;
468816ee1e9aSmrg      esac
4689fda9279dSmrg      ;;
4690fda9279dSmrg
4691fda9279dSmrg    hpux9* | hpux10* | hpux11*)
4692fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4693fda9279dSmrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4694fda9279dSmrg      # not for PA HP-UX.
4695fda9279dSmrg      case $host_cpu in
4696fda9279dSmrg      hppa*64*|ia64*)
4697fda9279dSmrg	# +Z the default
4698fda9279dSmrg	;;
4699fda9279dSmrg      *)
4700fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4701fda9279dSmrg	;;
4702fda9279dSmrg      esac
4703fda9279dSmrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
470416ee1e9aSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4705fda9279dSmrg      ;;
4706fda9279dSmrg
4707fda9279dSmrg    irix5* | irix6* | nonstopux*)
4708fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4709fda9279dSmrg      # PIC (with -KPIC) is the default.
4710fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4711fda9279dSmrg      ;;
4712fda9279dSmrg
4713fda9279dSmrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
4714fda9279dSmrg      case $cc_basename in
471516ee1e9aSmrg      # old Intel for x86_64, which still supported -KPIC.
4716fda9279dSmrg      ecc*)
4717fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4718fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4719fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4720fda9279dSmrg        ;;
4721fda9279dSmrg      # icc used to be incompatible with GCC.
4722fda9279dSmrg      # ICC 10 doesn't accept -KPIC any more.
4723fda9279dSmrg      icc* | ifort*)
4724fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4725fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4726fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4727fda9279dSmrg        ;;
4728fda9279dSmrg      # Lahey Fortran 8.1.
4729fda9279dSmrg      lf95*)
4730fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4731fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4732fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4733fda9279dSmrg	;;
4734fda9279dSmrg      nagfor*)
4735fda9279dSmrg	# NAG Fortran compiler
4736fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4737fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4738fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4739fda9279dSmrg	;;
474016ee1e9aSmrg      tcc*)
474116ee1e9aSmrg	# Fabrice Bellard et al's Tiny C Compiler
474216ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474316ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
474416ee1e9aSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
474516ee1e9aSmrg	;;
4746fda9279dSmrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4747fda9279dSmrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4748fda9279dSmrg	# which looks to be a dead project)
4749fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4750fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4751fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4752fda9279dSmrg        ;;
4753fda9279dSmrg      ccc*)
4754fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4755fda9279dSmrg        # All Alpha code is PIC.
4756fda9279dSmrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4757fda9279dSmrg        ;;
4758fda9279dSmrg      xl* | bgxl* | bgf* | mpixl*)
4759fda9279dSmrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4760fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4761fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4762fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4763fda9279dSmrg	;;
4764fda9279dSmrg      *)
4765fda9279dSmrg	case `$CC -V 2>&1 | sed 5q` in
4766fda9279dSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4767fda9279dSmrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4768fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4769fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4770fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4771fda9279dSmrg	  ;;
4772fda9279dSmrg	*Sun\ F* | *Sun*Fortran*)
4773fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4774fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4775fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4776fda9279dSmrg	  ;;
4777fda9279dSmrg	*Sun\ C*)
4778fda9279dSmrg	  # Sun C 5.9
4779fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4780fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4781fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4782fda9279dSmrg	  ;;
4783fda9279dSmrg        *Intel*\ [[CF]]*Compiler*)
4784fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4785fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4786fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4787fda9279dSmrg	  ;;
4788fda9279dSmrg	*Portland\ Group*)
4789fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4790fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4791fda9279dSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4792fda9279dSmrg	  ;;
4793fda9279dSmrg	esac
4794fda9279dSmrg	;;
4795fda9279dSmrg      esac
4796fda9279dSmrg      ;;
4797fda9279dSmrg
4798fda9279dSmrg    newsos6)
4799fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4800fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4801fda9279dSmrg      ;;
4802fda9279dSmrg
4803fda9279dSmrg    *nto* | *qnx*)
4804fda9279dSmrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4805fda9279dSmrg      # it will coredump.
4806fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4807fda9279dSmrg      ;;
4808fda9279dSmrg
4809fda9279dSmrg    osf3* | osf4* | osf5*)
4810fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4811fda9279dSmrg      # All OSF/1 code is PIC.
4812fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4813fda9279dSmrg      ;;
4814fda9279dSmrg
4815fda9279dSmrg    rdos*)
4816fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4817fda9279dSmrg      ;;
4818fda9279dSmrg
4819fda9279dSmrg    solaris*)
4820fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4821fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4822fda9279dSmrg      case $cc_basename in
4823fda9279dSmrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4824fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4825fda9279dSmrg      *)
4826fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4827fda9279dSmrg      esac
4828fda9279dSmrg      ;;
4829fda9279dSmrg
4830fda9279dSmrg    sunos4*)
4831fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4832fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4833fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4834fda9279dSmrg      ;;
4835fda9279dSmrg
4836fda9279dSmrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4837fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4838fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4839fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4840fda9279dSmrg      ;;
4841fda9279dSmrg
4842fda9279dSmrg    sysv4*MP*)
484316ee1e9aSmrg      if test -d /usr/nec; then
4844fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4845fda9279dSmrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4846fda9279dSmrg      fi
4847fda9279dSmrg      ;;
4848fda9279dSmrg
4849fda9279dSmrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4850fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4851fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4852fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4853fda9279dSmrg      ;;
4854fda9279dSmrg
4855fda9279dSmrg    unicos*)
4856fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4857fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4858fda9279dSmrg      ;;
4859fda9279dSmrg
4860fda9279dSmrg    uts4*)
4861fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4862fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4863fda9279dSmrg      ;;
4864fda9279dSmrg
4865fda9279dSmrg    *)
4866fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4867fda9279dSmrg      ;;
4868fda9279dSmrg    esac
4869fda9279dSmrg  fi
4870fda9279dSmrg])
4871fda9279dSmrgcase $host_os in
487216ee1e9aSmrg  # For platforms that do not support PIC, -DPIC is meaningless:
4873fda9279dSmrg  *djgpp*)
4874fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4875fda9279dSmrg    ;;
4876fda9279dSmrg  *)
4877fda9279dSmrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4878fda9279dSmrg    ;;
4879fda9279dSmrgesac
4880fda9279dSmrg
4881fda9279dSmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4882fda9279dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4883fda9279dSmrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4884fda9279dSmrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4885fda9279dSmrg
4886fda9279dSmrg#
4887fda9279dSmrg# Check to make sure the PIC flag actually works.
4888fda9279dSmrg#
4889fda9279dSmrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4890fda9279dSmrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4891fda9279dSmrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4892fda9279dSmrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4893fda9279dSmrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4894fda9279dSmrg     "" | " "*) ;;
4895fda9279dSmrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4896fda9279dSmrg     esac],
4897fda9279dSmrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4898fda9279dSmrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
4899fda9279dSmrgfi
4900fda9279dSmrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4901fda9279dSmrg	[Additional compiler flags for building library objects])
4902fda9279dSmrg
4903fda9279dSmrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4904fda9279dSmrg	[How to pass a linker flag through the compiler])
4905fda9279dSmrg#
4906fda9279dSmrg# Check to make sure the static flag actually works.
4907fda9279dSmrg#
4908fda9279dSmrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4909fda9279dSmrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4910fda9279dSmrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4911fda9279dSmrg  $lt_tmp_static_flag,
4912fda9279dSmrg  [],
4913fda9279dSmrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4914fda9279dSmrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4915fda9279dSmrg	[Compiler flag to prevent dynamic linking])
4916fda9279dSmrg])# _LT_COMPILER_PIC
4917fda9279dSmrg
4918fda9279dSmrg
4919fda9279dSmrg# _LT_LINKER_SHLIBS([TAGNAME])
4920fda9279dSmrg# ----------------------------
4921fda9279dSmrg# See if the linker supports building shared libraries.
4922fda9279dSmrgm4_defun([_LT_LINKER_SHLIBS],
4923fda9279dSmrg[AC_REQUIRE([LT_PATH_LD])dnl
4924fda9279dSmrgAC_REQUIRE([LT_PATH_NM])dnl
4925fda9279dSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4926fda9279dSmrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4927fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
4928fda9279dSmrgm4_require([_LT_DECL_SED])dnl
4929fda9279dSmrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4930fda9279dSmrgm4_require([_LT_TAG_COMPILER])dnl
4931fda9279dSmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4932fda9279dSmrgm4_if([$1], [CXX], [
4933fda9279dSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4934fda9279dSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4935fda9279dSmrg  case $host_os in
4936fda9279dSmrg  aix[[4-9]]*)
4937fda9279dSmrg    # If we're using GNU nm, then we don't want the "-C" option.
493816ee1e9aSmrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
493916ee1e9aSmrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
494016ee1e9aSmrg    # weak defined symbols like other global defined symbols, whereas
494116ee1e9aSmrg    # GNU nm marks them as "W".
494216ee1e9aSmrg    # While the 'weak' keyword is ignored in the Export File, we need
494316ee1e9aSmrg    # it in the Import File for the 'aix-soname' feature, so we have
494416ee1e9aSmrg    # to replace the "-B" option with "-P" for AIX nm.
4945fda9279dSmrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
494616ee1e9aSmrg      _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'
4947fda9279dSmrg    else
494816ee1e9aSmrg      _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'
4949fda9279dSmrg    fi
4950fda9279dSmrg    ;;
4951fda9279dSmrg  pw32*)
495216ee1e9aSmrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
4953fda9279dSmrg    ;;
4954fda9279dSmrg  cygwin* | mingw* | cegcc*)
4955fda9279dSmrg    case $cc_basename in
4956fda9279dSmrg    cl*)
4957fda9279dSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4958fda9279dSmrg      ;;
4959fda9279dSmrg    *)
4960fda9279dSmrg      _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'
4961fda9279dSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4962fda9279dSmrg      ;;
4963fda9279dSmrg    esac
4964fda9279dSmrg    ;;
4965c2e4ac43Smrg  linux* | k*bsd*-gnu | gnu*)
4966c2e4ac43Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
4967c2e4ac43Smrg    ;;
4968fda9279dSmrg  *)
4969fda9279dSmrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4970fda9279dSmrg    ;;
4971fda9279dSmrg  esac
4972fda9279dSmrg], [
4973fda9279dSmrg  runpath_var=
4974fda9279dSmrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4975fda9279dSmrg  _LT_TAGVAR(always_export_symbols, $1)=no
4976fda9279dSmrg  _LT_TAGVAR(archive_cmds, $1)=
4977fda9279dSmrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4978fda9279dSmrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4979fda9279dSmrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4980fda9279dSmrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4981fda9279dSmrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4982fda9279dSmrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4983fda9279dSmrg  _LT_TAGVAR(hardcode_direct, $1)=no
4984fda9279dSmrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4985fda9279dSmrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4986fda9279dSmrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4987fda9279dSmrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4988fda9279dSmrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4989fda9279dSmrg  _LT_TAGVAR(inherit_rpath, $1)=no
4990fda9279dSmrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4991fda9279dSmrg  _LT_TAGVAR(module_cmds, $1)=
4992fda9279dSmrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4993fda9279dSmrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4994fda9279dSmrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4995fda9279dSmrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4996fda9279dSmrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4997fda9279dSmrg  # include_expsyms should be a list of space-separated symbols to be *always*
4998fda9279dSmrg  # included in the symbol list
4999fda9279dSmrg  _LT_TAGVAR(include_expsyms, $1)=
5000fda9279dSmrg  # exclude_expsyms can be an extended regexp of symbols to exclude
500116ee1e9aSmrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
500216ee1e9aSmrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
500316ee1e9aSmrg  # as well as any symbol that contains 'd'.
5004fda9279dSmrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
5005fda9279dSmrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
5006fda9279dSmrg  # platforms (ab)use it in PIC code, but their linkers get confused if
5007fda9279dSmrg  # the symbol is explicitly referenced.  Since portable code cannot
5008fda9279dSmrg  # rely on this symbol name, it's probably fine to never include it in
5009fda9279dSmrg  # preloaded symbol tables.
5010fda9279dSmrg  # Exclude shared library initialization/finalization symbols.
5011fda9279dSmrgdnl Note also adjust exclude_expsyms for C++ above.
5012fda9279dSmrg  extract_expsyms_cmds=
5013fda9279dSmrg
5014fda9279dSmrg  case $host_os in
5015fda9279dSmrg  cygwin* | mingw* | pw32* | cegcc*)
5016fda9279dSmrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
5017fda9279dSmrg    # When not using gcc, we currently assume that we are using
5018fda9279dSmrg    # Microsoft Visual C++.
501916ee1e9aSmrg    if test yes != "$GCC"; then
5020fda9279dSmrg      with_gnu_ld=no
5021fda9279dSmrg    fi
5022fda9279dSmrg    ;;
5023fda9279dSmrg  interix*)
5024fda9279dSmrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
5025fda9279dSmrg    with_gnu_ld=yes
5026fda9279dSmrg    ;;
502716ee1e9aSmrg  openbsd* | bitrig*)
5028fda9279dSmrg    with_gnu_ld=no
5029fda9279dSmrg    ;;
5030c2e4ac43Smrg  linux* | k*bsd*-gnu | gnu*)
5031c2e4ac43Smrg    _LT_TAGVAR(link_all_deplibs, $1)=no
5032c2e4ac43Smrg    ;;
5033fda9279dSmrg  esac
5034fda9279dSmrg
5035fda9279dSmrg  _LT_TAGVAR(ld_shlibs, $1)=yes
5036fda9279dSmrg
5037fda9279dSmrg  # On some targets, GNU ld is compatible enough with the native linker
5038fda9279dSmrg  # that we're better off using the native interface for both.
5039fda9279dSmrg  lt_use_gnu_ld_interface=no
504016ee1e9aSmrg  if test yes = "$with_gnu_ld"; then
5041fda9279dSmrg    case $host_os in
5042fda9279dSmrg      aix*)
5043fda9279dSmrg	# The AIX port of GNU ld has always aspired to compatibility
5044fda9279dSmrg	# with the native linker.  However, as the warning in the GNU ld
5045fda9279dSmrg	# block says, versions before 2.19.5* couldn't really create working
5046fda9279dSmrg	# shared libraries, regardless of the interface used.
5047fda9279dSmrg	case `$LD -v 2>&1` in
5048fda9279dSmrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
5049fda9279dSmrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
5050fda9279dSmrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
5051fda9279dSmrg	  *)
5052fda9279dSmrg	    lt_use_gnu_ld_interface=yes
5053fda9279dSmrg	    ;;
5054fda9279dSmrg	esac
5055fda9279dSmrg	;;
5056fda9279dSmrg      *)
5057fda9279dSmrg	lt_use_gnu_ld_interface=yes
5058fda9279dSmrg	;;
5059fda9279dSmrg    esac
5060fda9279dSmrg  fi
5061fda9279dSmrg
506216ee1e9aSmrg  if test yes = "$lt_use_gnu_ld_interface"; then
5063fda9279dSmrg    # If archive_cmds runs LD, not CC, wlarc should be empty
506416ee1e9aSmrg    wlarc='$wl'
5065fda9279dSmrg
5066fda9279dSmrg    # Set some defaults for GNU ld with shared library support. These
5067fda9279dSmrg    # are reset later if shared libraries are not supported. Putting them
5068fda9279dSmrg    # here allows them to be overridden if necessary.
5069fda9279dSmrg    runpath_var=LD_RUN_PATH
507016ee1e9aSmrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
507116ee1e9aSmrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
5072fda9279dSmrg    # ancient GNU ld didn't support --whole-archive et. al.
5073fda9279dSmrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
507416ee1e9aSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
5075fda9279dSmrg    else
5076fda9279dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5077fda9279dSmrg    fi
5078fda9279dSmrg    supports_anon_versioning=no
507916ee1e9aSmrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
5080fda9279dSmrg      *GNU\ gold*) supports_anon_versioning=yes ;;
5081fda9279dSmrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
5082fda9279dSmrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
5083fda9279dSmrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
5084fda9279dSmrg      *\ 2.11.*) ;; # other 2.11 versions
5085fda9279dSmrg      *) supports_anon_versioning=yes ;;
5086fda9279dSmrg    esac
5087fda9279dSmrg
5088fda9279dSmrg    # See if GNU ld supports shared libraries.
5089fda9279dSmrg    case $host_os in
5090fda9279dSmrg    aix[[3-9]]*)
5091fda9279dSmrg      # On AIX/PPC, the GNU linker is very broken
509216ee1e9aSmrg      if test ia64 != "$host_cpu"; then
5093fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5094fda9279dSmrg	cat <<_LT_EOF 1>&2
5095fda9279dSmrg
5096fda9279dSmrg*** Warning: the GNU linker, at least up to release 2.19, is reported
5097fda9279dSmrg*** to be unable to reliably create shared libraries on AIX.
5098fda9279dSmrg*** Therefore, libtool is disabling shared libraries support.  If you
5099fda9279dSmrg*** really care for shared libraries, you may want to install binutils
5100fda9279dSmrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
5101fda9279dSmrg*** You will then need to restart the configuration process.
5102fda9279dSmrg
5103fda9279dSmrg_LT_EOF
5104fda9279dSmrg      fi
5105fda9279dSmrg      ;;
5106fda9279dSmrg
5107fda9279dSmrg    amigaos*)
5108fda9279dSmrg      case $host_cpu in
5109fda9279dSmrg      powerpc)
5110fda9279dSmrg            # see comment about AmigaOS4 .so support
511116ee1e9aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5112fda9279dSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5113fda9279dSmrg        ;;
5114fda9279dSmrg      m68k)
5115fda9279dSmrg            _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)'
5116fda9279dSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5117fda9279dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5118fda9279dSmrg        ;;
5119fda9279dSmrg      esac
5120fda9279dSmrg      ;;
5121fda9279dSmrg
5122fda9279dSmrg    beos*)
5123fda9279dSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5124fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5125fda9279dSmrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
5126fda9279dSmrg	# support --undefined.  This deserves some investigation.  FIXME
512716ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5128fda9279dSmrg      else
5129fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5130fda9279dSmrg      fi
5131fda9279dSmrg      ;;
5132fda9279dSmrg
5133fda9279dSmrg    cygwin* | mingw* | pw32* | cegcc*)
5134fda9279dSmrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
5135fda9279dSmrg      # as there is no search path for DLLs.
5136fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
513716ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
5138fda9279dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5139fda9279dSmrg      _LT_TAGVAR(always_export_symbols, $1)=no
5140fda9279dSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5141fda9279dSmrg      _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'
5142fda9279dSmrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
5143fda9279dSmrg
5144fda9279dSmrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
514516ee1e9aSmrg        _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'
514616ee1e9aSmrg	# If the export-symbols file already is a .def file, use it as
514716ee1e9aSmrg	# is; otherwise, prepend EXPORTS...
514816ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
514916ee1e9aSmrg          cp $export_symbols $output_objdir/$soname.def;
515016ee1e9aSmrg        else
515116ee1e9aSmrg          echo EXPORTS > $output_objdir/$soname.def;
515216ee1e9aSmrg          cat $export_symbols >> $output_objdir/$soname.def;
515316ee1e9aSmrg        fi~
515416ee1e9aSmrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
5155fda9279dSmrg      else
5156fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5157fda9279dSmrg      fi
5158fda9279dSmrg      ;;
5159fda9279dSmrg
5160fda9279dSmrg    haiku*)
516116ee1e9aSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5162fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5163fda9279dSmrg      ;;
5164fda9279dSmrg
516516ee1e9aSmrg    os2*)
516616ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
516716ee1e9aSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
516816ee1e9aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
516916ee1e9aSmrg      shrext_cmds=.dll
517016ee1e9aSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
517116ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
517216ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
517316ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
517416ee1e9aSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
517516ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
517616ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
517716ee1e9aSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
517816ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
517916ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
518016ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
518116ee1e9aSmrg	prefix_cmds="$SED"~
518216ee1e9aSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
518316ee1e9aSmrg	  prefix_cmds="$prefix_cmds -e 1d";
518416ee1e9aSmrg	fi~
518516ee1e9aSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
518616ee1e9aSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
518716ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
518816ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
518916ee1e9aSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
519016ee1e9aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
519116ee1e9aSmrg      ;;
519216ee1e9aSmrg
5193fda9279dSmrg    interix[[3-9]]*)
5194fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=no
5195fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
519616ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
519716ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5198fda9279dSmrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
5199fda9279dSmrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
5200fda9279dSmrg      # default) and relocated if they conflict, which is a slow very memory
5201fda9279dSmrg      # consuming and fragmenting process.  To avoid this, we pick a random,
5202fda9279dSmrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
5203fda9279dSmrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
520416ee1e9aSmrg      _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'
520516ee1e9aSmrg      _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'
5206fda9279dSmrg      ;;
5207fda9279dSmrg
5208fda9279dSmrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
5209fda9279dSmrg      tmp_diet=no
521016ee1e9aSmrg      if test linux-dietlibc = "$host_os"; then
5211fda9279dSmrg	case $cc_basename in
5212fda9279dSmrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
5213fda9279dSmrg	esac
5214fda9279dSmrg      fi
5215fda9279dSmrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
521616ee1e9aSmrg	 && test no = "$tmp_diet"
5217fda9279dSmrg      then
5218fda9279dSmrg	tmp_addflag=' $pic_flag'
5219fda9279dSmrg	tmp_sharedflag='-shared'
5220fda9279dSmrg	case $cc_basename,$host_cpu in
5221fda9279dSmrg        pgcc*)				# Portland Group C compiler
522216ee1e9aSmrg	  _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'
5223fda9279dSmrg	  tmp_addflag=' $pic_flag'
5224fda9279dSmrg	  ;;
5225fda9279dSmrg	pgf77* | pgf90* | pgf95* | pgfortran*)
5226fda9279dSmrg					# Portland Group f77 and f90 compilers
522716ee1e9aSmrg	  _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'
5228fda9279dSmrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
5229fda9279dSmrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
5230fda9279dSmrg	  tmp_addflag=' -i_dynamic' ;;
5231fda9279dSmrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
5232fda9279dSmrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
5233fda9279dSmrg	ifc* | ifort*)			# Intel Fortran compiler
5234fda9279dSmrg	  tmp_addflag=' -nofor_main' ;;
5235fda9279dSmrg	lf95*)				# Lahey Fortran 8.1
5236fda9279dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
5237fda9279dSmrg	  tmp_sharedflag='--shared' ;;
523816ee1e9aSmrg        nagfor*)                        # NAGFOR 5.3
523916ee1e9aSmrg          tmp_sharedflag='-Wl,-shared' ;;
5240fda9279dSmrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
5241fda9279dSmrg	  tmp_sharedflag='-qmkshrobj'
5242fda9279dSmrg	  tmp_addflag= ;;
5243fda9279dSmrg	nvcc*)	# Cuda Compiler Driver 2.2
524416ee1e9aSmrg	  _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'
5245fda9279dSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5246fda9279dSmrg	  ;;
5247fda9279dSmrg	esac
5248fda9279dSmrg	case `$CC -V 2>&1 | sed 5q` in
5249fda9279dSmrg	*Sun\ C*)			# Sun C 5.9
525016ee1e9aSmrg	  _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'
5251fda9279dSmrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
5252fda9279dSmrg	  tmp_sharedflag='-G' ;;
5253fda9279dSmrg	*Sun\ F*)			# Sun Fortran 8.3
5254fda9279dSmrg	  tmp_sharedflag='-G' ;;
5255fda9279dSmrg	esac
525616ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5257fda9279dSmrg
525816ee1e9aSmrg        if test yes = "$supports_anon_versioning"; then
5259fda9279dSmrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
526016ee1e9aSmrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
526116ee1e9aSmrg            echo "local: *; };" >> $output_objdir/$libname.ver~
526216ee1e9aSmrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
5263fda9279dSmrg        fi
5264fda9279dSmrg
5265fda9279dSmrg	case $cc_basename in
526616ee1e9aSmrg	tcc*)
526716ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
526816ee1e9aSmrg	  ;;
5269fda9279dSmrg	xlf* | bgf* | bgxlf* | mpixlf*)
5270fda9279dSmrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
5271fda9279dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
527216ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5273fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
527416ee1e9aSmrg	  if test yes = "$supports_anon_versioning"; then
5275fda9279dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
527616ee1e9aSmrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
527716ee1e9aSmrg              echo "local: *; };" >> $output_objdir/$libname.ver~
527816ee1e9aSmrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
5279fda9279dSmrg	  fi
5280fda9279dSmrg	  ;;
5281fda9279dSmrg	esac
5282fda9279dSmrg      else
5283fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
5284fda9279dSmrg      fi
5285fda9279dSmrg      ;;
5286fda9279dSmrg
5287c2e4ac43Smrg    netbsd* | netbsdelf*-gnu)
5288fda9279dSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5289fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
5290fda9279dSmrg	wlarc=
5291fda9279dSmrg      else
529216ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
529316ee1e9aSmrg	_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'
5294fda9279dSmrg      fi
5295fda9279dSmrg      ;;
5296fda9279dSmrg
5297fda9279dSmrg    solaris*)
5298fda9279dSmrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
5299fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5300fda9279dSmrg	cat <<_LT_EOF 1>&2
5301fda9279dSmrg
5302fda9279dSmrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
5303fda9279dSmrg*** create shared libraries on Solaris systems.  Therefore, libtool
5304fda9279dSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5305fda9279dSmrg*** binutils to release 2.9.1 or newer.  Another option is to modify
5306fda9279dSmrg*** your PATH or compiler configuration so that the native linker is
5307fda9279dSmrg*** used, and then restart.
5308fda9279dSmrg
5309fda9279dSmrg_LT_EOF
5310fda9279dSmrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
531116ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
531216ee1e9aSmrg	_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'
5313fda9279dSmrg      else
5314fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5315fda9279dSmrg      fi
5316fda9279dSmrg      ;;
5317fda9279dSmrg
5318fda9279dSmrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
5319fda9279dSmrg      case `$LD -v 2>&1` in
5320fda9279dSmrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
5321fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5322fda9279dSmrg	cat <<_LT_EOF 1>&2
5323fda9279dSmrg
532416ee1e9aSmrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
5325fda9279dSmrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
5326fda9279dSmrg*** is disabling shared libraries support.  We urge you to upgrade GNU
5327fda9279dSmrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
5328fda9279dSmrg*** your PATH or compiler configuration so that the native linker is
5329fda9279dSmrg*** used, and then restart.
5330fda9279dSmrg
5331fda9279dSmrg_LT_EOF
5332fda9279dSmrg	;;
5333fda9279dSmrg	*)
5334fda9279dSmrg	  # For security reasons, it is highly recommended that you always
5335fda9279dSmrg	  # use absolute paths for naming shared libraries, and exclude the
5336fda9279dSmrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
5337fda9279dSmrg	  # requires that you compile everything twice, which is a pain.
5338fda9279dSmrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
533916ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
534016ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
534116ee1e9aSmrg	    _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'
5342fda9279dSmrg	  else
5343fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
5344fda9279dSmrg	  fi
5345fda9279dSmrg	;;
5346fda9279dSmrg      esac
5347fda9279dSmrg      ;;
5348fda9279dSmrg
5349fda9279dSmrg    sunos4*)
5350fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5351fda9279dSmrg      wlarc=
5352fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5353fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5354fda9279dSmrg      ;;
5355fda9279dSmrg
5356fda9279dSmrg    *)
5357fda9279dSmrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
535816ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
535916ee1e9aSmrg	_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'
5360fda9279dSmrg      else
5361fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5362fda9279dSmrg      fi
5363fda9279dSmrg      ;;
5364fda9279dSmrg    esac
5365fda9279dSmrg
536616ee1e9aSmrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
5367fda9279dSmrg      runpath_var=
5368fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5369fda9279dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
5370fda9279dSmrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
5371fda9279dSmrg    fi
5372fda9279dSmrg  else
5373fda9279dSmrg    # PORTME fill in a description of your system's linker (not GNU ld)
5374fda9279dSmrg    case $host_os in
5375fda9279dSmrg    aix3*)
5376fda9279dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5377fda9279dSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5378fda9279dSmrg      _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'
5379fda9279dSmrg      # Note: this linker hardcodes the directories in LIBPATH if there
5380fda9279dSmrg      # are no directories specified by -L.
5381fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
538216ee1e9aSmrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
5383fda9279dSmrg	# Neither direct hardcoding nor static linking is supported with a
5384fda9279dSmrg	# broken collect2.
5385fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
5386fda9279dSmrg      fi
5387fda9279dSmrg      ;;
5388fda9279dSmrg
5389fda9279dSmrg    aix[[4-9]]*)
539016ee1e9aSmrg      if test ia64 = "$host_cpu"; then
5391fda9279dSmrg	# On IA64, the linker does run time linking by default, so we don't
5392fda9279dSmrg	# have to do anything special.
5393fda9279dSmrg	aix_use_runtimelinking=no
5394fda9279dSmrg	exp_sym_flag='-Bexport'
539516ee1e9aSmrg	no_entry_flag=
5396fda9279dSmrg      else
5397fda9279dSmrg	# If we're using GNU nm, then we don't want the "-C" option.
539816ee1e9aSmrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
539916ee1e9aSmrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
540016ee1e9aSmrg	# weak defined symbols like other global defined symbols, whereas
540116ee1e9aSmrg	# GNU nm marks them as "W".
540216ee1e9aSmrg	# While the 'weak' keyword is ignored in the Export File, we need
540316ee1e9aSmrg	# it in the Import File for the 'aix-soname' feature, so we have
540416ee1e9aSmrg	# to replace the "-B" option with "-P" for AIX nm.
5405fda9279dSmrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
540616ee1e9aSmrg	  _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'
5407fda9279dSmrg	else
540816ee1e9aSmrg	  _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'
5409fda9279dSmrg	fi
5410fda9279dSmrg	aix_use_runtimelinking=no
5411fda9279dSmrg
5412fda9279dSmrg	# Test if we are trying to use run time linking or normal
5413fda9279dSmrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
541416ee1e9aSmrg	# have runtime linking enabled, and use it for executables.
541516ee1e9aSmrg	# For shared libraries, we enable/disable runtime linking
541616ee1e9aSmrg	# depending on the kind of the shared library created -
541716ee1e9aSmrg	# when "with_aix_soname,aix_use_runtimelinking" is:
541816ee1e9aSmrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
541916ee1e9aSmrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
542016ee1e9aSmrg	#            lib.a           static archive
542116ee1e9aSmrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
542216ee1e9aSmrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
542316ee1e9aSmrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
542416ee1e9aSmrg	#            lib.a(lib.so.V) shared, rtl:no
542516ee1e9aSmrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
542616ee1e9aSmrg	#            lib.a           static archive
5427fda9279dSmrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5428fda9279dSmrg	  for ld_flag in $LDFLAGS; do
542916ee1e9aSmrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
5430fda9279dSmrg	    aix_use_runtimelinking=yes
5431fda9279dSmrg	    break
5432fda9279dSmrg	  fi
5433fda9279dSmrg	  done
543416ee1e9aSmrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
543516ee1e9aSmrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
543616ee1e9aSmrg	    # so we don't have lib.a shared libs to link our executables.
543716ee1e9aSmrg	    # We have to force runtime linking in this case.
543816ee1e9aSmrg	    aix_use_runtimelinking=yes
543916ee1e9aSmrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
544016ee1e9aSmrg	  fi
5441fda9279dSmrg	  ;;
5442fda9279dSmrg	esac
5443fda9279dSmrg
5444fda9279dSmrg	exp_sym_flag='-bexport'
5445fda9279dSmrg	no_entry_flag='-bnoentry'
5446fda9279dSmrg      fi
5447fda9279dSmrg
5448fda9279dSmrg      # When large executables or shared objects are built, AIX ld can
5449fda9279dSmrg      # have problems creating the table of contents.  If linking a library
5450fda9279dSmrg      # or program results in "error TOC overflow" add -mminimal-toc to
5451fda9279dSmrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5452fda9279dSmrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
5453fda9279dSmrg
5454fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)=''
5455fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5456fda9279dSmrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5457fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5458fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
545916ee1e9aSmrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
546016ee1e9aSmrg      case $with_aix_soname,$aix_use_runtimelinking in
546116ee1e9aSmrg      aix,*) ;; # traditional, no import file
546216ee1e9aSmrg      svr4,* | *,yes) # use import file
546316ee1e9aSmrg	# The Import File defines what to hardcode.
546416ee1e9aSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
546516ee1e9aSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
546616ee1e9aSmrg	;;
546716ee1e9aSmrg      esac
5468fda9279dSmrg
546916ee1e9aSmrg      if test yes = "$GCC"; then
5470fda9279dSmrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5471fda9279dSmrg	# We only want to do this on AIX 4.2 and lower, the check
5472fda9279dSmrg	# below for broken collect2 doesn't work under 4.3+
547316ee1e9aSmrg	  collect2name=`$CC -print-prog-name=collect2`
5474fda9279dSmrg	  if test -f "$collect2name" &&
5475fda9279dSmrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5476fda9279dSmrg	  then
5477fda9279dSmrg	  # We have reworked collect2
5478fda9279dSmrg	  :
5479fda9279dSmrg	  else
5480fda9279dSmrg	  # We have old collect2
5481fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5482fda9279dSmrg	  # It fails to find uninstalled libraries when the uninstalled
5483fda9279dSmrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5484fda9279dSmrg	  # to unsupported forces relinking
5485fda9279dSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5486fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5487fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5488fda9279dSmrg	  fi
5489fda9279dSmrg	  ;;
5490fda9279dSmrg	esac
5491fda9279dSmrg	shared_flag='-shared'
549216ee1e9aSmrg	if test yes = "$aix_use_runtimelinking"; then
549316ee1e9aSmrg	  shared_flag="$shared_flag "'$wl-G'
5494fda9279dSmrg	fi
549516ee1e9aSmrg	# Need to ensure runtime linking is disabled for the traditional
549616ee1e9aSmrg	# shared library, or the linker may eventually find shared libraries
549716ee1e9aSmrg	# /with/ Import File - we do not want to mix them.
549816ee1e9aSmrg	shared_flag_aix='-shared'
549916ee1e9aSmrg	shared_flag_svr4='-shared $wl-G'
5500fda9279dSmrg      else
5501fda9279dSmrg	# not using gcc
550216ee1e9aSmrg	if test ia64 = "$host_cpu"; then
5503fda9279dSmrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5504fda9279dSmrg	# chokes on -Wl,-G. The following line is correct:
5505fda9279dSmrg	  shared_flag='-G'
5506fda9279dSmrg	else
550716ee1e9aSmrg	  if test yes = "$aix_use_runtimelinking"; then
550816ee1e9aSmrg	    shared_flag='$wl-G'
5509fda9279dSmrg	  else
551016ee1e9aSmrg	    shared_flag='$wl-bM:SRE'
5511fda9279dSmrg	  fi
551216ee1e9aSmrg	  shared_flag_aix='$wl-bM:SRE'
551316ee1e9aSmrg	  shared_flag_svr4='$wl-G'
5514fda9279dSmrg	fi
5515fda9279dSmrg      fi
5516fda9279dSmrg
551716ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
5518fda9279dSmrg      # It seems that -bexpall does not export symbols beginning with
5519fda9279dSmrg      # underscore (_), so it is better to generate a list of symbols to export.
5520fda9279dSmrg      _LT_TAGVAR(always_export_symbols, $1)=yes
552116ee1e9aSmrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
5522fda9279dSmrg	# Warning - without using the other runtime loading flags (-brtl),
5523fda9279dSmrg	# -berok will link without error, but may produce a broken library.
5524fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5525fda9279dSmrg        # Determine the default libpath from the value encoded in an
5526fda9279dSmrg        # empty executable.
5527fda9279dSmrg        _LT_SYS_MODULE_PATH_AIX([$1])
552816ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
552916ee1e9aSmrg        _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
5530fda9279dSmrg      else
553116ee1e9aSmrg	if test ia64 = "$host_cpu"; then
553216ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
5533fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
553416ee1e9aSmrg	  _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"
5535fda9279dSmrg	else
5536fda9279dSmrg	 # Determine the default libpath from the value encoded in an
5537fda9279dSmrg	 # empty executable.
5538fda9279dSmrg	 _LT_SYS_MODULE_PATH_AIX([$1])
553916ee1e9aSmrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5540fda9279dSmrg	  # Warning - without using the other run time loading flags,
5541fda9279dSmrg	  # -berok will link without error, but may produce a broken library.
554216ee1e9aSmrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
554316ee1e9aSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
554416ee1e9aSmrg	  if test yes = "$with_gnu_ld"; then
5545fda9279dSmrg	    # We only use this code for GNU lds that support --whole-archive.
554616ee1e9aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
5547fda9279dSmrg	  else
5548fda9279dSmrg	    # Exported symbols can be pulled into shared objects from archives
5549fda9279dSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5550fda9279dSmrg	  fi
5551fda9279dSmrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
555216ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
555316ee1e9aSmrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
555416ee1e9aSmrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
555516ee1e9aSmrg	  if test svr4 != "$with_aix_soname"; then
555616ee1e9aSmrg	    # This is similar to how AIX traditionally builds its shared libraries.
555716ee1e9aSmrg	    _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'
555816ee1e9aSmrg	  fi
555916ee1e9aSmrg	  if test aix != "$with_aix_soname"; then
556016ee1e9aSmrg	    _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'
556116ee1e9aSmrg	  else
556216ee1e9aSmrg	    # used by -dlpreopen to get the symbols
556316ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
556416ee1e9aSmrg	  fi
556516ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
5566fda9279dSmrg	fi
5567fda9279dSmrg      fi
5568fda9279dSmrg      ;;
5569fda9279dSmrg
5570fda9279dSmrg    amigaos*)
5571fda9279dSmrg      case $host_cpu in
5572fda9279dSmrg      powerpc)
5573fda9279dSmrg            # see comment about AmigaOS4 .so support
557416ee1e9aSmrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5575fda9279dSmrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5576fda9279dSmrg        ;;
5577fda9279dSmrg      m68k)
5578fda9279dSmrg            _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)'
5579fda9279dSmrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5580fda9279dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5581fda9279dSmrg        ;;
5582fda9279dSmrg      esac
5583fda9279dSmrg      ;;
5584fda9279dSmrg
5585fda9279dSmrg    bsdi[[45]]*)
5586fda9279dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5587fda9279dSmrg      ;;
5588fda9279dSmrg
5589fda9279dSmrg    cygwin* | mingw* | pw32* | cegcc*)
5590fda9279dSmrg      # When not using gcc, we currently assume that we are using
5591fda9279dSmrg      # Microsoft Visual C++.
5592fda9279dSmrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5593fda9279dSmrg      # no search path for DLLs.
5594fda9279dSmrg      case $cc_basename in
5595fda9279dSmrg      cl*)
5596fda9279dSmrg	# Native MSVC
5597fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5598fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5599fda9279dSmrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5600fda9279dSmrg	_LT_TAGVAR(file_list_spec, $1)='@'
5601fda9279dSmrg	# Tell ltmain to make .lib files, not .a files.
5602fda9279dSmrg	libext=lib
5603fda9279dSmrg	# Tell ltmain to make .dll files, not .so files.
560416ee1e9aSmrg	shrext_cmds=.dll
5605fda9279dSmrg	# FIXME: Setting linknames here is a bad hack.
560616ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
560716ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
560816ee1e9aSmrg            cp "$export_symbols" "$output_objdir/$soname.def";
560916ee1e9aSmrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
561016ee1e9aSmrg          else
561116ee1e9aSmrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
561216ee1e9aSmrg          fi~
561316ee1e9aSmrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
561416ee1e9aSmrg          linknames='
5615fda9279dSmrg	# The linker will not automatically build a static lib if we build a DLL.
5616fda9279dSmrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5617fda9279dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5618fda9279dSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5619fda9279dSmrg	_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'
5620fda9279dSmrg	# Don't use ranlib
5621fda9279dSmrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5622fda9279dSmrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
562316ee1e9aSmrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
562416ee1e9aSmrg          case $lt_outputfile in
562516ee1e9aSmrg            *.exe|*.EXE) ;;
562616ee1e9aSmrg            *)
562716ee1e9aSmrg              lt_outputfile=$lt_outputfile.exe
562816ee1e9aSmrg              lt_tool_outputfile=$lt_tool_outputfile.exe
562916ee1e9aSmrg              ;;
563016ee1e9aSmrg          esac~
563116ee1e9aSmrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
563216ee1e9aSmrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
563316ee1e9aSmrg            $RM "$lt_outputfile.manifest";
563416ee1e9aSmrg          fi'
5635fda9279dSmrg	;;
5636fda9279dSmrg      *)
5637fda9279dSmrg	# Assume MSVC wrapper
5638fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5639fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5640fda9279dSmrg	# Tell ltmain to make .lib files, not .a files.
5641fda9279dSmrg	libext=lib
5642fda9279dSmrg	# Tell ltmain to make .dll files, not .so files.
564316ee1e9aSmrg	shrext_cmds=.dll
5644fda9279dSmrg	# FIXME: Setting linknames here is a bad hack.
5645fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5646fda9279dSmrg	# The linker will automatically build a .lib file if we build a DLL.
5647fda9279dSmrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5648fda9279dSmrg	# FIXME: Should let the user specify the lib program.
5649fda9279dSmrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5650fda9279dSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5651fda9279dSmrg	;;
5652fda9279dSmrg      esac
5653fda9279dSmrg      ;;
5654fda9279dSmrg
5655fda9279dSmrg    darwin* | rhapsody*)
5656fda9279dSmrg      _LT_DARWIN_LINKER_FEATURES($1)
5657fda9279dSmrg      ;;
5658fda9279dSmrg
5659fda9279dSmrg    dgux*)
5660fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5661fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5662fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5663fda9279dSmrg      ;;
5664fda9279dSmrg
5665fda9279dSmrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5666fda9279dSmrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5667fda9279dSmrg    # does not break anything, and helps significantly (at the cost of a little
5668fda9279dSmrg    # extra space).
5669fda9279dSmrg    freebsd2.2*)
5670fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5671fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5672fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5673fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5674fda9279dSmrg      ;;
5675fda9279dSmrg
5676fda9279dSmrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5677fda9279dSmrg    freebsd2.*)
5678fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5679fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5680fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5681fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5682fda9279dSmrg      ;;
5683fda9279dSmrg
5684fda9279dSmrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5685fda9279dSmrg    freebsd* | dragonfly*)
5686fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5687fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5688fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5689fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5690fda9279dSmrg      ;;
5691fda9279dSmrg
5692fda9279dSmrg    hpux9*)
569316ee1e9aSmrg      if test yes = "$GCC"; then
569416ee1e9aSmrg	_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'
5695fda9279dSmrg      else
569616ee1e9aSmrg	_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'
5697fda9279dSmrg      fi
569816ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5699fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5700fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5701fda9279dSmrg
5702fda9279dSmrg      # hardcode_minus_L: Not really in the search PATH,
5703fda9279dSmrg      # but as the default location of the library.
5704fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
570516ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5706fda9279dSmrg      ;;
5707fda9279dSmrg
5708fda9279dSmrg    hpux10*)
570916ee1e9aSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
571016ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5711fda9279dSmrg      else
5712fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5713fda9279dSmrg      fi
571416ee1e9aSmrg      if test no = "$with_gnu_ld"; then
571516ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5716fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5717fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5718fda9279dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
571916ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5720fda9279dSmrg	# hardcode_minus_L: Not really in the search PATH,
5721fda9279dSmrg	# but as the default location of the library.
5722fda9279dSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5723fda9279dSmrg      fi
5724fda9279dSmrg      ;;
5725fda9279dSmrg
5726fda9279dSmrg    hpux11*)
572716ee1e9aSmrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5728fda9279dSmrg	case $host_cpu in
5729fda9279dSmrg	hppa*64*)
573016ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5731fda9279dSmrg	  ;;
5732fda9279dSmrg	ia64*)
573316ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5734fda9279dSmrg	  ;;
5735fda9279dSmrg	*)
573616ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5737fda9279dSmrg	  ;;
5738fda9279dSmrg	esac
5739fda9279dSmrg      else
5740fda9279dSmrg	case $host_cpu in
5741fda9279dSmrg	hppa*64*)
574216ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5743fda9279dSmrg	  ;;
5744fda9279dSmrg	ia64*)
574516ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5746fda9279dSmrg	  ;;
5747fda9279dSmrg	*)
5748fda9279dSmrg	m4_if($1, [], [
5749fda9279dSmrg	  # Older versions of the 11.00 compiler do not understand -b yet
5750fda9279dSmrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5751fda9279dSmrg	  _LT_LINKER_OPTION([if $CC understands -b],
5752fda9279dSmrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
575316ee1e9aSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5754fda9279dSmrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
575516ee1e9aSmrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5756fda9279dSmrg	  ;;
5757fda9279dSmrg	esac
5758fda9279dSmrg      fi
575916ee1e9aSmrg      if test no = "$with_gnu_ld"; then
576016ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
5761fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5762fda9279dSmrg
5763fda9279dSmrg	case $host_cpu in
5764fda9279dSmrg	hppa*64*|ia64*)
5765fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5766fda9279dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5767fda9279dSmrg	  ;;
5768fda9279dSmrg	*)
5769fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5770fda9279dSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
577116ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5772fda9279dSmrg
5773fda9279dSmrg	  # hardcode_minus_L: Not really in the search PATH,
5774fda9279dSmrg	  # but as the default location of the library.
5775fda9279dSmrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5776fda9279dSmrg	  ;;
5777fda9279dSmrg	esac
5778fda9279dSmrg      fi
5779fda9279dSmrg      ;;
5780fda9279dSmrg
5781fda9279dSmrg    irix5* | irix6* | nonstopux*)
578216ee1e9aSmrg      if test yes = "$GCC"; then
578316ee1e9aSmrg	_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'
5784fda9279dSmrg	# Try to use the -exported_symbol ld option, if it does not
5785fda9279dSmrg	# work, assume that -exports_file does not work either and
5786fda9279dSmrg	# implicitly export all symbols.
5787fda9279dSmrg	# This should be the same for all languages, so no per-tag cache variable.
5788fda9279dSmrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5789fda9279dSmrg	  [lt_cv_irix_exported_symbol],
579016ee1e9aSmrg	  [save_LDFLAGS=$LDFLAGS
579116ee1e9aSmrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
5792fda9279dSmrg	   AC_LINK_IFELSE(
5793fda9279dSmrg	     [AC_LANG_SOURCE(
5794fda9279dSmrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5795fda9279dSmrg			      [C++], [[int foo (void) { return 0; }]],
5796fda9279dSmrg			      [Fortran 77], [[
5797fda9279dSmrg      subroutine foo
5798fda9279dSmrg      end]],
5799fda9279dSmrg			      [Fortran], [[
5800fda9279dSmrg      subroutine foo
5801fda9279dSmrg      end]])])],
5802fda9279dSmrg	      [lt_cv_irix_exported_symbol=yes],
5803fda9279dSmrg	      [lt_cv_irix_exported_symbol=no])
580416ee1e9aSmrg           LDFLAGS=$save_LDFLAGS])
580516ee1e9aSmrg	if test yes = "$lt_cv_irix_exported_symbol"; then
580616ee1e9aSmrg          _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'
5807fda9279dSmrg	fi
5808c2e4ac43Smrg	_LT_TAGVAR(link_all_deplibs, $1)=no
5809fda9279dSmrg      else
581016ee1e9aSmrg	_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'
581116ee1e9aSmrg	_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'
5812fda9279dSmrg      fi
5813fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
581416ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5815fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5816fda9279dSmrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5817fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5818fda9279dSmrg      ;;
5819fda9279dSmrg
582016ee1e9aSmrg    linux*)
582116ee1e9aSmrg      case $cc_basename in
582216ee1e9aSmrg      tcc*)
582316ee1e9aSmrg	# Fabrice Bellard et al's Tiny C Compiler
582416ee1e9aSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
582516ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
582616ee1e9aSmrg	;;
582716ee1e9aSmrg      esac
582816ee1e9aSmrg      ;;
582916ee1e9aSmrg
5830c2e4ac43Smrg    netbsd* | netbsdelf*-gnu)
5831fda9279dSmrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5832fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5833fda9279dSmrg      else
5834fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5835fda9279dSmrg      fi
5836fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5837fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5838fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5839fda9279dSmrg      ;;
5840fda9279dSmrg
5841fda9279dSmrg    newsos6)
5842fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5843fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
584416ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5845fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5846fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5847fda9279dSmrg      ;;
5848fda9279dSmrg
5849fda9279dSmrg    *nto* | *qnx*)
5850fda9279dSmrg      ;;
5851fda9279dSmrg
585216ee1e9aSmrg    openbsd* | bitrig*)
5853fda9279dSmrg      if test -f /usr/libexec/ld.so; then
5854fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5855fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5856fda9279dSmrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
585716ee1e9aSmrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
5858fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
585916ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
586016ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
586116ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
5862fda9279dSmrg	else
586316ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
586416ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5865fda9279dSmrg	fi
5866fda9279dSmrg      else
5867fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
5868fda9279dSmrg      fi
5869fda9279dSmrg      ;;
5870fda9279dSmrg
5871fda9279dSmrg    os2*)
5872fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5873fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5874fda9279dSmrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
587516ee1e9aSmrg      shrext_cmds=.dll
587616ee1e9aSmrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
587716ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
587816ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
587916ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
588016ee1e9aSmrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
588116ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
588216ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
588316ee1e9aSmrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
588416ee1e9aSmrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
588516ee1e9aSmrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
588616ee1e9aSmrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
588716ee1e9aSmrg	prefix_cmds="$SED"~
588816ee1e9aSmrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
588916ee1e9aSmrg	  prefix_cmds="$prefix_cmds -e 1d";
589016ee1e9aSmrg	fi~
589116ee1e9aSmrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
589216ee1e9aSmrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
589316ee1e9aSmrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
589416ee1e9aSmrg	emximp -o $lib $output_objdir/$libname.def'
589516ee1e9aSmrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
589616ee1e9aSmrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5897fda9279dSmrg      ;;
5898fda9279dSmrg
5899fda9279dSmrg    osf3*)
590016ee1e9aSmrg      if test yes = "$GCC"; then
590116ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
590216ee1e9aSmrg	_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'
5903fda9279dSmrg      else
5904fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
590516ee1e9aSmrg	_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'
5906fda9279dSmrg      fi
5907fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
590816ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5909fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5910fda9279dSmrg      ;;
5911fda9279dSmrg
5912fda9279dSmrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
591316ee1e9aSmrg      if test yes = "$GCC"; then
591416ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
591516ee1e9aSmrg	_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'
591616ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5917fda9279dSmrg      else
5918fda9279dSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
591916ee1e9aSmrg	_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'
5920fda9279dSmrg	_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~
592116ee1e9aSmrg          $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'
5922fda9279dSmrg
5923fda9279dSmrg	# Both c and cxx compiler support -rpath directly
5924fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5925fda9279dSmrg      fi
5926fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5927fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5928fda9279dSmrg      ;;
5929fda9279dSmrg
5930fda9279dSmrg    solaris*)
5931fda9279dSmrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
593216ee1e9aSmrg      if test yes = "$GCC"; then
593316ee1e9aSmrg	wlarc='$wl'
593416ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
5935fda9279dSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
593616ee1e9aSmrg          $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'
5937fda9279dSmrg      else
5938fda9279dSmrg	case `$CC -V 2>&1` in
5939fda9279dSmrg	*"Compilers 5.0"*)
5940fda9279dSmrg	  wlarc=''
594116ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
5942fda9279dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
594316ee1e9aSmrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5944fda9279dSmrg	  ;;
5945fda9279dSmrg	*)
594616ee1e9aSmrg	  wlarc='$wl'
594716ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5948fda9279dSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
594916ee1e9aSmrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5950fda9279dSmrg	  ;;
5951fda9279dSmrg	esac
5952fda9279dSmrg      fi
5953fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5954fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5955fda9279dSmrg      case $host_os in
5956fda9279dSmrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5957fda9279dSmrg      *)
5958fda9279dSmrg	# The compiler driver will combine and reorder linker options,
595916ee1e9aSmrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
5960fda9279dSmrg	# but is careful enough not to reorder.
5961fda9279dSmrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
596216ee1e9aSmrg	if test yes = "$GCC"; then
596316ee1e9aSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
5964fda9279dSmrg	else
5965fda9279dSmrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5966fda9279dSmrg	fi
5967fda9279dSmrg	;;
5968fda9279dSmrg      esac
5969fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5970fda9279dSmrg      ;;
5971fda9279dSmrg
5972fda9279dSmrg    sunos4*)
597316ee1e9aSmrg      if test sequent = "$host_vendor"; then
5974fda9279dSmrg	# Use $CC to link under sequent, because it throws in some extra .o
5975fda9279dSmrg	# files that make .init and .fini sections work.
597616ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5977fda9279dSmrg      else
5978fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5979fda9279dSmrg      fi
5980fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5981fda9279dSmrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5982fda9279dSmrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5983fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5984fda9279dSmrg      ;;
5985fda9279dSmrg
5986fda9279dSmrg    sysv4)
5987fda9279dSmrg      case $host_vendor in
5988fda9279dSmrg	sni)
5989fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5990fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5991fda9279dSmrg	;;
5992fda9279dSmrg	siemens)
5993fda9279dSmrg	  ## LD is ld it makes a PLAMLIB
5994fda9279dSmrg	  ## CC just makes a GrossModule.
5995fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5996fda9279dSmrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5997fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5998fda9279dSmrg        ;;
5999fda9279dSmrg	motorola)
6000fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6001fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
6002fda9279dSmrg	;;
6003fda9279dSmrg      esac
6004fda9279dSmrg      runpath_var='LD_RUN_PATH'
6005fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6006fda9279dSmrg      ;;
6007fda9279dSmrg
6008fda9279dSmrg    sysv4.3*)
6009fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6010fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6011fda9279dSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
6012fda9279dSmrg      ;;
6013fda9279dSmrg
6014fda9279dSmrg    sysv4*MP*)
6015fda9279dSmrg      if test -d /usr/nec; then
6016fda9279dSmrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6017fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6018fda9279dSmrg	runpath_var=LD_RUN_PATH
6019fda9279dSmrg	hardcode_runpath_var=yes
6020fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=yes
6021fda9279dSmrg      fi
6022fda9279dSmrg      ;;
6023fda9279dSmrg
6024fda9279dSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
602516ee1e9aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6026fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6027fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6028fda9279dSmrg      runpath_var='LD_RUN_PATH'
6029fda9279dSmrg
603016ee1e9aSmrg      if test yes = "$GCC"; then
603116ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
603216ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6033fda9279dSmrg      else
603416ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
603516ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6036fda9279dSmrg      fi
6037fda9279dSmrg      ;;
6038fda9279dSmrg
6039fda9279dSmrg    sysv5* | sco3.2v5* | sco5v6*)
604016ee1e9aSmrg      # Note: We CANNOT use -z defs as we might desire, because we do not
6041fda9279dSmrg      # link with -lc, and that would cause any symbols used from libc to
6042fda9279dSmrg      # always be unresolved, which means just about no library would
6043fda9279dSmrg      # ever link correctly.  If we're not using GNU ld we use -z text
6044fda9279dSmrg      # though, which does catch some bad symbols but isn't as heavy-handed
6045fda9279dSmrg      # as -z defs.
604616ee1e9aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
604716ee1e9aSmrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
6048fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6049fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
605016ee1e9aSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
6051fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6052fda9279dSmrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
605316ee1e9aSmrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
6054fda9279dSmrg      runpath_var='LD_RUN_PATH'
6055fda9279dSmrg
605616ee1e9aSmrg      if test yes = "$GCC"; then
605716ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
605816ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6059fda9279dSmrg      else
606016ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
606116ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6062fda9279dSmrg      fi
6063fda9279dSmrg      ;;
6064fda9279dSmrg
6065fda9279dSmrg    uts4*)
6066fda9279dSmrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
6067fda9279dSmrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6068fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6069fda9279dSmrg      ;;
6070fda9279dSmrg
6071fda9279dSmrg    *)
6072fda9279dSmrg      _LT_TAGVAR(ld_shlibs, $1)=no
6073fda9279dSmrg      ;;
6074fda9279dSmrg    esac
6075fda9279dSmrg
607616ee1e9aSmrg    if test sni = "$host_vendor"; then
6077fda9279dSmrg      case $host in
6078fda9279dSmrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
607916ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
6080fda9279dSmrg	;;
6081fda9279dSmrg      esac
6082fda9279dSmrg    fi
6083fda9279dSmrg  fi
6084fda9279dSmrg])
6085fda9279dSmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
608616ee1e9aSmrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
6087fda9279dSmrg
6088fda9279dSmrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
6089fda9279dSmrg
6090fda9279dSmrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
6091fda9279dSmrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
6092fda9279dSmrg_LT_DECL([], [extract_expsyms_cmds], [2],
6093fda9279dSmrg    [The commands to extract the exported symbol list from a shared archive])
6094fda9279dSmrg
6095fda9279dSmrg#
6096fda9279dSmrg# Do we need to explicitly link libc?
6097fda9279dSmrg#
6098fda9279dSmrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
6099fda9279dSmrgx|xyes)
6100fda9279dSmrg  # Assume -lc should be added
6101fda9279dSmrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6102fda9279dSmrg
610316ee1e9aSmrg  if test yes,yes = "$GCC,$enable_shared"; then
6104fda9279dSmrg    case $_LT_TAGVAR(archive_cmds, $1) in
6105fda9279dSmrg    *'~'*)
6106fda9279dSmrg      # FIXME: we may have to deal with multi-command sequences.
6107fda9279dSmrg      ;;
6108fda9279dSmrg    '$CC '*)
6109fda9279dSmrg      # Test whether the compiler implicitly links with -lc since on some
6110fda9279dSmrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
6111fda9279dSmrg      # to ld, don't add -lc before -lgcc.
6112fda9279dSmrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
6113fda9279dSmrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
6114fda9279dSmrg	[$RM conftest*
6115fda9279dSmrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6116fda9279dSmrg
6117fda9279dSmrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
6118fda9279dSmrg	  soname=conftest
6119fda9279dSmrg	  lib=conftest
6120fda9279dSmrg	  libobjs=conftest.$ac_objext
6121fda9279dSmrg	  deplibs=
6122fda9279dSmrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
6123fda9279dSmrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
6124fda9279dSmrg	  compiler_flags=-v
6125fda9279dSmrg	  linker_flags=-v
6126fda9279dSmrg	  verstring=
6127fda9279dSmrg	  output_objdir=.
6128fda9279dSmrg	  libname=conftest
6129fda9279dSmrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
6130fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
6131fda9279dSmrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
6132fda9279dSmrg	  then
6133fda9279dSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6134fda9279dSmrg	  else
6135fda9279dSmrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6136fda9279dSmrg	  fi
6137fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
6138fda9279dSmrg	else
6139fda9279dSmrg	  cat conftest.err 1>&5
6140fda9279dSmrg	fi
6141fda9279dSmrg	$RM conftest*
6142fda9279dSmrg	])
6143fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
6144fda9279dSmrg      ;;
6145fda9279dSmrg    esac
6146fda9279dSmrg  fi
6147fda9279dSmrg  ;;
6148fda9279dSmrgesac
6149fda9279dSmrg
6150fda9279dSmrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
6151fda9279dSmrg    [Whether or not to add -lc for building shared libraries])
6152fda9279dSmrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
6153fda9279dSmrg    [enable_shared_with_static_runtimes], [0],
6154fda9279dSmrg    [Whether or not to disallow shared libs when runtime libs are static])
6155fda9279dSmrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
6156fda9279dSmrg    [Compiler flag to allow reflexive dlopens])
6157fda9279dSmrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
6158fda9279dSmrg    [Compiler flag to generate shared objects directly from archives])
6159fda9279dSmrg_LT_TAGDECL([], [compiler_needs_object], [1],
6160fda9279dSmrg    [Whether the compiler copes with passing no objects directly])
6161fda9279dSmrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
6162fda9279dSmrg    [Create an old-style archive from a shared archive])
6163fda9279dSmrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
6164fda9279dSmrg    [Create a temporary old-style archive to link instead of a shared archive])
6165fda9279dSmrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
6166fda9279dSmrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
6167fda9279dSmrg_LT_TAGDECL([], [module_cmds], [2],
6168fda9279dSmrg    [Commands used to build a loadable module if different from building
6169fda9279dSmrg    a shared archive.])
6170fda9279dSmrg_LT_TAGDECL([], [module_expsym_cmds], [2])
6171fda9279dSmrg_LT_TAGDECL([], [with_gnu_ld], [1],
6172fda9279dSmrg    [Whether we are building with GNU ld or not])
6173fda9279dSmrg_LT_TAGDECL([], [allow_undefined_flag], [1],
6174fda9279dSmrg    [Flag that allows shared libraries with undefined symbols to be built])
6175fda9279dSmrg_LT_TAGDECL([], [no_undefined_flag], [1],
6176fda9279dSmrg    [Flag that enforces no undefined symbols])
6177fda9279dSmrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
6178fda9279dSmrg    [Flag to hardcode $libdir into a binary during linking.
6179fda9279dSmrg    This must work even if $libdir does not exist])
6180fda9279dSmrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
6181fda9279dSmrg    [Whether we need a single "-rpath" flag with a separated argument])
6182fda9279dSmrg_LT_TAGDECL([], [hardcode_direct], [0],
618316ee1e9aSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6184fda9279dSmrg    DIR into the resulting binary])
6185fda9279dSmrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
618616ee1e9aSmrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
6187fda9279dSmrg    DIR into the resulting binary and the resulting library dependency is
618816ee1e9aSmrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
6189fda9279dSmrg    library is relocated])
6190fda9279dSmrg_LT_TAGDECL([], [hardcode_minus_L], [0],
6191fda9279dSmrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
6192fda9279dSmrg    into the resulting binary])
6193fda9279dSmrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
6194fda9279dSmrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
6195fda9279dSmrg    into the resulting binary])
6196fda9279dSmrg_LT_TAGDECL([], [hardcode_automatic], [0],
6197fda9279dSmrg    [Set to "yes" if building a shared library automatically hardcodes DIR
6198fda9279dSmrg    into the library and all subsequent libraries and executables linked
6199fda9279dSmrg    against it])
6200fda9279dSmrg_LT_TAGDECL([], [inherit_rpath], [0],
6201fda9279dSmrg    [Set to yes if linker adds runtime paths of dependent libraries
6202fda9279dSmrg    to runtime path list])
6203fda9279dSmrg_LT_TAGDECL([], [link_all_deplibs], [0],
6204fda9279dSmrg    [Whether libtool must link a program against all its dependency libraries])
6205fda9279dSmrg_LT_TAGDECL([], [always_export_symbols], [0],
6206fda9279dSmrg    [Set to "yes" if exported symbols are required])
6207fda9279dSmrg_LT_TAGDECL([], [export_symbols_cmds], [2],
6208fda9279dSmrg    [The commands to list exported symbols])
6209fda9279dSmrg_LT_TAGDECL([], [exclude_expsyms], [1],
6210fda9279dSmrg    [Symbols that should not be listed in the preloaded symbols])
6211fda9279dSmrg_LT_TAGDECL([], [include_expsyms], [1],
6212fda9279dSmrg    [Symbols that must always be exported])
6213fda9279dSmrg_LT_TAGDECL([], [prelink_cmds], [2],
6214fda9279dSmrg    [Commands necessary for linking programs (against libraries) with templates])
6215fda9279dSmrg_LT_TAGDECL([], [postlink_cmds], [2],
6216fda9279dSmrg    [Commands necessary for finishing linking programs])
6217fda9279dSmrg_LT_TAGDECL([], [file_list_spec], [1],
6218fda9279dSmrg    [Specify filename containing input files])
6219fda9279dSmrgdnl FIXME: Not yet implemented
6220fda9279dSmrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
6221fda9279dSmrgdnl    [Compiler flag to generate thread safe objects])
6222fda9279dSmrg])# _LT_LINKER_SHLIBS
6223fda9279dSmrg
6224fda9279dSmrg
6225fda9279dSmrg# _LT_LANG_C_CONFIG([TAG])
6226fda9279dSmrg# ------------------------
6227fda9279dSmrg# Ensure that the configuration variables for a C compiler are suitably
6228fda9279dSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
622916ee1e9aSmrg# the compiler configuration to 'libtool'.
6230fda9279dSmrgm4_defun([_LT_LANG_C_CONFIG],
6231fda9279dSmrg[m4_require([_LT_DECL_EGREP])dnl
623216ee1e9aSmrglt_save_CC=$CC
6233fda9279dSmrgAC_LANG_PUSH(C)
6234fda9279dSmrg
6235fda9279dSmrg# Source file extension for C test sources.
6236fda9279dSmrgac_ext=c
6237fda9279dSmrg
6238fda9279dSmrg# Object file extension for compiled C test sources.
6239fda9279dSmrgobjext=o
6240fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
6241fda9279dSmrg
6242fda9279dSmrg# Code to be used in simple compile tests
6243fda9279dSmrglt_simple_compile_test_code="int some_variable = 0;"
6244fda9279dSmrg
6245fda9279dSmrg# Code to be used in simple link tests
6246fda9279dSmrglt_simple_link_test_code='int main(){return(0);}'
6247fda9279dSmrg
6248fda9279dSmrg_LT_TAG_COMPILER
6249fda9279dSmrg# Save the default compiler, since it gets overwritten when the other
6250fda9279dSmrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
6251fda9279dSmrgcompiler_DEFAULT=$CC
6252fda9279dSmrg
6253fda9279dSmrg# save warnings/boilerplate of simple test code
6254fda9279dSmrg_LT_COMPILER_BOILERPLATE
6255fda9279dSmrg_LT_LINKER_BOILERPLATE
6256fda9279dSmrg
6257fda9279dSmrgif test -n "$compiler"; then
6258fda9279dSmrg  _LT_COMPILER_NO_RTTI($1)
6259fda9279dSmrg  _LT_COMPILER_PIC($1)
6260fda9279dSmrg  _LT_COMPILER_C_O($1)
6261fda9279dSmrg  _LT_COMPILER_FILE_LOCKS($1)
6262fda9279dSmrg  _LT_LINKER_SHLIBS($1)
6263fda9279dSmrg  _LT_SYS_DYNAMIC_LINKER($1)
6264fda9279dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
6265fda9279dSmrg  LT_SYS_DLOPEN_SELF
6266fda9279dSmrg  _LT_CMD_STRIPLIB
6267fda9279dSmrg
626816ee1e9aSmrg  # Report what library types will actually be built
6269fda9279dSmrg  AC_MSG_CHECKING([if libtool supports shared libraries])
6270fda9279dSmrg  AC_MSG_RESULT([$can_build_shared])
6271fda9279dSmrg
6272fda9279dSmrg  AC_MSG_CHECKING([whether to build shared libraries])
627316ee1e9aSmrg  test no = "$can_build_shared" && enable_shared=no
6274fda9279dSmrg
6275fda9279dSmrg  # On AIX, shared libraries and static libraries use the same namespace, and
6276fda9279dSmrg  # are all built from PIC.
6277fda9279dSmrg  case $host_os in
6278fda9279dSmrg  aix3*)
627916ee1e9aSmrg    test yes = "$enable_shared" && enable_static=no
6280fda9279dSmrg    if test -n "$RANLIB"; then
6281fda9279dSmrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
6282fda9279dSmrg      postinstall_cmds='$RANLIB $lib'
6283fda9279dSmrg    fi
6284fda9279dSmrg    ;;
6285fda9279dSmrg
6286fda9279dSmrg  aix[[4-9]]*)
628716ee1e9aSmrg    if test ia64 != "$host_cpu"; then
628816ee1e9aSmrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
628916ee1e9aSmrg      yes,aix,yes) ;;			# shared object as lib.so file only
629016ee1e9aSmrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
629116ee1e9aSmrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
629216ee1e9aSmrg      esac
6293fda9279dSmrg    fi
6294fda9279dSmrg    ;;
6295fda9279dSmrg  esac
6296fda9279dSmrg  AC_MSG_RESULT([$enable_shared])
6297fda9279dSmrg
6298fda9279dSmrg  AC_MSG_CHECKING([whether to build static libraries])
6299fda9279dSmrg  # Make sure either enable_shared or enable_static is yes.
630016ee1e9aSmrg  test yes = "$enable_shared" || enable_static=yes
6301fda9279dSmrg  AC_MSG_RESULT([$enable_static])
6302fda9279dSmrg
6303fda9279dSmrg  _LT_CONFIG($1)
6304fda9279dSmrgfi
6305fda9279dSmrgAC_LANG_POP
630616ee1e9aSmrgCC=$lt_save_CC
6307fda9279dSmrg])# _LT_LANG_C_CONFIG
6308fda9279dSmrg
6309fda9279dSmrg
6310fda9279dSmrg# _LT_LANG_CXX_CONFIG([TAG])
6311fda9279dSmrg# --------------------------
6312fda9279dSmrg# Ensure that the configuration variables for a C++ compiler are suitably
6313fda9279dSmrg# defined.  These variables are subsequently used by _LT_CONFIG to write
631416ee1e9aSmrg# the compiler configuration to 'libtool'.
6315fda9279dSmrgm4_defun([_LT_LANG_CXX_CONFIG],
6316fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6317fda9279dSmrgm4_require([_LT_DECL_EGREP])dnl
6318fda9279dSmrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
631916ee1e9aSmrgif test -n "$CXX" && ( test no != "$CXX" &&
632016ee1e9aSmrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
632116ee1e9aSmrg    (test g++ != "$CXX"))); then
6322fda9279dSmrg  AC_PROG_CXXCPP
6323fda9279dSmrgelse
6324fda9279dSmrg  _lt_caught_CXX_error=yes
6325fda9279dSmrgfi
6326fda9279dSmrg
6327fda9279dSmrgAC_LANG_PUSH(C++)
6328fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6329fda9279dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
6330fda9279dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
6331fda9279dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
6332fda9279dSmrg_LT_TAGVAR(compiler_needs_object, $1)=no
6333fda9279dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
6334fda9279dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
6335fda9279dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
6336fda9279dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
6337fda9279dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
6338fda9279dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
6339fda9279dSmrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
6340fda9279dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
6341fda9279dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
6342fda9279dSmrg_LT_TAGVAR(module_cmds, $1)=
6343fda9279dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
6344fda9279dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
6345fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
6346fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
6347fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
6348fda9279dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
6349fda9279dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
6350fda9279dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
6351fda9279dSmrg
6352fda9279dSmrg# Source file extension for C++ test sources.
6353fda9279dSmrgac_ext=cpp
6354fda9279dSmrg
6355fda9279dSmrg# Object file extension for compiled C++ test sources.
6356fda9279dSmrgobjext=o
6357fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
6358fda9279dSmrg
6359fda9279dSmrg# No sense in running all these tests if we already determined that
6360fda9279dSmrg# the CXX compiler isn't working.  Some variables (like enable_shared)
6361fda9279dSmrg# are currently assumed to apply to all compilers on this platform,
6362fda9279dSmrg# and will be corrupted by setting them based on a non-working compiler.
636316ee1e9aSmrgif test yes != "$_lt_caught_CXX_error"; then
6364fda9279dSmrg  # Code to be used in simple compile tests
6365fda9279dSmrg  lt_simple_compile_test_code="int some_variable = 0;"
6366fda9279dSmrg
6367fda9279dSmrg  # Code to be used in simple link tests
6368fda9279dSmrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6369fda9279dSmrg
6370fda9279dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
6371fda9279dSmrg  _LT_TAG_COMPILER
6372fda9279dSmrg
6373fda9279dSmrg  # save warnings/boilerplate of simple test code
6374fda9279dSmrg  _LT_COMPILER_BOILERPLATE
6375fda9279dSmrg  _LT_LINKER_BOILERPLATE
6376fda9279dSmrg
6377fda9279dSmrg  # Allow CC to be a program name with arguments.
6378fda9279dSmrg  lt_save_CC=$CC
6379fda9279dSmrg  lt_save_CFLAGS=$CFLAGS
6380fda9279dSmrg  lt_save_LD=$LD
6381fda9279dSmrg  lt_save_GCC=$GCC
6382fda9279dSmrg  GCC=$GXX
6383fda9279dSmrg  lt_save_with_gnu_ld=$with_gnu_ld
6384fda9279dSmrg  lt_save_path_LD=$lt_cv_path_LD
6385fda9279dSmrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
6386fda9279dSmrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
6387fda9279dSmrg  else
6388fda9279dSmrg    $as_unset lt_cv_prog_gnu_ld
6389fda9279dSmrg  fi
6390fda9279dSmrg  if test -n "${lt_cv_path_LDCXX+set}"; then
6391fda9279dSmrg    lt_cv_path_LD=$lt_cv_path_LDCXX
6392fda9279dSmrg  else
6393fda9279dSmrg    $as_unset lt_cv_path_LD
6394fda9279dSmrg  fi
6395fda9279dSmrg  test -z "${LDCXX+set}" || LD=$LDCXX
6396fda9279dSmrg  CC=${CXX-"c++"}
6397fda9279dSmrg  CFLAGS=$CXXFLAGS
6398fda9279dSmrg  compiler=$CC
6399fda9279dSmrg  _LT_TAGVAR(compiler, $1)=$CC
6400fda9279dSmrg  _LT_CC_BASENAME([$compiler])
6401fda9279dSmrg
6402fda9279dSmrg  if test -n "$compiler"; then
6403fda9279dSmrg    # We don't want -fno-exception when compiling C++ code, so set the
6404fda9279dSmrg    # no_builtin_flag separately
640516ee1e9aSmrg    if test yes = "$GXX"; then
6406fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
6407fda9279dSmrg    else
6408fda9279dSmrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
6409fda9279dSmrg    fi
6410fda9279dSmrg
641116ee1e9aSmrg    if test yes = "$GXX"; then
6412fda9279dSmrg      # Set up default GNU C++ configuration
6413fda9279dSmrg
6414fda9279dSmrg      LT_PATH_LD
6415fda9279dSmrg
6416fda9279dSmrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
6417fda9279dSmrg      # archiving commands below assume that GNU ld is being used.
641816ee1e9aSmrg      if test yes = "$with_gnu_ld"; then
641916ee1e9aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
642016ee1e9aSmrg        _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'
6421fda9279dSmrg
642216ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
642316ee1e9aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6424fda9279dSmrg
6425fda9279dSmrg        # If archive_cmds runs LD, not CC, wlarc should be empty
6426fda9279dSmrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
6427fda9279dSmrg        #     investigate it a little bit more. (MM)
642816ee1e9aSmrg        wlarc='$wl'
6429fda9279dSmrg
6430fda9279dSmrg        # ancient GNU ld didn't support --whole-archive et. al.
6431fda9279dSmrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
6432fda9279dSmrg	  $GREP 'no-whole-archive' > /dev/null; then
643316ee1e9aSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
6434fda9279dSmrg        else
6435fda9279dSmrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
6436fda9279dSmrg        fi
6437fda9279dSmrg      else
6438fda9279dSmrg        with_gnu_ld=no
6439fda9279dSmrg        wlarc=
6440fda9279dSmrg
6441fda9279dSmrg        # A generic and very simple default shared library creation
6442fda9279dSmrg        # command for GNU C++ for the case where it uses the native
6443fda9279dSmrg        # linker, instead of GNU ld.  If possible, this setting should
6444fda9279dSmrg        # overridden to take advantage of the native linker features on
6445fda9279dSmrg        # the platform it is being used on.
6446fda9279dSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6447fda9279dSmrg      fi
6448fda9279dSmrg
6449fda9279dSmrg      # Commands to make compiler produce verbose output that lists
6450fda9279dSmrg      # what "hidden" libraries, object files and flags are used when
6451fda9279dSmrg      # linking a shared library.
6452fda9279dSmrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6453fda9279dSmrg
6454fda9279dSmrg    else
6455fda9279dSmrg      GXX=no
6456fda9279dSmrg      with_gnu_ld=no
6457fda9279dSmrg      wlarc=
6458fda9279dSmrg    fi
6459fda9279dSmrg
6460fda9279dSmrg    # PORTME: fill in a description of your system's C++ link characteristics
6461fda9279dSmrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
6462fda9279dSmrg    _LT_TAGVAR(ld_shlibs, $1)=yes
6463fda9279dSmrg    case $host_os in
6464fda9279dSmrg      aix3*)
6465fda9279dSmrg        # FIXME: insert proper C++ library support
6466fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6467fda9279dSmrg        ;;
6468fda9279dSmrg      aix[[4-9]]*)
646916ee1e9aSmrg        if test ia64 = "$host_cpu"; then
6470fda9279dSmrg          # On IA64, the linker does run time linking by default, so we don't
6471fda9279dSmrg          # have to do anything special.
6472fda9279dSmrg          aix_use_runtimelinking=no
6473fda9279dSmrg          exp_sym_flag='-Bexport'
647416ee1e9aSmrg          no_entry_flag=
6475fda9279dSmrg        else
6476fda9279dSmrg          aix_use_runtimelinking=no
6477fda9279dSmrg
6478fda9279dSmrg          # Test if we are trying to use run time linking or normal
6479fda9279dSmrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
648016ee1e9aSmrg          # have runtime linking enabled, and use it for executables.
648116ee1e9aSmrg          # For shared libraries, we enable/disable runtime linking
648216ee1e9aSmrg          # depending on the kind of the shared library created -
648316ee1e9aSmrg          # when "with_aix_soname,aix_use_runtimelinking" is:
648416ee1e9aSmrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
648516ee1e9aSmrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
648616ee1e9aSmrg          #            lib.a           static archive
648716ee1e9aSmrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
648816ee1e9aSmrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
648916ee1e9aSmrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
649016ee1e9aSmrg          #            lib.a(lib.so.V) shared, rtl:no
649116ee1e9aSmrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
649216ee1e9aSmrg          #            lib.a           static archive
6493fda9279dSmrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
6494fda9279dSmrg	    for ld_flag in $LDFLAGS; do
6495fda9279dSmrg	      case $ld_flag in
6496fda9279dSmrg	      *-brtl*)
6497fda9279dSmrg	        aix_use_runtimelinking=yes
6498fda9279dSmrg	        break
6499fda9279dSmrg	        ;;
6500fda9279dSmrg	      esac
6501fda9279dSmrg	    done
650216ee1e9aSmrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
650316ee1e9aSmrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
650416ee1e9aSmrg	      # so we don't have lib.a shared libs to link our executables.
650516ee1e9aSmrg	      # We have to force runtime linking in this case.
650616ee1e9aSmrg	      aix_use_runtimelinking=yes
650716ee1e9aSmrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
650816ee1e9aSmrg	    fi
6509fda9279dSmrg	    ;;
6510fda9279dSmrg          esac
6511fda9279dSmrg
6512fda9279dSmrg          exp_sym_flag='-bexport'
6513fda9279dSmrg          no_entry_flag='-bnoentry'
6514fda9279dSmrg        fi
6515fda9279dSmrg
6516fda9279dSmrg        # When large executables or shared objects are built, AIX ld can
6517fda9279dSmrg        # have problems creating the table of contents.  If linking a library
6518fda9279dSmrg        # or program results in "error TOC overflow" add -mminimal-toc to
6519fda9279dSmrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6520fda9279dSmrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6521fda9279dSmrg
6522fda9279dSmrg        _LT_TAGVAR(archive_cmds, $1)=''
6523fda9279dSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6524fda9279dSmrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6525fda9279dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6526fda9279dSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
652716ee1e9aSmrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
652816ee1e9aSmrg        case $with_aix_soname,$aix_use_runtimelinking in
652916ee1e9aSmrg        aix,*) ;;	# no import file
653016ee1e9aSmrg        svr4,* | *,yes) # use import file
653116ee1e9aSmrg          # The Import File defines what to hardcode.
653216ee1e9aSmrg          _LT_TAGVAR(hardcode_direct, $1)=no
653316ee1e9aSmrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
653416ee1e9aSmrg          ;;
653516ee1e9aSmrg        esac
6536fda9279dSmrg
653716ee1e9aSmrg        if test yes = "$GXX"; then
6538fda9279dSmrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6539fda9279dSmrg          # We only want to do this on AIX 4.2 and lower, the check
6540fda9279dSmrg          # below for broken collect2 doesn't work under 4.3+
654116ee1e9aSmrg	  collect2name=`$CC -print-prog-name=collect2`
6542fda9279dSmrg	  if test -f "$collect2name" &&
6543fda9279dSmrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6544fda9279dSmrg	  then
6545fda9279dSmrg	    # We have reworked collect2
6546fda9279dSmrg	    :
6547fda9279dSmrg	  else
6548fda9279dSmrg	    # We have old collect2
6549fda9279dSmrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6550fda9279dSmrg	    # It fails to find uninstalled libraries when the uninstalled
6551fda9279dSmrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6552fda9279dSmrg	    # to unsupported forces relinking
6553fda9279dSmrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6554fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6555fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6556fda9279dSmrg	  fi
6557fda9279dSmrg          esac
6558fda9279dSmrg          shared_flag='-shared'
655916ee1e9aSmrg	  if test yes = "$aix_use_runtimelinking"; then
656016ee1e9aSmrg	    shared_flag=$shared_flag' $wl-G'
6561fda9279dSmrg	  fi
656216ee1e9aSmrg	  # Need to ensure runtime linking is disabled for the traditional
656316ee1e9aSmrg	  # shared library, or the linker may eventually find shared libraries
656416ee1e9aSmrg	  # /with/ Import File - we do not want to mix them.
656516ee1e9aSmrg	  shared_flag_aix='-shared'
656616ee1e9aSmrg	  shared_flag_svr4='-shared $wl-G'
6567fda9279dSmrg        else
6568fda9279dSmrg          # not using gcc
656916ee1e9aSmrg          if test ia64 = "$host_cpu"; then
6570fda9279dSmrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6571fda9279dSmrg	  # chokes on -Wl,-G. The following line is correct:
6572fda9279dSmrg	  shared_flag='-G'
6573fda9279dSmrg          else
657416ee1e9aSmrg	    if test yes = "$aix_use_runtimelinking"; then
657516ee1e9aSmrg	      shared_flag='$wl-G'
6576fda9279dSmrg	    else
657716ee1e9aSmrg	      shared_flag='$wl-bM:SRE'
6578fda9279dSmrg	    fi
657916ee1e9aSmrg	    shared_flag_aix='$wl-bM:SRE'
658016ee1e9aSmrg	    shared_flag_svr4='$wl-G'
6581fda9279dSmrg          fi
6582fda9279dSmrg        fi
6583fda9279dSmrg
658416ee1e9aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
6585fda9279dSmrg        # It seems that -bexpall does not export symbols beginning with
6586fda9279dSmrg        # underscore (_), so it is better to generate a list of symbols to
6587fda9279dSmrg	# export.
6588fda9279dSmrg        _LT_TAGVAR(always_export_symbols, $1)=yes
658916ee1e9aSmrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
6590fda9279dSmrg          # Warning - without using the other runtime loading flags (-brtl),
6591fda9279dSmrg          # -berok will link without error, but may produce a broken library.
659216ee1e9aSmrg          # The "-G" linker flag allows undefined symbols.
659316ee1e9aSmrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
6594fda9279dSmrg          # Determine the default libpath from the value encoded in an empty
6595fda9279dSmrg          # executable.
6596fda9279dSmrg          _LT_SYS_MODULE_PATH_AIX([$1])
659716ee1e9aSmrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6598fda9279dSmrg
659916ee1e9aSmrg          _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
6600fda9279dSmrg        else
660116ee1e9aSmrg          if test ia64 = "$host_cpu"; then
660216ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
6603fda9279dSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
660416ee1e9aSmrg	    _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"
6605fda9279dSmrg          else
6606fda9279dSmrg	    # Determine the default libpath from the value encoded in an
6607fda9279dSmrg	    # empty executable.
6608fda9279dSmrg	    _LT_SYS_MODULE_PATH_AIX([$1])
660916ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6610fda9279dSmrg	    # Warning - without using the other run time loading flags,
6611fda9279dSmrg	    # -berok will link without error, but may produce a broken library.
661216ee1e9aSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
661316ee1e9aSmrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
661416ee1e9aSmrg	    if test yes = "$with_gnu_ld"; then
6615fda9279dSmrg	      # We only use this code for GNU lds that support --whole-archive.
661616ee1e9aSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
6617fda9279dSmrg	    else
6618fda9279dSmrg	      # Exported symbols can be pulled into shared objects from archives
6619fda9279dSmrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6620fda9279dSmrg	    fi
6621fda9279dSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
662216ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
662316ee1e9aSmrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
662416ee1e9aSmrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
662516ee1e9aSmrg	    if test svr4 != "$with_aix_soname"; then
662616ee1e9aSmrg	      # This is similar to how AIX traditionally builds its shared
662716ee1e9aSmrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
662816ee1e9aSmrg	      _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'
662916ee1e9aSmrg	    fi
663016ee1e9aSmrg	    if test aix != "$with_aix_soname"; then
663116ee1e9aSmrg	      _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'
663216ee1e9aSmrg	    else
663316ee1e9aSmrg	      # used by -dlpreopen to get the symbols
663416ee1e9aSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
663516ee1e9aSmrg	    fi
663616ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
6637fda9279dSmrg          fi
6638fda9279dSmrg        fi
6639fda9279dSmrg        ;;
6640fda9279dSmrg
6641fda9279dSmrg      beos*)
6642fda9279dSmrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6643fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6644fda9279dSmrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6645fda9279dSmrg	  # support --undefined.  This deserves some investigation.  FIXME
664616ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6647fda9279dSmrg	else
6648fda9279dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6649fda9279dSmrg	fi
6650fda9279dSmrg	;;
6651fda9279dSmrg
6652fda9279dSmrg      chorus*)
6653fda9279dSmrg        case $cc_basename in
6654fda9279dSmrg          *)
6655fda9279dSmrg	  # FIXME: insert proper C++ library support
6656fda9279dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6657fda9279dSmrg	  ;;
6658fda9279dSmrg        esac
6659fda9279dSmrg        ;;
6660fda9279dSmrg
6661fda9279dSmrg      cygwin* | mingw* | pw32* | cegcc*)
6662fda9279dSmrg	case $GXX,$cc_basename in
6663fda9279dSmrg	,cl* | no,cl*)
6664fda9279dSmrg	  # Native MSVC
6665fda9279dSmrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6666fda9279dSmrg	  # no search path for DLLs.
6667fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6668fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6669fda9279dSmrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6670fda9279dSmrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6671fda9279dSmrg	  # Tell ltmain to make .lib files, not .a files.
6672fda9279dSmrg	  libext=lib
6673fda9279dSmrg	  # Tell ltmain to make .dll files, not .so files.
667416ee1e9aSmrg	  shrext_cmds=.dll
6675fda9279dSmrg	  # FIXME: Setting linknames here is a bad hack.
667616ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
667716ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
667816ee1e9aSmrg              cp "$export_symbols" "$output_objdir/$soname.def";
667916ee1e9aSmrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
668016ee1e9aSmrg            else
668116ee1e9aSmrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
668216ee1e9aSmrg            fi~
668316ee1e9aSmrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
668416ee1e9aSmrg            linknames='
6685fda9279dSmrg	  # The linker will not automatically build a static lib if we build a DLL.
6686fda9279dSmrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6687fda9279dSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6688fda9279dSmrg	  # Don't use ranlib
6689fda9279dSmrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6690fda9279dSmrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
669116ee1e9aSmrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
669216ee1e9aSmrg            case $lt_outputfile in
669316ee1e9aSmrg              *.exe|*.EXE) ;;
669416ee1e9aSmrg              *)
669516ee1e9aSmrg                lt_outputfile=$lt_outputfile.exe
669616ee1e9aSmrg                lt_tool_outputfile=$lt_tool_outputfile.exe
669716ee1e9aSmrg                ;;
669816ee1e9aSmrg            esac~
669916ee1e9aSmrg            func_to_tool_file "$lt_outputfile"~
670016ee1e9aSmrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
670116ee1e9aSmrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
670216ee1e9aSmrg              $RM "$lt_outputfile.manifest";
670316ee1e9aSmrg            fi'
6704fda9279dSmrg	  ;;
6705fda9279dSmrg	*)
6706fda9279dSmrg	  # g++
6707fda9279dSmrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6708fda9279dSmrg	  # as there is no search path for DLLs.
6709fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
671016ee1e9aSmrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
6711fda9279dSmrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6712fda9279dSmrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6713fda9279dSmrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6714fda9279dSmrg
6715fda9279dSmrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
671616ee1e9aSmrg	    _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'
671716ee1e9aSmrg	    # If the export-symbols file already is a .def file, use it as
671816ee1e9aSmrg	    # is; otherwise, prepend EXPORTS...
671916ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
672016ee1e9aSmrg              cp $export_symbols $output_objdir/$soname.def;
672116ee1e9aSmrg            else
672216ee1e9aSmrg              echo EXPORTS > $output_objdir/$soname.def;
672316ee1e9aSmrg              cat $export_symbols >> $output_objdir/$soname.def;
672416ee1e9aSmrg            fi~
672516ee1e9aSmrg            $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'
6726fda9279dSmrg	  else
6727fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6728fda9279dSmrg	  fi
6729fda9279dSmrg	  ;;
6730fda9279dSmrg	esac
6731fda9279dSmrg	;;
6732fda9279dSmrg      darwin* | rhapsody*)
6733fda9279dSmrg        _LT_DARWIN_LINKER_FEATURES($1)
6734fda9279dSmrg	;;
6735fda9279dSmrg
673616ee1e9aSmrg      os2*)
673716ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
673816ee1e9aSmrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
673916ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
674016ee1e9aSmrg	shrext_cmds=.dll
674116ee1e9aSmrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
674216ee1e9aSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
674316ee1e9aSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
674416ee1e9aSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
674516ee1e9aSmrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
674616ee1e9aSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
674716ee1e9aSmrg	  emximp -o $lib $output_objdir/$libname.def'
674816ee1e9aSmrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
674916ee1e9aSmrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
675016ee1e9aSmrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
675116ee1e9aSmrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
675216ee1e9aSmrg	  prefix_cmds="$SED"~
675316ee1e9aSmrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
675416ee1e9aSmrg	    prefix_cmds="$prefix_cmds -e 1d";
675516ee1e9aSmrg	  fi~
675616ee1e9aSmrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
675716ee1e9aSmrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
675816ee1e9aSmrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
675916ee1e9aSmrg	  emximp -o $lib $output_objdir/$libname.def'
676016ee1e9aSmrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
676116ee1e9aSmrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
676216ee1e9aSmrg	;;
676316ee1e9aSmrg
6764fda9279dSmrg      dgux*)
6765fda9279dSmrg        case $cc_basename in
6766fda9279dSmrg          ec++*)
6767fda9279dSmrg	    # FIXME: insert proper C++ library support
6768fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6769fda9279dSmrg	    ;;
6770fda9279dSmrg          ghcx*)
6771fda9279dSmrg	    # Green Hills C++ Compiler
6772fda9279dSmrg	    # FIXME: insert proper C++ library support
6773fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6774fda9279dSmrg	    ;;
6775fda9279dSmrg          *)
6776fda9279dSmrg	    # FIXME: insert proper C++ library support
6777fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6778fda9279dSmrg	    ;;
6779fda9279dSmrg        esac
6780fda9279dSmrg        ;;
6781fda9279dSmrg
6782fda9279dSmrg      freebsd2.*)
6783fda9279dSmrg        # C++ shared libraries reported to be fairly broken before
6784fda9279dSmrg	# switch to ELF
6785fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
6786fda9279dSmrg        ;;
6787fda9279dSmrg
6788fda9279dSmrg      freebsd-elf*)
6789fda9279dSmrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6790fda9279dSmrg        ;;
6791fda9279dSmrg
6792fda9279dSmrg      freebsd* | dragonfly*)
6793fda9279dSmrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6794fda9279dSmrg        # conventions
6795fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6796fda9279dSmrg        ;;
6797fda9279dSmrg
6798fda9279dSmrg      haiku*)
679916ee1e9aSmrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6800fda9279dSmrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6801fda9279dSmrg        ;;
6802fda9279dSmrg
6803fda9279dSmrg      hpux9*)
680416ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6805fda9279dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
680616ee1e9aSmrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6807fda9279dSmrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6808fda9279dSmrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6809fda9279dSmrg				             # but as the default
6810fda9279dSmrg				             # location of the library.
6811fda9279dSmrg
6812fda9279dSmrg        case $cc_basename in
6813fda9279dSmrg          CC*)
6814fda9279dSmrg            # FIXME: insert proper C++ library support
6815fda9279dSmrg            _LT_TAGVAR(ld_shlibs, $1)=no
6816fda9279dSmrg            ;;
6817fda9279dSmrg          aCC*)
681816ee1e9aSmrg            _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'
6819fda9279dSmrg            # Commands to make compiler produce verbose output that lists
6820fda9279dSmrg            # what "hidden" libraries, object files and flags are used when
6821fda9279dSmrg            # linking a shared library.
6822fda9279dSmrg            #
6823fda9279dSmrg            # There doesn't appear to be a way to prevent this compiler from
6824fda9279dSmrg            # explicitly linking system object files so we need to strip them
6825fda9279dSmrg            # from the output so that they don't get included in the library
6826fda9279dSmrg            # dependencies.
682716ee1e9aSmrg            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"'
6828fda9279dSmrg            ;;
6829fda9279dSmrg          *)
683016ee1e9aSmrg            if test yes = "$GXX"; then
683116ee1e9aSmrg              _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'
6832fda9279dSmrg            else
6833fda9279dSmrg              # FIXME: insert proper C++ library support
6834fda9279dSmrg              _LT_TAGVAR(ld_shlibs, $1)=no
6835fda9279dSmrg            fi
6836fda9279dSmrg            ;;
6837fda9279dSmrg        esac
6838fda9279dSmrg        ;;
6839fda9279dSmrg
6840fda9279dSmrg      hpux10*|hpux11*)
684116ee1e9aSmrg        if test no = "$with_gnu_ld"; then
684216ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
6843fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6844fda9279dSmrg
6845fda9279dSmrg          case $host_cpu in
6846fda9279dSmrg            hppa*64*|ia64*)
6847fda9279dSmrg              ;;
6848fda9279dSmrg            *)
684916ee1e9aSmrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6850fda9279dSmrg              ;;
6851fda9279dSmrg          esac
6852fda9279dSmrg        fi
6853fda9279dSmrg        case $host_cpu in
6854fda9279dSmrg          hppa*64*|ia64*)
6855fda9279dSmrg            _LT_TAGVAR(hardcode_direct, $1)=no
6856fda9279dSmrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6857fda9279dSmrg            ;;
6858fda9279dSmrg          *)
6859fda9279dSmrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6860fda9279dSmrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6861fda9279dSmrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6862fda9279dSmrg					         # but as the default
6863fda9279dSmrg					         # location of the library.
6864fda9279dSmrg            ;;
6865fda9279dSmrg        esac
6866fda9279dSmrg
6867fda9279dSmrg        case $cc_basename in
6868fda9279dSmrg          CC*)
6869fda9279dSmrg	    # FIXME: insert proper C++ library support
6870fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6871fda9279dSmrg	    ;;
6872fda9279dSmrg          aCC*)
6873fda9279dSmrg	    case $host_cpu in
6874fda9279dSmrg	      hppa*64*)
687516ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6876fda9279dSmrg	        ;;
6877fda9279dSmrg	      ia64*)
687816ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6879fda9279dSmrg	        ;;
6880fda9279dSmrg	      *)
688116ee1e9aSmrg	        _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'
6882fda9279dSmrg	        ;;
6883fda9279dSmrg	    esac
6884fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
6885fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
6886fda9279dSmrg	    # linking a shared library.
6887fda9279dSmrg	    #
6888fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
6889fda9279dSmrg	    # explicitly linking system object files so we need to strip them
6890fda9279dSmrg	    # from the output so that they don't get included in the library
6891fda9279dSmrg	    # dependencies.
689216ee1e9aSmrg	    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"'
6893fda9279dSmrg	    ;;
6894fda9279dSmrg          *)
689516ee1e9aSmrg	    if test yes = "$GXX"; then
689616ee1e9aSmrg	      if test no = "$with_gnu_ld"; then
6897fda9279dSmrg	        case $host_cpu in
6898fda9279dSmrg	          hppa*64*)
689916ee1e9aSmrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6900fda9279dSmrg	            ;;
6901fda9279dSmrg	          ia64*)
690216ee1e9aSmrg	            _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'
6903fda9279dSmrg	            ;;
6904fda9279dSmrg	          *)
690516ee1e9aSmrg	            _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'
6906fda9279dSmrg	            ;;
6907fda9279dSmrg	        esac
6908fda9279dSmrg	      fi
6909fda9279dSmrg	    else
6910fda9279dSmrg	      # FIXME: insert proper C++ library support
6911fda9279dSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6912fda9279dSmrg	    fi
6913fda9279dSmrg	    ;;
6914fda9279dSmrg        esac
6915fda9279dSmrg        ;;
6916fda9279dSmrg
6917fda9279dSmrg      interix[[3-9]]*)
6918fda9279dSmrg	_LT_TAGVAR(hardcode_direct, $1)=no
6919fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
692016ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
692116ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
6922fda9279dSmrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6923fda9279dSmrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6924fda9279dSmrg	# default) and relocated if they conflict, which is a slow very memory
6925fda9279dSmrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6926fda9279dSmrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6927fda9279dSmrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
692816ee1e9aSmrg	_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'
692916ee1e9aSmrg	_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'
6930fda9279dSmrg	;;
6931fda9279dSmrg      irix5* | irix6*)
6932fda9279dSmrg        case $cc_basename in
6933fda9279dSmrg          CC*)
6934fda9279dSmrg	    # SGI C++
693516ee1e9aSmrg	    _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'
6936fda9279dSmrg
6937fda9279dSmrg	    # Archives containing C++ object files must be created using
6938fda9279dSmrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6939fda9279dSmrg	    # necessary to make sure instantiated templates are included
6940fda9279dSmrg	    # in the archive.
6941fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6942fda9279dSmrg	    ;;
6943fda9279dSmrg          *)
694416ee1e9aSmrg	    if test yes = "$GXX"; then
694516ee1e9aSmrg	      if test no = "$with_gnu_ld"; then
694616ee1e9aSmrg	        _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'
6947fda9279dSmrg	      else
694816ee1e9aSmrg	        _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'
6949fda9279dSmrg	      fi
6950fda9279dSmrg	    fi
6951fda9279dSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6952fda9279dSmrg	    ;;
6953fda9279dSmrg        esac
695416ee1e9aSmrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6955fda9279dSmrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6956fda9279dSmrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6957fda9279dSmrg        ;;
6958fda9279dSmrg
6959fda9279dSmrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
6960fda9279dSmrg        case $cc_basename in
6961fda9279dSmrg          KCC*)
6962fda9279dSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6963fda9279dSmrg
6964fda9279dSmrg	    # KCC will only create a shared library if the output file
6965fda9279dSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6966fda9279dSmrg	    # to its proper name (with version) after linking.
696716ee1e9aSmrg	    _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'
696816ee1e9aSmrg	    _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'
6969fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
6970fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
6971fda9279dSmrg	    # linking a shared library.
6972fda9279dSmrg	    #
6973fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
6974fda9279dSmrg	    # explicitly linking system object files so we need to strip them
6975fda9279dSmrg	    # from the output so that they don't get included in the library
6976fda9279dSmrg	    # dependencies.
697716ee1e9aSmrg	    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"'
6978fda9279dSmrg
697916ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
698016ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6981fda9279dSmrg
6982fda9279dSmrg	    # Archives containing C++ object files must be created using
6983fda9279dSmrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6984fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6985fda9279dSmrg	    ;;
6986fda9279dSmrg	  icpc* | ecpc* )
6987fda9279dSmrg	    # Intel C++
6988fda9279dSmrg	    with_gnu_ld=yes
6989fda9279dSmrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6990fda9279dSmrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6991fda9279dSmrg	    # earlier do not add the objects themselves.
6992fda9279dSmrg	    case `$CC -V 2>&1` in
6993fda9279dSmrg	      *"Version 7."*)
699416ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
699516ee1e9aSmrg		_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'
6996fda9279dSmrg		;;
6997fda9279dSmrg	      *)  # Version 8.0 or newer
6998fda9279dSmrg	        tmp_idyn=
6999fda9279dSmrg	        case $host_cpu in
7000fda9279dSmrg		  ia64*) tmp_idyn=' -i_dynamic';;
7001fda9279dSmrg		esac
700216ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
700316ee1e9aSmrg		_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'
7004fda9279dSmrg		;;
7005fda9279dSmrg	    esac
7006fda9279dSmrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
700716ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
700816ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
700916ee1e9aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
7010fda9279dSmrg	    ;;
7011fda9279dSmrg          pgCC* | pgcpp*)
7012fda9279dSmrg            # Portland Group C++ compiler
7013fda9279dSmrg	    case `$CC -V` in
7014fda9279dSmrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
7015fda9279dSmrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
701616ee1e9aSmrg               rm -rf $tpldir~
701716ee1e9aSmrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
701816ee1e9aSmrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
7019fda9279dSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
702016ee1e9aSmrg                rm -rf $tpldir~
702116ee1e9aSmrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
702216ee1e9aSmrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
702316ee1e9aSmrg                $RANLIB $oldlib'
7024fda9279dSmrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
702516ee1e9aSmrg                rm -rf $tpldir~
702616ee1e9aSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
702716ee1e9aSmrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7028fda9279dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
702916ee1e9aSmrg                rm -rf $tpldir~
703016ee1e9aSmrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
703116ee1e9aSmrg                $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'
7032fda9279dSmrg	      ;;
7033fda9279dSmrg	    *) # Version 6 and above use weak symbols
703416ee1e9aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
703516ee1e9aSmrg	      _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'
7036fda9279dSmrg	      ;;
7037fda9279dSmrg	    esac
7038fda9279dSmrg
703916ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
704016ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
704116ee1e9aSmrg	    _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'
7042fda9279dSmrg            ;;
7043fda9279dSmrg	  cxx*)
7044fda9279dSmrg	    # Compaq C++
704516ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
704616ee1e9aSmrg	    _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'
7047fda9279dSmrg
7048fda9279dSmrg	    runpath_var=LD_RUN_PATH
7049fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7050fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7051fda9279dSmrg
7052fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
7053fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
7054fda9279dSmrg	    # linking a shared library.
7055fda9279dSmrg	    #
7056fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
7057fda9279dSmrg	    # explicitly linking system object files so we need to strip them
7058fda9279dSmrg	    # from the output so that they don't get included in the library
7059fda9279dSmrg	    # dependencies.
706016ee1e9aSmrg	    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'
7061fda9279dSmrg	    ;;
7062fda9279dSmrg	  xl* | mpixl* | bgxl*)
7063fda9279dSmrg	    # IBM XL 8.0 on PPC, with GNU ld
706416ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
706516ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
706616ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
706716ee1e9aSmrg	    if test yes = "$supports_anon_versioning"; then
7068fda9279dSmrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
706916ee1e9aSmrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
707016ee1e9aSmrg                echo "local: *; };" >> $output_objdir/$libname.ver~
707116ee1e9aSmrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
7072fda9279dSmrg	    fi
7073fda9279dSmrg	    ;;
7074fda9279dSmrg	  *)
7075fda9279dSmrg	    case `$CC -V 2>&1 | sed 5q` in
7076fda9279dSmrg	    *Sun\ C*)
7077fda9279dSmrg	      # Sun C++ 5.9
7078fda9279dSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
707916ee1e9aSmrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
708016ee1e9aSmrg	      _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'
7081fda9279dSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
708216ee1e9aSmrg	      _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'
7083fda9279dSmrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
7084fda9279dSmrg
7085fda9279dSmrg	      # Not sure whether something based on
7086fda9279dSmrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
7087fda9279dSmrg	      # would be better.
7088fda9279dSmrg	      output_verbose_link_cmd='func_echo_all'
7089fda9279dSmrg
7090fda9279dSmrg	      # Archives containing C++ object files must be created using
7091fda9279dSmrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7092fda9279dSmrg	      # necessary to make sure instantiated templates are included
7093fda9279dSmrg	      # in the archive.
7094fda9279dSmrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7095fda9279dSmrg	      ;;
7096fda9279dSmrg	    esac
7097fda9279dSmrg	    ;;
7098fda9279dSmrg	esac
7099fda9279dSmrg	;;
7100fda9279dSmrg
7101fda9279dSmrg      lynxos*)
7102fda9279dSmrg        # FIXME: insert proper C++ library support
7103fda9279dSmrg	_LT_TAGVAR(ld_shlibs, $1)=no
7104fda9279dSmrg	;;
7105fda9279dSmrg
7106fda9279dSmrg      m88k*)
7107fda9279dSmrg        # FIXME: insert proper C++ library support
7108fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7109fda9279dSmrg	;;
7110fda9279dSmrg
7111fda9279dSmrg      mvs*)
7112fda9279dSmrg        case $cc_basename in
7113fda9279dSmrg          cxx*)
7114fda9279dSmrg	    # FIXME: insert proper C++ library support
7115fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7116fda9279dSmrg	    ;;
7117fda9279dSmrg	  *)
7118fda9279dSmrg	    # FIXME: insert proper C++ library support
7119fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7120fda9279dSmrg	    ;;
7121fda9279dSmrg	esac
7122fda9279dSmrg	;;
7123fda9279dSmrg
7124fda9279dSmrg      netbsd*)
7125fda9279dSmrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
7126fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
7127fda9279dSmrg	  wlarc=
7128fda9279dSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7129fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7130fda9279dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7131fda9279dSmrg	fi
7132fda9279dSmrg	# Workaround some broken pre-1.5 toolchains
7133fda9279dSmrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
7134fda9279dSmrg	;;
7135fda9279dSmrg
7136fda9279dSmrg      *nto* | *qnx*)
7137fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=yes
7138fda9279dSmrg	;;
7139fda9279dSmrg
714016ee1e9aSmrg      openbsd* | bitrig*)
7141fda9279dSmrg	if test -f /usr/libexec/ld.so; then
7142fda9279dSmrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
7143fda9279dSmrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7144fda9279dSmrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
7145fda9279dSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
714616ee1e9aSmrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
714716ee1e9aSmrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
714816ee1e9aSmrg	    _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'
714916ee1e9aSmrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
715016ee1e9aSmrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
7151fda9279dSmrg	  fi
7152fda9279dSmrg	  output_verbose_link_cmd=func_echo_all
7153fda9279dSmrg	else
7154fda9279dSmrg	  _LT_TAGVAR(ld_shlibs, $1)=no
7155fda9279dSmrg	fi
7156fda9279dSmrg	;;
7157fda9279dSmrg
7158fda9279dSmrg      osf3* | osf4* | osf5*)
7159fda9279dSmrg        case $cc_basename in
7160fda9279dSmrg          KCC*)
7161fda9279dSmrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7162fda9279dSmrg
7163fda9279dSmrg	    # KCC will only create a shared library if the output file
7164fda9279dSmrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
7165fda9279dSmrg	    # to its proper name (with version) after linking.
716616ee1e9aSmrg	    _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'
7167fda9279dSmrg
716816ee1e9aSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7169fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7170fda9279dSmrg
7171fda9279dSmrg	    # Archives containing C++ object files must be created using
7172fda9279dSmrg	    # the KAI C++ compiler.
7173fda9279dSmrg	    case $host in
7174fda9279dSmrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
7175fda9279dSmrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
7176fda9279dSmrg	    esac
7177fda9279dSmrg	    ;;
7178fda9279dSmrg          RCC*)
7179fda9279dSmrg	    # Rational C++ 2.4.1
7180fda9279dSmrg	    # FIXME: insert proper C++ library support
7181fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7182fda9279dSmrg	    ;;
7183fda9279dSmrg          cxx*)
7184fda9279dSmrg	    case $host in
7185fda9279dSmrg	      osf3*)
718616ee1e9aSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
718716ee1e9aSmrg	        _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'
718816ee1e9aSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7189fda9279dSmrg		;;
7190fda9279dSmrg	      *)
7191fda9279dSmrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
719216ee1e9aSmrg	        _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'
7193fda9279dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
719416ee1e9aSmrg                  echo "-hidden">> $lib.exp~
719516ee1e9aSmrg                  $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~
719616ee1e9aSmrg                  $RM $lib.exp'
7197fda9279dSmrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
7198fda9279dSmrg		;;
7199fda9279dSmrg	    esac
7200fda9279dSmrg
7201fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7202fda9279dSmrg
7203fda9279dSmrg	    # Commands to make compiler produce verbose output that lists
7204fda9279dSmrg	    # what "hidden" libraries, object files and flags are used when
7205fda9279dSmrg	    # linking a shared library.
7206fda9279dSmrg	    #
7207fda9279dSmrg	    # There doesn't appear to be a way to prevent this compiler from
7208fda9279dSmrg	    # explicitly linking system object files so we need to strip them
7209fda9279dSmrg	    # from the output so that they don't get included in the library
7210fda9279dSmrg	    # dependencies.
721116ee1e9aSmrg	    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"'
7212fda9279dSmrg	    ;;
7213fda9279dSmrg	  *)
721416ee1e9aSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
721516ee1e9aSmrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7216fda9279dSmrg	      case $host in
7217fda9279dSmrg	        osf3*)
721816ee1e9aSmrg	          _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'
7219fda9279dSmrg		  ;;
7220fda9279dSmrg	        *)
722116ee1e9aSmrg	          _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'
7222fda9279dSmrg		  ;;
7223fda9279dSmrg	      esac
7224fda9279dSmrg
722516ee1e9aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7226fda9279dSmrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7227fda9279dSmrg
7228fda9279dSmrg	      # Commands to make compiler produce verbose output that lists
7229fda9279dSmrg	      # what "hidden" libraries, object files and flags are used when
7230fda9279dSmrg	      # linking a shared library.
7231fda9279dSmrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7232fda9279dSmrg
7233fda9279dSmrg	    else
7234fda9279dSmrg	      # FIXME: insert proper C++ library support
7235fda9279dSmrg	      _LT_TAGVAR(ld_shlibs, $1)=no
7236fda9279dSmrg	    fi
7237fda9279dSmrg	    ;;
7238fda9279dSmrg        esac
7239fda9279dSmrg        ;;
7240fda9279dSmrg
7241fda9279dSmrg      psos*)
7242fda9279dSmrg        # FIXME: insert proper C++ library support
7243fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7244fda9279dSmrg        ;;
7245fda9279dSmrg
7246fda9279dSmrg      sunos4*)
7247fda9279dSmrg        case $cc_basename in
7248fda9279dSmrg          CC*)
7249fda9279dSmrg	    # Sun C++ 4.x
7250fda9279dSmrg	    # FIXME: insert proper C++ library support
7251fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7252fda9279dSmrg	    ;;
7253fda9279dSmrg          lcc*)
7254fda9279dSmrg	    # Lucid
7255fda9279dSmrg	    # FIXME: insert proper C++ library support
7256fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7257fda9279dSmrg	    ;;
7258fda9279dSmrg          *)
7259fda9279dSmrg	    # FIXME: insert proper C++ library support
7260fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7261fda9279dSmrg	    ;;
7262fda9279dSmrg        esac
7263fda9279dSmrg        ;;
7264fda9279dSmrg
7265fda9279dSmrg      solaris*)
7266fda9279dSmrg        case $cc_basename in
7267fda9279dSmrg          CC* | sunCC*)
7268fda9279dSmrg	    # Sun C++ 4.2, 5.x and Centerline C++
7269fda9279dSmrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
7270fda9279dSmrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
727116ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7272fda9279dSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
727316ee1e9aSmrg              $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'
7274fda9279dSmrg
7275fda9279dSmrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7276fda9279dSmrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7277fda9279dSmrg	    case $host_os in
7278fda9279dSmrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7279fda9279dSmrg	      *)
7280fda9279dSmrg		# The compiler driver will combine and reorder linker options,
728116ee1e9aSmrg		# but understands '-z linker_flag'.
7282fda9279dSmrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
7283fda9279dSmrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
7284fda9279dSmrg	        ;;
7285fda9279dSmrg	    esac
7286fda9279dSmrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7287fda9279dSmrg
7288fda9279dSmrg	    output_verbose_link_cmd='func_echo_all'
7289fda9279dSmrg
7290fda9279dSmrg	    # Archives containing C++ object files must be created using
7291fda9279dSmrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
7292fda9279dSmrg	    # necessary to make sure instantiated templates are included
7293fda9279dSmrg	    # in the archive.
7294fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
7295fda9279dSmrg	    ;;
7296fda9279dSmrg          gcx*)
7297fda9279dSmrg	    # Green Hills C++ Compiler
729816ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7299fda9279dSmrg
7300fda9279dSmrg	    # The C++ compiler must be used to create the archive.
7301fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
7302fda9279dSmrg	    ;;
7303fda9279dSmrg          *)
7304fda9279dSmrg	    # GNU C++ compiler with Solaris linker
730516ee1e9aSmrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
730616ee1e9aSmrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
7307fda9279dSmrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
730816ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7309fda9279dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
731016ee1e9aSmrg                  $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'
7311fda9279dSmrg
7312fda9279dSmrg	        # Commands to make compiler produce verbose output that lists
7313fda9279dSmrg	        # what "hidden" libraries, object files and flags are used when
7314fda9279dSmrg	        # linking a shared library.
7315fda9279dSmrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7316fda9279dSmrg	      else
731716ee1e9aSmrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
7318fda9279dSmrg	        # platform.
731916ee1e9aSmrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7320fda9279dSmrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
732116ee1e9aSmrg                  $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'
7322fda9279dSmrg
7323fda9279dSmrg	        # Commands to make compiler produce verbose output that lists
7324fda9279dSmrg	        # what "hidden" libraries, object files and flags are used when
7325fda9279dSmrg	        # linking a shared library.
7326fda9279dSmrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7327fda9279dSmrg	      fi
7328fda9279dSmrg
732916ee1e9aSmrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
7330fda9279dSmrg	      case $host_os in
7331fda9279dSmrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
7332fda9279dSmrg		*)
733316ee1e9aSmrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
7334fda9279dSmrg		  ;;
7335fda9279dSmrg	      esac
7336fda9279dSmrg	    fi
7337fda9279dSmrg	    ;;
7338fda9279dSmrg        esac
7339fda9279dSmrg        ;;
7340fda9279dSmrg
7341fda9279dSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
734216ee1e9aSmrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7343fda9279dSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7344fda9279dSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7345fda9279dSmrg      runpath_var='LD_RUN_PATH'
7346fda9279dSmrg
7347fda9279dSmrg      case $cc_basename in
7348fda9279dSmrg        CC*)
734916ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
735016ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7351fda9279dSmrg	  ;;
7352fda9279dSmrg	*)
735316ee1e9aSmrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
735416ee1e9aSmrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7355fda9279dSmrg	  ;;
7356fda9279dSmrg      esac
7357fda9279dSmrg      ;;
7358fda9279dSmrg
7359fda9279dSmrg      sysv5* | sco3.2v5* | sco5v6*)
736016ee1e9aSmrg	# Note: We CANNOT use -z defs as we might desire, because we do not
7361fda9279dSmrg	# link with -lc, and that would cause any symbols used from libc to
7362fda9279dSmrg	# always be unresolved, which means just about no library would
7363fda9279dSmrg	# ever link correctly.  If we're not using GNU ld we use -z text
7364fda9279dSmrg	# though, which does catch some bad symbols but isn't as heavy-handed
7365fda9279dSmrg	# as -z defs.
736616ee1e9aSmrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
736716ee1e9aSmrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
7368fda9279dSmrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7369fda9279dSmrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
737016ee1e9aSmrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
7371fda9279dSmrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
7372fda9279dSmrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
737316ee1e9aSmrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
7374fda9279dSmrg	runpath_var='LD_RUN_PATH'
7375fda9279dSmrg
7376fda9279dSmrg	case $cc_basename in
7377fda9279dSmrg          CC*)
737816ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737916ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7380fda9279dSmrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
738116ee1e9aSmrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
7382fda9279dSmrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
738316ee1e9aSmrg              '"$_LT_TAGVAR(reload_cmds, $1)"
7384fda9279dSmrg	    ;;
7385fda9279dSmrg	  *)
738616ee1e9aSmrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
738716ee1e9aSmrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7388fda9279dSmrg	    ;;
7389fda9279dSmrg	esac
7390fda9279dSmrg      ;;
7391fda9279dSmrg
7392fda9279dSmrg      tandem*)
7393fda9279dSmrg        case $cc_basename in
7394fda9279dSmrg          NCC*)
7395fda9279dSmrg	    # NonStop-UX NCC 3.20
7396fda9279dSmrg	    # FIXME: insert proper C++ library support
7397fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7398fda9279dSmrg	    ;;
7399fda9279dSmrg          *)
7400fda9279dSmrg	    # FIXME: insert proper C++ library support
7401fda9279dSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
7402fda9279dSmrg	    ;;
7403fda9279dSmrg        esac
7404fda9279dSmrg        ;;
7405fda9279dSmrg
7406fda9279dSmrg      vxworks*)
7407fda9279dSmrg        # FIXME: insert proper C++ library support
7408fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7409fda9279dSmrg        ;;
7410fda9279dSmrg
7411fda9279dSmrg      *)
7412fda9279dSmrg        # FIXME: insert proper C++ library support
7413fda9279dSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
7414fda9279dSmrg        ;;
7415fda9279dSmrg    esac
7416fda9279dSmrg
7417fda9279dSmrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
741816ee1e9aSmrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7419fda9279dSmrg
742016ee1e9aSmrg    _LT_TAGVAR(GCC, $1)=$GXX
742116ee1e9aSmrg    _LT_TAGVAR(LD, $1)=$LD
7422fda9279dSmrg
7423fda9279dSmrg    ## CAVEAT EMPTOR:
7424fda9279dSmrg    ## There is no encapsulation within the following macros, do not change
7425fda9279dSmrg    ## the running order or otherwise move them around unless you know exactly
7426fda9279dSmrg    ## what you are doing...
7427fda9279dSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7428fda9279dSmrg    _LT_COMPILER_PIC($1)
7429fda9279dSmrg    _LT_COMPILER_C_O($1)
7430fda9279dSmrg    _LT_COMPILER_FILE_LOCKS($1)
7431fda9279dSmrg    _LT_LINKER_SHLIBS($1)
7432fda9279dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7433fda9279dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7434fda9279dSmrg
7435fda9279dSmrg    _LT_CONFIG($1)
7436fda9279dSmrg  fi # test -n "$compiler"
7437fda9279dSmrg
7438fda9279dSmrg  CC=$lt_save_CC
7439fda9279dSmrg  CFLAGS=$lt_save_CFLAGS
7440fda9279dSmrg  LDCXX=$LD
7441fda9279dSmrg  LD=$lt_save_LD
7442fda9279dSmrg  GCC=$lt_save_GCC
7443fda9279dSmrg  with_gnu_ld=$lt_save_with_gnu_ld
7444fda9279dSmrg  lt_cv_path_LDCXX=$lt_cv_path_LD
7445fda9279dSmrg  lt_cv_path_LD=$lt_save_path_LD
7446fda9279dSmrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
7447fda9279dSmrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
744816ee1e9aSmrgfi # test yes != "$_lt_caught_CXX_error"
7449fda9279dSmrg
7450fda9279dSmrgAC_LANG_POP
7451fda9279dSmrg])# _LT_LANG_CXX_CONFIG
7452fda9279dSmrg
7453fda9279dSmrg
7454fda9279dSmrg# _LT_FUNC_STRIPNAME_CNF
7455fda9279dSmrg# ----------------------
7456fda9279dSmrg# func_stripname_cnf prefix suffix name
7457fda9279dSmrg# strip PREFIX and SUFFIX off of NAME.
7458fda9279dSmrg# PREFIX and SUFFIX must not contain globbing or regex special
7459fda9279dSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
7460fda9279dSmrg# dot (in which case that matches only a dot).
7461fda9279dSmrg#
7462fda9279dSmrg# This function is identical to the (non-XSI) version of func_stripname,
7463fda9279dSmrg# except this one can be used by m4 code that may be executed by configure,
7464fda9279dSmrg# rather than the libtool script.
7465fda9279dSmrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
7466fda9279dSmrgAC_REQUIRE([_LT_DECL_SED])
7467fda9279dSmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
7468fda9279dSmrgfunc_stripname_cnf ()
7469fda9279dSmrg{
747016ee1e9aSmrg  case @S|@2 in
747116ee1e9aSmrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
747216ee1e9aSmrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
7473fda9279dSmrg  esac
7474fda9279dSmrg} # func_stripname_cnf
7475fda9279dSmrg])# _LT_FUNC_STRIPNAME_CNF
7476fda9279dSmrg
747716ee1e9aSmrg
7478fda9279dSmrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
7479fda9279dSmrg# ---------------------------------
7480fda9279dSmrg# Figure out "hidden" library dependencies from verbose
7481fda9279dSmrg# compiler output when linking a shared library.
7482fda9279dSmrg# Parse the compiler output and extract the necessary
7483fda9279dSmrg# objects, libraries and library flags.
7484fda9279dSmrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
7485fda9279dSmrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
7486fda9279dSmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
7487fda9279dSmrg# Dependencies to place before and after the object being linked:
7488fda9279dSmrg_LT_TAGVAR(predep_objects, $1)=
7489fda9279dSmrg_LT_TAGVAR(postdep_objects, $1)=
7490fda9279dSmrg_LT_TAGVAR(predeps, $1)=
7491fda9279dSmrg_LT_TAGVAR(postdeps, $1)=
7492fda9279dSmrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7493fda9279dSmrg
7494fda9279dSmrgdnl we can't use the lt_simple_compile_test_code here,
7495fda9279dSmrgdnl because it contains code intended for an executable,
7496fda9279dSmrgdnl not a library.  It's possible we should let each
7497fda9279dSmrgdnl tag define a new lt_????_link_test_code variable,
7498fda9279dSmrgdnl but it's only used here...
7499fda9279dSmrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
7500fda9279dSmrgint a;
7501fda9279dSmrgvoid foo (void) { a = 0; }
7502fda9279dSmrg_LT_EOF
7503fda9279dSmrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
7504fda9279dSmrgclass Foo
7505fda9279dSmrg{
7506fda9279dSmrgpublic:
7507fda9279dSmrg  Foo (void) { a = 0; }
7508fda9279dSmrgprivate:
7509fda9279dSmrg  int a;
7510fda9279dSmrg};
7511fda9279dSmrg_LT_EOF
7512fda9279dSmrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
7513fda9279dSmrg      subroutine foo
7514fda9279dSmrg      implicit none
7515fda9279dSmrg      integer*4 a
7516fda9279dSmrg      a=0
7517fda9279dSmrg      return
7518fda9279dSmrg      end
7519fda9279dSmrg_LT_EOF
7520fda9279dSmrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
7521fda9279dSmrg      subroutine foo
7522fda9279dSmrg      implicit none
7523fda9279dSmrg      integer a
7524fda9279dSmrg      a=0
7525fda9279dSmrg      return
7526fda9279dSmrg      end
7527fda9279dSmrg_LT_EOF
7528fda9279dSmrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
7529fda9279dSmrgpublic class foo {
7530fda9279dSmrg  private int a;
7531fda9279dSmrg  public void bar (void) {
7532fda9279dSmrg    a = 0;
7533fda9279dSmrg  }
7534fda9279dSmrg};
7535fda9279dSmrg_LT_EOF
7536fda9279dSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7537fda9279dSmrgpackage foo
7538fda9279dSmrgfunc foo() {
7539fda9279dSmrg}
7540fda9279dSmrg_LT_EOF
7541fda9279dSmrg])
7542fda9279dSmrg
7543fda9279dSmrg_lt_libdeps_save_CFLAGS=$CFLAGS
7544fda9279dSmrgcase "$CC $CFLAGS " in #(
7545fda9279dSmrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
7546fda9279dSmrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7547fda9279dSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
7548fda9279dSmrgesac
7549fda9279dSmrg
7550fda9279dSmrgdnl Parse the compiler output and extract the necessary
7551fda9279dSmrgdnl objects, libraries and library flags.
7552fda9279dSmrgif AC_TRY_EVAL(ac_compile); then
7553fda9279dSmrg  # Parse the compiler output and extract the necessary
7554fda9279dSmrg  # objects, libraries and library flags.
7555fda9279dSmrg
7556fda9279dSmrg  # Sentinel used to keep track of whether or not we are before
7557fda9279dSmrg  # the conftest object file.
7558fda9279dSmrg  pre_test_object_deps_done=no
7559fda9279dSmrg
7560fda9279dSmrg  for p in `eval "$output_verbose_link_cmd"`; do
756116ee1e9aSmrg    case $prev$p in
7562fda9279dSmrg
7563fda9279dSmrg    -L* | -R* | -l*)
7564fda9279dSmrg       # Some compilers place space between "-{L,R}" and the path.
7565fda9279dSmrg       # Remove the space.
756616ee1e9aSmrg       if test x-L = "$p" ||
756716ee1e9aSmrg          test x-R = "$p"; then
7568fda9279dSmrg	 prev=$p
7569fda9279dSmrg	 continue
7570fda9279dSmrg       fi
7571fda9279dSmrg
7572fda9279dSmrg       # Expand the sysroot to ease extracting the directories later.
7573fda9279dSmrg       if test -z "$prev"; then
7574fda9279dSmrg         case $p in
7575fda9279dSmrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7576fda9279dSmrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7577fda9279dSmrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7578fda9279dSmrg         esac
7579fda9279dSmrg       fi
7580fda9279dSmrg       case $p in
7581fda9279dSmrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7582fda9279dSmrg       esac
758316ee1e9aSmrg       if test no = "$pre_test_object_deps_done"; then
758416ee1e9aSmrg	 case $prev in
7585fda9279dSmrg	 -L | -R)
7586fda9279dSmrg	   # Internal compiler library paths should come after those
7587fda9279dSmrg	   # provided the user.  The postdeps already come after the
7588fda9279dSmrg	   # user supplied libs so there is no need to process them.
7589fda9279dSmrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
759016ee1e9aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
7591fda9279dSmrg	   else
759216ee1e9aSmrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
7593fda9279dSmrg	   fi
7594fda9279dSmrg	   ;;
7595fda9279dSmrg	 # The "-l" case would never come before the object being
7596fda9279dSmrg	 # linked, so don't bother handling this case.
7597fda9279dSmrg	 esac
7598fda9279dSmrg       else
7599fda9279dSmrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
760016ee1e9aSmrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
7601fda9279dSmrg	 else
760216ee1e9aSmrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
7603fda9279dSmrg	 fi
7604fda9279dSmrg       fi
7605fda9279dSmrg       prev=
7606fda9279dSmrg       ;;
7607fda9279dSmrg
7608fda9279dSmrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7609fda9279dSmrg    *.$objext)
7610fda9279dSmrg       # This assumes that the test object file only shows up
7611fda9279dSmrg       # once in the compiler output.
7612fda9279dSmrg       if test "$p" = "conftest.$objext"; then
7613fda9279dSmrg	 pre_test_object_deps_done=yes
7614fda9279dSmrg	 continue
7615fda9279dSmrg       fi
7616fda9279dSmrg
761716ee1e9aSmrg       if test no = "$pre_test_object_deps_done"; then
7618fda9279dSmrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
761916ee1e9aSmrg	   _LT_TAGVAR(predep_objects, $1)=$p
7620fda9279dSmrg	 else
7621fda9279dSmrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7622fda9279dSmrg	 fi
7623fda9279dSmrg       else
7624fda9279dSmrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
762516ee1e9aSmrg	   _LT_TAGVAR(postdep_objects, $1)=$p
7626fda9279dSmrg	 else
7627fda9279dSmrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7628fda9279dSmrg	 fi
7629fda9279dSmrg       fi
7630fda9279dSmrg       ;;
7631fda9279dSmrg
7632fda9279dSmrg    *) ;; # Ignore the rest.
7633fda9279dSmrg
7634fda9279dSmrg    esac
7635fda9279dSmrg  done
7636fda9279dSmrg
7637fda9279dSmrg  # Clean up.
7638fda9279dSmrg  rm -f a.out a.exe
7639fda9279dSmrgelse
7640fda9279dSmrg  echo "libtool.m4: error: problem compiling $1 test program"
7641fda9279dSmrgfi
7642fda9279dSmrg
7643fda9279dSmrg$RM -f confest.$objext
7644fda9279dSmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7645fda9279dSmrg
7646fda9279dSmrg# PORTME: override above test on systems where it is broken
7647fda9279dSmrgm4_if([$1], [CXX],
7648fda9279dSmrg[case $host_os in
7649fda9279dSmrginterix[[3-9]]*)
7650fda9279dSmrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7651fda9279dSmrg  # hack all around it, let's just trust "g++" to DTRT.
7652fda9279dSmrg  _LT_TAGVAR(predep_objects,$1)=
7653fda9279dSmrg  _LT_TAGVAR(postdep_objects,$1)=
7654fda9279dSmrg  _LT_TAGVAR(postdeps,$1)=
7655fda9279dSmrg  ;;
7656fda9279dSmrgesac
7657fda9279dSmrg])
7658fda9279dSmrg
7659fda9279dSmrgcase " $_LT_TAGVAR(postdeps, $1) " in
7660fda9279dSmrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7661fda9279dSmrgesac
7662fda9279dSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7663fda9279dSmrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
766416ee1e9aSmrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
7665fda9279dSmrgfi
7666fda9279dSmrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7667fda9279dSmrg    [The directories searched by this compiler when creating a shared library])
7668fda9279dSmrg_LT_TAGDECL([], [predep_objects], [1],
7669fda9279dSmrg    [Dependencies to place before and after the objects being linked to
7670fda9279dSmrg    create a shared library])
7671fda9279dSmrg_LT_TAGDECL([], [postdep_objects], [1])
7672fda9279dSmrg_LT_TAGDECL([], [predeps], [1])
7673fda9279dSmrg_LT_TAGDECL([], [postdeps], [1])
7674fda9279dSmrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7675fda9279dSmrg    [The library search path used internally by the compiler when linking
7676fda9279dSmrg    a shared library])
7677fda9279dSmrg])# _LT_SYS_HIDDEN_LIBDEPS
7678fda9279dSmrg
7679fda9279dSmrg
7680fda9279dSmrg# _LT_LANG_F77_CONFIG([TAG])
7681fda9279dSmrg# --------------------------
7682fda9279dSmrg# Ensure that the configuration variables for a Fortran 77 compiler are
7683fda9279dSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
768416ee1e9aSmrg# to write the compiler configuration to 'libtool'.
7685fda9279dSmrgm4_defun([_LT_LANG_F77_CONFIG],
7686fda9279dSmrg[AC_LANG_PUSH(Fortran 77)
768716ee1e9aSmrgif test -z "$F77" || test no = "$F77"; then
7688fda9279dSmrg  _lt_disable_F77=yes
7689fda9279dSmrgfi
7690fda9279dSmrg
7691fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7692fda9279dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7693fda9279dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7694fda9279dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7695fda9279dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7696fda9279dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7697fda9279dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7698fda9279dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7699fda9279dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7700fda9279dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7701fda9279dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7702fda9279dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7703fda9279dSmrg_LT_TAGVAR(module_cmds, $1)=
7704fda9279dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7705fda9279dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7706fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7707fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7708fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7709fda9279dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7710fda9279dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7711fda9279dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7712fda9279dSmrg
7713fda9279dSmrg# Source file extension for f77 test sources.
7714fda9279dSmrgac_ext=f
7715fda9279dSmrg
7716fda9279dSmrg# Object file extension for compiled f77 test sources.
7717fda9279dSmrgobjext=o
7718fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
7719fda9279dSmrg
7720fda9279dSmrg# No sense in running all these tests if we already determined that
7721fda9279dSmrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7722fda9279dSmrg# are currently assumed to apply to all compilers on this platform,
7723fda9279dSmrg# and will be corrupted by setting them based on a non-working compiler.
772416ee1e9aSmrgif test yes != "$_lt_disable_F77"; then
7725fda9279dSmrg  # Code to be used in simple compile tests
7726fda9279dSmrg  lt_simple_compile_test_code="\
7727fda9279dSmrg      subroutine t
7728fda9279dSmrg      return
7729fda9279dSmrg      end
7730fda9279dSmrg"
7731fda9279dSmrg
7732fda9279dSmrg  # Code to be used in simple link tests
7733fda9279dSmrg  lt_simple_link_test_code="\
7734fda9279dSmrg      program t
7735fda9279dSmrg      end
7736fda9279dSmrg"
7737fda9279dSmrg
7738fda9279dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7739fda9279dSmrg  _LT_TAG_COMPILER
7740fda9279dSmrg
7741fda9279dSmrg  # save warnings/boilerplate of simple test code
7742fda9279dSmrg  _LT_COMPILER_BOILERPLATE
7743fda9279dSmrg  _LT_LINKER_BOILERPLATE
7744fda9279dSmrg
7745fda9279dSmrg  # Allow CC to be a program name with arguments.
774616ee1e9aSmrg  lt_save_CC=$CC
7747fda9279dSmrg  lt_save_GCC=$GCC
7748fda9279dSmrg  lt_save_CFLAGS=$CFLAGS
7749fda9279dSmrg  CC=${F77-"f77"}
7750fda9279dSmrg  CFLAGS=$FFLAGS
7751fda9279dSmrg  compiler=$CC
7752fda9279dSmrg  _LT_TAGVAR(compiler, $1)=$CC
7753fda9279dSmrg  _LT_CC_BASENAME([$compiler])
7754fda9279dSmrg  GCC=$G77
7755fda9279dSmrg  if test -n "$compiler"; then
7756fda9279dSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7757fda9279dSmrg    AC_MSG_RESULT([$can_build_shared])
7758fda9279dSmrg
7759fda9279dSmrg    AC_MSG_CHECKING([whether to build shared libraries])
776016ee1e9aSmrg    test no = "$can_build_shared" && enable_shared=no
7761fda9279dSmrg
7762fda9279dSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7763fda9279dSmrg    # are all built from PIC.
7764fda9279dSmrg    case $host_os in
7765fda9279dSmrg      aix3*)
776616ee1e9aSmrg        test yes = "$enable_shared" && enable_static=no
7767fda9279dSmrg        if test -n "$RANLIB"; then
7768fda9279dSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7769fda9279dSmrg          postinstall_cmds='$RANLIB $lib'
7770fda9279dSmrg        fi
7771fda9279dSmrg        ;;
7772fda9279dSmrg      aix[[4-9]]*)
777316ee1e9aSmrg	if test ia64 != "$host_cpu"; then
777416ee1e9aSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
777516ee1e9aSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
777616ee1e9aSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
777716ee1e9aSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
777816ee1e9aSmrg	  esac
7779fda9279dSmrg	fi
7780fda9279dSmrg        ;;
7781fda9279dSmrg    esac
7782fda9279dSmrg    AC_MSG_RESULT([$enable_shared])
7783fda9279dSmrg
7784fda9279dSmrg    AC_MSG_CHECKING([whether to build static libraries])
7785fda9279dSmrg    # Make sure either enable_shared or enable_static is yes.
778616ee1e9aSmrg    test yes = "$enable_shared" || enable_static=yes
7787fda9279dSmrg    AC_MSG_RESULT([$enable_static])
7788fda9279dSmrg
778916ee1e9aSmrg    _LT_TAGVAR(GCC, $1)=$G77
779016ee1e9aSmrg    _LT_TAGVAR(LD, $1)=$LD
7791fda9279dSmrg
7792fda9279dSmrg    ## CAVEAT EMPTOR:
7793fda9279dSmrg    ## There is no encapsulation within the following macros, do not change
7794fda9279dSmrg    ## the running order or otherwise move them around unless you know exactly
7795fda9279dSmrg    ## what you are doing...
7796fda9279dSmrg    _LT_COMPILER_PIC($1)
7797fda9279dSmrg    _LT_COMPILER_C_O($1)
7798fda9279dSmrg    _LT_COMPILER_FILE_LOCKS($1)
7799fda9279dSmrg    _LT_LINKER_SHLIBS($1)
7800fda9279dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7801fda9279dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7802fda9279dSmrg
7803fda9279dSmrg    _LT_CONFIG($1)
7804fda9279dSmrg  fi # test -n "$compiler"
7805fda9279dSmrg
7806fda9279dSmrg  GCC=$lt_save_GCC
780716ee1e9aSmrg  CC=$lt_save_CC
780816ee1e9aSmrg  CFLAGS=$lt_save_CFLAGS
780916ee1e9aSmrgfi # test yes != "$_lt_disable_F77"
7810fda9279dSmrg
7811fda9279dSmrgAC_LANG_POP
7812fda9279dSmrg])# _LT_LANG_F77_CONFIG
7813fda9279dSmrg
7814fda9279dSmrg
7815fda9279dSmrg# _LT_LANG_FC_CONFIG([TAG])
7816fda9279dSmrg# -------------------------
7817fda9279dSmrg# Ensure that the configuration variables for a Fortran compiler are
7818fda9279dSmrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
781916ee1e9aSmrg# to write the compiler configuration to 'libtool'.
7820fda9279dSmrgm4_defun([_LT_LANG_FC_CONFIG],
7821fda9279dSmrg[AC_LANG_PUSH(Fortran)
7822fda9279dSmrg
782316ee1e9aSmrgif test -z "$FC" || test no = "$FC"; then
7824fda9279dSmrg  _lt_disable_FC=yes
7825fda9279dSmrgfi
7826fda9279dSmrg
7827fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7828fda9279dSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
7829fda9279dSmrg_LT_TAGVAR(always_export_symbols, $1)=no
7830fda9279dSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7831fda9279dSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7832fda9279dSmrg_LT_TAGVAR(hardcode_direct, $1)=no
7833fda9279dSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7834fda9279dSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7835fda9279dSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7836fda9279dSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7837fda9279dSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
7838fda9279dSmrg_LT_TAGVAR(inherit_rpath, $1)=no
7839fda9279dSmrg_LT_TAGVAR(module_cmds, $1)=
7840fda9279dSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
7841fda9279dSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7842fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7843fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7844fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7845fda9279dSmrg_LT_TAGVAR(no_undefined_flag, $1)=
7846fda9279dSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7847fda9279dSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7848fda9279dSmrg
7849fda9279dSmrg# Source file extension for fc test sources.
7850fda9279dSmrgac_ext=${ac_fc_srcext-f}
7851fda9279dSmrg
7852fda9279dSmrg# Object file extension for compiled fc test sources.
7853fda9279dSmrgobjext=o
7854fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
7855fda9279dSmrg
7856fda9279dSmrg# No sense in running all these tests if we already determined that
7857fda9279dSmrg# the FC compiler isn't working.  Some variables (like enable_shared)
7858fda9279dSmrg# are currently assumed to apply to all compilers on this platform,
7859fda9279dSmrg# and will be corrupted by setting them based on a non-working compiler.
786016ee1e9aSmrgif test yes != "$_lt_disable_FC"; then
7861fda9279dSmrg  # Code to be used in simple compile tests
7862fda9279dSmrg  lt_simple_compile_test_code="\
7863fda9279dSmrg      subroutine t
7864fda9279dSmrg      return
7865fda9279dSmrg      end
7866fda9279dSmrg"
7867fda9279dSmrg
7868fda9279dSmrg  # Code to be used in simple link tests
7869fda9279dSmrg  lt_simple_link_test_code="\
7870fda9279dSmrg      program t
7871fda9279dSmrg      end
7872fda9279dSmrg"
7873fda9279dSmrg
7874fda9279dSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7875fda9279dSmrg  _LT_TAG_COMPILER
7876fda9279dSmrg
7877fda9279dSmrg  # save warnings/boilerplate of simple test code
7878fda9279dSmrg  _LT_COMPILER_BOILERPLATE
7879fda9279dSmrg  _LT_LINKER_BOILERPLATE
7880fda9279dSmrg
7881fda9279dSmrg  # Allow CC to be a program name with arguments.
788216ee1e9aSmrg  lt_save_CC=$CC
7883fda9279dSmrg  lt_save_GCC=$GCC
7884fda9279dSmrg  lt_save_CFLAGS=$CFLAGS
7885fda9279dSmrg  CC=${FC-"f95"}
7886fda9279dSmrg  CFLAGS=$FCFLAGS
7887fda9279dSmrg  compiler=$CC
7888fda9279dSmrg  GCC=$ac_cv_fc_compiler_gnu
7889fda9279dSmrg
7890fda9279dSmrg  _LT_TAGVAR(compiler, $1)=$CC
7891fda9279dSmrg  _LT_CC_BASENAME([$compiler])
7892fda9279dSmrg
7893fda9279dSmrg  if test -n "$compiler"; then
7894fda9279dSmrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7895fda9279dSmrg    AC_MSG_RESULT([$can_build_shared])
7896fda9279dSmrg
7897fda9279dSmrg    AC_MSG_CHECKING([whether to build shared libraries])
789816ee1e9aSmrg    test no = "$can_build_shared" && enable_shared=no
7899fda9279dSmrg
7900fda9279dSmrg    # On AIX, shared libraries and static libraries use the same namespace, and
7901fda9279dSmrg    # are all built from PIC.
7902fda9279dSmrg    case $host_os in
7903fda9279dSmrg      aix3*)
790416ee1e9aSmrg        test yes = "$enable_shared" && enable_static=no
7905fda9279dSmrg        if test -n "$RANLIB"; then
7906fda9279dSmrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7907fda9279dSmrg          postinstall_cmds='$RANLIB $lib'
7908fda9279dSmrg        fi
7909fda9279dSmrg        ;;
7910fda9279dSmrg      aix[[4-9]]*)
791116ee1e9aSmrg	if test ia64 != "$host_cpu"; then
791216ee1e9aSmrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
791316ee1e9aSmrg	  yes,aix,yes) ;;		# shared object as lib.so file only
791416ee1e9aSmrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
791516ee1e9aSmrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
791616ee1e9aSmrg	  esac
7917fda9279dSmrg	fi
7918fda9279dSmrg        ;;
7919fda9279dSmrg    esac
7920fda9279dSmrg    AC_MSG_RESULT([$enable_shared])
7921fda9279dSmrg
7922fda9279dSmrg    AC_MSG_CHECKING([whether to build static libraries])
7923fda9279dSmrg    # Make sure either enable_shared or enable_static is yes.
792416ee1e9aSmrg    test yes = "$enable_shared" || enable_static=yes
7925fda9279dSmrg    AC_MSG_RESULT([$enable_static])
7926fda9279dSmrg
792716ee1e9aSmrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
792816ee1e9aSmrg    _LT_TAGVAR(LD, $1)=$LD
7929fda9279dSmrg
7930fda9279dSmrg    ## CAVEAT EMPTOR:
7931fda9279dSmrg    ## There is no encapsulation within the following macros, do not change
7932fda9279dSmrg    ## the running order or otherwise move them around unless you know exactly
7933fda9279dSmrg    ## what you are doing...
7934fda9279dSmrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7935fda9279dSmrg    _LT_COMPILER_PIC($1)
7936fda9279dSmrg    _LT_COMPILER_C_O($1)
7937fda9279dSmrg    _LT_COMPILER_FILE_LOCKS($1)
7938fda9279dSmrg    _LT_LINKER_SHLIBS($1)
7939fda9279dSmrg    _LT_SYS_DYNAMIC_LINKER($1)
7940fda9279dSmrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7941fda9279dSmrg
7942fda9279dSmrg    _LT_CONFIG($1)
7943fda9279dSmrg  fi # test -n "$compiler"
7944fda9279dSmrg
7945fda9279dSmrg  GCC=$lt_save_GCC
7946fda9279dSmrg  CC=$lt_save_CC
7947fda9279dSmrg  CFLAGS=$lt_save_CFLAGS
794816ee1e9aSmrgfi # test yes != "$_lt_disable_FC"
7949fda9279dSmrg
7950fda9279dSmrgAC_LANG_POP
7951fda9279dSmrg])# _LT_LANG_FC_CONFIG
7952fda9279dSmrg
7953fda9279dSmrg
7954fda9279dSmrg# _LT_LANG_GCJ_CONFIG([TAG])
7955fda9279dSmrg# --------------------------
7956fda9279dSmrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7957fda9279dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
795816ee1e9aSmrg# to write the compiler configuration to 'libtool'.
7959fda9279dSmrgm4_defun([_LT_LANG_GCJ_CONFIG],
7960fda9279dSmrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7961fda9279dSmrgAC_LANG_SAVE
7962fda9279dSmrg
7963fda9279dSmrg# Source file extension for Java test sources.
7964fda9279dSmrgac_ext=java
7965fda9279dSmrg
7966fda9279dSmrg# Object file extension for compiled Java test sources.
7967fda9279dSmrgobjext=o
7968fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
7969fda9279dSmrg
7970fda9279dSmrg# Code to be used in simple compile tests
7971fda9279dSmrglt_simple_compile_test_code="class foo {}"
7972fda9279dSmrg
7973fda9279dSmrg# Code to be used in simple link tests
7974fda9279dSmrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7975fda9279dSmrg
7976fda9279dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7977fda9279dSmrg_LT_TAG_COMPILER
7978fda9279dSmrg
7979fda9279dSmrg# save warnings/boilerplate of simple test code
7980fda9279dSmrg_LT_COMPILER_BOILERPLATE
7981fda9279dSmrg_LT_LINKER_BOILERPLATE
7982fda9279dSmrg
7983fda9279dSmrg# Allow CC to be a program name with arguments.
7984fda9279dSmrglt_save_CC=$CC
7985fda9279dSmrglt_save_CFLAGS=$CFLAGS
7986fda9279dSmrglt_save_GCC=$GCC
7987fda9279dSmrgGCC=yes
7988fda9279dSmrgCC=${GCJ-"gcj"}
7989fda9279dSmrgCFLAGS=$GCJFLAGS
7990fda9279dSmrgcompiler=$CC
7991fda9279dSmrg_LT_TAGVAR(compiler, $1)=$CC
799216ee1e9aSmrg_LT_TAGVAR(LD, $1)=$LD
7993fda9279dSmrg_LT_CC_BASENAME([$compiler])
7994fda9279dSmrg
7995fda9279dSmrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7996fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7997fda9279dSmrg
7998fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7999fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8000fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8001fda9279dSmrg
8002fda9279dSmrgif test -n "$compiler"; then
8003fda9279dSmrg  _LT_COMPILER_NO_RTTI($1)
8004fda9279dSmrg  _LT_COMPILER_PIC($1)
8005fda9279dSmrg  _LT_COMPILER_C_O($1)
8006fda9279dSmrg  _LT_COMPILER_FILE_LOCKS($1)
8007fda9279dSmrg  _LT_LINKER_SHLIBS($1)
8008fda9279dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8009fda9279dSmrg
8010fda9279dSmrg  _LT_CONFIG($1)
8011fda9279dSmrgfi
8012fda9279dSmrg
8013fda9279dSmrgAC_LANG_RESTORE
8014fda9279dSmrg
8015fda9279dSmrgGCC=$lt_save_GCC
8016fda9279dSmrgCC=$lt_save_CC
8017fda9279dSmrgCFLAGS=$lt_save_CFLAGS
8018fda9279dSmrg])# _LT_LANG_GCJ_CONFIG
8019fda9279dSmrg
8020fda9279dSmrg
8021fda9279dSmrg# _LT_LANG_GO_CONFIG([TAG])
8022fda9279dSmrg# --------------------------
8023fda9279dSmrg# Ensure that the configuration variables for the GNU Go compiler
8024fda9279dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
802516ee1e9aSmrg# to write the compiler configuration to 'libtool'.
8026fda9279dSmrgm4_defun([_LT_LANG_GO_CONFIG],
8027fda9279dSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8028fda9279dSmrgAC_LANG_SAVE
8029fda9279dSmrg
8030fda9279dSmrg# Source file extension for Go test sources.
8031fda9279dSmrgac_ext=go
8032fda9279dSmrg
8033fda9279dSmrg# Object file extension for compiled Go test sources.
8034fda9279dSmrgobjext=o
8035fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
8036fda9279dSmrg
8037fda9279dSmrg# Code to be used in simple compile tests
8038fda9279dSmrglt_simple_compile_test_code="package main; func main() { }"
8039fda9279dSmrg
8040fda9279dSmrg# Code to be used in simple link tests
8041fda9279dSmrglt_simple_link_test_code='package main; func main() { }'
8042fda9279dSmrg
8043fda9279dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8044fda9279dSmrg_LT_TAG_COMPILER
8045fda9279dSmrg
8046fda9279dSmrg# save warnings/boilerplate of simple test code
8047fda9279dSmrg_LT_COMPILER_BOILERPLATE
8048fda9279dSmrg_LT_LINKER_BOILERPLATE
8049fda9279dSmrg
8050fda9279dSmrg# Allow CC to be a program name with arguments.
8051fda9279dSmrglt_save_CC=$CC
8052fda9279dSmrglt_save_CFLAGS=$CFLAGS
8053fda9279dSmrglt_save_GCC=$GCC
8054fda9279dSmrgGCC=yes
8055fda9279dSmrgCC=${GOC-"gccgo"}
8056fda9279dSmrgCFLAGS=$GOFLAGS
8057fda9279dSmrgcompiler=$CC
8058fda9279dSmrg_LT_TAGVAR(compiler, $1)=$CC
805916ee1e9aSmrg_LT_TAGVAR(LD, $1)=$LD
8060fda9279dSmrg_LT_CC_BASENAME([$compiler])
8061fda9279dSmrg
8062fda9279dSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8063fda9279dSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8064fda9279dSmrg
8065fda9279dSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8066fda9279dSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8067fda9279dSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8068fda9279dSmrg
8069fda9279dSmrgif test -n "$compiler"; then
8070fda9279dSmrg  _LT_COMPILER_NO_RTTI($1)
8071fda9279dSmrg  _LT_COMPILER_PIC($1)
8072fda9279dSmrg  _LT_COMPILER_C_O($1)
8073fda9279dSmrg  _LT_COMPILER_FILE_LOCKS($1)
8074fda9279dSmrg  _LT_LINKER_SHLIBS($1)
8075fda9279dSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8076fda9279dSmrg
8077fda9279dSmrg  _LT_CONFIG($1)
8078fda9279dSmrgfi
8079fda9279dSmrg
8080fda9279dSmrgAC_LANG_RESTORE
8081fda9279dSmrg
8082fda9279dSmrgGCC=$lt_save_GCC
8083fda9279dSmrgCC=$lt_save_CC
8084fda9279dSmrgCFLAGS=$lt_save_CFLAGS
8085fda9279dSmrg])# _LT_LANG_GO_CONFIG
8086fda9279dSmrg
8087fda9279dSmrg
8088fda9279dSmrg# _LT_LANG_RC_CONFIG([TAG])
8089fda9279dSmrg# -------------------------
8090fda9279dSmrg# Ensure that the configuration variables for the Windows resource compiler
8091fda9279dSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
809216ee1e9aSmrg# to write the compiler configuration to 'libtool'.
8093fda9279dSmrgm4_defun([_LT_LANG_RC_CONFIG],
8094fda9279dSmrg[AC_REQUIRE([LT_PROG_RC])dnl
8095fda9279dSmrgAC_LANG_SAVE
8096fda9279dSmrg
8097fda9279dSmrg# Source file extension for RC test sources.
8098fda9279dSmrgac_ext=rc
8099fda9279dSmrg
8100fda9279dSmrg# Object file extension for compiled RC test sources.
8101fda9279dSmrgobjext=o
8102fda9279dSmrg_LT_TAGVAR(objext, $1)=$objext
8103fda9279dSmrg
8104fda9279dSmrg# Code to be used in simple compile tests
8105fda9279dSmrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8106fda9279dSmrg
8107fda9279dSmrg# Code to be used in simple link tests
810816ee1e9aSmrglt_simple_link_test_code=$lt_simple_compile_test_code
8109fda9279dSmrg
8110fda9279dSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8111fda9279dSmrg_LT_TAG_COMPILER
8112fda9279dSmrg
8113fda9279dSmrg# save warnings/boilerplate of simple test code
8114fda9279dSmrg_LT_COMPILER_BOILERPLATE
8115fda9279dSmrg_LT_LINKER_BOILERPLATE
8116fda9279dSmrg
8117fda9279dSmrg# Allow CC to be a program name with arguments.
811816ee1e9aSmrglt_save_CC=$CC
8119fda9279dSmrglt_save_CFLAGS=$CFLAGS
8120fda9279dSmrglt_save_GCC=$GCC
8121fda9279dSmrgGCC=
8122fda9279dSmrgCC=${RC-"windres"}
8123fda9279dSmrgCFLAGS=
8124fda9279dSmrgcompiler=$CC
8125fda9279dSmrg_LT_TAGVAR(compiler, $1)=$CC
8126fda9279dSmrg_LT_CC_BASENAME([$compiler])
8127fda9279dSmrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
8128fda9279dSmrg
8129fda9279dSmrgif test -n "$compiler"; then
8130fda9279dSmrg  :
8131fda9279dSmrg  _LT_CONFIG($1)
8132fda9279dSmrgfi
8133fda9279dSmrg
8134fda9279dSmrgGCC=$lt_save_GCC
8135fda9279dSmrgAC_LANG_RESTORE
8136fda9279dSmrgCC=$lt_save_CC
8137fda9279dSmrgCFLAGS=$lt_save_CFLAGS
8138fda9279dSmrg])# _LT_LANG_RC_CONFIG
8139fda9279dSmrg
8140fda9279dSmrg
8141fda9279dSmrg# LT_PROG_GCJ
8142fda9279dSmrg# -----------
8143fda9279dSmrgAC_DEFUN([LT_PROG_GCJ],
8144fda9279dSmrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
8145fda9279dSmrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
8146fda9279dSmrg    [AC_CHECK_TOOL(GCJ, gcj,)
814716ee1e9aSmrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
8148fda9279dSmrg      AC_SUBST(GCJFLAGS)])])[]dnl
8149fda9279dSmrg])
8150fda9279dSmrg
8151fda9279dSmrg# Old name:
8152fda9279dSmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
8153fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8154fda9279dSmrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8155fda9279dSmrg
8156fda9279dSmrg
8157fda9279dSmrg# LT_PROG_GO
8158fda9279dSmrg# ----------
8159fda9279dSmrgAC_DEFUN([LT_PROG_GO],
8160fda9279dSmrg[AC_CHECK_TOOL(GOC, gccgo,)
8161fda9279dSmrg])
8162fda9279dSmrg
8163fda9279dSmrg
8164fda9279dSmrg# LT_PROG_RC
8165fda9279dSmrg# ----------
8166fda9279dSmrgAC_DEFUN([LT_PROG_RC],
8167fda9279dSmrg[AC_CHECK_TOOL(RC, windres,)
8168fda9279dSmrg])
8169fda9279dSmrg
8170fda9279dSmrg# Old name:
8171fda9279dSmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
8172fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8173fda9279dSmrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8174fda9279dSmrg
8175fda9279dSmrg
8176fda9279dSmrg# _LT_DECL_EGREP
8177fda9279dSmrg# --------------
8178fda9279dSmrg# If we don't have a new enough Autoconf to choose the best grep
8179fda9279dSmrg# available, choose the one first in the user's PATH.
8180fda9279dSmrgm4_defun([_LT_DECL_EGREP],
8181fda9279dSmrg[AC_REQUIRE([AC_PROG_EGREP])dnl
8182fda9279dSmrgAC_REQUIRE([AC_PROG_FGREP])dnl
8183fda9279dSmrgtest -z "$GREP" && GREP=grep
8184fda9279dSmrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
8185fda9279dSmrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
8186fda9279dSmrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
8187fda9279dSmrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
8188fda9279dSmrgAC_SUBST([GREP])
8189fda9279dSmrg])
8190fda9279dSmrg
8191fda9279dSmrg
8192fda9279dSmrg# _LT_DECL_OBJDUMP
8193fda9279dSmrg# --------------
8194fda9279dSmrg# If we don't have a new enough Autoconf to choose the best objdump
8195fda9279dSmrg# available, choose the one first in the user's PATH.
8196fda9279dSmrgm4_defun([_LT_DECL_OBJDUMP],
8197fda9279dSmrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
8198fda9279dSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8199fda9279dSmrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
8200fda9279dSmrgAC_SUBST([OBJDUMP])
8201fda9279dSmrg])
8202fda9279dSmrg
8203fda9279dSmrg# _LT_DECL_DLLTOOL
8204fda9279dSmrg# ----------------
8205fda9279dSmrg# Ensure DLLTOOL variable is set.
8206fda9279dSmrgm4_defun([_LT_DECL_DLLTOOL],
8207fda9279dSmrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8208fda9279dSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8209fda9279dSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
8210fda9279dSmrgAC_SUBST([DLLTOOL])
8211fda9279dSmrg])
8212fda9279dSmrg
8213fda9279dSmrg# _LT_DECL_SED
8214fda9279dSmrg# ------------
8215fda9279dSmrg# Check for a fully-functional sed program, that truncates
8216fda9279dSmrg# as few characters as possible.  Prefer GNU sed if found.
8217fda9279dSmrgm4_defun([_LT_DECL_SED],
8218fda9279dSmrg[AC_PROG_SED
8219fda9279dSmrgtest -z "$SED" && SED=sed
8220fda9279dSmrgXsed="$SED -e 1s/^X//"
8221fda9279dSmrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
8222fda9279dSmrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
8223fda9279dSmrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
8224fda9279dSmrg])# _LT_DECL_SED
8225fda9279dSmrg
8226fda9279dSmrgm4_ifndef([AC_PROG_SED], [
8227fda9279dSmrg# NOTE: This macro has been submitted for inclusion into   #
8228fda9279dSmrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
8229fda9279dSmrg#  a released version of Autoconf we should remove this    #
8230fda9279dSmrg#  macro and use it instead.                               #
8231fda9279dSmrg
8232fda9279dSmrgm4_defun([AC_PROG_SED],
8233fda9279dSmrg[AC_MSG_CHECKING([for a sed that does not truncate output])
8234fda9279dSmrgAC_CACHE_VAL(lt_cv_path_SED,
8235fda9279dSmrg[# Loop through the user's path and test for sed and gsed.
8236fda9279dSmrg# Then use that list of sed's as ones to test for truncation.
8237fda9279dSmrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8238fda9279dSmrgfor as_dir in $PATH
8239fda9279dSmrgdo
8240fda9279dSmrg  IFS=$as_save_IFS
8241fda9279dSmrg  test -z "$as_dir" && as_dir=.
8242fda9279dSmrg  for lt_ac_prog in sed gsed; do
8243fda9279dSmrg    for ac_exec_ext in '' $ac_executable_extensions; do
8244fda9279dSmrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
8245fda9279dSmrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
8246fda9279dSmrg      fi
8247fda9279dSmrg    done
8248fda9279dSmrg  done
8249fda9279dSmrgdone
8250fda9279dSmrgIFS=$as_save_IFS
8251fda9279dSmrglt_ac_max=0
8252fda9279dSmrglt_ac_count=0
8253fda9279dSmrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
8254fda9279dSmrg# along with /bin/sed that truncates output.
8255fda9279dSmrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
825616ee1e9aSmrg  test ! -f "$lt_ac_sed" && continue
8257fda9279dSmrg  cat /dev/null > conftest.in
8258fda9279dSmrg  lt_ac_count=0
8259fda9279dSmrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
8260fda9279dSmrg  # Check for GNU sed and select it if it is found.
8261fda9279dSmrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
8262fda9279dSmrg    lt_cv_path_SED=$lt_ac_sed
8263fda9279dSmrg    break
8264fda9279dSmrg  fi
8265fda9279dSmrg  while true; do
8266fda9279dSmrg    cat conftest.in conftest.in >conftest.tmp
8267fda9279dSmrg    mv conftest.tmp conftest.in
8268fda9279dSmrg    cp conftest.in conftest.nl
8269fda9279dSmrg    echo >>conftest.nl
8270fda9279dSmrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
8271fda9279dSmrg    cmp -s conftest.out conftest.nl || break
8272fda9279dSmrg    # 10000 chars as input seems more than enough
827316ee1e9aSmrg    test 10 -lt "$lt_ac_count" && break
8274fda9279dSmrg    lt_ac_count=`expr $lt_ac_count + 1`
827516ee1e9aSmrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
8276fda9279dSmrg      lt_ac_max=$lt_ac_count
8277fda9279dSmrg      lt_cv_path_SED=$lt_ac_sed
8278fda9279dSmrg    fi
8279fda9279dSmrg  done
8280fda9279dSmrgdone
8281fda9279dSmrg])
8282fda9279dSmrgSED=$lt_cv_path_SED
8283fda9279dSmrgAC_SUBST([SED])
8284fda9279dSmrgAC_MSG_RESULT([$SED])
8285fda9279dSmrg])#AC_PROG_SED
8286fda9279dSmrg])#m4_ifndef
8287fda9279dSmrg
8288fda9279dSmrg# Old name:
8289fda9279dSmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
8290fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8291fda9279dSmrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8292fda9279dSmrg
8293fda9279dSmrg
8294fda9279dSmrg# _LT_CHECK_SHELL_FEATURES
8295fda9279dSmrg# ------------------------
8296fda9279dSmrg# Find out whether the shell is Bourne or XSI compatible,
8297fda9279dSmrg# or has some other useful features.
8298fda9279dSmrgm4_defun([_LT_CHECK_SHELL_FEATURES],
829916ee1e9aSmrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
8300fda9279dSmrg  lt_unset=unset
8301fda9279dSmrgelse
8302fda9279dSmrg  lt_unset=false
8303fda9279dSmrgfi
8304fda9279dSmrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8305fda9279dSmrg
8306fda9279dSmrg# test EBCDIC or ASCII
8307fda9279dSmrgcase `echo X|tr X '\101'` in
8308fda9279dSmrg A) # ASCII based system
8309fda9279dSmrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
8310fda9279dSmrg  lt_SP2NL='tr \040 \012'
8311fda9279dSmrg  lt_NL2SP='tr \015\012 \040\040'
8312fda9279dSmrg  ;;
8313fda9279dSmrg *) # EBCDIC based system
8314fda9279dSmrg  lt_SP2NL='tr \100 \n'
8315fda9279dSmrg  lt_NL2SP='tr \r\n \100\100'
8316fda9279dSmrg  ;;
8317fda9279dSmrgesac
8318fda9279dSmrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8319fda9279dSmrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8320fda9279dSmrg])# _LT_CHECK_SHELL_FEATURES
8321fda9279dSmrg
8322fda9279dSmrg
8323fda9279dSmrg# _LT_PATH_CONVERSION_FUNCTIONS
8324fda9279dSmrg# -----------------------------
832516ee1e9aSmrg# Determine what file name conversion functions should be used by
8326fda9279dSmrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
8327fda9279dSmrg# for certain cross-compile configurations and native mingw.
8328fda9279dSmrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
8329fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8330fda9279dSmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
8331fda9279dSmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
8332fda9279dSmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
8333fda9279dSmrg[case $host in
8334fda9279dSmrg  *-*-mingw* )
8335fda9279dSmrg    case $build in
8336fda9279dSmrg      *-*-mingw* ) # actually msys
8337fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
8338fda9279dSmrg        ;;
8339fda9279dSmrg      *-*-cygwin* )
8340fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
8341fda9279dSmrg        ;;
8342fda9279dSmrg      * ) # otherwise, assume *nix
8343fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
8344fda9279dSmrg        ;;
8345fda9279dSmrg    esac
8346fda9279dSmrg    ;;
8347fda9279dSmrg  *-*-cygwin* )
8348fda9279dSmrg    case $build in
8349fda9279dSmrg      *-*-mingw* ) # actually msys
8350fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
8351fda9279dSmrg        ;;
8352fda9279dSmrg      *-*-cygwin* )
8353fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_noop
8354fda9279dSmrg        ;;
8355fda9279dSmrg      * ) # otherwise, assume *nix
8356fda9279dSmrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
8357fda9279dSmrg        ;;
8358fda9279dSmrg    esac
8359fda9279dSmrg    ;;
8360fda9279dSmrg  * ) # unhandled hosts (and "normal" native builds)
8361fda9279dSmrg    lt_cv_to_host_file_cmd=func_convert_file_noop
8362fda9279dSmrg    ;;
8363fda9279dSmrgesac
8364fda9279dSmrg])
8365fda9279dSmrgto_host_file_cmd=$lt_cv_to_host_file_cmd
8366fda9279dSmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
8367fda9279dSmrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
8368fda9279dSmrg         [0], [convert $build file names to $host format])dnl
8369fda9279dSmrg
8370fda9279dSmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
8371fda9279dSmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
8372fda9279dSmrg[#assume ordinary cross tools, or native build.
8373fda9279dSmrglt_cv_to_tool_file_cmd=func_convert_file_noop
8374fda9279dSmrgcase $host in
8375fda9279dSmrg  *-*-mingw* )
8376fda9279dSmrg    case $build in
8377fda9279dSmrg      *-*-mingw* ) # actually msys
8378fda9279dSmrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
8379fda9279dSmrg        ;;
8380fda9279dSmrg    esac
8381fda9279dSmrg    ;;
8382fda9279dSmrgesac
8383fda9279dSmrg])
8384fda9279dSmrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
8385fda9279dSmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
8386fda9279dSmrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
8387fda9279dSmrg         [0], [convert $build files to toolchain format])dnl
8388fda9279dSmrg])# _LT_PATH_CONVERSION_FUNCTIONS
8389fda9279dSmrg
8390fda9279dSmrg# Helper functions for option handling.                    -*- Autoconf -*-
8391fda9279dSmrg#
839216ee1e9aSmrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
839316ee1e9aSmrg#   Foundation, Inc.
8394fda9279dSmrg#   Written by Gary V. Vaughan, 2004
8395fda9279dSmrg#
8396fda9279dSmrg# This file is free software; the Free Software Foundation gives
8397fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8398fda9279dSmrg# modifications, as long as this notice is preserved.
8399fda9279dSmrg
840016ee1e9aSmrg# serial 8 ltoptions.m4
8401fda9279dSmrg
8402fda9279dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8403fda9279dSmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8404fda9279dSmrg
8405fda9279dSmrg
8406fda9279dSmrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8407fda9279dSmrg# ------------------------------------------
8408fda9279dSmrgm4_define([_LT_MANGLE_OPTION],
8409fda9279dSmrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8410fda9279dSmrg
8411fda9279dSmrg
8412fda9279dSmrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8413fda9279dSmrg# ---------------------------------------
8414fda9279dSmrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8415fda9279dSmrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8416fda9279dSmrg# saved as a flag.
8417fda9279dSmrgm4_define([_LT_SET_OPTION],
8418fda9279dSmrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8419fda9279dSmrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8420fda9279dSmrg        _LT_MANGLE_DEFUN([$1], [$2]),
842116ee1e9aSmrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
8422fda9279dSmrg])
8423fda9279dSmrg
8424fda9279dSmrg
8425fda9279dSmrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8426fda9279dSmrg# ------------------------------------------------------------
8427fda9279dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8428fda9279dSmrgm4_define([_LT_IF_OPTION],
8429fda9279dSmrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8430fda9279dSmrg
8431fda9279dSmrg
8432fda9279dSmrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8433fda9279dSmrg# -------------------------------------------------------
8434fda9279dSmrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8435fda9279dSmrg# are set.
8436fda9279dSmrgm4_define([_LT_UNLESS_OPTIONS],
8437fda9279dSmrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8438fda9279dSmrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8439fda9279dSmrg		      [m4_define([$0_found])])])[]dnl
8440fda9279dSmrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8441fda9279dSmrg])[]dnl
8442fda9279dSmrg])
8443fda9279dSmrg
8444fda9279dSmrg
8445fda9279dSmrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8446fda9279dSmrg# ----------------------------------------
8447fda9279dSmrg# OPTION-LIST is a space-separated list of Libtool options associated
8448fda9279dSmrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8449fda9279dSmrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8450fda9279dSmrg# the unknown option and exit.
8451fda9279dSmrgm4_defun([_LT_SET_OPTIONS],
8452fda9279dSmrg[# Set options
8453fda9279dSmrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8454fda9279dSmrg    [_LT_SET_OPTION([$1], _LT_Option)])
8455fda9279dSmrg
8456fda9279dSmrgm4_if([$1],[LT_INIT],[
8457fda9279dSmrg  dnl
8458fda9279dSmrg  dnl Simply set some default values (i.e off) if boolean options were not
8459fda9279dSmrg  dnl specified:
8460fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8461fda9279dSmrg  ])
8462fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8463fda9279dSmrg  ])
8464fda9279dSmrg  dnl
8465fda9279dSmrg  dnl If no reference was made to various pairs of opposing options, then
8466fda9279dSmrg  dnl we run the default mode handler for the pair.  For example, if neither
846716ee1e9aSmrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
8468fda9279dSmrg  dnl archives by default:
8469fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8470fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8471fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8472fda9279dSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
847316ee1e9aSmrg		   [_LT_ENABLE_FAST_INSTALL])
847416ee1e9aSmrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
847516ee1e9aSmrg		   [_LT_WITH_AIX_SONAME([aix])])
8476fda9279dSmrg  ])
8477fda9279dSmrg])# _LT_SET_OPTIONS
8478fda9279dSmrg
8479fda9279dSmrg
8480fda9279dSmrg
8481fda9279dSmrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8482fda9279dSmrg# -----------------------------------------
8483fda9279dSmrgm4_define([_LT_MANGLE_DEFUN],
8484fda9279dSmrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8485fda9279dSmrg
8486fda9279dSmrg
8487fda9279dSmrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8488fda9279dSmrg# -----------------------------------------------
8489fda9279dSmrgm4_define([LT_OPTION_DEFINE],
8490fda9279dSmrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8491fda9279dSmrg])# LT_OPTION_DEFINE
8492fda9279dSmrg
8493fda9279dSmrg
8494fda9279dSmrg# dlopen
8495fda9279dSmrg# ------
8496fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8497fda9279dSmrg])
8498fda9279dSmrg
8499fda9279dSmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8500fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8501fda9279dSmrgAC_DIAGNOSE([obsolete],
8502fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
850316ee1e9aSmrgput the 'dlopen' option into LT_INIT's first parameter.])
8504fda9279dSmrg])
8505fda9279dSmrg
8506fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8507fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8508fda9279dSmrg
8509fda9279dSmrg
8510fda9279dSmrg# win32-dll
8511fda9279dSmrg# ---------
8512fda9279dSmrg# Declare package support for building win32 dll's.
8513fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8514fda9279dSmrg[enable_win32_dll=yes
8515fda9279dSmrg
8516fda9279dSmrgcase $host in
8517fda9279dSmrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8518fda9279dSmrg  AC_CHECK_TOOL(AS, as, false)
8519fda9279dSmrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8520fda9279dSmrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8521fda9279dSmrg  ;;
8522fda9279dSmrgesac
8523fda9279dSmrg
8524fda9279dSmrgtest -z "$AS" && AS=as
8525fda9279dSmrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
8526fda9279dSmrg
8527fda9279dSmrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8528fda9279dSmrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
8529fda9279dSmrg
8530fda9279dSmrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8531fda9279dSmrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8532fda9279dSmrg])# win32-dll
8533fda9279dSmrg
8534fda9279dSmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8535fda9279dSmrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8536fda9279dSmrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8537fda9279dSmrgAC_DIAGNOSE([obsolete],
8538fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
853916ee1e9aSmrgput the 'win32-dll' option into LT_INIT's first parameter.])
8540fda9279dSmrg])
8541fda9279dSmrg
8542fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8543fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8544fda9279dSmrg
8545fda9279dSmrg
8546fda9279dSmrg# _LT_ENABLE_SHARED([DEFAULT])
8547fda9279dSmrg# ----------------------------
854816ee1e9aSmrg# implement the --enable-shared flag, and supports the 'shared' and
854916ee1e9aSmrg# 'disable-shared' LT_INIT options.
855016ee1e9aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8551fda9279dSmrgm4_define([_LT_ENABLE_SHARED],
8552fda9279dSmrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8553fda9279dSmrgAC_ARG_ENABLE([shared],
8554fda9279dSmrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8555fda9279dSmrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8556fda9279dSmrg    [p=${PACKAGE-default}
8557fda9279dSmrg    case $enableval in
8558fda9279dSmrg    yes) enable_shared=yes ;;
8559fda9279dSmrg    no) enable_shared=no ;;
8560fda9279dSmrg    *)
8561fda9279dSmrg      enable_shared=no
8562fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
856316ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8564fda9279dSmrg      for pkg in $enableval; do
856516ee1e9aSmrg	IFS=$lt_save_ifs
8566fda9279dSmrg	if test "X$pkg" = "X$p"; then
8567fda9279dSmrg	  enable_shared=yes
8568fda9279dSmrg	fi
8569fda9279dSmrg      done
857016ee1e9aSmrg      IFS=$lt_save_ifs
8571fda9279dSmrg      ;;
8572fda9279dSmrg    esac],
8573fda9279dSmrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8574fda9279dSmrg
8575fda9279dSmrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8576fda9279dSmrg	[Whether or not to build shared libraries])
8577fda9279dSmrg])# _LT_ENABLE_SHARED
8578fda9279dSmrg
8579fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8580fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8581fda9279dSmrg
8582fda9279dSmrg# Old names:
8583fda9279dSmrgAC_DEFUN([AC_ENABLE_SHARED],
8584fda9279dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8585fda9279dSmrg])
8586fda9279dSmrg
8587fda9279dSmrgAC_DEFUN([AC_DISABLE_SHARED],
8588fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8589fda9279dSmrg])
8590fda9279dSmrg
8591fda9279dSmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8592fda9279dSmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8593fda9279dSmrg
8594fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8595fda9279dSmrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8596fda9279dSmrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8597fda9279dSmrg
8598fda9279dSmrg
8599fda9279dSmrg
8600fda9279dSmrg# _LT_ENABLE_STATIC([DEFAULT])
8601fda9279dSmrg# ----------------------------
860216ee1e9aSmrg# implement the --enable-static flag, and support the 'static' and
860316ee1e9aSmrg# 'disable-static' LT_INIT options.
860416ee1e9aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8605fda9279dSmrgm4_define([_LT_ENABLE_STATIC],
8606fda9279dSmrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8607fda9279dSmrgAC_ARG_ENABLE([static],
8608fda9279dSmrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8609fda9279dSmrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8610fda9279dSmrg    [p=${PACKAGE-default}
8611fda9279dSmrg    case $enableval in
8612fda9279dSmrg    yes) enable_static=yes ;;
8613fda9279dSmrg    no) enable_static=no ;;
8614fda9279dSmrg    *)
8615fda9279dSmrg     enable_static=no
8616fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
861716ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8618fda9279dSmrg      for pkg in $enableval; do
861916ee1e9aSmrg	IFS=$lt_save_ifs
8620fda9279dSmrg	if test "X$pkg" = "X$p"; then
8621fda9279dSmrg	  enable_static=yes
8622fda9279dSmrg	fi
8623fda9279dSmrg      done
862416ee1e9aSmrg      IFS=$lt_save_ifs
8625fda9279dSmrg      ;;
8626fda9279dSmrg    esac],
8627fda9279dSmrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8628fda9279dSmrg
8629fda9279dSmrg    _LT_DECL([build_old_libs], [enable_static], [0],
8630fda9279dSmrg	[Whether or not to build static libraries])
8631fda9279dSmrg])# _LT_ENABLE_STATIC
8632fda9279dSmrg
8633fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8634fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8635fda9279dSmrg
8636fda9279dSmrg# Old names:
8637fda9279dSmrgAC_DEFUN([AC_ENABLE_STATIC],
8638fda9279dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8639fda9279dSmrg])
8640fda9279dSmrg
8641fda9279dSmrgAC_DEFUN([AC_DISABLE_STATIC],
8642fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8643fda9279dSmrg])
8644fda9279dSmrg
8645fda9279dSmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8646fda9279dSmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8647fda9279dSmrg
8648fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8649fda9279dSmrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8650fda9279dSmrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8651fda9279dSmrg
8652fda9279dSmrg
8653fda9279dSmrg
8654fda9279dSmrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8655fda9279dSmrg# ----------------------------------
865616ee1e9aSmrg# implement the --enable-fast-install flag, and support the 'fast-install'
865716ee1e9aSmrg# and 'disable-fast-install' LT_INIT options.
865816ee1e9aSmrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
8659fda9279dSmrgm4_define([_LT_ENABLE_FAST_INSTALL],
8660fda9279dSmrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8661fda9279dSmrgAC_ARG_ENABLE([fast-install],
8662fda9279dSmrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8663fda9279dSmrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8664fda9279dSmrg    [p=${PACKAGE-default}
8665fda9279dSmrg    case $enableval in
8666fda9279dSmrg    yes) enable_fast_install=yes ;;
8667fda9279dSmrg    no) enable_fast_install=no ;;
8668fda9279dSmrg    *)
8669fda9279dSmrg      enable_fast_install=no
8670fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
867116ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8672fda9279dSmrg      for pkg in $enableval; do
867316ee1e9aSmrg	IFS=$lt_save_ifs
8674fda9279dSmrg	if test "X$pkg" = "X$p"; then
8675fda9279dSmrg	  enable_fast_install=yes
8676fda9279dSmrg	fi
8677fda9279dSmrg      done
867816ee1e9aSmrg      IFS=$lt_save_ifs
8679fda9279dSmrg      ;;
8680fda9279dSmrg    esac],
8681fda9279dSmrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8682fda9279dSmrg
8683fda9279dSmrg_LT_DECL([fast_install], [enable_fast_install], [0],
8684fda9279dSmrg	 [Whether or not to optimize for fast installation])dnl
8685fda9279dSmrg])# _LT_ENABLE_FAST_INSTALL
8686fda9279dSmrg
8687fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8688fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8689fda9279dSmrg
8690fda9279dSmrg# Old names:
8691fda9279dSmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8692fda9279dSmrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8693fda9279dSmrgAC_DIAGNOSE([obsolete],
8694fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
869516ee1e9aSmrgthe 'fast-install' option into LT_INIT's first parameter.])
8696fda9279dSmrg])
8697fda9279dSmrg
8698fda9279dSmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8699fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8700fda9279dSmrgAC_DIAGNOSE([obsolete],
8701fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
870216ee1e9aSmrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
8703fda9279dSmrg])
8704fda9279dSmrg
8705fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8706fda9279dSmrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8707fda9279dSmrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8708fda9279dSmrg
8709fda9279dSmrg
871016ee1e9aSmrg# _LT_WITH_AIX_SONAME([DEFAULT])
871116ee1e9aSmrg# ----------------------------------
871216ee1e9aSmrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
871316ee1e9aSmrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
871416ee1e9aSmrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
871516ee1e9aSmrgm4_define([_LT_WITH_AIX_SONAME],
871616ee1e9aSmrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
871716ee1e9aSmrgshared_archive_member_spec=
871816ee1e9aSmrgcase $host,$enable_shared in
871916ee1e9aSmrgpower*-*-aix[[5-9]]*,yes)
872016ee1e9aSmrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
872116ee1e9aSmrg  AC_ARG_WITH([aix-soname],
872216ee1e9aSmrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
872316ee1e9aSmrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
872416ee1e9aSmrg    [case $withval in
872516ee1e9aSmrg    aix|svr4|both)
872616ee1e9aSmrg      ;;
872716ee1e9aSmrg    *)
872816ee1e9aSmrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
872916ee1e9aSmrg      ;;
873016ee1e9aSmrg    esac
873116ee1e9aSmrg    lt_cv_with_aix_soname=$with_aix_soname],
873216ee1e9aSmrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
873316ee1e9aSmrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
873416ee1e9aSmrg    with_aix_soname=$lt_cv_with_aix_soname])
873516ee1e9aSmrg  AC_MSG_RESULT([$with_aix_soname])
873616ee1e9aSmrg  if test aix != "$with_aix_soname"; then
873716ee1e9aSmrg    # For the AIX way of multilib, we name the shared archive member
873816ee1e9aSmrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
873916ee1e9aSmrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
874016ee1e9aSmrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
874116ee1e9aSmrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
874216ee1e9aSmrg    if test 64 = "${OBJECT_MODE-32}"; then
874316ee1e9aSmrg      shared_archive_member_spec=shr_64
874416ee1e9aSmrg    else
874516ee1e9aSmrg      shared_archive_member_spec=shr
874616ee1e9aSmrg    fi
874716ee1e9aSmrg  fi
874816ee1e9aSmrg  ;;
874916ee1e9aSmrg*)
875016ee1e9aSmrg  with_aix_soname=aix
875116ee1e9aSmrg  ;;
875216ee1e9aSmrgesac
875316ee1e9aSmrg
875416ee1e9aSmrg_LT_DECL([], [shared_archive_member_spec], [0],
875516ee1e9aSmrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
875616ee1e9aSmrg])# _LT_WITH_AIX_SONAME
875716ee1e9aSmrg
875816ee1e9aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
875916ee1e9aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
876016ee1e9aSmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
876116ee1e9aSmrg
876216ee1e9aSmrg
8763fda9279dSmrg# _LT_WITH_PIC([MODE])
8764fda9279dSmrg# --------------------
876516ee1e9aSmrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
8766fda9279dSmrg# LT_INIT options.
876716ee1e9aSmrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
8768fda9279dSmrgm4_define([_LT_WITH_PIC],
8769fda9279dSmrg[AC_ARG_WITH([pic],
8770fda9279dSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8771fda9279dSmrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8772fda9279dSmrg    [lt_p=${PACKAGE-default}
8773fda9279dSmrg    case $withval in
8774fda9279dSmrg    yes|no) pic_mode=$withval ;;
8775fda9279dSmrg    *)
8776fda9279dSmrg      pic_mode=default
8777fda9279dSmrg      # Look at the argument we got.  We use all the common list separators.
877816ee1e9aSmrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8779fda9279dSmrg      for lt_pkg in $withval; do
878016ee1e9aSmrg	IFS=$lt_save_ifs
8781fda9279dSmrg	if test "X$lt_pkg" = "X$lt_p"; then
8782fda9279dSmrg	  pic_mode=yes
8783fda9279dSmrg	fi
8784fda9279dSmrg      done
878516ee1e9aSmrg      IFS=$lt_save_ifs
8786fda9279dSmrg      ;;
8787fda9279dSmrg    esac],
878816ee1e9aSmrg    [pic_mode=m4_default([$1], [default])])
8789fda9279dSmrg
8790fda9279dSmrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8791fda9279dSmrg])# _LT_WITH_PIC
8792fda9279dSmrg
8793fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8794fda9279dSmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8795fda9279dSmrg
8796fda9279dSmrg# Old name:
8797fda9279dSmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8798fda9279dSmrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8799fda9279dSmrgAC_DIAGNOSE([obsolete],
8800fda9279dSmrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
880116ee1e9aSmrgput the 'pic-only' option into LT_INIT's first parameter.])
8802fda9279dSmrg])
8803fda9279dSmrg
8804fda9279dSmrgdnl aclocal-1.4 backwards compatibility:
8805fda9279dSmrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8806fda9279dSmrg
8807fda9279dSmrg
8808fda9279dSmrgm4_define([_LTDL_MODE], [])
8809fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8810fda9279dSmrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8811fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8812fda9279dSmrg		 [m4_define([_LTDL_MODE], [recursive])])
8813fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8814fda9279dSmrg		 [m4_define([_LTDL_MODE], [subproject])])
8815fda9279dSmrg
8816fda9279dSmrgm4_define([_LTDL_TYPE], [])
8817fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8818fda9279dSmrg		 [m4_define([_LTDL_TYPE], [installable])])
8819fda9279dSmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8820fda9279dSmrg		 [m4_define([_LTDL_TYPE], [convenience])])
8821fda9279dSmrg
8822fda9279dSmrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8823fda9279dSmrg#
882416ee1e9aSmrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
882516ee1e9aSmrg# Foundation, Inc.
8826fda9279dSmrg# Written by Gary V. Vaughan, 2004
8827fda9279dSmrg#
8828fda9279dSmrg# This file is free software; the Free Software Foundation gives
8829fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8830fda9279dSmrg# modifications, as long as this notice is preserved.
8831fda9279dSmrg
8832fda9279dSmrg# serial 6 ltsugar.m4
8833fda9279dSmrg
8834fda9279dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
8835fda9279dSmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8836fda9279dSmrg
8837fda9279dSmrg
8838fda9279dSmrg# lt_join(SEP, ARG1, [ARG2...])
8839fda9279dSmrg# -----------------------------
8840fda9279dSmrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8841fda9279dSmrg# associated separator.
8842fda9279dSmrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8843fda9279dSmrg# versions in m4sugar had bugs.
8844fda9279dSmrgm4_define([lt_join],
8845fda9279dSmrg[m4_if([$#], [1], [],
8846fda9279dSmrg       [$#], [2], [[$2]],
8847fda9279dSmrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8848fda9279dSmrgm4_define([_lt_join],
8849fda9279dSmrg[m4_if([$#$2], [2], [],
8850fda9279dSmrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8851fda9279dSmrg
8852fda9279dSmrg
8853fda9279dSmrg# lt_car(LIST)
8854fda9279dSmrg# lt_cdr(LIST)
8855fda9279dSmrg# ------------
8856fda9279dSmrg# Manipulate m4 lists.
8857fda9279dSmrg# These macros are necessary as long as will still need to support
885816ee1e9aSmrg# Autoconf-2.59, which quotes differently.
8859fda9279dSmrgm4_define([lt_car], [[$1]])
8860fda9279dSmrgm4_define([lt_cdr],
8861fda9279dSmrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8862fda9279dSmrg       [$#], 1, [],
8863fda9279dSmrg       [m4_dquote(m4_shift($@))])])
8864fda9279dSmrgm4_define([lt_unquote], $1)
8865fda9279dSmrg
8866fda9279dSmrg
8867fda9279dSmrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8868fda9279dSmrg# ------------------------------------------
886916ee1e9aSmrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
8870fda9279dSmrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8871fda9279dSmrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8872fda9279dSmrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8873fda9279dSmrg# than defined and empty).
8874fda9279dSmrg#
8875fda9279dSmrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8876fda9279dSmrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8877fda9279dSmrgm4_define([lt_append],
8878fda9279dSmrg[m4_define([$1],
8879fda9279dSmrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8880fda9279dSmrg
8881fda9279dSmrg
8882fda9279dSmrg
8883fda9279dSmrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8884fda9279dSmrg# ----------------------------------------------------------
8885fda9279dSmrg# Produce a SEP delimited list of all paired combinations of elements of
8886fda9279dSmrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8887fda9279dSmrg# has the form PREFIXmINFIXSUFFIXn.
8888fda9279dSmrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8889fda9279dSmrgm4_define([lt_combine],
8890fda9279dSmrg[m4_if(m4_eval([$# > 3]), [1],
8891fda9279dSmrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8892fda9279dSmrg[[m4_foreach([_Lt_prefix], [$2],
8893fda9279dSmrg	     [m4_foreach([_Lt_suffix],
8894fda9279dSmrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8895fda9279dSmrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8896fda9279dSmrg
8897fda9279dSmrg
8898fda9279dSmrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8899fda9279dSmrg# -----------------------------------------------------------------------
8900fda9279dSmrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8901fda9279dSmrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8902fda9279dSmrgm4_define([lt_if_append_uniq],
8903fda9279dSmrg[m4_ifdef([$1],
8904fda9279dSmrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8905fda9279dSmrg		 [lt_append([$1], [$2], [$3])$4],
8906fda9279dSmrg		 [$5])],
8907fda9279dSmrg	  [lt_append([$1], [$2], [$3])$4])])
8908fda9279dSmrg
8909fda9279dSmrg
8910fda9279dSmrg# lt_dict_add(DICT, KEY, VALUE)
8911fda9279dSmrg# -----------------------------
8912fda9279dSmrgm4_define([lt_dict_add],
8913fda9279dSmrg[m4_define([$1($2)], [$3])])
8914fda9279dSmrg
8915fda9279dSmrg
8916fda9279dSmrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8917fda9279dSmrg# --------------------------------------------
8918fda9279dSmrgm4_define([lt_dict_add_subkey],
8919fda9279dSmrg[m4_define([$1($2:$3)], [$4])])
8920fda9279dSmrg
8921fda9279dSmrg
8922fda9279dSmrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8923fda9279dSmrg# ----------------------------------
8924fda9279dSmrgm4_define([lt_dict_fetch],
8925fda9279dSmrg[m4_ifval([$3],
8926fda9279dSmrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8927fda9279dSmrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8928fda9279dSmrg
8929fda9279dSmrg
8930fda9279dSmrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8931fda9279dSmrg# -----------------------------------------------------------------
8932fda9279dSmrgm4_define([lt_if_dict_fetch],
8933fda9279dSmrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8934fda9279dSmrg	[$5],
8935fda9279dSmrg    [$6])])
8936fda9279dSmrg
8937fda9279dSmrg
8938fda9279dSmrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8939fda9279dSmrg# --------------------------------------------------------------
8940fda9279dSmrgm4_define([lt_dict_filter],
8941fda9279dSmrg[m4_if([$5], [], [],
8942fda9279dSmrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8943fda9279dSmrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8944fda9279dSmrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8945fda9279dSmrg])
8946fda9279dSmrg
8947fda9279dSmrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8948fda9279dSmrg#
894916ee1e9aSmrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
8950fda9279dSmrg#   Written by Scott James Remnant, 2004
8951fda9279dSmrg#
8952fda9279dSmrg# This file is free software; the Free Software Foundation gives
8953fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8954fda9279dSmrg# modifications, as long as this notice is preserved.
8955fda9279dSmrg
8956fda9279dSmrg# @configure_input@
8957fda9279dSmrg
895816ee1e9aSmrg# serial 4179 ltversion.m4
8959fda9279dSmrg# This file is part of GNU Libtool
8960fda9279dSmrg
896116ee1e9aSmrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
896216ee1e9aSmrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
8963fda9279dSmrg
8964fda9279dSmrgAC_DEFUN([LTVERSION_VERSION],
896516ee1e9aSmrg[macro_version='2.4.6'
896616ee1e9aSmrgmacro_revision='2.4.6'
8967fda9279dSmrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8968fda9279dSmrg_LT_DECL(, macro_revision, 0)
8969fda9279dSmrg])
8970fda9279dSmrg
8971fda9279dSmrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8972fda9279dSmrg#
897316ee1e9aSmrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
897416ee1e9aSmrg#   Foundation, Inc.
8975fda9279dSmrg#   Written by Scott James Remnant, 2004.
8976fda9279dSmrg#
8977fda9279dSmrg# This file is free software; the Free Software Foundation gives
8978fda9279dSmrg# unlimited permission to copy and/or distribute it, with or without
8979fda9279dSmrg# modifications, as long as this notice is preserved.
8980fda9279dSmrg
8981fda9279dSmrg# serial 5 lt~obsolete.m4
8982fda9279dSmrg
8983fda9279dSmrg# These exist entirely to fool aclocal when bootstrapping libtool.
8984fda9279dSmrg#
898516ee1e9aSmrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8986fda9279dSmrg# which have later been changed to m4_define as they aren't part of the
8987fda9279dSmrg# exported API, or moved to Autoconf or Automake where they belong.
8988fda9279dSmrg#
8989fda9279dSmrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8990fda9279dSmrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8991fda9279dSmrg# using a macro with the same name in our local m4/libtool.m4 it'll
8992fda9279dSmrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8993fda9279dSmrg# and doesn't know about Autoconf macros at all.)
8994fda9279dSmrg#
8995fda9279dSmrg# So we provide this file, which has a silly filename so it's always
8996fda9279dSmrg# included after everything else.  This provides aclocal with the
8997fda9279dSmrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8998fda9279dSmrg# because those macros already exist, or will be overwritten later.
899916ee1e9aSmrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
9000fda9279dSmrg#
9001fda9279dSmrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
9002fda9279dSmrg# Yes, that means every name once taken will need to remain here until
9003fda9279dSmrg# we give up compatibility with versions before 1.7, at which point
9004fda9279dSmrg# we need to keep only those names which we still refer to.
9005fda9279dSmrg
9006fda9279dSmrg# This is to help aclocal find these macros, as it can't see m4_define.
9007fda9279dSmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9008fda9279dSmrg
9009fda9279dSmrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9010fda9279dSmrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9011fda9279dSmrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9012fda9279dSmrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9013fda9279dSmrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9014fda9279dSmrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9015fda9279dSmrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9016fda9279dSmrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9017fda9279dSmrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9018fda9279dSmrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9019fda9279dSmrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9020fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9021fda9279dSmrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9022fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9023fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9024fda9279dSmrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9025fda9279dSmrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9026fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9027fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9028fda9279dSmrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9029fda9279dSmrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9030fda9279dSmrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9031fda9279dSmrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9032fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9033fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9034fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9035fda9279dSmrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9036fda9279dSmrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9037fda9279dSmrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9038fda9279dSmrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9039fda9279dSmrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9040fda9279dSmrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9041fda9279dSmrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9042fda9279dSmrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9043fda9279dSmrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9044fda9279dSmrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9045fda9279dSmrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9046fda9279dSmrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9047fda9279dSmrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9048fda9279dSmrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9049fda9279dSmrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9050fda9279dSmrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9051fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9052fda9279dSmrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9053fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9054fda9279dSmrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9055fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9056fda9279dSmrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9057fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9058fda9279dSmrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9059fda9279dSmrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9060fda9279dSmrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9061fda9279dSmrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9062fda9279dSmrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9063fda9279dSmrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9064fda9279dSmrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9065fda9279dSmrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9066fda9279dSmrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9067fda9279dSmrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9068fda9279dSmrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9069fda9279dSmrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9070fda9279dSmrg
9071c2e4ac43Smrgdnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
9072c2e4ac43Smrgdnl serial 11 (pkg-config-0.29.1)
9073c2e4ac43Smrgdnl
9074c2e4ac43Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9075c2e4ac43Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
9076c2e4ac43Smrgdnl
9077c2e4ac43Smrgdnl This program is free software; you can redistribute it and/or modify
9078c2e4ac43Smrgdnl it under the terms of the GNU General Public License as published by
9079c2e4ac43Smrgdnl the Free Software Foundation; either version 2 of the License, or
9080c2e4ac43Smrgdnl (at your option) any later version.
9081c2e4ac43Smrgdnl
9082c2e4ac43Smrgdnl This program is distributed in the hope that it will be useful, but
9083c2e4ac43Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
9084c2e4ac43Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9085c2e4ac43Smrgdnl General Public License for more details.
9086c2e4ac43Smrgdnl
9087c2e4ac43Smrgdnl You should have received a copy of the GNU General Public License
9088c2e4ac43Smrgdnl along with this program; if not, write to the Free Software
9089c2e4ac43Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
9090c2e4ac43Smrgdnl 02111-1307, USA.
9091c2e4ac43Smrgdnl
9092c2e4ac43Smrgdnl As a special exception to the GNU General Public License, if you
9093c2e4ac43Smrgdnl distribute this file as part of a program that contains a
9094c2e4ac43Smrgdnl configuration script generated by Autoconf, you may include it under
9095c2e4ac43Smrgdnl the same distribution terms that you use for the rest of that
9096c2e4ac43Smrgdnl program.
9097c2e4ac43Smrg
9098c2e4ac43Smrgdnl PKG_PREREQ(MIN-VERSION)
9099c2e4ac43Smrgdnl -----------------------
9100c2e4ac43Smrgdnl Since: 0.29
9101c2e4ac43Smrgdnl
9102c2e4ac43Smrgdnl Verify that the version of the pkg-config macros are at least
9103c2e4ac43Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
9104c2e4ac43Smrgdnl installed version of pkg-config, this checks the developer's version
9105c2e4ac43Smrgdnl of pkg.m4 when generating configure.
9106c2e4ac43Smrgdnl
9107c2e4ac43Smrgdnl To ensure that this macro is defined, also add:
9108c2e4ac43Smrgdnl m4_ifndef([PKG_PREREQ],
9109c2e4ac43Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
9110c2e4ac43Smrgdnl
9111c2e4ac43Smrgdnl See the "Since" comment for each macro you use to see what version
9112c2e4ac43Smrgdnl of the macros you require.
9113c2e4ac43Smrgm4_defun([PKG_PREREQ],
9114c2e4ac43Smrg[m4_define([PKG_MACROS_VERSION], [0.29.1])
9115c2e4ac43Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
9116c2e4ac43Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
9117c2e4ac43Smrg])dnl PKG_PREREQ
9118c2e4ac43Smrg
9119c2e4ac43Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
9120c2e4ac43Smrgdnl ----------------------------------
9121c2e4ac43Smrgdnl Since: 0.16
9122c2e4ac43Smrgdnl
9123c2e4ac43Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
9124c2e4ac43Smrgdnl first found in the path. Checks that the version of pkg-config found
9125c2e4ac43Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
9126c2e4ac43Smrgdnl used since that's the first version where most current features of
9127c2e4ac43Smrgdnl pkg-config existed.
9128fda9279dSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9129fda9279dSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9130fda9279dSmrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9131fda9279dSmrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9132fda9279dSmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9133fda9279dSmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9134fda9279dSmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9135fda9279dSmrg
9136fda9279dSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9137fda9279dSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9138fda9279dSmrgfi
9139fda9279dSmrgif test -n "$PKG_CONFIG"; then
9140fda9279dSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9141fda9279dSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9142fda9279dSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9143fda9279dSmrg		AC_MSG_RESULT([yes])
9144fda9279dSmrg	else
9145fda9279dSmrg		AC_MSG_RESULT([no])
9146fda9279dSmrg		PKG_CONFIG=""
9147fda9279dSmrg	fi
9148fda9279dSmrgfi[]dnl
9149c2e4ac43Smrg])dnl PKG_PROG_PKG_CONFIG
9150fda9279dSmrg
9151c2e4ac43Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9152c2e4ac43Smrgdnl -------------------------------------------------------------------
9153c2e4ac43Smrgdnl Since: 0.18
9154c2e4ac43Smrgdnl
9155c2e4ac43Smrgdnl Check to see whether a particular set of modules exists. Similar to
9156c2e4ac43Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
9157c2e4ac43Smrgdnl
9158c2e4ac43Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9159c2e4ac43Smrgdnl only at the first occurence in configure.ac, so if the first place
9160c2e4ac43Smrgdnl it's called might be skipped (such as if it is within an "if", you
9161c2e4ac43Smrgdnl have to call PKG_CHECK_EXISTS manually
9162fda9279dSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9163fda9279dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9164fda9279dSmrgif test -n "$PKG_CONFIG" && \
9165fda9279dSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9166fda9279dSmrg  m4_default([$2], [:])
9167fda9279dSmrgm4_ifvaln([$3], [else
9168fda9279dSmrg  $3])dnl
9169fda9279dSmrgfi])
9170fda9279dSmrg
9171c2e4ac43Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9172c2e4ac43Smrgdnl ---------------------------------------------
9173c2e4ac43Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
9174c2e4ac43Smrgdnl pkg_failed based on the result.
9175fda9279dSmrgm4_define([_PKG_CONFIG],
9176fda9279dSmrg[if test -n "$$1"; then
9177fda9279dSmrg    pkg_cv_[]$1="$$1"
9178fda9279dSmrg elif test -n "$PKG_CONFIG"; then
9179fda9279dSmrg    PKG_CHECK_EXISTS([$3],
9180fda9279dSmrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9181fda9279dSmrg		      test "x$?" != "x0" && pkg_failed=yes ],
9182fda9279dSmrg		     [pkg_failed=yes])
9183fda9279dSmrg else
9184fda9279dSmrg    pkg_failed=untried
9185fda9279dSmrgfi[]dnl
9186c2e4ac43Smrg])dnl _PKG_CONFIG
9187fda9279dSmrg
9188c2e4ac43Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
9189c2e4ac43Smrgdnl ---------------------------
9190c2e4ac43Smrgdnl Internal check to see if pkg-config supports short errors.
9191fda9279dSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9192fda9279dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9193fda9279dSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9194fda9279dSmrg        _pkg_short_errors_supported=yes
9195fda9279dSmrgelse
9196fda9279dSmrg        _pkg_short_errors_supported=no
9197fda9279dSmrgfi[]dnl
9198c2e4ac43Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
9199fda9279dSmrg
9200fda9279dSmrg
9201c2e4ac43Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9202c2e4ac43Smrgdnl   [ACTION-IF-NOT-FOUND])
9203c2e4ac43Smrgdnl --------------------------------------------------------------
9204c2e4ac43Smrgdnl Since: 0.4.0
9205c2e4ac43Smrgdnl
9206c2e4ac43Smrgdnl Note that if there is a possibility the first call to
9207c2e4ac43Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
9208c2e4ac43Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9209fda9279dSmrgAC_DEFUN([PKG_CHECK_MODULES],
9210fda9279dSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9211fda9279dSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9212fda9279dSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9213fda9279dSmrg
9214fda9279dSmrgpkg_failed=no
9215fda9279dSmrgAC_MSG_CHECKING([for $1])
9216fda9279dSmrg
9217fda9279dSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9218fda9279dSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9219fda9279dSmrg
9220fda9279dSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9221fda9279dSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9222fda9279dSmrgSee the pkg-config man page for more details.])
9223fda9279dSmrg
9224fda9279dSmrgif test $pkg_failed = yes; then
9225fda9279dSmrg   	AC_MSG_RESULT([no])
9226fda9279dSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9227fda9279dSmrg        if test $_pkg_short_errors_supported = yes; then
9228fda9279dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9229fda9279dSmrg        else 
9230fda9279dSmrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9231fda9279dSmrg        fi
9232fda9279dSmrg	# Put the nasty error message in config.log where it belongs
9233fda9279dSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9234fda9279dSmrg
9235fda9279dSmrg	m4_default([$4], [AC_MSG_ERROR(
9236fda9279dSmrg[Package requirements ($2) were not met:
9237fda9279dSmrg
9238fda9279dSmrg$$1_PKG_ERRORS
9239fda9279dSmrg
9240fda9279dSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9241fda9279dSmrginstalled software in a non-standard prefix.
9242fda9279dSmrg
9243fda9279dSmrg_PKG_TEXT])[]dnl
9244fda9279dSmrg        ])
9245fda9279dSmrgelif test $pkg_failed = untried; then
9246fda9279dSmrg     	AC_MSG_RESULT([no])
9247fda9279dSmrg	m4_default([$4], [AC_MSG_FAILURE(
9248fda9279dSmrg[The pkg-config script could not be found or is too old.  Make sure it
9249fda9279dSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9250fda9279dSmrgpath to pkg-config.
9251fda9279dSmrg
9252fda9279dSmrg_PKG_TEXT
9253fda9279dSmrg
9254fda9279dSmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9255fda9279dSmrg        ])
9256fda9279dSmrgelse
9257fda9279dSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9258fda9279dSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9259fda9279dSmrg        AC_MSG_RESULT([yes])
9260fda9279dSmrg	$3
9261fda9279dSmrgfi[]dnl
9262c2e4ac43Smrg])dnl PKG_CHECK_MODULES
9263fda9279dSmrg
926416ee1e9aSmrg
9265c2e4ac43Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9266c2e4ac43Smrgdnl   [ACTION-IF-NOT-FOUND])
9267c2e4ac43Smrgdnl ---------------------------------------------------------------------
9268c2e4ac43Smrgdnl Since: 0.29
9269c2e4ac43Smrgdnl
9270c2e4ac43Smrgdnl Checks for existence of MODULES and gathers its build flags with
9271c2e4ac43Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
9272c2e4ac43Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
9273c2e4ac43Smrgdnl
9274c2e4ac43Smrgdnl Note that if there is a possibility the first call to
9275c2e4ac43Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
9276c2e4ac43Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
9277c2e4ac43Smrgdnl configure.ac.
9278c2e4ac43SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
9279c2e4ac43Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9280c2e4ac43Smrg_save_PKG_CONFIG=$PKG_CONFIG
9281c2e4ac43SmrgPKG_CONFIG="$PKG_CONFIG --static"
9282c2e4ac43SmrgPKG_CHECK_MODULES($@)
9283c2e4ac43SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
9284c2e4ac43Smrg])dnl PKG_CHECK_MODULES_STATIC
9285c2e4ac43Smrg
9286c2e4ac43Smrg
9287c2e4ac43Smrgdnl PKG_INSTALLDIR([DIRECTORY])
9288c2e4ac43Smrgdnl -------------------------
9289c2e4ac43Smrgdnl Since: 0.27
9290c2e4ac43Smrgdnl
9291c2e4ac43Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
9292c2e4ac43Smrgdnl should install pkg-config .pc files. By default the directory is
9293c2e4ac43Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
9294c2e4ac43Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
9295c2e4ac43Smrgdnl parameter.
929616ee1e9aSmrgAC_DEFUN([PKG_INSTALLDIR],
929716ee1e9aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
929816ee1e9aSmrgm4_pushdef([pkg_description],
929916ee1e9aSmrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
930016ee1e9aSmrgAC_ARG_WITH([pkgconfigdir],
930116ee1e9aSmrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
930216ee1e9aSmrg    [with_pkgconfigdir=]pkg_default)
930316ee1e9aSmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
930416ee1e9aSmrgm4_popdef([pkg_default])
930516ee1e9aSmrgm4_popdef([pkg_description])
9306c2e4ac43Smrg])dnl PKG_INSTALLDIR
930716ee1e9aSmrg
930816ee1e9aSmrg
9309c2e4ac43Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
9310c2e4ac43Smrgdnl --------------------------------
9311c2e4ac43Smrgdnl Since: 0.27
9312c2e4ac43Smrgdnl
9313c2e4ac43Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
9314c2e4ac43Smrgdnl module should install arch-independent pkg-config .pc files. By
9315c2e4ac43Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
9316c2e4ac43Smrgdnl changed by passing DIRECTORY. The user can override through the
9317c2e4ac43Smrgdnl --with-noarch-pkgconfigdir parameter.
931816ee1e9aSmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
931916ee1e9aSmrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
932016ee1e9aSmrgm4_pushdef([pkg_description],
932116ee1e9aSmrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
932216ee1e9aSmrgAC_ARG_WITH([noarch-pkgconfigdir],
932316ee1e9aSmrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
932416ee1e9aSmrg    [with_noarch_pkgconfigdir=]pkg_default)
932516ee1e9aSmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
932616ee1e9aSmrgm4_popdef([pkg_default])
932716ee1e9aSmrgm4_popdef([pkg_description])
9328c2e4ac43Smrg])dnl PKG_NOARCH_INSTALLDIR
932916ee1e9aSmrg
933016ee1e9aSmrg
9331c2e4ac43Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9332c2e4ac43Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9333c2e4ac43Smrgdnl -------------------------------------------
9334c2e4ac43Smrgdnl Since: 0.28
9335c2e4ac43Smrgdnl
9336c2e4ac43Smrgdnl Retrieves the value of the pkg-config variable for the given module.
933716ee1e9aSmrgAC_DEFUN([PKG_CHECK_VAR],
933816ee1e9aSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
933916ee1e9aSmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
934016ee1e9aSmrg
934116ee1e9aSmrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
934216ee1e9aSmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
934316ee1e9aSmrg
934416ee1e9aSmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9345c2e4ac43Smrg])dnl PKG_CHECK_VAR
934616ee1e9aSmrg
9347fda9279dSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
9348fda9279dSmrgdnl
9349fda9279dSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
935016ee1e9aSmrgdnl
9351fda9279dSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
9352fda9279dSmrgdnl copy of this software and associated documentation files (the "Software"),
9353fda9279dSmrgdnl to deal in the Software without restriction, including without limitation
9354fda9279dSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
9355fda9279dSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
9356fda9279dSmrgdnl Software is furnished to do so, subject to the following conditions:
9357fda9279dSmrgdnl
9358fda9279dSmrgdnl The above copyright notice and this permission notice (including the next
9359fda9279dSmrgdnl paragraph) shall be included in all copies or substantial portions of the
9360fda9279dSmrgdnl Software.
9361fda9279dSmrgdnl
9362fda9279dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
9363fda9279dSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
9364fda9279dSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
9365fda9279dSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9366fda9279dSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
9367fda9279dSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
9368fda9279dSmrgdnl DEALINGS IN THE SOFTWARE.
9369fda9279dSmrg
9370fda9279dSmrg# XORG_MACROS_VERSION(required-version)
9371fda9279dSmrg# -------------------------------------
9372fda9279dSmrg# Minimum version: 1.1.0
9373fda9279dSmrg#
9374fda9279dSmrg# If you're using a macro added in Version 1.1 or newer, include this in
9375fda9279dSmrg# your configure.ac with the minimum required version, such as:
9376fda9279dSmrg# XORG_MACROS_VERSION(1.1)
9377fda9279dSmrg#
9378fda9279dSmrg# To ensure that this macro is defined, also add:
9379fda9279dSmrg# m4_ifndef([XORG_MACROS_VERSION],
9380fda9279dSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9381fda9279dSmrg#
9382fda9279dSmrg#
938316ee1e9aSmrg# See the "minimum version" comment for each macro you use to see what
9384fda9279dSmrg# version you require.
9385fda9279dSmrgm4_defun([XORG_MACROS_VERSION],[
938616ee1e9aSmrgm4_define([vers_have], [1.19.0])
9387fda9279dSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9388fda9279dSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9389fda9279dSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9390fda9279dSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9391fda9279dSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9392fda9279dSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9393fda9279dSmrgm4_undefine([vers_have])
9394fda9279dSmrgm4_undefine([maj_have])
9395fda9279dSmrgm4_undefine([maj_needed])
9396fda9279dSmrg]) # XORG_MACROS_VERSION
9397fda9279dSmrg
9398fda9279dSmrg# XORG_PROG_RAWCPP()
9399fda9279dSmrg# ------------------
9400fda9279dSmrg# Minimum version: 1.0.0
9401fda9279dSmrg#
9402fda9279dSmrg# Find cpp program and necessary flags for use in pre-processing text files
9403fda9279dSmrg# such as man pages and config files
9404fda9279dSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9405fda9279dSmrgAC_REQUIRE([AC_PROG_CPP])
940616ee1e9aSmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9407fda9279dSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9408fda9279dSmrg
9409fda9279dSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9410fda9279dSmrg# which is not the best choice for supporting other OS'es, but covers most
9411fda9279dSmrg# of the ones we need for now.
9412fda9279dSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9413fda9279dSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9414fda9279dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9415fda9279dSmrg	AC_MSG_RESULT([no])
9416fda9279dSmrgelse
9417fda9279dSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9418fda9279dSmrg		RAWCPPFLAGS=-undef
9419fda9279dSmrg		AC_MSG_RESULT([yes])
9420fda9279dSmrg	# under Cygwin unix is still defined even with -undef
9421fda9279dSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9422fda9279dSmrg		RAWCPPFLAGS="-undef -ansi"
9423fda9279dSmrg		AC_MSG_RESULT([yes, with -ansi])
9424fda9279dSmrg	else
9425fda9279dSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9426fda9279dSmrg	fi
9427fda9279dSmrgfi
9428fda9279dSmrgrm -f conftest.$ac_ext
9429fda9279dSmrg
9430fda9279dSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9431fda9279dSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9432fda9279dSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9433fda9279dSmrg	AC_MSG_RESULT([no])
9434fda9279dSmrgelse
9435fda9279dSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
943616ee1e9aSmrg		TRADITIONALCPPFLAGS="-traditional"
9437fda9279dSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9438fda9279dSmrg		AC_MSG_RESULT([yes])
9439fda9279dSmrg	else
9440fda9279dSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9441fda9279dSmrg	fi
9442fda9279dSmrgfi
9443fda9279dSmrgrm -f conftest.$ac_ext
9444fda9279dSmrgAC_SUBST(RAWCPPFLAGS)
944516ee1e9aSmrgAC_SUBST(TRADITIONALCPPFLAGS)
9446fda9279dSmrg]) # XORG_PROG_RAWCPP
9447fda9279dSmrg
9448fda9279dSmrg# XORG_MANPAGE_SECTIONS()
9449fda9279dSmrg# -----------------------
9450fda9279dSmrg# Minimum version: 1.0.0
9451fda9279dSmrg#
9452fda9279dSmrg# Determine which sections man pages go in for the different man page types
9453fda9279dSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9454fda9279dSmrg# Not sure if there's any better way than just hardcoding by OS name.
9455fda9279dSmrg# Override default settings by setting environment variables
9456fda9279dSmrg# Added MAN_SUBSTS in version 1.8
9457fda9279dSmrg# Added AC_PROG_SED in version 1.8
9458fda9279dSmrg
9459fda9279dSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9460fda9279dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
9461fda9279dSmrgAC_REQUIRE([AC_PROG_SED])
9462fda9279dSmrg
9463fda9279dSmrgif test x$APP_MAN_SUFFIX = x    ; then
9464fda9279dSmrg    APP_MAN_SUFFIX=1
9465fda9279dSmrgfi
9466fda9279dSmrgif test x$APP_MAN_DIR = x    ; then
9467fda9279dSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9468fda9279dSmrgfi
9469fda9279dSmrg
9470fda9279dSmrgif test x$LIB_MAN_SUFFIX = x    ; then
9471fda9279dSmrg    LIB_MAN_SUFFIX=3
9472fda9279dSmrgfi
9473fda9279dSmrgif test x$LIB_MAN_DIR = x    ; then
9474fda9279dSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9475fda9279dSmrgfi
9476fda9279dSmrg
9477fda9279dSmrgif test x$FILE_MAN_SUFFIX = x    ; then
9478fda9279dSmrg    case $host_os in
9479fda9279dSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9480fda9279dSmrg	*)		FILE_MAN_SUFFIX=5  ;;
9481fda9279dSmrg    esac
9482fda9279dSmrgfi
9483fda9279dSmrgif test x$FILE_MAN_DIR = x    ; then
9484fda9279dSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9485fda9279dSmrgfi
9486fda9279dSmrg
9487fda9279dSmrgif test x$MISC_MAN_SUFFIX = x    ; then
9488fda9279dSmrg    case $host_os in
9489fda9279dSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9490fda9279dSmrg	*)		MISC_MAN_SUFFIX=7  ;;
9491fda9279dSmrg    esac
9492fda9279dSmrgfi
9493fda9279dSmrgif test x$MISC_MAN_DIR = x    ; then
9494fda9279dSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9495fda9279dSmrgfi
9496fda9279dSmrg
9497fda9279dSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9498fda9279dSmrg    case $host_os in
9499fda9279dSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9500fda9279dSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9501fda9279dSmrg    esac
9502fda9279dSmrgfi
9503fda9279dSmrgif test x$DRIVER_MAN_DIR = x    ; then
9504fda9279dSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9505fda9279dSmrgfi
9506fda9279dSmrg
9507fda9279dSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9508fda9279dSmrg    case $host_os in
9509fda9279dSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9510fda9279dSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9511fda9279dSmrg    esac
9512fda9279dSmrgfi
9513fda9279dSmrgif test x$ADMIN_MAN_DIR = x    ; then
9514fda9279dSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9515fda9279dSmrgfi
9516fda9279dSmrg
9517fda9279dSmrg
9518fda9279dSmrgAC_SUBST([APP_MAN_SUFFIX])
9519fda9279dSmrgAC_SUBST([LIB_MAN_SUFFIX])
9520fda9279dSmrgAC_SUBST([FILE_MAN_SUFFIX])
9521fda9279dSmrgAC_SUBST([MISC_MAN_SUFFIX])
9522fda9279dSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9523fda9279dSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9524fda9279dSmrgAC_SUBST([APP_MAN_DIR])
9525fda9279dSmrgAC_SUBST([LIB_MAN_DIR])
9526fda9279dSmrgAC_SUBST([FILE_MAN_DIR])
9527fda9279dSmrgAC_SUBST([MISC_MAN_DIR])
9528fda9279dSmrgAC_SUBST([DRIVER_MAN_DIR])
9529fda9279dSmrgAC_SUBST([ADMIN_MAN_DIR])
9530fda9279dSmrg
9531fda9279dSmrgXORG_MAN_PAGE="X Version 11"
9532fda9279dSmrgAC_SUBST([XORG_MAN_PAGE])
9533fda9279dSmrgMAN_SUBSTS="\
9534fda9279dSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9535fda9279dSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9536fda9279dSmrg	-e 's|__xservername__|Xorg|g' \
9537fda9279dSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
9538fda9279dSmrg	-e 's|__projectroot__|\$(prefix)|g' \
9539fda9279dSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9540fda9279dSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9541fda9279dSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9542fda9279dSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9543fda9279dSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9544fda9279dSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9545fda9279dSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9546fda9279dSmrgAC_SUBST([MAN_SUBSTS])
9547fda9279dSmrg
9548fda9279dSmrg]) # XORG_MANPAGE_SECTIONS
9549fda9279dSmrg
9550fda9279dSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9551fda9279dSmrg# ------------------------
9552fda9279dSmrg# Minimum version: 1.7.0
9553fda9279dSmrg#
9554fda9279dSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9555fda9279dSmrg# provided by xorg-sgml-doctools, if installed.
9556fda9279dSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9557fda9279dSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9558fda9279dSmrgXORG_SGML_PATH=
9559fda9279dSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9560fda9279dSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9561fda9279dSmrg    [m4_ifval([$1],[:],
9562fda9279dSmrg        [if test x"$cross_compiling" != x"yes" ; then
9563fda9279dSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9564fda9279dSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9565fda9279dSmrg         fi])
9566fda9279dSmrg    ])
9567fda9279dSmrg
9568fda9279dSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9569fda9279dSmrg# the path and the name of the doc stylesheet
9570fda9279dSmrgif test "x$XORG_SGML_PATH" != "x" ; then
9571fda9279dSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9572fda9279dSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9573fda9279dSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9574fda9279dSmrgelse
9575fda9279dSmrg   AC_MSG_RESULT([no])
9576fda9279dSmrgfi
9577fda9279dSmrg
9578fda9279dSmrgAC_SUBST(XORG_SGML_PATH)
9579fda9279dSmrgAC_SUBST(STYLESHEET_SRCDIR)
9580fda9279dSmrgAC_SUBST(XSL_STYLESHEET)
9581fda9279dSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9582fda9279dSmrg]) # XORG_CHECK_SGML_DOCTOOLS
9583fda9279dSmrg
9584fda9279dSmrg# XORG_CHECK_LINUXDOC
9585fda9279dSmrg# -------------------
9586fda9279dSmrg# Minimum version: 1.0.0
9587fda9279dSmrg#
9588fda9279dSmrg# Defines the variable MAKE_TEXT if the necessary tools and
9589fda9279dSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9590fda9279dSmrg# Whether or not the necessary tools and files are found can be checked
9591fda9279dSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9592fda9279dSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9593fda9279dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9594fda9279dSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9595fda9279dSmrg
9596fda9279dSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9597fda9279dSmrg
9598fda9279dSmrgAC_MSG_CHECKING([whether to build documentation])
9599fda9279dSmrg
9600fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9601fda9279dSmrg   BUILDDOC=yes
9602fda9279dSmrgelse
9603fda9279dSmrg   BUILDDOC=no
9604fda9279dSmrgfi
9605fda9279dSmrg
9606fda9279dSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9607fda9279dSmrg
9608fda9279dSmrgAC_MSG_RESULT([$BUILDDOC])
9609fda9279dSmrg
9610fda9279dSmrgAC_MSG_CHECKING([whether to build pdf documentation])
9611fda9279dSmrg
9612fda9279dSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9613fda9279dSmrg   BUILDPDFDOC=yes
9614fda9279dSmrgelse
9615fda9279dSmrg   BUILDPDFDOC=no
9616fda9279dSmrgfi
9617fda9279dSmrg
9618fda9279dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9619fda9279dSmrg
9620fda9279dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9621fda9279dSmrg
9622fda9279dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9623fda9279dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9624fda9279dSmrgMAKE_PDF="$PS2PDF"
9625fda9279dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9626fda9279dSmrg
9627fda9279dSmrgAC_SUBST(MAKE_TEXT)
9628fda9279dSmrgAC_SUBST(MAKE_PS)
9629fda9279dSmrgAC_SUBST(MAKE_PDF)
9630fda9279dSmrgAC_SUBST(MAKE_HTML)
9631fda9279dSmrg]) # XORG_CHECK_LINUXDOC
9632fda9279dSmrg
9633fda9279dSmrg# XORG_CHECK_DOCBOOK
9634fda9279dSmrg# -------------------
9635fda9279dSmrg# Minimum version: 1.0.0
9636fda9279dSmrg#
9637fda9279dSmrg# Checks for the ability to build output formats from SGML DocBook source.
9638fda9279dSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9639fda9279dSmrg# indicates whether the necessary tools and files are found and, if set,
9640fda9279dSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9641fda9279dSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9642fda9279dSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9643fda9279dSmrg
9644fda9279dSmrgBUILDTXTDOC=no
9645fda9279dSmrgBUILDPDFDOC=no
9646fda9279dSmrgBUILDPSDOC=no
9647fda9279dSmrgBUILDHTMLDOC=no
9648fda9279dSmrg
9649fda9279dSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9650fda9279dSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9651fda9279dSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9652fda9279dSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9653fda9279dSmrg
9654fda9279dSmrgAC_MSG_CHECKING([whether to build text documentation])
9655fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9656fda9279dSmrg   test x$BUILD_TXTDOC != xno; then
9657fda9279dSmrg	BUILDTXTDOC=yes
9658fda9279dSmrgfi
9659fda9279dSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9660fda9279dSmrgAC_MSG_RESULT([$BUILDTXTDOC])
9661fda9279dSmrg
9662fda9279dSmrgAC_MSG_CHECKING([whether to build PDF documentation])
9663fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9664fda9279dSmrg   test x$BUILD_PDFDOC != xno; then
9665fda9279dSmrg	BUILDPDFDOC=yes
9666fda9279dSmrgfi
9667fda9279dSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9668fda9279dSmrgAC_MSG_RESULT([$BUILDPDFDOC])
9669fda9279dSmrg
9670fda9279dSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9671fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9672fda9279dSmrg   test x$BUILD_PSDOC != xno; then
9673fda9279dSmrg	BUILDPSDOC=yes
9674fda9279dSmrgfi
9675fda9279dSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9676fda9279dSmrgAC_MSG_RESULT([$BUILDPSDOC])
9677fda9279dSmrg
9678fda9279dSmrgAC_MSG_CHECKING([whether to build HTML documentation])
9679fda9279dSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9680fda9279dSmrg   test x$BUILD_HTMLDOC != xno; then
9681fda9279dSmrg	BUILDHTMLDOC=yes
9682fda9279dSmrgfi
9683fda9279dSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9684fda9279dSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9685fda9279dSmrg
9686fda9279dSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9687fda9279dSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9688fda9279dSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9689fda9279dSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9690fda9279dSmrg
9691fda9279dSmrgAC_SUBST(MAKE_TEXT)
9692fda9279dSmrgAC_SUBST(MAKE_PS)
9693fda9279dSmrgAC_SUBST(MAKE_PDF)
9694fda9279dSmrgAC_SUBST(MAKE_HTML)
9695fda9279dSmrg]) # XORG_CHECK_DOCBOOK
9696fda9279dSmrg
9697fda9279dSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9698fda9279dSmrg# ----------------
9699fda9279dSmrg# Minimum version: 1.5.0
9700fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9701fda9279dSmrg#
9702fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9703fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9704fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9705fda9279dSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9706fda9279dSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9707fda9279dSmrg# --with-xmlto assumes 'auto'.
9708fda9279dSmrg#
9709fda9279dSmrg# Interface to module:
9710fda9279dSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9711fda9279dSmrg# XMLTO:	returns the path of the xmlto program found
9712fda9279dSmrg#		returns the path set by the user in the environment
9713fda9279dSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9714fda9279dSmrg#		'no' user instructs the module not to use xmlto
9715fda9279dSmrg#
9716fda9279dSmrg# Added in version 1.10.0
9717fda9279dSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9718fda9279dSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9719fda9279dSmrg#
9720fda9279dSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9721fda9279dSmrg#
9722fda9279dSmrgAC_DEFUN([XORG_WITH_XMLTO],[
9723fda9279dSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9724fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9725fda9279dSmrgAC_ARG_WITH(xmlto,
9726fda9279dSmrg	AS_HELP_STRING([--with-xmlto],
9727fda9279dSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9728fda9279dSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9729fda9279dSmrgm4_undefine([_defopt])
9730fda9279dSmrg
9731fda9279dSmrgif test "x$use_xmlto" = x"auto"; then
9732fda9279dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9733fda9279dSmrg   if test "x$XMLTO" = "x"; then
9734fda9279dSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9735fda9279dSmrg	have_xmlto=no
9736fda9279dSmrg   else
9737fda9279dSmrg        have_xmlto=yes
9738fda9279dSmrg   fi
9739fda9279dSmrgelif test "x$use_xmlto" = x"yes" ; then
9740fda9279dSmrg   AC_PATH_PROG([XMLTO], [xmlto])
9741fda9279dSmrg   if test "x$XMLTO" = "x"; then
9742fda9279dSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9743fda9279dSmrg   fi
9744fda9279dSmrg   have_xmlto=yes
9745fda9279dSmrgelif test "x$use_xmlto" = x"no" ; then
9746fda9279dSmrg   if test "x$XMLTO" != "x"; then
9747fda9279dSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9748fda9279dSmrg   fi
9749fda9279dSmrg   have_xmlto=no
9750fda9279dSmrgelse
9751fda9279dSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
9752fda9279dSmrgfi
9753fda9279dSmrg
9754fda9279dSmrg# Test for a minimum version of xmlto, if provided.
9755fda9279dSmrgm4_ifval([$1],
9756fda9279dSmrg[if test "$have_xmlto" = yes; then
9757fda9279dSmrg    # scrape the xmlto version
9758fda9279dSmrg    AC_MSG_CHECKING([the xmlto version])
9759fda9279dSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9760fda9279dSmrg    AC_MSG_RESULT([$xmlto_version])
9761fda9279dSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9762fda9279dSmrg        [if test "x$use_xmlto" = xauto; then
9763fda9279dSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9764fda9279dSmrg            have_xmlto=no
9765fda9279dSmrg        else
9766fda9279dSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9767fda9279dSmrg        fi])
9768fda9279dSmrgfi])
9769fda9279dSmrg
9770fda9279dSmrg# Test for the ability of xmlto to generate a text target
9771fda9279dSmrghave_xmlto_text=no
9772fda9279dSmrgcat > conftest.xml << "EOF"
9773c2e4ac43Smrg<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
9774c2e4ac43Smrg                   "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
9775c2e4ac43Smrg<book id="saver">
9776c2e4ac43Smrg</book>
9777fda9279dSmrgEOF
9778fda9279dSmrgAS_IF([test "$have_xmlto" = yes],
9779fda9279dSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9780fda9279dSmrg             [have_xmlto_text=yes],
9781fda9279dSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9782fda9279dSmrgrm -f conftest.xml
9783fda9279dSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9784fda9279dSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9785fda9279dSmrg]) # XORG_WITH_XMLTO
9786fda9279dSmrg
9787fda9279dSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9788fda9279dSmrg# --------------------------------------------
9789fda9279dSmrg# Minimum version: 1.12.0
9790fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.12.0
9791fda9279dSmrg#
9792fda9279dSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9793fda9279dSmrg# XML-based language used for the transformation of XML documents.
9794fda9279dSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9795fda9279dSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9796fda9279dSmrg# The XSLT processor is often used as a standalone tool for transformations.
9797fda9279dSmrg# It should not be assumed that this tool is used only to work with documnetation.
9798fda9279dSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9799fda9279dSmrg#
9800fda9279dSmrg# Interface to module:
9801fda9279dSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9802fda9279dSmrg# XSLTPROC:	 returns the path of the xsltproc program found
9803fda9279dSmrg#		 returns the path set by the user in the environment
9804fda9279dSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9805fda9279dSmrg#		  'no' user instructs the module not to use xsltproc
9806fda9279dSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9807fda9279dSmrg#
9808fda9279dSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9809fda9279dSmrg#
9810fda9279dSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9811fda9279dSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9812fda9279dSmrg# Preserves the interface, should it be implemented later
9813fda9279dSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9814fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9815fda9279dSmrgAC_ARG_WITH(xsltproc,
9816fda9279dSmrg	AS_HELP_STRING([--with-xsltproc],
9817fda9279dSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9818fda9279dSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9819fda9279dSmrgm4_undefine([_defopt])
9820fda9279dSmrg
9821fda9279dSmrgif test "x$use_xsltproc" = x"auto"; then
9822fda9279dSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9823fda9279dSmrg   if test "x$XSLTPROC" = "x"; then
9824fda9279dSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9825fda9279dSmrg	have_xsltproc=no
9826fda9279dSmrg   else
9827fda9279dSmrg        have_xsltproc=yes
9828fda9279dSmrg   fi
9829fda9279dSmrgelif test "x$use_xsltproc" = x"yes" ; then
9830fda9279dSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9831fda9279dSmrg   if test "x$XSLTPROC" = "x"; then
9832fda9279dSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9833fda9279dSmrg   fi
9834fda9279dSmrg   have_xsltproc=yes
9835fda9279dSmrgelif test "x$use_xsltproc" = x"no" ; then
9836fda9279dSmrg   if test "x$XSLTPROC" != "x"; then
9837fda9279dSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9838fda9279dSmrg   fi
9839fda9279dSmrg   have_xsltproc=no
9840fda9279dSmrgelse
9841fda9279dSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
9842fda9279dSmrgfi
9843fda9279dSmrg
9844fda9279dSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9845fda9279dSmrg]) # XORG_WITH_XSLTPROC
9846fda9279dSmrg
9847fda9279dSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9848fda9279dSmrg# ----------------------------------------
9849fda9279dSmrg# Minimum version: 1.15.0
9850fda9279dSmrg#
9851fda9279dSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
9852fda9279dSmrg# scanning arbitrary text files, extracting information from those text files,
9853fda9279dSmrg# and printing reports based on that information.
9854fda9279dSmrg#
9855fda9279dSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9856fda9279dSmrg#
9857fda9279dSmrg# Interface to module:
9858fda9279dSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
9859fda9279dSmrg# PERL:	     returns the path of the perl program found
9860fda9279dSmrg#	     returns the path set by the user in the environment
9861fda9279dSmrg# --with-perl: 'yes' user instructs the module to use perl
9862fda9279dSmrg#	       'no' user instructs the module not to use perl
9863fda9279dSmrg# have_perl: returns yes if perl found in PATH or no
9864fda9279dSmrg#
9865fda9279dSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9866fda9279dSmrg#
9867fda9279dSmrgAC_DEFUN([XORG_WITH_PERL],[
9868fda9279dSmrgAC_ARG_VAR([PERL], [Path to perl command])
9869fda9279dSmrg# Preserves the interface, should it be implemented later
9870fda9279dSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9871fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9872fda9279dSmrgAC_ARG_WITH(perl,
9873fda9279dSmrg	AS_HELP_STRING([--with-perl],
9874fda9279dSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9875fda9279dSmrg	   [use_perl=$withval], [use_perl=]_defopt)
9876fda9279dSmrgm4_undefine([_defopt])
9877fda9279dSmrg
9878fda9279dSmrgif test "x$use_perl" = x"auto"; then
9879fda9279dSmrg   AC_PATH_PROG([PERL], [perl])
9880fda9279dSmrg   if test "x$PERL" = "x"; then
9881fda9279dSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9882fda9279dSmrg	have_perl=no
9883fda9279dSmrg   else
9884fda9279dSmrg        have_perl=yes
9885fda9279dSmrg   fi
9886fda9279dSmrgelif test "x$use_perl" = x"yes" ; then
9887fda9279dSmrg   AC_PATH_PROG([PERL], [perl])
9888fda9279dSmrg   if test "x$PERL" = "x"; then
9889fda9279dSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9890fda9279dSmrg   fi
9891fda9279dSmrg   have_perl=yes
9892fda9279dSmrgelif test "x$use_perl" = x"no" ; then
9893fda9279dSmrg   if test "x$PERL" != "x"; then
9894fda9279dSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9895fda9279dSmrg   fi
9896fda9279dSmrg   have_perl=no
9897fda9279dSmrgelse
9898fda9279dSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9899fda9279dSmrgfi
9900fda9279dSmrg
9901fda9279dSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9902fda9279dSmrg]) # XORG_WITH_PERL
9903fda9279dSmrg
9904fda9279dSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9905fda9279dSmrg# ----------------
9906fda9279dSmrg# Minimum version: 1.5.0
9907fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
9908fda9279dSmrg#
9909fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9910fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9911fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9912fda9279dSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9913fda9279dSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9914fda9279dSmrg# --with-asciidoc assumes 'auto'.
9915fda9279dSmrg#
9916fda9279dSmrg# Interface to module:
9917fda9279dSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9918fda9279dSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
9919fda9279dSmrg#		 returns the path set by the user in the environment
9920fda9279dSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9921fda9279dSmrg#		  'no' user instructs the module not to use asciidoc
9922fda9279dSmrg#
9923fda9279dSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9924fda9279dSmrg#
9925fda9279dSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9926fda9279dSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9927fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9928fda9279dSmrgAC_ARG_WITH(asciidoc,
9929fda9279dSmrg	AS_HELP_STRING([--with-asciidoc],
9930fda9279dSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9931fda9279dSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9932fda9279dSmrgm4_undefine([_defopt])
9933fda9279dSmrg
9934fda9279dSmrgif test "x$use_asciidoc" = x"auto"; then
9935fda9279dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9936fda9279dSmrg   if test "x$ASCIIDOC" = "x"; then
9937fda9279dSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9938fda9279dSmrg	have_asciidoc=no
9939fda9279dSmrg   else
9940fda9279dSmrg        have_asciidoc=yes
9941fda9279dSmrg   fi
9942fda9279dSmrgelif test "x$use_asciidoc" = x"yes" ; then
9943fda9279dSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9944fda9279dSmrg   if test "x$ASCIIDOC" = "x"; then
9945fda9279dSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9946fda9279dSmrg   fi
9947fda9279dSmrg   have_asciidoc=yes
9948fda9279dSmrgelif test "x$use_asciidoc" = x"no" ; then
9949fda9279dSmrg   if test "x$ASCIIDOC" != "x"; then
9950fda9279dSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9951fda9279dSmrg   fi
9952fda9279dSmrg   have_asciidoc=no
9953fda9279dSmrgelse
9954fda9279dSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
9955fda9279dSmrgfi
9956fda9279dSmrgm4_ifval([$1],
9957fda9279dSmrg[if test "$have_asciidoc" = yes; then
9958fda9279dSmrg    # scrape the asciidoc version
9959fda9279dSmrg    AC_MSG_CHECKING([the asciidoc version])
9960fda9279dSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9961fda9279dSmrg    AC_MSG_RESULT([$asciidoc_version])
9962fda9279dSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9963fda9279dSmrg        [if test "x$use_asciidoc" = xauto; then
9964fda9279dSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9965fda9279dSmrg            have_asciidoc=no
9966fda9279dSmrg        else
9967fda9279dSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9968fda9279dSmrg        fi])
9969fda9279dSmrgfi])
9970fda9279dSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9971fda9279dSmrg]) # XORG_WITH_ASCIIDOC
9972fda9279dSmrg
9973fda9279dSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
997416ee1e9aSmrg# -------------------------------------------
9975fda9279dSmrg# Minimum version: 1.5.0
9976fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
997716ee1e9aSmrg# Minimum version for optional DOT checking: 1.18.0
9978fda9279dSmrg#
9979fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
9980fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
9981fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
9982fda9279dSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9983fda9279dSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9984fda9279dSmrg# --with-doxygen assumes 'auto'.
9985fda9279dSmrg#
9986fda9279dSmrg# Interface to module:
9987fda9279dSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9988fda9279dSmrg# DOXYGEN:	 returns the path of the doxygen program found
9989fda9279dSmrg#		 returns the path set by the user in the environment
9990fda9279dSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9991fda9279dSmrg#		  'no' user instructs the module not to use doxygen
9992fda9279dSmrg#
9993fda9279dSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9994fda9279dSmrg#
9995fda9279dSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9996fda9279dSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
999716ee1e9aSmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
9998fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
9999fda9279dSmrgAC_ARG_WITH(doxygen,
10000fda9279dSmrg	AS_HELP_STRING([--with-doxygen],
10001fda9279dSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
10002fda9279dSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
10003fda9279dSmrgm4_undefine([_defopt])
10004fda9279dSmrg
10005fda9279dSmrgif test "x$use_doxygen" = x"auto"; then
10006fda9279dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10007fda9279dSmrg   if test "x$DOXYGEN" = "x"; then
10008fda9279dSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
10009fda9279dSmrg	have_doxygen=no
10010fda9279dSmrg   else
10011fda9279dSmrg        have_doxygen=yes
10012fda9279dSmrg   fi
10013fda9279dSmrgelif test "x$use_doxygen" = x"yes" ; then
10014fda9279dSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
10015fda9279dSmrg   if test "x$DOXYGEN" = "x"; then
10016fda9279dSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
10017fda9279dSmrg   fi
10018fda9279dSmrg   have_doxygen=yes
10019fda9279dSmrgelif test "x$use_doxygen" = x"no" ; then
10020fda9279dSmrg   if test "x$DOXYGEN" != "x"; then
10021fda9279dSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
10022fda9279dSmrg   fi
10023fda9279dSmrg   have_doxygen=no
10024fda9279dSmrgelse
10025fda9279dSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
10026fda9279dSmrgfi
10027fda9279dSmrgm4_ifval([$1],
10028fda9279dSmrg[if test "$have_doxygen" = yes; then
10029fda9279dSmrg    # scrape the doxygen version
10030fda9279dSmrg    AC_MSG_CHECKING([the doxygen version])
10031fda9279dSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
10032fda9279dSmrg    AC_MSG_RESULT([$doxygen_version])
10033fda9279dSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
10034fda9279dSmrg        [if test "x$use_doxygen" = xauto; then
10035fda9279dSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
10036fda9279dSmrg            have_doxygen=no
10037fda9279dSmrg        else
10038fda9279dSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
10039fda9279dSmrg        fi])
10040fda9279dSmrgfi])
1004116ee1e9aSmrg
1004216ee1e9aSmrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
1004316ee1e9aSmrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
1004416ee1e9aSmrgdnl 	HAVE_DOT = @HAVE_DOT@
1004516ee1e9aSmrgHAVE_DOT=no
1004616ee1e9aSmrgif test "x$have_doxygen" = "xyes"; then
1004716ee1e9aSmrg  AC_PATH_PROG([DOT], [dot])
1004816ee1e9aSmrg    if test "x$DOT" != "x"; then
1004916ee1e9aSmrg      HAVE_DOT=yes
1005016ee1e9aSmrg    fi
1005116ee1e9aSmrgfi
1005216ee1e9aSmrg
1005316ee1e9aSmrgAC_SUBST([HAVE_DOT])
1005416ee1e9aSmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
10055fda9279dSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
10056fda9279dSmrg]) # XORG_WITH_DOXYGEN
10057fda9279dSmrg
10058fda9279dSmrg# XORG_WITH_GROFF([DEFAULT])
10059fda9279dSmrg# ----------------
10060fda9279dSmrg# Minimum version: 1.6.0
10061fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10062fda9279dSmrg#
10063fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10064fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
10065fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10066fda9279dSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
10067fda9279dSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
10068fda9279dSmrg# --with-groff assumes 'auto'.
10069fda9279dSmrg#
10070fda9279dSmrg# Interface to module:
10071fda9279dSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10072fda9279dSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10073fda9279dSmrg# HAVE_GROFF_MS: the -ms macros package
10074fda9279dSmrg# GROFF:	 returns the path of the groff program found
10075fda9279dSmrg#		 returns the path set by the user in the environment
10076fda9279dSmrg# --with-groff:	 'yes' user instructs the module to use groff
10077fda9279dSmrg#		 'no' user instructs the module not to use groff
10078fda9279dSmrg#
10079fda9279dSmrg# Added in version 1.9.0:
10080fda9279dSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10081fda9279dSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10082fda9279dSmrg#		   psselect from the psutils package.
10083fda9279dSmrg#		   the ghostcript package. Refer to the grohtml man pages
10084fda9279dSmrg#
10085fda9279dSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10086fda9279dSmrg#
10087fda9279dSmrg# OS and distros often splits groff in a basic and full package, the former
10088fda9279dSmrg# having the groff program and the later having devices, fonts and macros
10089fda9279dSmrg# Checking for the groff executable is not enough.
10090fda9279dSmrg#
10091fda9279dSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
10092fda9279dSmrg# unset HAVE_GROFF or GROFF env variables.
10093fda9279dSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10094fda9279dSmrg#
10095fda9279dSmrgAC_DEFUN([XORG_WITH_GROFF],[
10096fda9279dSmrgAC_ARG_VAR([GROFF], [Path to groff command])
10097fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10098fda9279dSmrgAC_ARG_WITH(groff,
10099fda9279dSmrg	AS_HELP_STRING([--with-groff],
10100fda9279dSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10101fda9279dSmrg	   [use_groff=$withval], [use_groff=]_defopt)
10102fda9279dSmrgm4_undefine([_defopt])
10103fda9279dSmrg
10104fda9279dSmrgif test "x$use_groff" = x"auto"; then
10105fda9279dSmrg   AC_PATH_PROG([GROFF], [groff])
10106fda9279dSmrg   if test "x$GROFF" = "x"; then
10107fda9279dSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10108fda9279dSmrg	have_groff=no
10109fda9279dSmrg   else
10110fda9279dSmrg        have_groff=yes
10111fda9279dSmrg   fi
10112fda9279dSmrgelif test "x$use_groff" = x"yes" ; then
10113fda9279dSmrg   AC_PATH_PROG([GROFF], [groff])
10114fda9279dSmrg   if test "x$GROFF" = "x"; then
10115fda9279dSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10116fda9279dSmrg   fi
10117fda9279dSmrg   have_groff=yes
10118fda9279dSmrgelif test "x$use_groff" = x"no" ; then
10119fda9279dSmrg   if test "x$GROFF" != "x"; then
10120fda9279dSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10121fda9279dSmrg   fi
10122fda9279dSmrg   have_groff=no
10123fda9279dSmrgelse
10124fda9279dSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10125fda9279dSmrgfi
10126fda9279dSmrg
10127fda9279dSmrg# We have groff, test for the presence of the macro packages
10128fda9279dSmrgif test "x$have_groff" = x"yes"; then
10129fda9279dSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10130fda9279dSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10131fda9279dSmrg        groff_ms_works=yes
10132fda9279dSmrg    else
10133fda9279dSmrg        groff_ms_works=no
10134fda9279dSmrg    fi
10135fda9279dSmrg    AC_MSG_RESULT([$groff_ms_works])
10136fda9279dSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10137fda9279dSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10138fda9279dSmrg        groff_mm_works=yes
10139fda9279dSmrg    else
10140fda9279dSmrg        groff_mm_works=no
10141fda9279dSmrg    fi
10142fda9279dSmrg    AC_MSG_RESULT([$groff_mm_works])
10143fda9279dSmrgfi
10144fda9279dSmrg
10145fda9279dSmrg# We have groff, test for HTML dependencies, one command per package
10146fda9279dSmrgif test "x$have_groff" = x"yes"; then
10147fda9279dSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10148fda9279dSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10149fda9279dSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10150fda9279dSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10151fda9279dSmrg      have_groff_html=yes
10152fda9279dSmrg   else
10153fda9279dSmrg      have_groff_html=no
10154fda9279dSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10155fda9279dSmrg   fi
10156fda9279dSmrgfi
10157fda9279dSmrg
10158fda9279dSmrg# Set Automake conditionals for Makefiles
10159fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10160fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10161fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10162fda9279dSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10163fda9279dSmrg]) # XORG_WITH_GROFF
10164fda9279dSmrg
10165fda9279dSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10166fda9279dSmrg# ---------------------------------------
10167fda9279dSmrg# Minimum version: 1.6.0
10168fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10169fda9279dSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10170fda9279dSmrg#
10171fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10172fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
10173fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10174fda9279dSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
10175fda9279dSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
10176fda9279dSmrg# --with-fop assumes 'auto'.
10177fda9279dSmrg#
10178fda9279dSmrg# Interface to module:
10179fda9279dSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10180fda9279dSmrg# FOP:	 	returns the path of the fop program found
10181fda9279dSmrg#		returns the path set by the user in the environment
10182fda9279dSmrg# --with-fop: 	'yes' user instructs the module to use fop
10183fda9279dSmrg#		'no' user instructs the module not to use fop
10184fda9279dSmrg#
10185fda9279dSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10186fda9279dSmrg#
10187fda9279dSmrgAC_DEFUN([XORG_WITH_FOP],[
10188fda9279dSmrgAC_ARG_VAR([FOP], [Path to fop command])
10189fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
10190fda9279dSmrgAC_ARG_WITH(fop,
10191fda9279dSmrg	AS_HELP_STRING([--with-fop],
10192fda9279dSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10193fda9279dSmrg	   [use_fop=$withval], [use_fop=]_defopt)
10194fda9279dSmrgm4_undefine([_defopt])
10195fda9279dSmrg
10196fda9279dSmrgif test "x$use_fop" = x"auto"; then
10197fda9279dSmrg   AC_PATH_PROG([FOP], [fop])
10198fda9279dSmrg   if test "x$FOP" = "x"; then
10199fda9279dSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10200fda9279dSmrg	have_fop=no
10201fda9279dSmrg   else
10202fda9279dSmrg        have_fop=yes
10203fda9279dSmrg   fi
10204fda9279dSmrgelif test "x$use_fop" = x"yes" ; then
10205fda9279dSmrg   AC_PATH_PROG([FOP], [fop])
10206fda9279dSmrg   if test "x$FOP" = "x"; then
10207fda9279dSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10208fda9279dSmrg   fi
10209fda9279dSmrg   have_fop=yes
10210fda9279dSmrgelif test "x$use_fop" = x"no" ; then
10211fda9279dSmrg   if test "x$FOP" != "x"; then
10212fda9279dSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10213fda9279dSmrg   fi
10214fda9279dSmrg   have_fop=no
10215fda9279dSmrgelse
10216fda9279dSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10217fda9279dSmrgfi
10218fda9279dSmrg
10219fda9279dSmrg# Test for a minimum version of fop, if provided.
10220fda9279dSmrgm4_ifval([$1],
10221fda9279dSmrg[if test "$have_fop" = yes; then
10222fda9279dSmrg    # scrape the fop version
10223fda9279dSmrg    AC_MSG_CHECKING([for fop minimum version])
10224fda9279dSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10225fda9279dSmrg    AC_MSG_RESULT([$fop_version])
10226fda9279dSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
10227fda9279dSmrg        [if test "x$use_fop" = xauto; then
10228fda9279dSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10229fda9279dSmrg            have_fop=no
10230fda9279dSmrg        else
10231fda9279dSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10232fda9279dSmrg        fi])
10233fda9279dSmrgfi])
10234fda9279dSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10235fda9279dSmrg]) # XORG_WITH_FOP
10236fda9279dSmrg
1023716ee1e9aSmrg# XORG_WITH_M4([MIN-VERSION])
1023816ee1e9aSmrg# ---------------------------
1023916ee1e9aSmrg# Minimum version: 1.19.0
1024016ee1e9aSmrg#
1024116ee1e9aSmrg# This macro attempts to locate an m4 macro processor which supports
1024216ee1e9aSmrg# -I option and is only useful for modules relying on M4 in order to
1024316ee1e9aSmrg# expand macros in source code files.
1024416ee1e9aSmrg#
1024516ee1e9aSmrg# Interface to module:
1024616ee1e9aSmrg# M4:	 	returns the path of the m4 program found
1024716ee1e9aSmrg#		returns the path set by the user in the environment
1024816ee1e9aSmrg#
1024916ee1e9aSmrgAC_DEFUN([XORG_WITH_M4], [
1025016ee1e9aSmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1025116ee1e9aSmrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1025216ee1e9aSmrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1025316ee1e9aSmrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1025416ee1e9aSmrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1025516ee1e9aSmrg   [$PATH:/usr/gnu/bin])])
1025616ee1e9aSmrg
1025716ee1e9aSmrgAC_SUBST([M4], [$ac_cv_path_M4])
1025816ee1e9aSmrg]) # XORG_WITH_M4
1025916ee1e9aSmrg
10260fda9279dSmrg# XORG_WITH_PS2PDF([DEFAULT])
10261fda9279dSmrg# ----------------
10262fda9279dSmrg# Minimum version: 1.6.0
10263fda9279dSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10264fda9279dSmrg#
10265fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10266fda9279dSmrg# not at the appropriate level. This macro enables a module to test for the
10267fda9279dSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
10268fda9279dSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10269fda9279dSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10270fda9279dSmrg# --with-ps2pdf assumes 'auto'.
10271fda9279dSmrg#
10272fda9279dSmrg# Interface to module:
10273fda9279dSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10274fda9279dSmrg# PS2PDF:	returns the path of the ps2pdf program found
10275fda9279dSmrg#		returns the path set by the user in the environment
10276fda9279dSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10277fda9279dSmrg#		 'no' user instructs the module not to use ps2pdf
10278fda9279dSmrg#
10279fda9279dSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10280fda9279dSmrg#
10281fda9279dSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10282fda9279dSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10283fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10284fda9279dSmrgAC_ARG_WITH(ps2pdf,
10285fda9279dSmrg	AS_HELP_STRING([--with-ps2pdf],
10286fda9279dSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10287fda9279dSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10288fda9279dSmrgm4_undefine([_defopt])
10289fda9279dSmrg
10290fda9279dSmrgif test "x$use_ps2pdf" = x"auto"; then
10291fda9279dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10292fda9279dSmrg   if test "x$PS2PDF" = "x"; then
10293fda9279dSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10294fda9279dSmrg	have_ps2pdf=no
10295fda9279dSmrg   else
10296fda9279dSmrg        have_ps2pdf=yes
10297fda9279dSmrg   fi
10298fda9279dSmrgelif test "x$use_ps2pdf" = x"yes" ; then
10299fda9279dSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10300fda9279dSmrg   if test "x$PS2PDF" = "x"; then
10301fda9279dSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10302fda9279dSmrg   fi
10303fda9279dSmrg   have_ps2pdf=yes
10304fda9279dSmrgelif test "x$use_ps2pdf" = x"no" ; then
10305fda9279dSmrg   if test "x$PS2PDF" != "x"; then
10306fda9279dSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10307fda9279dSmrg   fi
10308fda9279dSmrg   have_ps2pdf=no
10309fda9279dSmrgelse
10310fda9279dSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10311fda9279dSmrgfi
10312fda9279dSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10313fda9279dSmrg]) # XORG_WITH_PS2PDF
10314fda9279dSmrg
10315fda9279dSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
10316fda9279dSmrg# ----------------
10317fda9279dSmrg# Minimum version: 1.6.0
10318fda9279dSmrg#
10319fda9279dSmrg# Documentation tools are not always available on all platforms and sometimes
10320fda9279dSmrg# not at the appropriate level. This macro enables a builder to skip all
10321fda9279dSmrg# documentation targets except traditional man pages.
10322fda9279dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10323fda9279dSmrg# maximum flexibilty in controlling documentation building.
10324fda9279dSmrg# Refer to:
10325fda9279dSmrg# XORG_WITH_XMLTO         --with-xmlto
10326fda9279dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10327fda9279dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10328fda9279dSmrg# XORG_WITH_FOP           --with-fop
10329fda9279dSmrg# XORG_WITH_GROFF         --with-groff
10330fda9279dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10331fda9279dSmrg#
10332fda9279dSmrg# Interface to module:
10333fda9279dSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10334fda9279dSmrg# --enable-docs: 'yes' user instructs the module to generate docs
10335fda9279dSmrg#		 'no' user instructs the module not to generate docs
10336fda9279dSmrg# parm1:	specify the default value, yes or no.
10337fda9279dSmrg#
10338fda9279dSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10339fda9279dSmrgm4_define([docs_default], m4_default([$1], [yes]))
10340fda9279dSmrgAC_ARG_ENABLE(docs,
10341fda9279dSmrg	AS_HELP_STRING([--enable-docs],
10342fda9279dSmrg	   [Enable building the documentation (default: ]docs_default[)]),
10343fda9279dSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
10344fda9279dSmrgm4_undefine([docs_default])
10345fda9279dSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10346fda9279dSmrgAC_MSG_CHECKING([whether to build documentation])
10347fda9279dSmrgAC_MSG_RESULT([$build_docs])
10348fda9279dSmrg]) # XORG_ENABLE_DOCS
10349fda9279dSmrg
10350fda9279dSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10351fda9279dSmrg# ----------------
10352fda9279dSmrg# Minimum version: 1.6.0
10353fda9279dSmrg#
10354fda9279dSmrg# This macro enables a builder to skip all developer documentation.
10355fda9279dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10356fda9279dSmrg# maximum flexibilty in controlling documentation building.
10357fda9279dSmrg# Refer to:
10358fda9279dSmrg# XORG_WITH_XMLTO         --with-xmlto
10359fda9279dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10360fda9279dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10361fda9279dSmrg# XORG_WITH_FOP           --with-fop
10362fda9279dSmrg# XORG_WITH_GROFF         --with-groff
10363fda9279dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10364fda9279dSmrg#
10365fda9279dSmrg# Interface to module:
10366fda9279dSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10367fda9279dSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10368fda9279dSmrg#			'no' user instructs the module not to generate developer docs
10369fda9279dSmrg# parm1:		specify the default value, yes or no.
10370fda9279dSmrg#
10371fda9279dSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10372fda9279dSmrgm4_define([devel_default], m4_default([$1], [yes]))
10373fda9279dSmrgAC_ARG_ENABLE(devel-docs,
10374fda9279dSmrg	AS_HELP_STRING([--enable-devel-docs],
10375fda9279dSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10376fda9279dSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10377fda9279dSmrgm4_undefine([devel_default])
10378fda9279dSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10379fda9279dSmrgAC_MSG_CHECKING([whether to build developer documentation])
10380fda9279dSmrgAC_MSG_RESULT([$build_devel_docs])
10381fda9279dSmrg]) # XORG_ENABLE_DEVEL_DOCS
10382fda9279dSmrg
10383fda9279dSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
10384fda9279dSmrg# ----------------
10385fda9279dSmrg# Minimum version: 1.6.0
10386fda9279dSmrg#
10387fda9279dSmrg# This macro enables a builder to skip all functional specification targets.
10388fda9279dSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10389fda9279dSmrg# maximum flexibilty in controlling documentation building.
10390fda9279dSmrg# Refer to:
10391fda9279dSmrg# XORG_WITH_XMLTO         --with-xmlto
10392fda9279dSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10393fda9279dSmrg# XORG_WITH_DOXYGEN       --with-doxygen
10394fda9279dSmrg# XORG_WITH_FOP           --with-fop
10395fda9279dSmrg# XORG_WITH_GROFF         --with-groff
10396fda9279dSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
10397fda9279dSmrg#
10398fda9279dSmrg# Interface to module:
10399fda9279dSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10400fda9279dSmrg# --enable-specs:	'yes' user instructs the module to generate specs
10401fda9279dSmrg#			'no' user instructs the module not to generate specs
10402fda9279dSmrg# parm1:		specify the default value, yes or no.
10403fda9279dSmrg#
10404fda9279dSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10405fda9279dSmrgm4_define([spec_default], m4_default([$1], [yes]))
10406fda9279dSmrgAC_ARG_ENABLE(specs,
10407fda9279dSmrg	AS_HELP_STRING([--enable-specs],
10408fda9279dSmrg	   [Enable building the specs (default: ]spec_default[)]),
10409fda9279dSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
10410fda9279dSmrgm4_undefine([spec_default])
10411fda9279dSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10412fda9279dSmrgAC_MSG_CHECKING([whether to build functional specifications])
10413fda9279dSmrgAC_MSG_RESULT([$build_specs])
10414fda9279dSmrg]) # XORG_ENABLE_SPECS
10415fda9279dSmrg
10416fda9279dSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10417fda9279dSmrg# ----------------------------------------------
10418fda9279dSmrg# Minimum version: 1.13.0
10419fda9279dSmrg#
10420fda9279dSmrg# This macro enables a builder to enable/disable unit testing
10421fda9279dSmrg# It makes no assumption about the test cases implementation
10422fda9279dSmrg# Test cases may or may not use Automake "Support for test suites"
10423fda9279dSmrg# They may or may not use the software utility library GLib
10424fda9279dSmrg#
10425fda9279dSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10426fda9279dSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10427fda9279dSmrg# The variable enable_unit_tests is used by other macros in this file.
10428fda9279dSmrg#
10429fda9279dSmrg# Interface to module:
10430fda9279dSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10431fda9279dSmrg# enable_unit_tests:    used in configure.ac for additional configuration
10432fda9279dSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10433fda9279dSmrg#			'no' user instructs the module not to build tests
10434fda9279dSmrg# parm1:		specify the default value, yes or no.
10435fda9279dSmrg#
10436fda9279dSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10437fda9279dSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10438fda9279dSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10439fda9279dSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10440fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10441fda9279dSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10442fda9279dSmrg	[Enable building unit test cases (default: ]_defopt[)]),
10443fda9279dSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
10444fda9279dSmrgm4_undefine([_defopt])
10445fda9279dSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10446fda9279dSmrgAC_MSG_CHECKING([whether to build unit test cases])
10447fda9279dSmrgAC_MSG_RESULT([$enable_unit_tests])
10448fda9279dSmrg]) # XORG_ENABLE_UNIT_TESTS
10449fda9279dSmrg
10450fda9279dSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10451fda9279dSmrg# ------------------------------------------------------
10452fda9279dSmrg# Minimum version: 1.17.0
10453fda9279dSmrg#
10454fda9279dSmrg# This macro enables a builder to enable/disable integration testing
10455fda9279dSmrg# It makes no assumption about the test cases' implementation
10456fda9279dSmrg# Test cases may or may not use Automake "Support for test suites"
10457fda9279dSmrg#
10458fda9279dSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10459fda9279dSmrg# usually requires less dependencies and may be built and run under less
10460fda9279dSmrg# stringent environments than integration tests.
10461fda9279dSmrg#
10462fda9279dSmrg# Interface to module:
10463fda9279dSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10464fda9279dSmrg# enable_integration_tests:   used in configure.ac for additional configuration
10465fda9279dSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10466fda9279dSmrg#                             'no' user instructs the module not to build tests
10467fda9279dSmrg# parm1:                      specify the default value, yes or no.
10468fda9279dSmrg#
10469fda9279dSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10470fda9279dSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10471fda9279dSmrgm4_define([_defopt], m4_default([$1], [auto]))
10472fda9279dSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10473fda9279dSmrg	[Enable building integration test cases (default: ]_defopt[)]),
10474fda9279dSmrg	[enable_integration_tests=$enableval],
10475fda9279dSmrg	[enable_integration_tests=]_defopt)
10476fda9279dSmrgm4_undefine([_defopt])
10477fda9279dSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10478fda9279dSmrg	[test "x$enable_integration_tests" != xno])
10479fda9279dSmrgAC_MSG_CHECKING([whether to build unit test cases])
10480fda9279dSmrgAC_MSG_RESULT([$enable_integration_tests])
10481fda9279dSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10482fda9279dSmrg
10483fda9279dSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
10484fda9279dSmrg# ----------------------------------------
10485fda9279dSmrg# Minimum version: 1.13.0
10486fda9279dSmrg#
10487fda9279dSmrg# GLib is a library which provides advanced data structures and functions.
10488fda9279dSmrg# This macro enables a module to test for the presence of Glib.
10489fda9279dSmrg#
10490fda9279dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10491fda9279dSmrg# Otherwise the value of $enable_unit_tests is blank.
10492fda9279dSmrg#
10493fda9279dSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10494fda9279dSmrg# test support usually requires less dependencies and may be built and run under
10495fda9279dSmrg# less stringent environments than integration tests.
10496fda9279dSmrg#
10497fda9279dSmrg# Interface to module:
10498fda9279dSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
10499fda9279dSmrg# with_glib: used in configure.ac to know if GLib has been found
10500fda9279dSmrg# --with-glib:	'yes' user instructs the module to use glib
10501fda9279dSmrg#		'no' user instructs the module not to use glib
10502fda9279dSmrg#
10503fda9279dSmrgAC_DEFUN([XORG_WITH_GLIB],[
10504fda9279dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
10505fda9279dSmrgm4_define([_defopt], m4_default([$2], [auto]))
10506fda9279dSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10507fda9279dSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10508fda9279dSmrg	[with_glib=$withval], [with_glib=]_defopt)
10509fda9279dSmrgm4_undefine([_defopt])
10510fda9279dSmrg
10511fda9279dSmrghave_glib=no
10512fda9279dSmrg# Do not probe GLib if user explicitly disabled unit testing
10513fda9279dSmrgif test "x$enable_unit_tests" != x"no"; then
10514fda9279dSmrg  # Do not probe GLib if user explicitly disabled it
10515fda9279dSmrg  if test "x$with_glib" != x"no"; then
10516fda9279dSmrg    m4_ifval(
10517fda9279dSmrg      [$1],
10518fda9279dSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10519fda9279dSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10520fda9279dSmrg    )
10521fda9279dSmrg  fi
10522fda9279dSmrgfi
10523fda9279dSmrg
10524fda9279dSmrg# Not having GLib when unit testing has been explicitly requested is an error
10525fda9279dSmrgif test "x$enable_unit_tests" = x"yes"; then
10526fda9279dSmrg  if test "x$have_glib" = x"no"; then
10527fda9279dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10528fda9279dSmrg  fi
10529fda9279dSmrgfi
10530fda9279dSmrg
10531fda9279dSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
10532fda9279dSmrgif test "x$enable_unit_tests" = x"no"; then
10533fda9279dSmrg  if test "x$with_glib" = x"yes"; then
10534fda9279dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10535fda9279dSmrg  fi
10536fda9279dSmrgfi
10537fda9279dSmrg
10538fda9279dSmrg# Not having GLib when it has been explicitly requested is an error
10539fda9279dSmrgif test "x$with_glib" = x"yes"; then
10540fda9279dSmrg  if test "x$have_glib" = x"no"; then
10541fda9279dSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10542fda9279dSmrg  fi
10543fda9279dSmrgfi
10544fda9279dSmrg
10545fda9279dSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10546fda9279dSmrg]) # XORG_WITH_GLIB
10547fda9279dSmrg
10548fda9279dSmrg# XORG_LD_WRAP([required|optional])
10549fda9279dSmrg# ---------------------------------
10550fda9279dSmrg# Minimum version: 1.13.0
10551fda9279dSmrg#
10552fda9279dSmrg# Check if linker supports -wrap, passed via compiler flags
10553fda9279dSmrg#
10554fda9279dSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10555fda9279dSmrg# Otherwise the value of $enable_unit_tests is blank.
10556fda9279dSmrg#
10557fda9279dSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10558fda9279dSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10559fda9279dSmrg# available, an argument of "optional" allows use when some unit tests require
10560fda9279dSmrg# ld -wrap and others do not.
10561fda9279dSmrg#
10562fda9279dSmrgAC_DEFUN([XORG_LD_WRAP],[
10563fda9279dSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10564fda9279dSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10565fda9279dSmrg                      void __wrap_exit(int status) { return; }],
10566fda9279dSmrg                     [exit(0);])])
10567fda9279dSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
10568fda9279dSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10569fda9279dSmrg  if test "x$have_ld_wrap" = x"no"; then
10570fda9279dSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10571fda9279dSmrg  fi
10572fda9279dSmrgfi
10573fda9279dSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10574fda9279dSmrg#
10575fda9279dSmrg]) # XORG_LD_WRAP
10576fda9279dSmrg
10577fda9279dSmrg# XORG_CHECK_LINKER_FLAGS
10578fda9279dSmrg# -----------------------
10579fda9279dSmrg# SYNOPSIS
10580fda9279dSmrg#
10581fda9279dSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
10582fda9279dSmrg#
10583fda9279dSmrg# DESCRIPTION
10584fda9279dSmrg#
10585fda9279dSmrg#   Check whether the given linker FLAGS work with the current language's
10586fda9279dSmrg#   linker, or whether they give an error.
10587fda9279dSmrg#
10588fda9279dSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10589fda9279dSmrg#   success/failure.
10590fda9279dSmrg#
10591fda9279dSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
10592fda9279dSmrg#
10593fda9279dSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
10594fda9279dSmrg#
10595fda9279dSmrg# LICENSE
10596fda9279dSmrg#
10597fda9279dSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10598fda9279dSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10599fda9279dSmrg#   Copyright (c) 2009 Matteo Frigo
10600fda9279dSmrg#
10601fda9279dSmrg#   This program is free software: you can redistribute it and/or modify it
10602fda9279dSmrg#   under the terms of the GNU General Public License as published by the
10603fda9279dSmrg#   Free Software Foundation, either version 3 of the License, or (at your
10604fda9279dSmrg#   option) any later version.
10605fda9279dSmrg#
10606fda9279dSmrg#   This program is distributed in the hope that it will be useful, but
10607fda9279dSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10608fda9279dSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10609fda9279dSmrg#   Public License for more details.
10610fda9279dSmrg#
10611fda9279dSmrg#   You should have received a copy of the GNU General Public License along
10612fda9279dSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10613fda9279dSmrg#
10614fda9279dSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
10615fda9279dSmrg#   gives unlimited permission to copy, distribute and modify the configure
10616fda9279dSmrg#   scripts that are the output of Autoconf when processing the Macro. You
10617fda9279dSmrg#   need not follow the terms of the GNU General Public License when using
10618fda9279dSmrg#   or distributing such scripts, even though portions of the text of the
10619fda9279dSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10620fda9279dSmrg#   all other use of the material that constitutes the Autoconf Macro.
10621fda9279dSmrg#
10622fda9279dSmrg#   This special exception to the GPL applies to versions of the Autoconf
10623fda9279dSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
10624fda9279dSmrg#   modified version of the Autoconf Macro, you may extend this special
10625fda9279dSmrg#   exception to the GPL to apply to your modified version as well.#
10626fda9279dSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10627fda9279dSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
10628fda9279dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10629fda9279dSmrgAS_LITERAL_IF([$1],
10630fda9279dSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10631fda9279dSmrg      ax_save_FLAGS=$LDFLAGS
10632fda9279dSmrg      LDFLAGS="$1"
10633fda9279dSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10634fda9279dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10635fda9279dSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10636fda9279dSmrg      LDFLAGS=$ax_save_FLAGS])],
10637fda9279dSmrg  [ax_save_FLAGS=$LDFLAGS
10638fda9279dSmrg   LDFLAGS="$1"
10639fda9279dSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10640fda9279dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10641fda9279dSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10642fda9279dSmrg   LDFLAGS=$ax_save_FLAGS])
10643fda9279dSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10644fda9279dSmrgAC_MSG_RESULT($xorg_check_linker_flags)
10645fda9279dSmrgif test "x$xorg_check_linker_flags" = xyes; then
10646fda9279dSmrg	m4_default([$2], :)
10647fda9279dSmrgelse
10648fda9279dSmrg	m4_default([$3], :)
10649fda9279dSmrgfi
10650fda9279dSmrg]) # XORG_CHECK_LINKER_FLAGS
10651fda9279dSmrg
10652fda9279dSmrg# XORG_MEMORY_CHECK_FLAGS
10653fda9279dSmrg# -----------------------
10654fda9279dSmrg# Minimum version: 1.16.0
10655fda9279dSmrg#
10656fda9279dSmrg# This macro attempts to find appropriate memory checking functionality
10657fda9279dSmrg# for various platforms which unit testing code may use to catch various
10658fda9279dSmrg# forms of memory allocation and access errors in testing.
10659fda9279dSmrg#
10660fda9279dSmrg# Interface to module:
10661fda9279dSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10662fda9279dSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
10663fda9279dSmrg#
10664fda9279dSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
10665fda9279dSmrg#
10666fda9279dSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10667fda9279dSmrg
10668fda9279dSmrgAC_REQUIRE([AC_CANONICAL_HOST])
10669fda9279dSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10670fda9279dSmrg           [Environment variables to enable memory checking in tests])
10671fda9279dSmrg
10672fda9279dSmrg# Check for different types of support on different platforms
10673fda9279dSmrgcase $host_os in
10674fda9279dSmrg    solaris*)
10675fda9279dSmrg        AC_CHECK_LIB([umem], [umem_alloc],
10676fda9279dSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10677fda9279dSmrg        ;;
10678fda9279dSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10679fda9279dSmrg        # both directly and inverted, so should not be 0 or 255.
10680fda9279dSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
10681fda9279dSmrg        ;;
10682fda9279dSmrg    darwin*)
10683fda9279dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10684fda9279dSmrg        ;;
10685fda9279dSmrg    *bsd*)
10686fda9279dSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10687fda9279dSmrg        ;;
10688fda9279dSmrgesac
10689fda9279dSmrg
10690fda9279dSmrg# User supplied flags override default flags
10691fda9279dSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10692fda9279dSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
10693fda9279dSmrgfi
10694fda9279dSmrg
10695fda9279dSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10696fda9279dSmrg]) # XORG_WITH_LINT
10697fda9279dSmrg
10698fda9279dSmrg# XORG_CHECK_MALLOC_ZERO
10699fda9279dSmrg# ----------------------
10700fda9279dSmrg# Minimum version: 1.0.0
10701fda9279dSmrg#
10702fda9279dSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10703fda9279dSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10704fda9279dSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10705fda9279dSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10706fda9279dSmrgAC_ARG_ENABLE(malloc0returnsnull,
10707fda9279dSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10708fda9279dSmrg		       [malloc(0) returns NULL (default: auto)]),
10709fda9279dSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10710fda9279dSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10711fda9279dSmrg
10712fda9279dSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10713fda9279dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
1071416ee1e9aSmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
1071516ee1e9aSmrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10716fda9279dSmrg#include <stdlib.h>
10717fda9279dSmrg],[
10718fda9279dSmrg    char *m0, *r0, *c0, *p;
10719fda9279dSmrg    m0 = malloc(0);
10720fda9279dSmrg    p = malloc(10);
10721fda9279dSmrg    r0 = realloc(p,0);
10722fda9279dSmrg    c0 = calloc(0,10);
10723fda9279dSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10724fda9279dSmrg])],
1072516ee1e9aSmrg		[xorg_cv_malloc0_returns_null=yes],
1072616ee1e9aSmrg		[xorg_cv_malloc0_returns_null=no])])
1072716ee1e9aSmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10728fda9279dSmrgfi
10729fda9279dSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10730fda9279dSmrg
10731fda9279dSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10732fda9279dSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10733fda9279dSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10734fda9279dSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10735fda9279dSmrgelse
10736fda9279dSmrg	MALLOC_ZERO_CFLAGS=""
10737fda9279dSmrg	XMALLOC_ZERO_CFLAGS=""
10738fda9279dSmrg	XTMALLOC_ZERO_CFLAGS=""
10739fda9279dSmrgfi
10740fda9279dSmrg
10741fda9279dSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10742fda9279dSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10743fda9279dSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10744fda9279dSmrg]) # XORG_CHECK_MALLOC_ZERO
10745fda9279dSmrg
10746fda9279dSmrg# XORG_WITH_LINT()
10747fda9279dSmrg# ----------------
10748fda9279dSmrg# Minimum version: 1.1.0
10749fda9279dSmrg#
10750fda9279dSmrg# This macro enables the use of a tool that flags some suspicious and
10751fda9279dSmrg# non-portable constructs (likely to be bugs) in C language source code.
10752fda9279dSmrg# It will attempt to locate the tool and use appropriate options.
10753fda9279dSmrg# There are various lint type tools on different platforms.
10754fda9279dSmrg#
10755fda9279dSmrg# Interface to module:
10756fda9279dSmrg# LINT:		returns the path to the tool found on the platform
10757fda9279dSmrg#		or the value set to LINT on the configure cmd line
10758fda9279dSmrg#		also an Automake conditional
10759fda9279dSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
10760fda9279dSmrg#
10761fda9279dSmrg# --with-lint:	'yes' user instructs the module to use lint
10762fda9279dSmrg#		'no' user instructs the module not to use lint (default)
10763fda9279dSmrg#
10764fda9279dSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10765fda9279dSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10766fda9279dSmrg#
10767fda9279dSmrgAC_DEFUN([XORG_WITH_LINT],[
10768fda9279dSmrg
10769fda9279dSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10770fda9279dSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10771fda9279dSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10772fda9279dSmrg		[Use a lint-style source code checker (default: disabled)])],
10773fda9279dSmrg		[use_lint=$withval], [use_lint=no])
10774fda9279dSmrg
10775fda9279dSmrg# Obtain platform specific info like program name and options
10776fda9279dSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10777fda9279dSmrgcase $host_os in
10778fda9279dSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10779fda9279dSmrg	lint_name=splint
10780fda9279dSmrg	lint_options="-badflag"
10781fda9279dSmrg	;;
10782fda9279dSmrg  *freebsd* | *netbsd*)
10783fda9279dSmrg	lint_name=lint
10784fda9279dSmrg	lint_options="-u -b"
10785fda9279dSmrg	;;
10786fda9279dSmrg  *solaris*)
10787fda9279dSmrg	lint_name=lint
10788fda9279dSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10789fda9279dSmrg	;;
10790fda9279dSmrgesac
10791fda9279dSmrg
10792fda9279dSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10793fda9279dSmrgif test "x$use_lint" = x"yes" ; then
10794fda9279dSmrg   AC_PATH_PROG([LINT], [$lint_name])
10795fda9279dSmrg   if test "x$LINT" = "x"; then
10796fda9279dSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10797fda9279dSmrg   fi
10798fda9279dSmrgelif test "x$use_lint" = x"no" ; then
10799fda9279dSmrg   if test "x$LINT" != "x"; then
10800fda9279dSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10801fda9279dSmrg   fi
10802fda9279dSmrgelse
10803fda9279dSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10804fda9279dSmrgfi
10805fda9279dSmrg
10806fda9279dSmrg# User supplied flags override default flags
10807fda9279dSmrgif test "x$LINT_FLAGS" != "x"; then
10808fda9279dSmrg   lint_options=$LINT_FLAGS
10809fda9279dSmrgfi
10810fda9279dSmrg
10811fda9279dSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10812fda9279dSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10813fda9279dSmrg
10814fda9279dSmrg]) # XORG_WITH_LINT
10815fda9279dSmrg
10816fda9279dSmrg# XORG_LINT_LIBRARY(LIBNAME)
10817fda9279dSmrg# --------------------------
10818fda9279dSmrg# Minimum version: 1.1.0
10819fda9279dSmrg#
10820fda9279dSmrg# Sets up flags for building lint libraries for checking programs that call
10821fda9279dSmrg# functions in the library.
10822fda9279dSmrg#
10823fda9279dSmrg# Interface to module:
10824fda9279dSmrg# LINTLIB		- Automake variable with the name of lint library file to make
10825fda9279dSmrg# MAKE_LINT_LIB		- Automake conditional
10826fda9279dSmrg#
10827fda9279dSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10828fda9279dSmrg#			  - 'no' user instructs the module not to create a lint library (default)
10829fda9279dSmrg
10830fda9279dSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10831fda9279dSmrgAC_REQUIRE([XORG_WITH_LINT])
10832fda9279dSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10833fda9279dSmrg	[Create lint library (default: disabled)])],
10834fda9279dSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10835fda9279dSmrg
10836fda9279dSmrgif test "x$make_lint_lib" = x"yes" ; then
10837fda9279dSmrg   LINTLIB=llib-l$1.ln
10838fda9279dSmrg   if test "x$LINT" = "x"; then
10839fda9279dSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10840fda9279dSmrg   fi
10841fda9279dSmrgelif test "x$make_lint_lib" != x"no" ; then
10842fda9279dSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10843fda9279dSmrgfi
10844fda9279dSmrg
10845fda9279dSmrgAC_SUBST(LINTLIB)
10846fda9279dSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10847fda9279dSmrg
10848fda9279dSmrg]) # XORG_LINT_LIBRARY
10849fda9279dSmrg
10850fda9279dSmrg# XORG_COMPILER_BRAND
10851fda9279dSmrg# -------------------
10852fda9279dSmrg# Minimum version: 1.14.0
10853fda9279dSmrg#
10854fda9279dSmrg# Checks for various brands of compilers and sets flags as appropriate:
10855fda9279dSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10856fda9279dSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10857fda9279dSmrg#   clang compiler - sets CLANGCC to "yes"
10858fda9279dSmrg#   Intel compiler - sets INTELCC to "yes"
10859fda9279dSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10860fda9279dSmrg#
10861fda9279dSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10862fda9279dSmrgAC_LANG_CASE(
10863fda9279dSmrg	[C], [
10864fda9279dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
10865fda9279dSmrg	],
10866fda9279dSmrg	[C++], [
10867fda9279dSmrg		AC_REQUIRE([AC_PROG_CXX])
10868fda9279dSmrg	]
10869fda9279dSmrg)
10870fda9279dSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10871fda9279dSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10872fda9279dSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10873fda9279dSmrg]) # XORG_COMPILER_BRAND
10874fda9279dSmrg
10875fda9279dSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10876fda9279dSmrg# ---------------
10877fda9279dSmrg# Minimum version: 1.16.0
10878fda9279dSmrg#
10879fda9279dSmrg# Test if the compiler works when passed the given flag as a command line argument.
10880fda9279dSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10881fda9279dSmrg# next flag in the list until there are no more options.
10882fda9279dSmrg#
10883fda9279dSmrg# Note that this does not guarantee that the compiler supports the flag as some
10884fda9279dSmrg# compilers will simply ignore arguments that they do not understand, but we do
10885fda9279dSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10886fda9279dSmrg# -Werror=unused-command-line-argument
10887fda9279dSmrg#
10888fda9279dSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10889fda9279dSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10890fda9279dSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10891fda9279dSmrg
10892fda9279dSmrgAC_LANG_COMPILER_REQUIRE
10893fda9279dSmrg
10894fda9279dSmrgAC_LANG_CASE(
10895fda9279dSmrg	[C], [
10896fda9279dSmrg		AC_REQUIRE([AC_PROG_CC_C99])
10897fda9279dSmrg		define([PREFIX], [C])
10898fda9279dSmrg		define([CACHE_PREFIX], [cc])
10899fda9279dSmrg		define([COMPILER], [$CC])
10900fda9279dSmrg	],
10901fda9279dSmrg	[C++], [
10902fda9279dSmrg		define([PREFIX], [CXX])
10903fda9279dSmrg		define([CACHE_PREFIX], [cxx])
10904fda9279dSmrg		define([COMPILER], [$CXX])
10905fda9279dSmrg	]
10906fda9279dSmrg)
10907fda9279dSmrg
10908fda9279dSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10909fda9279dSmrg
10910fda9279dSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10911fda9279dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10912fda9279dSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10913fda9279dSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10914fda9279dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10915fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10916fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10917fda9279dSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10918fda9279dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10919fda9279dSmrgfi
10920fda9279dSmrg
10921fda9279dSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10922fda9279dSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10923fda9279dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10924fda9279dSmrg	fi
10925fda9279dSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10926fda9279dSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10927fda9279dSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10928fda9279dSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10929fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10930fda9279dSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10931fda9279dSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10932fda9279dSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10933fda9279dSmrgfi
10934fda9279dSmrg
10935fda9279dSmrgfound="no"
10936fda9279dSmrgm4_foreach([flag], m4_cdr($@), [
10937fda9279dSmrg	if test $found = "no" ; then
1093816ee1e9aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10939fda9279dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10940fda9279dSmrg		fi
10941fda9279dSmrg
1094216ee1e9aSmrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10943fda9279dSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10944fda9279dSmrg		fi
10945fda9279dSmrg
10946fda9279dSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10947fda9279dSmrg
10948fda9279dSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
1094916ee1e9aSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10950fda9279dSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10951fda9279dSmrg		AC_CACHE_VAL($cacheid,
10952fda9279dSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10953fda9279dSmrg					     [eval $cacheid=yes],
10954fda9279dSmrg					     [eval $cacheid=no])])
10955fda9279dSmrg
10956fda9279dSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10957fda9279dSmrg
10958fda9279dSmrg		eval supported=\$$cacheid
10959fda9279dSmrg		AC_MSG_RESULT([$supported])
10960fda9279dSmrg		if test "$supported" = "yes" ; then
10961fda9279dSmrg			$1="$$1 ]flag["
10962fda9279dSmrg			found="yes"
10963fda9279dSmrg		fi
10964fda9279dSmrg	fi
10965fda9279dSmrg])
10966fda9279dSmrg]) # XORG_TESTSET_CFLAG
10967fda9279dSmrg
10968fda9279dSmrg# XORG_COMPILER_FLAGS
10969fda9279dSmrg# ---------------
10970fda9279dSmrg# Minimum version: 1.16.0
10971fda9279dSmrg#
10972fda9279dSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10973fda9279dSmrg# arguments supported by the selected compiler which do NOT alter the generated
10974fda9279dSmrg# code.  These arguments will cause the compiler to print various warnings
10975fda9279dSmrg# during compilation AND turn a conservative set of warnings into errors.
10976fda9279dSmrg#
10977fda9279dSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10978fda9279dSmrg# future versions of util-macros as options are added to new compilers.
10979fda9279dSmrg#
10980fda9279dSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10981fda9279dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
10982fda9279dSmrg
10983fda9279dSmrgAC_ARG_ENABLE(selective-werror,
10984fda9279dSmrg              AS_HELP_STRING([--disable-selective-werror],
10985fda9279dSmrg                             [Turn off selective compiler errors. (default: enabled)]),
10986fda9279dSmrg              [SELECTIVE_WERROR=$enableval],
10987fda9279dSmrg              [SELECTIVE_WERROR=yes])
10988fda9279dSmrg
10989fda9279dSmrgAC_LANG_CASE(
10990fda9279dSmrg        [C], [
10991fda9279dSmrg                define([PREFIX], [C])
10992fda9279dSmrg        ],
10993fda9279dSmrg        [C++], [
10994fda9279dSmrg                define([PREFIX], [CXX])
10995fda9279dSmrg        ]
10996fda9279dSmrg)
10997fda9279dSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
10998fda9279dSmrgif test "x$SUNCC" = "xyes"; then
10999fda9279dSmrg    [BASE_]PREFIX[FLAGS]="-v"
11000fda9279dSmrgelse
11001fda9279dSmrg    [BASE_]PREFIX[FLAGS]=""
11002fda9279dSmrgfi
11003fda9279dSmrg
11004fda9279dSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11005fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11006fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11007fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11008fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11009fda9279dSmrg
11010fda9279dSmrgAC_LANG_CASE(
11011fda9279dSmrg	[C], [
11012fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11013fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11014fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11015fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
1101616ee1e9aSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11017fda9279dSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11018fda9279dSmrg	]
11019fda9279dSmrg)
11020fda9279dSmrg
11021fda9279dSmrg# This chunk adds additional warnings that could catch undesired effects.
11022fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11023fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11024fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11025fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11026fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11027fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
1102816ee1e9aSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11029fda9279dSmrg
11030fda9279dSmrg# These are currently disabled because they are noisy.  They will be enabled
11031fda9279dSmrg# in the future once the codebase is sufficiently modernized to silence
11032fda9279dSmrg# them.  For now, I don't want them to drown out the other warnings.
11033fda9279dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11034fda9279dSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
1103516ee1e9aSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11036fda9279dSmrg
11037fda9279dSmrg# Turn some warnings into errors, so we don't accidently get successful builds
11038fda9279dSmrg# when there are problems that should be fixed.
11039fda9279dSmrg
11040fda9279dSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11041fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11042fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11043fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11044fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11045fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11046fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11047fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11048fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11049fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11050fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11051fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11052fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11053fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11054fda9279dSmrgelse
11055fda9279dSmrgAC_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])
11056fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11057fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11058fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11059fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11060fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11061fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11062fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11063fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11064fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11065fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11066fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11067fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11068fda9279dSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11069fda9279dSmrgfi
11070fda9279dSmrg
11071fda9279dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11072fda9279dSmrg]) # XORG_COMPILER_FLAGS
11073fda9279dSmrg
11074fda9279dSmrg# XORG_CWARNFLAGS
11075fda9279dSmrg# ---------------
11076fda9279dSmrg# Minimum version: 1.2.0
11077fda9279dSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11078fda9279dSmrg#
11079fda9279dSmrg# Defines CWARNFLAGS to enable C compiler warnings.
11080fda9279dSmrg#
11081fda9279dSmrg# This function is deprecated because it defines -fno-strict-aliasing
11082fda9279dSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11083fda9279dSmrg# is needed, then it should be added explicitly in the module when
11084fda9279dSmrg# it is updated to use BASE_CFLAGS.
11085fda9279dSmrg#
11086fda9279dSmrgAC_DEFUN([XORG_CWARNFLAGS], [
11087fda9279dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11088fda9279dSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11089fda9279dSmrgAC_LANG_CASE(
11090fda9279dSmrg	[C], [
11091fda9279dSmrg		CWARNFLAGS="$BASE_CFLAGS"
11092fda9279dSmrg		if  test "x$GCC" = xyes ; then
11093fda9279dSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11094fda9279dSmrg		fi
11095fda9279dSmrg		AC_SUBST(CWARNFLAGS)
11096fda9279dSmrg	]
11097fda9279dSmrg)
11098fda9279dSmrg]) # XORG_CWARNFLAGS
11099fda9279dSmrg
11100fda9279dSmrg# XORG_STRICT_OPTION
11101fda9279dSmrg# -----------------------
11102fda9279dSmrg# Minimum version: 1.3.0
11103fda9279dSmrg#
11104fda9279dSmrg# Add configure option to enable strict compilation flags, such as treating
11105fda9279dSmrg# warnings as fatal errors.
11106fda9279dSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11107fda9279dSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11108fda9279dSmrg#
11109fda9279dSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11110fda9279dSmrg# when strict compilation is unconditionally desired.
11111fda9279dSmrgAC_DEFUN([XORG_STRICT_OPTION], [
11112fda9279dSmrgAC_REQUIRE([XORG_CWARNFLAGS])
11113fda9279dSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11114fda9279dSmrg
11115fda9279dSmrgAC_ARG_ENABLE(strict-compilation,
11116fda9279dSmrg			  AS_HELP_STRING([--enable-strict-compilation],
11117fda9279dSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11118fda9279dSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11119fda9279dSmrg
11120fda9279dSmrgAC_LANG_CASE(
11121fda9279dSmrg        [C], [
11122fda9279dSmrg                define([PREFIX], [C])
11123fda9279dSmrg        ],
11124fda9279dSmrg        [C++], [
11125fda9279dSmrg                define([PREFIX], [CXX])
11126fda9279dSmrg        ]
11127fda9279dSmrg)
11128fda9279dSmrg
11129fda9279dSmrg[STRICT_]PREFIX[FLAGS]=""
11130fda9279dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11131fda9279dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11132fda9279dSmrg
11133fda9279dSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11134fda9279dSmrg# activate it with -Werror, so we add it here explicitly.
11135fda9279dSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11136fda9279dSmrg
11137fda9279dSmrgif test "x$STRICT_COMPILE" = "xyes"; then
11138fda9279dSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11139fda9279dSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11140fda9279dSmrgfi
11141fda9279dSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11142fda9279dSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11143fda9279dSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11144fda9279dSmrg]) # XORG_STRICT_OPTION
11145fda9279dSmrg
11146fda9279dSmrg# XORG_DEFAULT_OPTIONS
11147fda9279dSmrg# --------------------
11148fda9279dSmrg# Minimum version: 1.3.0
11149fda9279dSmrg#
11150fda9279dSmrg# Defines default options for X.Org modules.
11151fda9279dSmrg#
11152fda9279dSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11153fda9279dSmrgAC_REQUIRE([AC_PROG_INSTALL])
11154fda9279dSmrgXORG_COMPILER_FLAGS
11155fda9279dSmrgXORG_CWARNFLAGS
11156fda9279dSmrgXORG_STRICT_OPTION
11157fda9279dSmrgXORG_RELEASE_VERSION
11158fda9279dSmrgXORG_CHANGELOG
11159fda9279dSmrgXORG_INSTALL
11160fda9279dSmrgXORG_MANPAGE_SECTIONS
11161fda9279dSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11162fda9279dSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11163fda9279dSmrg]) # XORG_DEFAULT_OPTIONS
11164fda9279dSmrg
11165fda9279dSmrg# XORG_INSTALL()
11166fda9279dSmrg# ----------------
11167fda9279dSmrg# Minimum version: 1.4.0
11168fda9279dSmrg#
11169fda9279dSmrg# Defines the variable INSTALL_CMD as the command to copy
11170fda9279dSmrg# INSTALL from $prefix/share/util-macros.
11171fda9279dSmrg#
11172fda9279dSmrgAC_DEFUN([XORG_INSTALL], [
11173fda9279dSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11174fda9279dSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11175fda9279dSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11176fda9279dSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11177fda9279dSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11178fda9279dSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11179fda9279dSmrgAC_SUBST([INSTALL_CMD])
11180fda9279dSmrg]) # XORG_INSTALL
11181fda9279dSmrgdnl Copyright 2005 Red Hat, Inc
11182fda9279dSmrgdnl
11183fda9279dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11184fda9279dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11185fda9279dSmrgdnl the above copyright notice appear in all copies and that both that
11186fda9279dSmrgdnl copyright notice and this permission notice appear in supporting
11187fda9279dSmrgdnl documentation.
11188fda9279dSmrgdnl
11189fda9279dSmrgdnl The above copyright notice and this permission notice shall be included
11190fda9279dSmrgdnl in all copies or substantial portions of the Software.
11191fda9279dSmrgdnl
11192fda9279dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11193fda9279dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11194fda9279dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11195fda9279dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11196fda9279dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11197fda9279dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11198fda9279dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11199fda9279dSmrgdnl
11200fda9279dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11201fda9279dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11202fda9279dSmrgdnl other dealings in this Software without prior written authorization
11203fda9279dSmrgdnl from the copyright holders.
11204fda9279dSmrgdnl
11205fda9279dSmrg
11206fda9279dSmrg# XORG_RELEASE_VERSION
11207fda9279dSmrg# --------------------
11208fda9279dSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
1120916ee1e9aSmrg
11210fda9279dSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11211fda9279dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11212fda9279dSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11213fda9279dSmrg		[Major version of this package])
11214fda9279dSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11215fda9279dSmrg	if test "x$PVM" = "x"; then
11216fda9279dSmrg		PVM="0"
11217fda9279dSmrg	fi
11218fda9279dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11219fda9279dSmrg		[$PVM],
11220fda9279dSmrg		[Minor version of this package])
11221fda9279dSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11222fda9279dSmrg	if test "x$PVP" = "x"; then
11223fda9279dSmrg		PVP="0"
11224fda9279dSmrg	fi
11225fda9279dSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11226fda9279dSmrg		[$PVP],
11227fda9279dSmrg		[Patch version of this package])
11228fda9279dSmrg])
11229fda9279dSmrg
11230fda9279dSmrg# XORG_CHANGELOG()
11231fda9279dSmrg# ----------------
11232fda9279dSmrg# Minimum version: 1.2.0
11233fda9279dSmrg#
11234fda9279dSmrg# Defines the variable CHANGELOG_CMD as the command to generate
11235fda9279dSmrg# ChangeLog from git.
11236fda9279dSmrg#
11237fda9279dSmrg#
11238fda9279dSmrgAC_DEFUN([XORG_CHANGELOG], [
11239fda9279dSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11240fda9279dSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11241fda9279dSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11242fda9279dSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11243fda9279dSmrgAC_SUBST([CHANGELOG_CMD])
11244fda9279dSmrg]) # XORG_CHANGELOG
11245fda9279dSmrg
11246fda9279dSmrgdnl Copyright 2005 Red Hat, Inc
11247fda9279dSmrgdnl 
11248fda9279dSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11249fda9279dSmrgdnl documentation for any purpose is hereby granted without fee, provided that
11250fda9279dSmrgdnl the above copyright notice appear in all copies and that both that
11251fda9279dSmrgdnl copyright notice and this permission notice appear in supporting
11252fda9279dSmrgdnl documentation.
11253fda9279dSmrgdnl 
11254fda9279dSmrgdnl The above copyright notice and this permission notice shall be included
11255fda9279dSmrgdnl in all copies or substantial portions of the Software.
11256fda9279dSmrgdnl 
11257fda9279dSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11258fda9279dSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11259fda9279dSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11260fda9279dSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11261fda9279dSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11262fda9279dSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11263fda9279dSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
11264fda9279dSmrgdnl 
11265fda9279dSmrgdnl Except as contained in this notice, the name of the copyright holders shall
11266fda9279dSmrgdnl not be used in advertising or otherwise to promote the sale, use or
11267fda9279dSmrgdnl other dealings in this Software without prior written authorization
11268fda9279dSmrgdnl from the copyright holders.
11269fda9279dSmrgdnl 
11270fda9279dSmrg
11271fda9279dSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
11272fda9279dSmrg# --------------------------
11273fda9279dSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11274fda9279dSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
11275fda9279dSmrg
11276fda9279dSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
11277fda9279dSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11278fda9279dSmrg	SAVE_CFLAGS="$CFLAGS"
11279fda9279dSmrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
11280fda9279dSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11281fda9279dSmrg#include "xorg-server.h"
11282fda9279dSmrg#if !defined $1
11283fda9279dSmrg#error $1 not defined
11284fda9279dSmrg#endif
11285fda9279dSmrg		]])],
11286fda9279dSmrg		[_EXT_CHECK=yes],
11287fda9279dSmrg		[_EXT_CHECK=no])
11288fda9279dSmrg	CFLAGS="$SAVE_CFLAGS"
11289fda9279dSmrg	AC_MSG_CHECKING([if $1 is defined])
11290fda9279dSmrg	AC_MSG_RESULT([$_EXT_CHECK])
11291fda9279dSmrg	if test "$_EXT_CHECK" != no; then
11292fda9279dSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
11293fda9279dSmrg	fi
11294fda9279dSmrg])
11295fda9279dSmrg
1129616ee1e9aSmrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
11297fda9279dSmrg#
11298fda9279dSmrg# This file is free software; the Free Software Foundation
11299fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11300fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11301fda9279dSmrg
11302fda9279dSmrg# AM_AUTOMAKE_VERSION(VERSION)
11303fda9279dSmrg# ----------------------------
11304fda9279dSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11305fda9279dSmrg# generated from the m4 files accompanying Automake X.Y.
11306fda9279dSmrg# (This private macro should not be called outside this file.)
11307fda9279dSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1130816ee1e9aSmrg[am__api_version='1.15'
11309fda9279dSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11310fda9279dSmrgdnl require some minimum version.  Point them to the right macro.
1131116ee1e9aSmrgm4_if([$1], [1.15], [],
11312fda9279dSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11313fda9279dSmrg])
11314fda9279dSmrg
11315fda9279dSmrg# _AM_AUTOCONF_VERSION(VERSION)
11316fda9279dSmrg# -----------------------------
11317fda9279dSmrg# aclocal traces this macro to find the Autoconf version.
11318fda9279dSmrg# This is a private macro too.  Using m4_define simplifies
11319fda9279dSmrg# the logic in aclocal, which can simply ignore this definition.
11320fda9279dSmrgm4_define([_AM_AUTOCONF_VERSION], [])
11321fda9279dSmrg
11322fda9279dSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11323fda9279dSmrg# -------------------------------
11324fda9279dSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11325fda9279dSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11326fda9279dSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1132716ee1e9aSmrg[AM_AUTOMAKE_VERSION([1.15])dnl
11328fda9279dSmrgm4_ifndef([AC_AUTOCONF_VERSION],
11329fda9279dSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11330fda9279dSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11331fda9279dSmrg
11332fda9279dSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11333fda9279dSmrg
1133416ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11335fda9279dSmrg#
11336fda9279dSmrg# This file is free software; the Free Software Foundation
11337fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11338fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11339fda9279dSmrg
11340fda9279dSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11341fda9279dSmrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11342fda9279dSmrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
11343fda9279dSmrg#
11344fda9279dSmrg# Of course, Automake must honor this variable whenever it calls a
11345fda9279dSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11346fda9279dSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11347fda9279dSmrg# depending on how configure is run.  This is pretty annoying, since
11348fda9279dSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11349fda9279dSmrg# source directory, any form will work fine, but in subdirectories a
11350fda9279dSmrg# relative path needs to be adjusted first.
11351fda9279dSmrg#
11352fda9279dSmrg# $ac_aux_dir/missing
11353fda9279dSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11354fda9279dSmrg# $top_srcdir/$ac_aux_dir/missing
11355fda9279dSmrg#    fails if $ac_aux_dir is absolute,
11356fda9279dSmrg#    fails when called from a subdirectory in a VPATH build with
11357fda9279dSmrg#          a relative $ac_aux_dir
11358fda9279dSmrg#
11359fda9279dSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11360fda9279dSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
11361fda9279dSmrg# harmless because $srcdir is '.', but things will broke when you
11362fda9279dSmrg# start a VPATH build or use an absolute $srcdir.
11363fda9279dSmrg#
11364fda9279dSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11365fda9279dSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11366fda9279dSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11367fda9279dSmrg# and then we would define $MISSING as
11368fda9279dSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11369fda9279dSmrg# This will work as long as MISSING is not called from configure, because
11370fda9279dSmrg# unfortunately $(top_srcdir) has no meaning in configure.
11371fda9279dSmrg# However there are other variables, like CC, which are often used in
11372fda9279dSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
11373fda9279dSmrg#
11374fda9279dSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
11375fda9279dSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
11376fda9279dSmrg# configured tree to be moved without reconfiguration.
11377fda9279dSmrg
11378fda9279dSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1137916ee1e9aSmrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1138016ee1e9aSmrg# Expand $ac_aux_dir to an absolute path.
1138116ee1e9aSmrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11382fda9279dSmrg])
11383fda9279dSmrg
11384fda9279dSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11385fda9279dSmrg
1138616ee1e9aSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11387fda9279dSmrg#
11388fda9279dSmrg# This file is free software; the Free Software Foundation
11389fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11390fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11391fda9279dSmrg
11392fda9279dSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11393fda9279dSmrg# -------------------------------------
11394fda9279dSmrg# Define a conditional.
11395fda9279dSmrgAC_DEFUN([AM_CONDITIONAL],
11396fda9279dSmrg[AC_PREREQ([2.52])dnl
11397fda9279dSmrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11398fda9279dSmrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11399fda9279dSmrgAC_SUBST([$1_TRUE])dnl
11400fda9279dSmrgAC_SUBST([$1_FALSE])dnl
11401fda9279dSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11402fda9279dSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11403fda9279dSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11404fda9279dSmrgif $2; then
11405fda9279dSmrg  $1_TRUE=
11406fda9279dSmrg  $1_FALSE='#'
11407fda9279dSmrgelse
11408fda9279dSmrg  $1_TRUE='#'
11409fda9279dSmrg  $1_FALSE=
11410fda9279dSmrgfi
11411fda9279dSmrgAC_CONFIG_COMMANDS_PRE(
11412fda9279dSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11413fda9279dSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11414fda9279dSmrgUsually this means the macro was only invoked conditionally.]])
11415fda9279dSmrgfi])])
11416fda9279dSmrg
1141716ee1e9aSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11418fda9279dSmrg#
11419fda9279dSmrg# This file is free software; the Free Software Foundation
11420fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11421fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11422fda9279dSmrg
11423fda9279dSmrg
11424fda9279dSmrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11425fda9279dSmrg# written in clear, in which case automake, when reading aclocal.m4,
11426fda9279dSmrg# will think it sees a *use*, and therefore will trigger all it's
11427fda9279dSmrg# C support machinery.  Also note that it means that autoscan, seeing
11428fda9279dSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11429fda9279dSmrg
11430fda9279dSmrg
11431fda9279dSmrg# _AM_DEPENDENCIES(NAME)
11432fda9279dSmrg# ----------------------
11433fda9279dSmrg# See how the compiler implements dependency checking.
11434fda9279dSmrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11435fda9279dSmrg# We try a few techniques and use that to set a single cache variable.
11436fda9279dSmrg#
11437fda9279dSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11438fda9279dSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11439fda9279dSmrg# dependency, and given that the user is not expected to run this macro,
11440fda9279dSmrg# just rely on AC_PROG_CC.
11441fda9279dSmrgAC_DEFUN([_AM_DEPENDENCIES],
11442fda9279dSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11443fda9279dSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11444fda9279dSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11445fda9279dSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11446fda9279dSmrg
11447fda9279dSmrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11448fda9279dSmrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11449fda9279dSmrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11450fda9279dSmrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11451fda9279dSmrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11452fda9279dSmrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11453fda9279dSmrg                    [depcc="$$1"   am_compiler_list=])
11454fda9279dSmrg
11455fda9279dSmrgAC_CACHE_CHECK([dependency style of $depcc],
11456fda9279dSmrg               [am_cv_$1_dependencies_compiler_type],
11457fda9279dSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11458fda9279dSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
11459fda9279dSmrg  # making bogus files that we don't know about and never remove.  For
11460fda9279dSmrg  # instance it was reported that on HP-UX the gcc test will end up
11461fda9279dSmrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11462fda9279dSmrg  # in D".
11463fda9279dSmrg  rm -rf conftest.dir
11464fda9279dSmrg  mkdir conftest.dir
11465fda9279dSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11466fda9279dSmrg  # using a relative directory.
11467fda9279dSmrg  cp "$am_depcomp" conftest.dir
11468fda9279dSmrg  cd conftest.dir
11469fda9279dSmrg  # We will build objects and dependencies in a subdirectory because
11470fda9279dSmrg  # it helps to detect inapplicable dependency modes.  For instance
11471fda9279dSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11472fda9279dSmrg  # side effect of compilation, but ICC will put the dependencies in
11473fda9279dSmrg  # the current directory while Tru64 will put them in the object
11474fda9279dSmrg  # directory.
11475fda9279dSmrg  mkdir sub
11476fda9279dSmrg
11477fda9279dSmrg  am_cv_$1_dependencies_compiler_type=none
11478fda9279dSmrg  if test "$am_compiler_list" = ""; then
11479fda9279dSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11480fda9279dSmrg  fi
11481fda9279dSmrg  am__universal=false
11482fda9279dSmrg  m4_case([$1], [CC],
11483fda9279dSmrg    [case " $depcc " in #(
11484fda9279dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11485fda9279dSmrg     esac],
11486fda9279dSmrg    [CXX],
11487fda9279dSmrg    [case " $depcc " in #(
11488fda9279dSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11489fda9279dSmrg     esac])
11490fda9279dSmrg
11491fda9279dSmrg  for depmode in $am_compiler_list; do
11492fda9279dSmrg    # Setup a source with many dependencies, because some compilers
11493fda9279dSmrg    # like to wrap large dependency lists on column 80 (with \), and
11494fda9279dSmrg    # we should not choose a depcomp mode which is confused by this.
11495fda9279dSmrg    #
11496fda9279dSmrg    # We need to recreate these files for each test, as the compiler may
11497fda9279dSmrg    # overwrite some of them when testing with obscure command lines.
11498fda9279dSmrg    # This happens at least with the AIX C compiler.
11499fda9279dSmrg    : > sub/conftest.c
11500fda9279dSmrg    for i in 1 2 3 4 5 6; do
11501fda9279dSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11502fda9279dSmrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11503fda9279dSmrg      # Solaris 10 /bin/sh.
11504fda9279dSmrg      echo '/* dummy */' > sub/conftst$i.h
11505fda9279dSmrg    done
11506fda9279dSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11507fda9279dSmrg
11508fda9279dSmrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11509fda9279dSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11510fda9279dSmrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11511fda9279dSmrg    # versions had trouble with output in subdirs.
11512fda9279dSmrg    am__obj=sub/conftest.${OBJEXT-o}
11513fda9279dSmrg    am__minus_obj="-o $am__obj"
11514fda9279dSmrg    case $depmode in
11515fda9279dSmrg    gcc)
11516fda9279dSmrg      # This depmode causes a compiler race in universal mode.
11517fda9279dSmrg      test "$am__universal" = false || continue
11518fda9279dSmrg      ;;
11519fda9279dSmrg    nosideeffect)
11520fda9279dSmrg      # After this tag, mechanisms are not by side-effect, so they'll
11521fda9279dSmrg      # only be used when explicitly requested.
11522fda9279dSmrg      if test "x$enable_dependency_tracking" = xyes; then
11523fda9279dSmrg	continue
11524fda9279dSmrg      else
11525fda9279dSmrg	break
11526fda9279dSmrg      fi
11527fda9279dSmrg      ;;
11528fda9279dSmrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11529fda9279dSmrg      # This compiler won't grok '-c -o', but also, the minuso test has
11530fda9279dSmrg      # not run yet.  These depmodes are late enough in the game, and
11531fda9279dSmrg      # so weak that their functioning should not be impacted.
11532fda9279dSmrg      am__obj=conftest.${OBJEXT-o}
11533fda9279dSmrg      am__minus_obj=
11534fda9279dSmrg      ;;
11535fda9279dSmrg    none) break ;;
11536fda9279dSmrg    esac
11537fda9279dSmrg    if depmode=$depmode \
11538fda9279dSmrg       source=sub/conftest.c object=$am__obj \
11539fda9279dSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11540fda9279dSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11541fda9279dSmrg         >/dev/null 2>conftest.err &&
11542fda9279dSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11543fda9279dSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11544fda9279dSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11545fda9279dSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11546fda9279dSmrg      # icc doesn't choke on unknown options, it will just issue warnings
11547fda9279dSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
11548fda9279dSmrg      # that says an option was ignored or not supported.
11549fda9279dSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11550fda9279dSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11551fda9279dSmrg      # The diagnosis changed in icc 8.0:
11552fda9279dSmrg      #   icc: Command line remark: option '-MP' not supported
11553fda9279dSmrg      if (grep 'ignoring option' conftest.err ||
11554fda9279dSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11555fda9279dSmrg        am_cv_$1_dependencies_compiler_type=$depmode
11556fda9279dSmrg        break
11557fda9279dSmrg      fi
11558fda9279dSmrg    fi
11559fda9279dSmrg  done
11560fda9279dSmrg
11561fda9279dSmrg  cd ..
11562fda9279dSmrg  rm -rf conftest.dir
11563fda9279dSmrgelse
11564fda9279dSmrg  am_cv_$1_dependencies_compiler_type=none
11565fda9279dSmrgfi
11566fda9279dSmrg])
11567fda9279dSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11568fda9279dSmrgAM_CONDITIONAL([am__fastdep$1], [
11569fda9279dSmrg  test "x$enable_dependency_tracking" != xno \
11570fda9279dSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11571fda9279dSmrg])
11572fda9279dSmrg
11573fda9279dSmrg
11574fda9279dSmrg# AM_SET_DEPDIR
11575fda9279dSmrg# -------------
11576fda9279dSmrg# Choose a directory name for dependency files.
11577fda9279dSmrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11578fda9279dSmrgAC_DEFUN([AM_SET_DEPDIR],
11579fda9279dSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11580fda9279dSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11581fda9279dSmrg])
11582fda9279dSmrg
11583fda9279dSmrg
11584fda9279dSmrg# AM_DEP_TRACK
11585fda9279dSmrg# ------------
11586fda9279dSmrgAC_DEFUN([AM_DEP_TRACK],
11587fda9279dSmrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11588fda9279dSmrgAS_HELP_STRING(
11589fda9279dSmrg  [--enable-dependency-tracking],
11590fda9279dSmrg  [do not reject slow dependency extractors])
11591fda9279dSmrgAS_HELP_STRING(
11592fda9279dSmrg  [--disable-dependency-tracking],
11593fda9279dSmrg  [speeds up one-time build])])
11594fda9279dSmrgif test "x$enable_dependency_tracking" != xno; then
11595fda9279dSmrg  am_depcomp="$ac_aux_dir/depcomp"
11596fda9279dSmrg  AMDEPBACKSLASH='\'
11597fda9279dSmrg  am__nodep='_no'
11598fda9279dSmrgfi
11599fda9279dSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11600fda9279dSmrgAC_SUBST([AMDEPBACKSLASH])dnl
11601fda9279dSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11602fda9279dSmrgAC_SUBST([am__nodep])dnl
11603fda9279dSmrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11604fda9279dSmrg])
11605fda9279dSmrg
11606fda9279dSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
11607fda9279dSmrg
1160816ee1e9aSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
11609fda9279dSmrg#
11610fda9279dSmrg# This file is free software; the Free Software Foundation
11611fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11612fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11613fda9279dSmrg
11614fda9279dSmrg
11615fda9279dSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11616fda9279dSmrg# ------------------------------
11617fda9279dSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11618fda9279dSmrg[{
11619fda9279dSmrg  # Older Autoconf quotes --file arguments for eval, but not when files
11620fda9279dSmrg  # are listed without --file.  Let's play safe and only enable the eval
11621fda9279dSmrg  # if we detect the quoting.
11622fda9279dSmrg  case $CONFIG_FILES in
11623fda9279dSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
11624fda9279dSmrg  *)   set x $CONFIG_FILES ;;
11625fda9279dSmrg  esac
11626fda9279dSmrg  shift
11627fda9279dSmrg  for mf
11628fda9279dSmrg  do
11629fda9279dSmrg    # Strip MF so we end up with the name of the file.
11630fda9279dSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11631fda9279dSmrg    # Check whether this is an Automake generated Makefile or not.
11632fda9279dSmrg    # We used to match only the files named 'Makefile.in', but
11633fda9279dSmrg    # some people rename them; so instead we look at the file content.
11634fda9279dSmrg    # Grep'ing the first line is not enough: some people post-process
11635fda9279dSmrg    # each Makefile.in and add a new line on top of each file to say so.
11636fda9279dSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
11637fda9279dSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
11638fda9279dSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11639fda9279dSmrg      dirpart=`AS_DIRNAME("$mf")`
11640fda9279dSmrg    else
11641fda9279dSmrg      continue
11642fda9279dSmrg    fi
11643fda9279dSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
11644fda9279dSmrg    # from the Makefile without running 'make'.
11645fda9279dSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11646fda9279dSmrg    test -z "$DEPDIR" && continue
11647fda9279dSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11648fda9279dSmrg    test -z "$am__include" && continue
11649fda9279dSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11650fda9279dSmrg    # Find all dependency output files, they are included files with
11651fda9279dSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11652fda9279dSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11653fda9279dSmrg    # expansion.
11654fda9279dSmrg    for file in `sed -n "
11655fda9279dSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11656fda9279dSmrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11657fda9279dSmrg      # Make sure the directory exists.
11658fda9279dSmrg      test -f "$dirpart/$file" && continue
11659fda9279dSmrg      fdir=`AS_DIRNAME(["$file"])`
11660fda9279dSmrg      AS_MKDIR_P([$dirpart/$fdir])
11661fda9279dSmrg      # echo "creating $dirpart/$file"
11662fda9279dSmrg      echo '# dummy' > "$dirpart/$file"
11663fda9279dSmrg    done
11664fda9279dSmrg  done
11665fda9279dSmrg}
11666fda9279dSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11667fda9279dSmrg
11668fda9279dSmrg
11669fda9279dSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11670fda9279dSmrg# -----------------------------
11671fda9279dSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
11672fda9279dSmrg#
11673fda9279dSmrg# This code is only required when automatic dependency tracking
11674fda9279dSmrg# is enabled.  FIXME.  This creates each '.P' file that we will
11675fda9279dSmrg# need in order to bootstrap the dependency handling code.
11676fda9279dSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11677fda9279dSmrg[AC_CONFIG_COMMANDS([depfiles],
11678fda9279dSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11679fda9279dSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11680fda9279dSmrg])
11681fda9279dSmrg
11682fda9279dSmrg# Do all the work for Automake.                             -*- Autoconf -*-
11683fda9279dSmrg
1168416ee1e9aSmrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
11685fda9279dSmrg#
11686fda9279dSmrg# This file is free software; the Free Software Foundation
11687fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11688fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11689fda9279dSmrg
11690fda9279dSmrg# This macro actually does too much.  Some checks are only needed if
11691fda9279dSmrg# your package does certain things.  But this isn't really a big deal.
11692fda9279dSmrg
11693fda9279dSmrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11694fda9279dSmrgm4_define([AC_PROG_CC],
11695fda9279dSmrgm4_defn([AC_PROG_CC])
11696fda9279dSmrg[_AM_PROG_CC_C_O
11697fda9279dSmrg])
11698fda9279dSmrg
11699fda9279dSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11700fda9279dSmrg# AM_INIT_AUTOMAKE([OPTIONS])
11701fda9279dSmrg# -----------------------------------------------
11702fda9279dSmrg# The call with PACKAGE and VERSION arguments is the old style
11703fda9279dSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11704fda9279dSmrg# and VERSION should now be passed to AC_INIT and removed from
11705fda9279dSmrg# the call to AM_INIT_AUTOMAKE.
11706fda9279dSmrg# We support both call styles for the transition.  After
11707fda9279dSmrg# the next Automake release, Autoconf can make the AC_INIT
11708fda9279dSmrg# arguments mandatory, and then we can depend on a new Autoconf
11709fda9279dSmrg# release and drop the old call support.
11710fda9279dSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11711fda9279dSmrg[AC_PREREQ([2.65])dnl
11712fda9279dSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11713fda9279dSmrgdnl the ones we care about.
11714fda9279dSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11715fda9279dSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11716fda9279dSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11717fda9279dSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11718fda9279dSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11719fda9279dSmrg  # is not polluted with repeated "-I."
11720fda9279dSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11721fda9279dSmrg  # test to see if srcdir already configured
11722fda9279dSmrg  if test -f $srcdir/config.status; then
11723fda9279dSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11724fda9279dSmrg  fi
11725fda9279dSmrgfi
11726fda9279dSmrg
11727fda9279dSmrg# test whether we have cygpath
11728fda9279dSmrgif test -z "$CYGPATH_W"; then
11729fda9279dSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11730fda9279dSmrg    CYGPATH_W='cygpath -w'
11731fda9279dSmrg  else
11732fda9279dSmrg    CYGPATH_W=echo
11733fda9279dSmrg  fi
11734fda9279dSmrgfi
11735fda9279dSmrgAC_SUBST([CYGPATH_W])
11736fda9279dSmrg
11737fda9279dSmrg# Define the identity of the package.
11738fda9279dSmrgdnl Distinguish between old-style and new-style calls.
11739fda9279dSmrgm4_ifval([$2],
11740fda9279dSmrg[AC_DIAGNOSE([obsolete],
11741fda9279dSmrg             [$0: two- and three-arguments forms are deprecated.])
11742fda9279dSmrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11743fda9279dSmrg AC_SUBST([PACKAGE], [$1])dnl
11744fda9279dSmrg AC_SUBST([VERSION], [$2])],
11745fda9279dSmrg[_AM_SET_OPTIONS([$1])dnl
11746fda9279dSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11747fda9279dSmrgm4_if(
11748fda9279dSmrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11749fda9279dSmrg  [ok:ok],,
11750fda9279dSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11751fda9279dSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11752fda9279dSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11753fda9279dSmrg
11754fda9279dSmrg_AM_IF_OPTION([no-define],,
11755fda9279dSmrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11756fda9279dSmrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11757fda9279dSmrg
11758fda9279dSmrg# Some tools Automake needs.
11759fda9279dSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11760fda9279dSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11761fda9279dSmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11762fda9279dSmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11763fda9279dSmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11764fda9279dSmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11765fda9279dSmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11766fda9279dSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11767fda9279dSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11768fda9279dSmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11769fda9279dSmrg# For better backward compatibility.  To be removed once Automake 1.9.x
11770fda9279dSmrg# dies out for good.  For more background, see:
11771fda9279dSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11772fda9279dSmrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11773fda9279dSmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1177416ee1e9aSmrg# We need awk for the "check" target (and possibly the TAP driver).  The
1177516ee1e9aSmrg# system "awk" is bad on some platforms.
11776fda9279dSmrgAC_REQUIRE([AC_PROG_AWK])dnl
11777fda9279dSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11778fda9279dSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11779fda9279dSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11780fda9279dSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11781fda9279dSmrg			     [_AM_PROG_TAR([v7])])])
11782fda9279dSmrg_AM_IF_OPTION([no-dependencies],,
11783fda9279dSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11784fda9279dSmrg		  [_AM_DEPENDENCIES([CC])],
11785fda9279dSmrg		  [m4_define([AC_PROG_CC],
11786fda9279dSmrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11787fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11788fda9279dSmrg		  [_AM_DEPENDENCIES([CXX])],
11789fda9279dSmrg		  [m4_define([AC_PROG_CXX],
11790fda9279dSmrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11791fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11792fda9279dSmrg		  [_AM_DEPENDENCIES([OBJC])],
11793fda9279dSmrg		  [m4_define([AC_PROG_OBJC],
11794fda9279dSmrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11795fda9279dSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11796fda9279dSmrg		  [_AM_DEPENDENCIES([OBJCXX])],
11797fda9279dSmrg		  [m4_define([AC_PROG_OBJCXX],
11798fda9279dSmrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11799fda9279dSmrg])
11800fda9279dSmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11801fda9279dSmrgdnl The testsuite driver may need to know about EXEEXT, so add the
11802fda9279dSmrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11803fda9279dSmrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11804fda9279dSmrgAC_CONFIG_COMMANDS_PRE(dnl
11805fda9279dSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11806fda9279dSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11807fda9279dSmrg
11808fda9279dSmrg# POSIX will say in a future version that running "rm -f" with no argument
11809fda9279dSmrg# is OK; and we want to be able to make that assumption in our Makefile
11810fda9279dSmrg# recipes.  So use an aggressive probe to check that the usage we want is
11811fda9279dSmrg# actually supported "in the wild" to an acceptable degree.
11812fda9279dSmrg# See automake bug#10828.
11813fda9279dSmrg# To make any issue more visible, cause the running configure to be aborted
11814fda9279dSmrg# by default if the 'rm' program in use doesn't match our expectations; the
11815fda9279dSmrg# user can still override this though.
11816fda9279dSmrgif rm -f && rm -fr && rm -rf; then : OK; else
11817fda9279dSmrg  cat >&2 <<'END'
11818fda9279dSmrgOops!
11819fda9279dSmrg
11820fda9279dSmrgYour 'rm' program seems unable to run without file operands specified
11821fda9279dSmrgon the command line, even when the '-f' option is present.  This is contrary
11822fda9279dSmrgto the behaviour of most rm programs out there, and not conforming with
11823fda9279dSmrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11824fda9279dSmrg
11825fda9279dSmrgPlease tell bug-automake@gnu.org about your system, including the value
11826fda9279dSmrgof your $PATH and any error possibly output before this message.  This
11827fda9279dSmrgcan help us improve future automake versions.
11828fda9279dSmrg
11829fda9279dSmrgEND
11830fda9279dSmrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11831fda9279dSmrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11832fda9279dSmrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11833fda9279dSmrg    echo >&2
11834fda9279dSmrg  else
11835fda9279dSmrg    cat >&2 <<'END'
11836fda9279dSmrgAborting the configuration process, to ensure you take notice of the issue.
11837fda9279dSmrg
11838fda9279dSmrgYou can download and install GNU coreutils to get an 'rm' implementation
11839fda9279dSmrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11840fda9279dSmrg
11841fda9279dSmrgIf you want to complete the configuration process using your problematic
11842fda9279dSmrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11843fda9279dSmrgto "yes", and re-run configure.
11844fda9279dSmrg
11845fda9279dSmrgEND
11846fda9279dSmrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11847fda9279dSmrg  fi
1184816ee1e9aSmrgfi
1184916ee1e9aSmrgdnl The trailing newline in this macro's definition is deliberate, for
1185016ee1e9aSmrgdnl backward compatibility and to allow trailing 'dnl'-style comments
1185116ee1e9aSmrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1185216ee1e9aSmrg])
11853fda9279dSmrg
11854fda9279dSmrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11855fda9279dSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11856fda9279dSmrgdnl mangled by Autoconf and run in a shell conditional statement.
11857fda9279dSmrgm4_define([_AC_COMPILER_EXEEXT],
11858fda9279dSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11859fda9279dSmrg
11860fda9279dSmrg# When config.status generates a header, we must update the stamp-h file.
11861fda9279dSmrg# This file resides in the same directory as the config header
11862fda9279dSmrg# that is generated.  The stamp files are numbered to have different names.
11863fda9279dSmrg
11864fda9279dSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11865fda9279dSmrg# loop where config.status creates the headers, so we can generate
11866fda9279dSmrg# our stamp files there.
11867fda9279dSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11868fda9279dSmrg[# Compute $1's index in $config_headers.
11869fda9279dSmrg_am_arg=$1
11870fda9279dSmrg_am_stamp_count=1
11871fda9279dSmrgfor _am_header in $config_headers :; do
11872fda9279dSmrg  case $_am_header in
11873fda9279dSmrg    $_am_arg | $_am_arg:* )
11874fda9279dSmrg      break ;;
11875fda9279dSmrg    * )
11876fda9279dSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11877fda9279dSmrg  esac
11878fda9279dSmrgdone
11879fda9279dSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11880fda9279dSmrg
1188116ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11882fda9279dSmrg#
11883fda9279dSmrg# This file is free software; the Free Software Foundation
11884fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11885fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11886fda9279dSmrg
11887fda9279dSmrg# AM_PROG_INSTALL_SH
11888fda9279dSmrg# ------------------
11889fda9279dSmrg# Define $install_sh.
11890fda9279dSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11891fda9279dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1189216ee1e9aSmrgif test x"${install_sh+set}" != xset; then
11893fda9279dSmrg  case $am_aux_dir in
11894fda9279dSmrg  *\ * | *\	*)
11895fda9279dSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11896fda9279dSmrg  *)
11897fda9279dSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11898fda9279dSmrg  esac
11899fda9279dSmrgfi
11900fda9279dSmrgAC_SUBST([install_sh])])
11901fda9279dSmrg
1190216ee1e9aSmrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
11903fda9279dSmrg#
11904fda9279dSmrg# This file is free software; the Free Software Foundation
11905fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11906fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11907fda9279dSmrg
11908fda9279dSmrg# Check whether the underlying file-system supports filenames
11909fda9279dSmrg# with a leading dot.  For instance MS-DOS doesn't.
11910fda9279dSmrgAC_DEFUN([AM_SET_LEADING_DOT],
11911fda9279dSmrg[rm -rf .tst 2>/dev/null
11912fda9279dSmrgmkdir .tst 2>/dev/null
11913fda9279dSmrgif test -d .tst; then
11914fda9279dSmrg  am__leading_dot=.
11915fda9279dSmrgelse
11916fda9279dSmrg  am__leading_dot=_
11917fda9279dSmrgfi
11918fda9279dSmrgrmdir .tst 2>/dev/null
11919fda9279dSmrgAC_SUBST([am__leading_dot])])
11920fda9279dSmrg
11921fda9279dSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
11922fda9279dSmrg
1192316ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11924fda9279dSmrg#
11925fda9279dSmrg# This file is free software; the Free Software Foundation
11926fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11927fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11928fda9279dSmrg
11929fda9279dSmrg# AM_MAKE_INCLUDE()
11930fda9279dSmrg# -----------------
11931fda9279dSmrg# Check to see how make treats includes.
11932fda9279dSmrgAC_DEFUN([AM_MAKE_INCLUDE],
11933fda9279dSmrg[am_make=${MAKE-make}
11934fda9279dSmrgcat > confinc << 'END'
11935fda9279dSmrgam__doit:
11936fda9279dSmrg	@echo this is the am__doit target
11937fda9279dSmrg.PHONY: am__doit
11938fda9279dSmrgEND
11939fda9279dSmrg# If we don't find an include directive, just comment out the code.
11940fda9279dSmrgAC_MSG_CHECKING([for style of include used by $am_make])
11941fda9279dSmrgam__include="#"
11942fda9279dSmrgam__quote=
11943fda9279dSmrg_am_result=none
11944fda9279dSmrg# First try GNU make style include.
11945fda9279dSmrgecho "include confinc" > confmf
11946fda9279dSmrg# Ignore all kinds of additional output from 'make'.
11947fda9279dSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11948fda9279dSmrg*the\ am__doit\ target*)
11949fda9279dSmrg  am__include=include
11950fda9279dSmrg  am__quote=
11951fda9279dSmrg  _am_result=GNU
11952fda9279dSmrg  ;;
11953fda9279dSmrgesac
11954fda9279dSmrg# Now try BSD make style include.
11955fda9279dSmrgif test "$am__include" = "#"; then
11956fda9279dSmrg   echo '.include "confinc"' > confmf
11957fda9279dSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11958fda9279dSmrg   *the\ am__doit\ target*)
11959fda9279dSmrg     am__include=.include
11960fda9279dSmrg     am__quote="\""
11961fda9279dSmrg     _am_result=BSD
11962fda9279dSmrg     ;;
11963fda9279dSmrg   esac
11964fda9279dSmrgfi
11965fda9279dSmrgAC_SUBST([am__include])
11966fda9279dSmrgAC_SUBST([am__quote])
11967fda9279dSmrgAC_MSG_RESULT([$_am_result])
11968fda9279dSmrgrm -f confinc confmf
11969fda9279dSmrg])
11970fda9279dSmrg
11971fda9279dSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11972fda9279dSmrg
1197316ee1e9aSmrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
11974fda9279dSmrg#
11975fda9279dSmrg# This file is free software; the Free Software Foundation
11976fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
11977fda9279dSmrg# with or without modifications, as long as this notice is preserved.
11978fda9279dSmrg
11979fda9279dSmrg# AM_MISSING_PROG(NAME, PROGRAM)
11980fda9279dSmrg# ------------------------------
11981fda9279dSmrgAC_DEFUN([AM_MISSING_PROG],
11982fda9279dSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11983fda9279dSmrg$1=${$1-"${am_missing_run}$2"}
11984fda9279dSmrgAC_SUBST($1)])
11985fda9279dSmrg
11986fda9279dSmrg# AM_MISSING_HAS_RUN
11987fda9279dSmrg# ------------------
11988fda9279dSmrg# Define MISSING if not defined so far and test if it is modern enough.
11989fda9279dSmrg# If it is, set am_missing_run to use it, otherwise, to nothing.
11990fda9279dSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11991fda9279dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11992fda9279dSmrgAC_REQUIRE_AUX_FILE([missing])dnl
11993fda9279dSmrgif test x"${MISSING+set}" != xset; then
11994fda9279dSmrg  case $am_aux_dir in
11995fda9279dSmrg  *\ * | *\	*)
11996fda9279dSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11997fda9279dSmrg  *)
11998fda9279dSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11999fda9279dSmrg  esac
12000fda9279dSmrgfi
12001fda9279dSmrg# Use eval to expand $SHELL
12002fda9279dSmrgif eval "$MISSING --is-lightweight"; then
12003fda9279dSmrg  am_missing_run="$MISSING "
12004fda9279dSmrgelse
12005fda9279dSmrg  am_missing_run=
12006fda9279dSmrg  AC_MSG_WARN(['missing' script is too old or missing])
12007fda9279dSmrgfi
12008fda9279dSmrg])
12009fda9279dSmrg
12010fda9279dSmrg# Helper functions for option handling.                     -*- Autoconf -*-
12011fda9279dSmrg
1201216ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12013fda9279dSmrg#
12014fda9279dSmrg# This file is free software; the Free Software Foundation
12015fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12016fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12017fda9279dSmrg
12018fda9279dSmrg# _AM_MANGLE_OPTION(NAME)
12019fda9279dSmrg# -----------------------
12020fda9279dSmrgAC_DEFUN([_AM_MANGLE_OPTION],
12021fda9279dSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
12022fda9279dSmrg
12023fda9279dSmrg# _AM_SET_OPTION(NAME)
12024fda9279dSmrg# --------------------
12025fda9279dSmrg# Set option NAME.  Presently that only means defining a flag for this option.
12026fda9279dSmrgAC_DEFUN([_AM_SET_OPTION],
12027fda9279dSmrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
12028fda9279dSmrg
12029fda9279dSmrg# _AM_SET_OPTIONS(OPTIONS)
12030fda9279dSmrg# ------------------------
12031fda9279dSmrg# OPTIONS is a space-separated list of Automake options.
12032fda9279dSmrgAC_DEFUN([_AM_SET_OPTIONS],
12033fda9279dSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
12034fda9279dSmrg
12035fda9279dSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
12036fda9279dSmrg# -------------------------------------------
12037fda9279dSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
12038fda9279dSmrgAC_DEFUN([_AM_IF_OPTION],
12039fda9279dSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12040fda9279dSmrg
1204116ee1e9aSmrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
12042fda9279dSmrg#
12043fda9279dSmrg# This file is free software; the Free Software Foundation
12044fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12045fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12046fda9279dSmrg
12047fda9279dSmrg# _AM_PROG_CC_C_O
12048fda9279dSmrg# ---------------
12049fda9279dSmrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
12050fda9279dSmrg# to automatically call this.
12051fda9279dSmrgAC_DEFUN([_AM_PROG_CC_C_O],
12052fda9279dSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12053fda9279dSmrgAC_REQUIRE_AUX_FILE([compile])dnl
12054fda9279dSmrgAC_LANG_PUSH([C])dnl
12055fda9279dSmrgAC_CACHE_CHECK(
12056fda9279dSmrg  [whether $CC understands -c and -o together],
12057fda9279dSmrg  [am_cv_prog_cc_c_o],
12058fda9279dSmrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
12059fda9279dSmrg  # Make sure it works both with $CC and with simple cc.
12060fda9279dSmrg  # Following AC_PROG_CC_C_O, we do the test twice because some
12061fda9279dSmrg  # compilers refuse to overwrite an existing .o file with -o,
12062fda9279dSmrg  # though they will create one.
12063fda9279dSmrg  am_cv_prog_cc_c_o=yes
12064fda9279dSmrg  for am_i in 1 2; do
12065fda9279dSmrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
12066fda9279dSmrg         && test -f conftest2.$ac_objext; then
12067fda9279dSmrg      : OK
12068fda9279dSmrg    else
12069fda9279dSmrg      am_cv_prog_cc_c_o=no
12070fda9279dSmrg      break
12071fda9279dSmrg    fi
12072fda9279dSmrg  done
12073fda9279dSmrg  rm -f core conftest*
12074fda9279dSmrg  unset am_i])
12075fda9279dSmrgif test "$am_cv_prog_cc_c_o" != yes; then
12076fda9279dSmrg   # Losing compiler, so override with the script.
12077fda9279dSmrg   # FIXME: It is wrong to rewrite CC.
12078fda9279dSmrg   # But if we don't then we get into trouble of one sort or another.
12079fda9279dSmrg   # A longer-term fix would be to have automake use am__CC in this case,
12080fda9279dSmrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12081fda9279dSmrg   CC="$am_aux_dir/compile $CC"
12082fda9279dSmrgfi
12083fda9279dSmrgAC_LANG_POP([C])])
12084fda9279dSmrg
12085fda9279dSmrg# For backward compatibility.
12086fda9279dSmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12087fda9279dSmrg
1208816ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12089fda9279dSmrg#
12090fda9279dSmrg# This file is free software; the Free Software Foundation
12091fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12092fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12093fda9279dSmrg
12094fda9279dSmrg# AM_RUN_LOG(COMMAND)
12095fda9279dSmrg# -------------------
12096fda9279dSmrg# Run COMMAND, save the exit status in ac_status, and log it.
12097fda9279dSmrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12098fda9279dSmrgAC_DEFUN([AM_RUN_LOG],
12099fda9279dSmrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12100fda9279dSmrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12101fda9279dSmrg   ac_status=$?
12102fda9279dSmrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12103fda9279dSmrg   (exit $ac_status); }])
12104fda9279dSmrg
12105fda9279dSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12106fda9279dSmrg
1210716ee1e9aSmrg# Copyright (C) 1996-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_SANITY_CHECK
12114fda9279dSmrg# ---------------
12115fda9279dSmrgAC_DEFUN([AM_SANITY_CHECK],
12116fda9279dSmrg[AC_MSG_CHECKING([whether build environment is sane])
12117fda9279dSmrg# Reject unsafe characters in $srcdir or the absolute working directory
12118fda9279dSmrg# name.  Accept space and tab only in the latter.
12119fda9279dSmrgam_lf='
12120fda9279dSmrg'
12121fda9279dSmrgcase `pwd` in
12122fda9279dSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12123fda9279dSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12124fda9279dSmrgesac
12125fda9279dSmrgcase $srcdir in
12126fda9279dSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12127fda9279dSmrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12128fda9279dSmrgesac
12129fda9279dSmrg
12130fda9279dSmrg# Do 'set' in a subshell so we don't clobber the current shell's
12131fda9279dSmrg# arguments.  Must try -L first in case configure is actually a
12132fda9279dSmrg# symlink; some systems play weird games with the mod time of symlinks
12133fda9279dSmrg# (eg FreeBSD returns the mod time of the symlink's containing
12134fda9279dSmrg# directory).
12135fda9279dSmrgif (
12136fda9279dSmrg   am_has_slept=no
12137fda9279dSmrg   for am_try in 1 2; do
12138fda9279dSmrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12139fda9279dSmrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12140fda9279dSmrg     if test "$[*]" = "X"; then
12141fda9279dSmrg	# -L didn't work.
12142fda9279dSmrg	set X `ls -t "$srcdir/configure" conftest.file`
12143fda9279dSmrg     fi
12144fda9279dSmrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12145fda9279dSmrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12146fda9279dSmrg
12147fda9279dSmrg	# If neither matched, then we have a broken ls.  This can happen
12148fda9279dSmrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12149fda9279dSmrg	# broken ls alias from the environment.  This has actually
12150fda9279dSmrg	# happened.  Such a system could not be considered "sane".
12151fda9279dSmrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12152fda9279dSmrg  alias in your environment])
12153fda9279dSmrg     fi
12154fda9279dSmrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12155fda9279dSmrg       break
12156fda9279dSmrg     fi
12157fda9279dSmrg     # Just in case.
12158fda9279dSmrg     sleep 1
12159fda9279dSmrg     am_has_slept=yes
12160fda9279dSmrg   done
12161fda9279dSmrg   test "$[2]" = conftest.file
12162fda9279dSmrg   )
12163fda9279dSmrgthen
12164fda9279dSmrg   # Ok.
12165fda9279dSmrg   :
12166fda9279dSmrgelse
12167fda9279dSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
12168fda9279dSmrgCheck your system clock])
12169fda9279dSmrgfi
12170fda9279dSmrgAC_MSG_RESULT([yes])
12171fda9279dSmrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12172fda9279dSmrg# generated files are strictly newer.
12173fda9279dSmrgam_sleep_pid=
12174fda9279dSmrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12175fda9279dSmrg  ( sleep 1 ) &
12176fda9279dSmrg  am_sleep_pid=$!
12177fda9279dSmrgfi
12178fda9279dSmrgAC_CONFIG_COMMANDS_PRE(
12179fda9279dSmrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12180fda9279dSmrg   if test -n "$am_sleep_pid"; then
12181fda9279dSmrg     # Hide warnings about reused PIDs.
12182fda9279dSmrg     wait $am_sleep_pid 2>/dev/null
12183fda9279dSmrg   fi
12184fda9279dSmrg   AC_MSG_RESULT([done])])
12185fda9279dSmrgrm -f conftest.file
12186fda9279dSmrg])
12187fda9279dSmrg
1218816ee1e9aSmrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
12189fda9279dSmrg#
12190fda9279dSmrg# This file is free software; the Free Software Foundation
12191fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12192fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12193fda9279dSmrg
12194fda9279dSmrg# AM_SILENT_RULES([DEFAULT])
12195fda9279dSmrg# --------------------------
12196fda9279dSmrg# Enable less verbose build rules; with the default set to DEFAULT
12197fda9279dSmrg# ("yes" being less verbose, "no" or empty being verbose).
12198fda9279dSmrgAC_DEFUN([AM_SILENT_RULES],
12199fda9279dSmrg[AC_ARG_ENABLE([silent-rules], [dnl
12200fda9279dSmrgAS_HELP_STRING(
12201fda9279dSmrg  [--enable-silent-rules],
12202fda9279dSmrg  [less verbose build output (undo: "make V=1")])
12203fda9279dSmrgAS_HELP_STRING(
12204fda9279dSmrg  [--disable-silent-rules],
12205fda9279dSmrg  [verbose build output (undo: "make V=0")])dnl
12206fda9279dSmrg])
12207fda9279dSmrgcase $enable_silent_rules in @%:@ (((
12208fda9279dSmrg  yes) AM_DEFAULT_VERBOSITY=0;;
12209fda9279dSmrg   no) AM_DEFAULT_VERBOSITY=1;;
12210fda9279dSmrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12211fda9279dSmrgesac
12212fda9279dSmrgdnl
12213fda9279dSmrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12214fda9279dSmrgdnl do not support nested variable expansions.
12215fda9279dSmrgdnl See automake bug#9928 and bug#10237.
12216fda9279dSmrgam_make=${MAKE-make}
12217fda9279dSmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12218fda9279dSmrg   [am_cv_make_support_nested_variables],
12219fda9279dSmrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12220fda9279dSmrgBAR0=false
12221fda9279dSmrgBAR1=true
12222fda9279dSmrgV=1
12223fda9279dSmrgam__doit:
12224fda9279dSmrg	@$(TRUE)
12225fda9279dSmrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12226fda9279dSmrg  am_cv_make_support_nested_variables=yes
12227fda9279dSmrgelse
12228fda9279dSmrg  am_cv_make_support_nested_variables=no
12229fda9279dSmrgfi])
12230fda9279dSmrgif test $am_cv_make_support_nested_variables = yes; then
12231fda9279dSmrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12232fda9279dSmrg  AM_V='$(V)'
12233fda9279dSmrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12234fda9279dSmrgelse
12235fda9279dSmrg  AM_V=$AM_DEFAULT_VERBOSITY
12236fda9279dSmrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12237fda9279dSmrgfi
12238fda9279dSmrgAC_SUBST([AM_V])dnl
12239fda9279dSmrgAM_SUBST_NOTMAKE([AM_V])dnl
12240fda9279dSmrgAC_SUBST([AM_DEFAULT_V])dnl
12241fda9279dSmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12242fda9279dSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12243fda9279dSmrgAM_BACKSLASH='\'
12244fda9279dSmrgAC_SUBST([AM_BACKSLASH])dnl
12245fda9279dSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12246fda9279dSmrg])
12247fda9279dSmrg
1224816ee1e9aSmrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12249fda9279dSmrg#
12250fda9279dSmrg# This file is free software; the Free Software Foundation
12251fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12252fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12253fda9279dSmrg
12254fda9279dSmrg# AM_PROG_INSTALL_STRIP
12255fda9279dSmrg# ---------------------
12256fda9279dSmrg# One issue with vendor 'install' (even GNU) is that you can't
12257fda9279dSmrg# specify the program used to strip binaries.  This is especially
12258fda9279dSmrg# annoying in cross-compiling environments, where the build's strip
12259fda9279dSmrg# is unlikely to handle the host's binaries.
12260fda9279dSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12261fda9279dSmrg# always use install-sh in "make install-strip", and initialize
12262fda9279dSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
12263fda9279dSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12264fda9279dSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12265fda9279dSmrg# Installed binaries are usually stripped using 'strip' when the user
12266fda9279dSmrg# run "make install-strip".  However 'strip' might not be the right
12267fda9279dSmrg# tool to use in cross-compilation environments, therefore Automake
12268fda9279dSmrg# will honor the 'STRIP' environment variable to overrule this program.
12269fda9279dSmrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12270fda9279dSmrgif test "$cross_compiling" != no; then
12271fda9279dSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
12272fda9279dSmrgfi
12273fda9279dSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12274fda9279dSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
12275fda9279dSmrg
1227616ee1e9aSmrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
12277fda9279dSmrg#
12278fda9279dSmrg# This file is free software; the Free Software Foundation
12279fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12280fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12281fda9279dSmrg
12282fda9279dSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
12283fda9279dSmrg# ---------------------------
12284fda9279dSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12285fda9279dSmrg# This macro is traced by Automake.
12286fda9279dSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
12287fda9279dSmrg
12288fda9279dSmrg# AM_SUBST_NOTMAKE(VARIABLE)
12289fda9279dSmrg# --------------------------
12290fda9279dSmrg# Public sister of _AM_SUBST_NOTMAKE.
12291fda9279dSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
12292fda9279dSmrg
12293fda9279dSmrg# Check how to create a tarball.                            -*- Autoconf -*-
12294fda9279dSmrg
1229516ee1e9aSmrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
12296fda9279dSmrg#
12297fda9279dSmrg# This file is free software; the Free Software Foundation
12298fda9279dSmrg# gives unlimited permission to copy and/or distribute it,
12299fda9279dSmrg# with or without modifications, as long as this notice is preserved.
12300fda9279dSmrg
12301fda9279dSmrg# _AM_PROG_TAR(FORMAT)
12302fda9279dSmrg# --------------------
12303fda9279dSmrg# Check how to create a tarball in format FORMAT.
12304fda9279dSmrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12305fda9279dSmrg#
12306fda9279dSmrg# Substitute a variable $(am__tar) that is a command
12307fda9279dSmrg# writing to stdout a FORMAT-tarball containing the directory
12308fda9279dSmrg# $tardir.
12309fda9279dSmrg#     tardir=directory && $(am__tar) > result.tar
12310fda9279dSmrg#
12311fda9279dSmrg# Substitute a variable $(am__untar) that extract such
12312fda9279dSmrg# a tarball read from stdin.
12313fda9279dSmrg#     $(am__untar) < result.tar
12314fda9279dSmrg#
12315fda9279dSmrgAC_DEFUN([_AM_PROG_TAR],
12316fda9279dSmrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12317fda9279dSmrg# in the wild :-(  We should find a proper way to deprecate it ...
12318fda9279dSmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
12319fda9279dSmrg
12320fda9279dSmrg# We'll loop over all known methods to create a tar archive until one works.
12321fda9279dSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12322fda9279dSmrg
12323fda9279dSmrgm4_if([$1], [v7],
12324fda9279dSmrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12325fda9279dSmrg
12326fda9279dSmrg  [m4_case([$1],
12327fda9279dSmrg    [ustar],
12328fda9279dSmrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12329fda9279dSmrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12330fda9279dSmrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12331fda9279dSmrg      # and bug#13588).
12332fda9279dSmrg      am_max_uid=2097151 # 2^21 - 1
12333fda9279dSmrg      am_max_gid=$am_max_uid
12334fda9279dSmrg      # The $UID and $GID variables are not portable, so we need to resort
12335fda9279dSmrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12336fda9279dSmrg      # below are definitely unexpected, so allow the users to see them
12337fda9279dSmrg      # (that is, avoid stderr redirection).
12338fda9279dSmrg      am_uid=`id -u || echo unknown`
12339fda9279dSmrg      am_gid=`id -g || echo unknown`
12340fda9279dSmrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12341fda9279dSmrg      if test $am_uid -le $am_max_uid; then
12342fda9279dSmrg         AC_MSG_RESULT([yes])
12343fda9279dSmrg      else
12344fda9279dSmrg         AC_MSG_RESULT([no])
12345fda9279dSmrg         _am_tools=none
12346fda9279dSmrg      fi
12347fda9279dSmrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12348fda9279dSmrg      if test $am_gid -le $am_max_gid; then
12349fda9279dSmrg         AC_MSG_RESULT([yes])
12350fda9279dSmrg      else
12351fda9279dSmrg        AC_MSG_RESULT([no])
12352fda9279dSmrg        _am_tools=none
12353fda9279dSmrg      fi],
12354fda9279dSmrg
12355fda9279dSmrg  [pax],
12356fda9279dSmrg    [],
12357fda9279dSmrg
12358fda9279dSmrg  [m4_fatal([Unknown tar format])])
12359fda9279dSmrg
12360fda9279dSmrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12361fda9279dSmrg
12362fda9279dSmrg  # Go ahead even if we have the value already cached.  We do so because we
12363fda9279dSmrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12364fda9279dSmrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12365fda9279dSmrg
12366fda9279dSmrg  for _am_tool in $_am_tools; do
12367fda9279dSmrg    case $_am_tool in
12368fda9279dSmrg    gnutar)
12369fda9279dSmrg      for _am_tar in tar gnutar gtar; do
12370fda9279dSmrg        AM_RUN_LOG([$_am_tar --version]) && break
12371fda9279dSmrg      done
12372fda9279dSmrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12373fda9279dSmrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12374fda9279dSmrg      am__untar="$_am_tar -xf -"
12375fda9279dSmrg      ;;
12376fda9279dSmrg    plaintar)
12377fda9279dSmrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12378fda9279dSmrg      # ustar tarball either.
12379fda9279dSmrg      (tar --version) >/dev/null 2>&1 && continue
12380fda9279dSmrg      am__tar='tar chf - "$$tardir"'
12381fda9279dSmrg      am__tar_='tar chf - "$tardir"'
12382fda9279dSmrg      am__untar='tar xf -'
12383fda9279dSmrg      ;;
12384fda9279dSmrg    pax)
12385fda9279dSmrg      am__tar='pax -L -x $1 -w "$$tardir"'
12386fda9279dSmrg      am__tar_='pax -L -x $1 -w "$tardir"'
12387fda9279dSmrg      am__untar='pax -r'
12388fda9279dSmrg      ;;
12389fda9279dSmrg    cpio)
12390fda9279dSmrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12391fda9279dSmrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12392fda9279dSmrg      am__untar='cpio -i -H $1 -d'
12393fda9279dSmrg      ;;
12394fda9279dSmrg    none)
12395fda9279dSmrg      am__tar=false
12396fda9279dSmrg      am__tar_=false
12397fda9279dSmrg      am__untar=false
12398fda9279dSmrg      ;;
12399fda9279dSmrg    esac
12400fda9279dSmrg
12401fda9279dSmrg    # If the value was cached, stop now.  We just wanted to have am__tar
12402fda9279dSmrg    # and am__untar set.
12403fda9279dSmrg    test -n "${am_cv_prog_tar_$1}" && break
12404fda9279dSmrg
12405fda9279dSmrg    # tar/untar a dummy directory, and stop if the command works.
12406fda9279dSmrg    rm -rf conftest.dir
12407fda9279dSmrg    mkdir conftest.dir
12408fda9279dSmrg    echo GrepMe > conftest.dir/file
12409fda9279dSmrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12410fda9279dSmrg    rm -rf conftest.dir
12411fda9279dSmrg    if test -s conftest.tar; then
12412fda9279dSmrg      AM_RUN_LOG([$am__untar <conftest.tar])
12413fda9279dSmrg      AM_RUN_LOG([cat conftest.dir/file])
12414fda9279dSmrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12415fda9279dSmrg    fi
12416fda9279dSmrg  done
12417fda9279dSmrg  rm -rf conftest.dir
12418fda9279dSmrg
12419fda9279dSmrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12420fda9279dSmrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12421fda9279dSmrg
12422fda9279dSmrgAC_SUBST([am__tar])
12423fda9279dSmrgAC_SUBST([am__untar])
12424fda9279dSmrg]) # _AM_PROG_TAR
12425fda9279dSmrg
12426