aclocal.m4 revision 89b0dc75
189b0dc75Smrg# generated automatically by aclocal 1.15 -*- Autoconf -*-
2eca46af7Smrg
389b0dc75Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
495b296d0Smrg
595b296d0Smrg# This file is free software; the Free Software Foundation
695b296d0Smrg# gives unlimited permission to copy and/or distribute it,
795b296d0Smrg# with or without modifications, as long as this notice is preserved.
895b296d0Smrg
995b296d0Smrg# This program is distributed in the hope that it will be useful,
1095b296d0Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1195b296d0Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1295b296d0Smrg# PARTICULAR PURPOSE.
1395b296d0Smrg
14eca46af7Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15ff89ac2bSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16ff89ac2bSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17eca46af7Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18eca46af7Smrg[m4_warning([this file was generated for autoconf 2.69.
19ff89ac2bSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20ff89ac2bSmrgIf you have problems, you may need to regenerate the build system entirely.
21eca46af7SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22ff89ac2bSmrg
23eca46af7Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
242378475aSmrg#
2589b0dc75Smrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
26eca46af7Smrg#   Written by Gordon Matzigkeit, 1996
27eca46af7Smrg#
28eca46af7Smrg# This file is free software; the Free Software Foundation gives
29eca46af7Smrg# unlimited permission to copy and/or distribute it, with or without
30eca46af7Smrg# modifications, as long as this notice is preserved.
3114330f12Smrg
32eca46af7Smrgm4_define([_LT_COPYING], [dnl
33eca46af7Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
34eca46af7Smrg# This is free software; see the source for copying conditions.  There is NO
35eca46af7Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3614330f12Smrg
37eca46af7Smrg# GNU Libtool is free software; you can redistribute it and/or modify
38eca46af7Smrg# it under the terms of the GNU General Public License as published by
39eca46af7Smrg# the Free Software Foundation; either version 2 of of the License, or
40eca46af7Smrg# (at your option) any later version.
41eca46af7Smrg#
42eca46af7Smrg# As a special exception to the GNU General Public License, if you
43eca46af7Smrg# distribute this file as part of a program or library that is built
44eca46af7Smrg# using GNU Libtool, you may include this file under the  same
45eca46af7Smrg# distribution terms that you use for the rest of that program.
46eca46af7Smrg#
47eca46af7Smrg# GNU Libtool is distributed in the hope that it will be useful, but
48eca46af7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49eca46af7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50eca46af7Smrg# GNU General Public License for more details.
51eca46af7Smrg#
52eca46af7Smrg# You should have received a copy of the GNU General Public License
53eca46af7Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54eca46af7Smrg])
5514330f12Smrg
56eca46af7Smrg# serial 58 LT_INIT
5714330f12Smrg
5814330f12Smrg
59eca46af7Smrg# LT_PREREQ(VERSION)
60eca46af7Smrg# ------------------
61eca46af7Smrg# Complain and exit if this libtool version is less that VERSION.
62eca46af7Smrgm4_defun([LT_PREREQ],
63eca46af7Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64eca46af7Smrg       [m4_default([$3],
65eca46af7Smrg		   [m4_fatal([Libtool version $1 or higher is required],
66eca46af7Smrg		             63)])],
67eca46af7Smrg       [$2])])
682378475aSmrg
6939713583Smrg
70eca46af7Smrg# _LT_CHECK_BUILDDIR
71eca46af7Smrg# ------------------
72eca46af7Smrg# Complain if the absolute build directory name contains unusual characters
73eca46af7Smrgm4_defun([_LT_CHECK_BUILDDIR],
74eca46af7Smrg[case `pwd` in
75eca46af7Smrg  *\ * | *\	*)
76eca46af7Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77eca46af7Smrgesac
782378475aSmrg])
792378475aSmrg
802378475aSmrg
81eca46af7Smrg# LT_INIT([OPTIONS])
82eca46af7Smrg# ------------------
83eca46af7SmrgAC_DEFUN([LT_INIT],
84eca46af7Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85eca46af7SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86eca46af7SmrgAC_BEFORE([$0], [LT_LANG])dnl
87eca46af7SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88eca46af7SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89eca46af7Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
9095b296d0Smrg
91eca46af7Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92eca46af7Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93eca46af7Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94eca46af7Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95eca46af7Smrgdnl unless we require an AC_DEFUNed macro:
96eca46af7SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97eca46af7SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98eca46af7SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99eca46af7SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100eca46af7Smrgm4_require([_LT_PROG_LTMAIN])dnl
10139713583Smrg
102eca46af7Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
10339713583Smrg
104eca46af7Smrgdnl Parse OPTIONS
105eca46af7Smrg_LT_SET_OPTIONS([$0], [$1])
1062378475aSmrg
107eca46af7Smrg# This can be used to rebuild libtool when needed
108eca46af7SmrgLIBTOOL_DEPS=$ltmain
1092378475aSmrg
110eca46af7Smrg# Always use our own libtool.
111eca46af7SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112eca46af7SmrgAC_SUBST(LIBTOOL)dnl
1132378475aSmrg
114eca46af7Smrg_LT_SETUP
1152378475aSmrg
116eca46af7Smrg# Only expand once:
117eca46af7Smrgm4_define([LT_INIT])
118eca46af7Smrg])# LT_INIT
1192378475aSmrg
120eca46af7Smrg# Old names:
121eca46af7SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122eca46af7SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
124eca46af7Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125eca46af7Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
1262378475aSmrg
12795b296d0Smrg
12889b0dc75Smrg# _LT_PREPARE_CC_BASENAME
12989b0dc75Smrg# -----------------------
13089b0dc75Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
13189b0dc75Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
13289b0dc75Smrgfunc_cc_basename ()
13389b0dc75Smrg{
13489b0dc75Smrg    for cc_temp in @S|@*""; do
13589b0dc75Smrg      case $cc_temp in
13689b0dc75Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
13789b0dc75Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
13889b0dc75Smrg        \-*) ;;
13989b0dc75Smrg        *) break;;
14089b0dc75Smrg      esac
14189b0dc75Smrg    done
14289b0dc75Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
14389b0dc75Smrg}
14489b0dc75Smrg])# _LT_PREPARE_CC_BASENAME
14589b0dc75Smrg
14689b0dc75Smrg
147eca46af7Smrg# _LT_CC_BASENAME(CC)
148eca46af7Smrg# -------------------
14989b0dc75Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
15089b0dc75Smrg# but that macro is also expanded into generated libtool script, which
15189b0dc75Smrg# arranges for $SED and $ECHO to be set by different means.
152eca46af7Smrgm4_defun([_LT_CC_BASENAME],
15389b0dc75Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
15489b0dc75SmrgAC_REQUIRE([_LT_DECL_SED])dnl
15589b0dc75SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
15689b0dc75Smrgfunc_cc_basename $1
15789b0dc75Smrgcc_basename=$func_cc_basename_result
158eca46af7Smrg])
159e6f085baSmrg
16095b296d0Smrg
161eca46af7Smrg# _LT_FILEUTILS_DEFAULTS
162eca46af7Smrg# ----------------------
163eca46af7Smrg# It is okay to use these file commands and assume they have been set
164eca46af7Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
165eca46af7Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
166eca46af7Smrg[: ${CP="cp -f"}
167eca46af7Smrg: ${MV="mv -f"}
168eca46af7Smrg: ${RM="rm -f"}
169eca46af7Smrg])# _LT_FILEUTILS_DEFAULTS
17095b296d0Smrg
17195b296d0Smrg
172eca46af7Smrg# _LT_SETUP
173eca46af7Smrg# ---------
174eca46af7Smrgm4_defun([_LT_SETUP],
175eca46af7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
176eca46af7SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177eca46af7SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178eca46af7SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
17939713583Smrg
180eca46af7Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181eca46af7Smrgdnl
182eca46af7Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
183eca46af7Smrg_LT_DECL([], [host], [0])dnl
184eca46af7Smrg_LT_DECL([], [host_os], [0])dnl
185eca46af7Smrgdnl
186eca46af7Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
187eca46af7Smrg_LT_DECL([], [build], [0])dnl
188eca46af7Smrg_LT_DECL([], [build_os], [0])dnl
189eca46af7Smrgdnl
190eca46af7SmrgAC_REQUIRE([AC_PROG_CC])dnl
191eca46af7SmrgAC_REQUIRE([LT_PATH_LD])dnl
192eca46af7SmrgAC_REQUIRE([LT_PATH_NM])dnl
193eca46af7Smrgdnl
194eca46af7SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
195eca46af7Smrgtest -z "$LN_S" && LN_S="ln -s"
196eca46af7Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
197eca46af7Smrgdnl
198eca46af7SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
199eca46af7Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
200eca46af7Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
201eca46af7Smrgdnl
202eca46af7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
203eca46af7Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204eca46af7Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
205eca46af7Smrgm4_require([_LT_CMD_RELOAD])dnl
206eca46af7Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207eca46af7Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
208eca46af7Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
209eca46af7Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210eca46af7Smrgm4_require([_LT_WITH_SYSROOT])dnl
211eca46af7Smrgm4_require([_LT_CMD_TRUNCATE])dnl
21239713583Smrg
213eca46af7Smrg_LT_CONFIG_LIBTOOL_INIT([
214eca46af7Smrg# See if we are running on zsh, and set the options that allow our
215eca46af7Smrg# commands through without removal of \ escapes INIT.
216eca46af7Smrgif test -n "\${ZSH_VERSION+set}"; then
217eca46af7Smrg   setopt NO_GLOB_SUBST
21814330f12Smrgfi
21914330f12Smrg])
220eca46af7Smrgif test -n "${ZSH_VERSION+set}"; then
221eca46af7Smrg   setopt NO_GLOB_SUBST
222eca46af7Smrgfi
22339713583Smrg
224eca46af7Smrg_LT_CHECK_OBJDIR
2252378475aSmrg
226eca46af7Smrgm4_require([_LT_TAG_COMPILER])dnl
2272378475aSmrg
228eca46af7Smrgcase $host_os in
229eca46af7Smrgaix3*)
230eca46af7Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
231eca46af7Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
232eca46af7Smrg  # vanish in a puff of smoke.
233eca46af7Smrg  if test set != "${COLLECT_NAMES+set}"; then
234eca46af7Smrg    COLLECT_NAMES=
235eca46af7Smrg    export COLLECT_NAMES
236eca46af7Smrg  fi
237eca46af7Smrg  ;;
238eca46af7Smrgesac
2392378475aSmrg
240eca46af7Smrg# Global variables:
241eca46af7Smrgofile=libtool
242eca46af7Smrgcan_build_shared=yes
2432378475aSmrg
244eca46af7Smrg# All known linkers require a '.a' archive for static linking (except MSVC,
245eca46af7Smrg# which needs '.lib').
246eca46af7Smrglibext=a
2472378475aSmrg
248eca46af7Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
2492378475aSmrg
250eca46af7Smrgold_CC=$CC
251eca46af7Smrgold_CFLAGS=$CFLAGS
2522378475aSmrg
253eca46af7Smrg# Set sane defaults for various variables
254eca46af7Smrgtest -z "$CC" && CC=cc
255eca46af7Smrgtest -z "$LTCC" && LTCC=$CC
256eca46af7Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
257eca46af7Smrgtest -z "$LD" && LD=ld
258eca46af7Smrgtest -z "$ac_objext" && ac_objext=o
2592378475aSmrg
260eca46af7Smrg_LT_CC_BASENAME([$compiler])
2612378475aSmrg
262eca46af7Smrg# Only perform the check for file, if the check method requires it
263eca46af7Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
264eca46af7Smrgcase $deplibs_check_method in
265eca46af7Smrgfile_magic*)
266eca46af7Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
267eca46af7Smrg    _LT_PATH_MAGIC
26814330f12Smrg  fi
269eca46af7Smrg  ;;
270eca46af7Smrgesac
2712378475aSmrg
272eca46af7Smrg# Use C for the default configuration in the libtool script
273eca46af7SmrgLT_SUPPORTED_TAG([CC])
274eca46af7Smrg_LT_LANG_C_CONFIG
275eca46af7Smrg_LT_LANG_DEFAULT_CONFIG
276eca46af7Smrg_LT_CONFIG_COMMANDS
277eca46af7Smrg])# _LT_SETUP
2782378475aSmrg
2792378475aSmrg
280eca46af7Smrg# _LT_PREPARE_SED_QUOTE_VARS
281eca46af7Smrg# --------------------------
282eca46af7Smrg# Define a few sed substitution that help us do robust quoting.
283eca46af7Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284eca46af7Smrg[# Backslashify metacharacters that are still active within
285eca46af7Smrg# double-quoted strings.
286eca46af7Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
2872378475aSmrg
288eca46af7Smrg# Same as above, but do not quote variable references.
289eca46af7Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
2902378475aSmrg
291eca46af7Smrg# Sed substitution to delay expansion of an escaped shell variable in a
292eca46af7Smrg# double_quote_subst'ed string.
293eca46af7Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
2942378475aSmrg
295eca46af7Smrg# Sed substitution to delay expansion of an escaped single quote.
296eca46af7Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
2972378475aSmrg
298eca46af7Smrg# Sed substitution to avoid accidental globbing in evaled expressions
299eca46af7Smrgno_glob_subst='s/\*/\\\*/g'
300eca46af7Smrg])
3012378475aSmrg
302eca46af7Smrg# _LT_PROG_LTMAIN
303eca46af7Smrg# ---------------
304eca46af7Smrg# Note that this code is called both from 'configure', and 'config.status'
305eca46af7Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
306eca46af7Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
307eca46af7Smrg# so we pass a copy along to make sure it has a sensible value anyway.
308eca46af7Smrgm4_defun([_LT_PROG_LTMAIN],
309eca46af7Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
310eca46af7Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
311eca46af7Smrgltmain=$ac_aux_dir/ltmain.sh
312eca46af7Smrg])# _LT_PROG_LTMAIN
3132378475aSmrg
3142378475aSmrg
3152378475aSmrg
316eca46af7Smrg# So that we can recreate a full libtool script including additional
317eca46af7Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
318eca46af7Smrg# in macros and then make a single call at the end using the 'libtool'
319eca46af7Smrg# label.
3202378475aSmrg
3212378475aSmrg
322eca46af7Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
323eca46af7Smrg# ----------------------------------------
324eca46af7Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325eca46af7Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
326eca46af7Smrg[m4_ifval([$1],
327eca46af7Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
328eca46af7Smrg                     [$1
329eca46af7Smrg])])])
3302378475aSmrg
331eca46af7Smrg# Initialize.
332eca46af7Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
3332378475aSmrg
3342378475aSmrg
335eca46af7Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
336eca46af7Smrg# ------------------------------
337eca46af7Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
338eca46af7Smrgm4_define([_LT_CONFIG_LIBTOOL],
339eca46af7Smrg[m4_ifval([$1],
340eca46af7Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
341eca46af7Smrg                     [$1
342eca46af7Smrg])])])
34314330f12Smrg
344eca46af7Smrg# Initialize.
345eca46af7Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
3462378475aSmrg
3472378475aSmrg
348eca46af7Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
349eca46af7Smrg# -----------------------------------------------------
350eca46af7Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
351eca46af7Smrg[_LT_CONFIG_LIBTOOL([$1])
352eca46af7Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
35314330f12Smrg])
3542378475aSmrg
3552378475aSmrg
356eca46af7Smrg# _LT_FORMAT_COMMENT([COMMENT])
357eca46af7Smrg# -----------------------------
358eca46af7Smrg# Add leading comment marks to the start of each line, and a trailing
359eca46af7Smrg# full-stop to the whole comment if one is not present already.
360eca46af7Smrgm4_define([_LT_FORMAT_COMMENT],
361eca46af7Smrg[m4_ifval([$1], [
362eca46af7Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
363eca46af7Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
364eca46af7Smrg)])
36539713583Smrg
36639713583Smrg
3672378475aSmrg
3682378475aSmrg
3692378475aSmrg
370eca46af7Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
371eca46af7Smrg# -------------------------------------------------------------------
372eca46af7Smrg# CONFIGNAME is the name given to the value in the libtool script.
373eca46af7Smrg# VARNAME is the (base) name used in the configure script.
374eca46af7Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
375eca46af7Smrg# VARNAME.  Any other value will be used directly.
376eca46af7Smrgm4_define([_LT_DECL],
377eca46af7Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
378eca46af7Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
379eca46af7Smrg	[m4_ifval([$1], [$1], [$2])])
380eca46af7Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
381eca46af7Smrg    m4_ifval([$4],
382eca46af7Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
383eca46af7Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
384eca46af7Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
3852378475aSmrg])
3862378475aSmrg
3872378475aSmrg
388eca46af7Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
389eca46af7Smrg# --------------------------------------------------------
390eca46af7Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
3912378475aSmrg
3922378475aSmrg
393eca46af7Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
394eca46af7Smrg# ------------------------------------------------
395eca46af7Smrgm4_define([lt_decl_tag_varnames],
396eca46af7Smrg[_lt_decl_filter([tagged?], [yes], $@)])
3972378475aSmrg
3982378475aSmrg
399eca46af7Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
400eca46af7Smrg# ---------------------------------------------------------
401eca46af7Smrgm4_define([_lt_decl_filter],
402eca46af7Smrg[m4_case([$#],
403eca46af7Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
404eca46af7Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
405eca46af7Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
406eca46af7Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
407eca46af7Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
408eca46af7Smrg])
4092378475aSmrg
4102378475aSmrg
411eca46af7Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
412eca46af7Smrg# --------------------------------------------------
413eca46af7Smrgm4_define([lt_decl_quote_varnames],
414eca46af7Smrg[_lt_decl_filter([value], [1], $@)])
4152378475aSmrg
4162378475aSmrg
417eca46af7Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
418eca46af7Smrg# ---------------------------------------------------
419eca46af7Smrgm4_define([lt_decl_dquote_varnames],
420eca46af7Smrg[_lt_decl_filter([value], [2], $@)])
4212378475aSmrg
4222378475aSmrg
423eca46af7Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
424eca46af7Smrg# ---------------------------------------------------
425eca46af7Smrgm4_define([lt_decl_varnames_tagged],
426eca46af7Smrg[m4_assert([$# <= 2])dnl
427eca46af7Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
428eca46af7Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
429eca46af7Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
430eca46af7Smrgm4_define([_lt_decl_varnames_tagged],
431eca46af7Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
432eca46af7Smrg
433eca46af7Smrg
434eca46af7Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
435eca46af7Smrg# ------------------------------------------------
436eca46af7Smrgm4_define([lt_decl_all_varnames],
437eca46af7Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
438eca46af7Smrg     m4_if([$2], [],
439eca46af7Smrg	   m4_quote(lt_decl_varnames),
440eca46af7Smrg	m4_quote(m4_shift($@))))[]dnl
441eca46af7Smrg])
442eca46af7Smrgm4_define([_lt_decl_all_varnames],
443eca46af7Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
444eca46af7Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
445eca46af7Smrg])
4462378475aSmrg
4472378475aSmrg
448eca46af7Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
449eca46af7Smrg# ------------------------------------
450eca46af7Smrg# Quote a variable value, and forward it to 'config.status' so that its
451eca46af7Smrg# declaration there will have the same value as in 'configure'.  VARNAME
452eca46af7Smrg# must have a single quote delimited value for this to work.
453eca46af7Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454eca46af7Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455eca46af7Smrg
456eca46af7Smrg
457eca46af7Smrg# _LT_CONFIG_STATUS_DECLARATIONS
458eca46af7Smrg# ------------------------------
459eca46af7Smrg# We delimit libtool config variables with single quotes, so when
460eca46af7Smrg# we write them to config.status, we have to be sure to quote all
461eca46af7Smrg# embedded single quotes properly.  In configure, this macro expands
462eca46af7Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
46314330f12Smrg#
464eca46af7Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
465eca46af7Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
466eca46af7Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
467eca46af7Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
4682378475aSmrg
4692378475aSmrg
470eca46af7Smrg# _LT_LIBTOOL_TAGS
471eca46af7Smrg# ----------------
472eca46af7Smrg# Output comment and list of tags supported by the script
473eca46af7Smrgm4_defun([_LT_LIBTOOL_TAGS],
474eca46af7Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
475eca46af7Smrgavailable_tags='_LT_TAGS'dnl
47614330f12Smrg])
4772378475aSmrg
478eca46af7Smrg
479eca46af7Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
480eca46af7Smrg# -----------------------------------
481eca46af7Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
482eca46af7Smrg# expand to a commented shell variable setting:
4832378475aSmrg#
484eca46af7Smrg#    # Some comment about what VAR is for.
485eca46af7Smrg#    visible_name=$lt_internal_name
486eca46af7Smrgm4_define([_LT_LIBTOOL_DECLARE],
487eca46af7Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
488eca46af7Smrg					   [description])))[]dnl
489eca46af7Smrgm4_pushdef([_libtool_name],
490eca46af7Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
491eca46af7Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
492eca46af7Smrg    [0], [_libtool_name=[$]$1],
493eca46af7Smrg    [1], [_libtool_name=$lt_[]$1],
494eca46af7Smrg    [2], [_libtool_name=$lt_[]$1],
495eca46af7Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
496eca46af7Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497eca46af7Smrg])
4982378475aSmrg
4992378475aSmrg
500eca46af7Smrg# _LT_LIBTOOL_CONFIG_VARS
501eca46af7Smrg# -----------------------
502eca46af7Smrg# Produce commented declarations of non-tagged libtool config variables
503eca46af7Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
504eca46af7Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
505eca46af7Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
506eca46af7Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
507eca46af7Smrg[m4_foreach([_lt_var],
508eca46af7Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
509eca46af7Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
5102378475aSmrg
5112378475aSmrg
512eca46af7Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
513eca46af7Smrg# -------------------------
514eca46af7Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
515eca46af7Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
516eca46af7Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
5172378475aSmrg
5182378475aSmrg
519eca46af7Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
520eca46af7Smrg# ------------------------------
521eca46af7Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
5222378475aSmrg
5232378475aSmrg
524eca46af7Smrg# _LT_CONFIG_COMMANDS
525eca46af7Smrg# -------------------
526eca46af7Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
527eca46af7Smrg# variables for single and double quote escaping we saved from calls
528eca46af7Smrg# to _LT_DECL, we can put quote escaped variables declarations
529eca46af7Smrg# into 'config.status', and then the shell code to quote escape them in
530eca46af7Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
531eca46af7Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
532eca46af7Smrgm4_defun([_LT_CONFIG_COMMANDS],
533eca46af7Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
534eca46af7Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
535eca46af7Smrg	dnl instead of duplicating it all over again into config.status,
536eca46af7Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
537eca46af7Smrg	dnl needs to know what name is stored there:
538eca46af7Smrg        [AC_CONFIG_COMMANDS([libtool],
539eca46af7Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
540eca46af7Smrg    dnl If the libtool generation code is destined for config.status,
541eca46af7Smrg    dnl expand the accumulated commands and init code now:
542eca46af7Smrg    [AC_CONFIG_COMMANDS([libtool],
543eca46af7Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
544eca46af7Smrg])#_LT_CONFIG_COMMANDS
5452378475aSmrg
5462378475aSmrg
547eca46af7Smrg# Initialize.
548eca46af7Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
549eca46af7Smrg[
5502378475aSmrg
551eca46af7Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
552eca46af7Smrg# if CDPATH is set.
553eca46af7Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
5542378475aSmrg
555eca46af7Smrgsed_quote_subst='$sed_quote_subst'
556eca46af7Smrgdouble_quote_subst='$double_quote_subst'
557eca46af7Smrgdelay_variable_subst='$delay_variable_subst'
558eca46af7Smrg_LT_CONFIG_STATUS_DECLARATIONS
559eca46af7SmrgLTCC='$LTCC'
560eca46af7SmrgLTCFLAGS='$LTCFLAGS'
561eca46af7Smrgcompiler='$compiler_DEFAULT'
5622378475aSmrg
563eca46af7Smrg# A function that is used when there is no print builtin or printf.
564eca46af7Smrgfunc_fallback_echo ()
565eca46af7Smrg{
566eca46af7Smrg  eval 'cat <<_LTECHO_EOF
567eca46af7Smrg\$[]1
568eca46af7Smrg_LTECHO_EOF'
569eca46af7Smrg}
5702378475aSmrg
571eca46af7Smrg# Quote evaled strings.
572eca46af7Smrgfor var in lt_decl_all_varnames([[ \
573eca46af7Smrg]], lt_decl_quote_varnames); do
574eca46af7Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575eca46af7Smrg    *[[\\\\\\\`\\"\\\$]]*)
576eca46af7Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
577eca46af7Smrg      ;;
578eca46af7Smrg    *)
579eca46af7Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
580eca46af7Smrg      ;;
581eca46af7Smrg    esac
582eca46af7Smrgdone
5832378475aSmrg
584eca46af7Smrg# Double-quote double-evaled strings.
585eca46af7Smrgfor var in lt_decl_all_varnames([[ \
586eca46af7Smrg]], lt_decl_dquote_varnames); do
587eca46af7Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
588eca46af7Smrg    *[[\\\\\\\`\\"\\\$]]*)
589eca46af7Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
590eca46af7Smrg      ;;
591eca46af7Smrg    *)
592eca46af7Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
593eca46af7Smrg      ;;
594eca46af7Smrg    esac
595eca46af7Smrgdone
5962378475aSmrg
597eca46af7Smrg_LT_OUTPUT_LIBTOOL_INIT
598eca46af7Smrg])
5992378475aSmrg
600eca46af7Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601eca46af7Smrg# ------------------------------------
602eca46af7Smrg# Generate a child script FILE with all initialization necessary to
603eca46af7Smrg# reuse the environment learned by the parent script, and make the
604eca46af7Smrg# file executable.  If COMMENT is supplied, it is inserted after the
605eca46af7Smrg# '#!' sequence but before initialization text begins.  After this
606eca46af7Smrg# macro, additional text can be appended to FILE to form the body of
607eca46af7Smrg# the child script.  The macro ends with non-zero status if the
608eca46af7Smrg# file could not be fully written (such as if the disk is full).
609eca46af7Smrgm4_ifdef([AS_INIT_GENERATED],
610eca46af7Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611eca46af7Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
612eca46af7Smrg[m4_require([AS_PREPARE])]dnl
613eca46af7Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614eca46af7Smrg[lt_write_fail=0
615eca46af7Smrgcat >$1 <<_ASEOF || lt_write_fail=1
616eca46af7Smrg#! $SHELL
617eca46af7Smrg# Generated by $as_me.
618eca46af7Smrg$2
619eca46af7SmrgSHELL=\${CONFIG_SHELL-$SHELL}
620eca46af7Smrgexport SHELL
621eca46af7Smrg_ASEOF
622eca46af7Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623eca46af7SmrgAS_SHELL_SANITIZE
624eca46af7Smrg_AS_PREPARE
625eca46af7Smrgexec AS_MESSAGE_FD>&1
626eca46af7Smrg_ASEOF
627eca46af7Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628eca46af7Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
6292378475aSmrg
630eca46af7Smrg# LT_OUTPUT
631eca46af7Smrg# ---------
632eca46af7Smrg# This macro allows early generation of the libtool script (before
633eca46af7Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
634eca46af7Smrg# tests.
635eca46af7SmrgAC_DEFUN([LT_OUTPUT],
636eca46af7Smrg[: ${CONFIG_LT=./config.lt}
637eca46af7SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638eca46af7Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639eca46af7Smrg[# Run this file to recreate a libtool stub with the current configuration.])
6402378475aSmrg
641eca46af7Smrgcat >>"$CONFIG_LT" <<\_LTEOF
642eca46af7Smrglt_cl_silent=false
643eca46af7Smrgexec AS_MESSAGE_LOG_FD>>config.log
644eca46af7Smrg{
645eca46af7Smrg  echo
646eca46af7Smrg  AS_BOX([Running $as_me.])
647eca46af7Smrg} >&AS_MESSAGE_LOG_FD
6482378475aSmrg
649eca46af7Smrglt_cl_help="\
650eca46af7Smrg'$as_me' creates a local libtool stub from the current configuration,
651eca46af7Smrgfor use in further configure time tests before the real libtool is
652eca46af7Smrggenerated.
6532378475aSmrg
654eca46af7SmrgUsage: $[0] [[OPTIONS]]
6552378475aSmrg
656eca46af7Smrg  -h, --help      print this help, then exit
657eca46af7Smrg  -V, --version   print version number, then exit
658eca46af7Smrg  -q, --quiet     do not print progress messages
659eca46af7Smrg  -d, --debug     don't remove temporary files
66095b296d0Smrg
661eca46af7SmrgReport bugs to <bug-libtool@gnu.org>."
6622378475aSmrg
663eca46af7Smrglt_cl_version="\
664eca46af7Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
665eca46af7Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
666eca46af7Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
66795b296d0Smrg
668eca46af7SmrgCopyright (C) 2011 Free Software Foundation, Inc.
669eca46af7SmrgThis config.lt script is free software; the Free Software Foundation
670eca46af7Smrggives unlimited permision to copy, distribute and modify it."
67195b296d0Smrg
672eca46af7Smrgwhile test 0 != $[#]
673eca46af7Smrgdo
674eca46af7Smrg  case $[1] in
675eca46af7Smrg    --version | --v* | -V )
676eca46af7Smrg      echo "$lt_cl_version"; exit 0 ;;
677eca46af7Smrg    --help | --h* | -h )
678eca46af7Smrg      echo "$lt_cl_help"; exit 0 ;;
679eca46af7Smrg    --debug | --d* | -d )
680eca46af7Smrg      debug=: ;;
681eca46af7Smrg    --quiet | --q* | --silent | --s* | -q )
682eca46af7Smrg      lt_cl_silent=: ;;
68395b296d0Smrg
684eca46af7Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
685eca46af7SmrgTry '$[0] --help' for more information.]) ;;
68695b296d0Smrg
687eca46af7Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
688eca46af7SmrgTry '$[0] --help' for more information.]) ;;
689eca46af7Smrg  esac
690eca46af7Smrg  shift
691eca46af7Smrgdone
69295b296d0Smrg
693eca46af7Smrgif $lt_cl_silent; then
694eca46af7Smrg  exec AS_MESSAGE_FD>/dev/null
695eca46af7Smrgfi
696eca46af7Smrg_LTEOF
69795b296d0Smrg
698eca46af7Smrgcat >>"$CONFIG_LT" <<_LTEOF
699eca46af7Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
700eca46af7Smrg_LTEOF
70195b296d0Smrg
702eca46af7Smrgcat >>"$CONFIG_LT" <<\_LTEOF
703eca46af7SmrgAC_MSG_NOTICE([creating $ofile])
704eca46af7Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
705eca46af7SmrgAS_EXIT(0)
706eca46af7Smrg_LTEOF
707eca46af7Smrgchmod +x "$CONFIG_LT"
708ff89ac2bSmrg
709eca46af7Smrg# configure is writing to config.log, but config.lt does its own redirection,
710eca46af7Smrg# appending to config.log, which fails on DOS, as config.log is still kept
711eca46af7Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
712eca46af7Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713eca46af7Smrglt_cl_success=:
714eca46af7Smrgtest yes = "$silent" &&
715eca46af7Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716eca46af7Smrgexec AS_MESSAGE_LOG_FD>/dev/null
717eca46af7Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718eca46af7Smrgexec AS_MESSAGE_LOG_FD>>config.log
719eca46af7Smrg$lt_cl_success || AS_EXIT(1)
720eca46af7Smrg])# LT_OUTPUT
7212378475aSmrg
72295b296d0Smrg
723eca46af7Smrg# _LT_CONFIG(TAG)
724eca46af7Smrg# ---------------
725eca46af7Smrg# If TAG is the built-in tag, create an initial libtool script with a
726eca46af7Smrg# default configuration from the untagged config vars.  Otherwise add code
727eca46af7Smrg# to config.status for appending the configuration named by TAG from the
728eca46af7Smrg# matching tagged config vars.
729eca46af7Smrgm4_defun([_LT_CONFIG],
730eca46af7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
731eca46af7Smrg_LT_CONFIG_SAVE_COMMANDS([
732eca46af7Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
733eca46af7Smrg  m4_if(_LT_TAG, [C], [
734eca46af7Smrg    # See if we are running on zsh, and set the options that allow our
735eca46af7Smrg    # commands through without removal of \ escapes.
736eca46af7Smrg    if test -n "${ZSH_VERSION+set}"; then
737eca46af7Smrg      setopt NO_GLOB_SUBST
738eca46af7Smrg    fi
73995b296d0Smrg
740eca46af7Smrg    cfgfile=${ofile}T
741eca46af7Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
742eca46af7Smrg    $RM "$cfgfile"
74395b296d0Smrg
744eca46af7Smrg    cat <<_LT_EOF >> "$cfgfile"
745eca46af7Smrg#! $SHELL
746eca46af7Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
747eca46af7Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
748eca46af7Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
74995b296d0Smrg
750eca46af7Smrg# Provide generalized library-building support services.
751eca46af7Smrg# Written by Gordon Matzigkeit, 1996
75295b296d0Smrg
753eca46af7Smrg_LT_COPYING
754eca46af7Smrg_LT_LIBTOOL_TAGS
75595b296d0Smrg
75689b0dc75Smrg# Configured defaults for sys_lib_dlsearch_path munging.
75789b0dc75Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
75889b0dc75Smrg
759eca46af7Smrg# ### BEGIN LIBTOOL CONFIG
760eca46af7Smrg_LT_LIBTOOL_CONFIG_VARS
761eca46af7Smrg_LT_LIBTOOL_TAG_VARS
762eca46af7Smrg# ### END LIBTOOL CONFIG
76395b296d0Smrg
76489b0dc75Smrg_LT_EOF
76589b0dc75Smrg
76689b0dc75Smrg    cat <<'_LT_EOF' >> "$cfgfile"
76789b0dc75Smrg
76889b0dc75Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
76989b0dc75Smrg
77089b0dc75Smrg_LT_PREPARE_MUNGE_PATH_LIST
77189b0dc75Smrg_LT_PREPARE_CC_BASENAME
77289b0dc75Smrg
77389b0dc75Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
77489b0dc75Smrg
775eca46af7Smrg_LT_EOF
77695b296d0Smrg
777eca46af7Smrg  case $host_os in
778eca46af7Smrg  aix3*)
779eca46af7Smrg    cat <<\_LT_EOF >> "$cfgfile"
780eca46af7Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
781eca46af7Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
782eca46af7Smrg# vanish in a puff of smoke.
783eca46af7Smrgif test set != "${COLLECT_NAMES+set}"; then
784eca46af7Smrg  COLLECT_NAMES=
785eca46af7Smrg  export COLLECT_NAMES
786eca46af7Smrgfi
787eca46af7Smrg_LT_EOF
788eca46af7Smrg    ;;
789eca46af7Smrg  esac
79095b296d0Smrg
791eca46af7Smrg  _LT_PROG_LTMAIN
79295b296d0Smrg
793eca46af7Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
794eca46af7Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
795eca46af7Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
796eca46af7Smrg  # is reportedly fixed, but why not run on old versions too?
797eca46af7Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
798eca46af7Smrg     || (rm -f "$cfgfile"; exit 1)
79995b296d0Smrg
800eca46af7Smrg   mv -f "$cfgfile" "$ofile" ||
801eca46af7Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
802eca46af7Smrg  chmod +x "$ofile"
803eca46af7Smrg],
804eca46af7Smrg[cat <<_LT_EOF >> "$ofile"
80595b296d0Smrg
806eca46af7Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
807eca46af7Smrgdnl in a comment (ie after a #).
808eca46af7Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
809eca46af7Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
810eca46af7Smrg# ### END LIBTOOL TAG CONFIG: $1
811eca46af7Smrg_LT_EOF
812eca46af7Smrg])dnl /m4_if
813eca46af7Smrg],
814eca46af7Smrg[m4_if([$1], [], [
815eca46af7Smrg    PACKAGE='$PACKAGE'
816eca46af7Smrg    VERSION='$VERSION'
817eca46af7Smrg    RM='$RM'
818eca46af7Smrg    ofile='$ofile'], [])
819eca46af7Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
820eca46af7Smrg])# _LT_CONFIG
821e6f085baSmrg
82214330f12Smrg
823eca46af7Smrg# LT_SUPPORTED_TAG(TAG)
824eca46af7Smrg# ---------------------
825eca46af7Smrg# Trace this macro to discover what tags are supported by the libtool
826eca46af7Smrg# --tag option, using:
827eca46af7Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
828eca46af7SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
82995b296d0Smrg
83095b296d0Smrg
831eca46af7Smrg# C support is built-in for now
832eca46af7Smrgm4_define([_LT_LANG_C_enabled], [])
833eca46af7Smrgm4_define([_LT_TAGS], [])
83495b296d0Smrg
83595b296d0Smrg
836eca46af7Smrg# LT_LANG(LANG)
837eca46af7Smrg# -------------
838eca46af7Smrg# Enable libtool support for the given language if not already enabled.
839eca46af7SmrgAC_DEFUN([LT_LANG],
840eca46af7Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
841eca46af7Smrgm4_case([$1],
842eca46af7Smrg  [C],			[_LT_LANG(C)],
843eca46af7Smrg  [C++],		[_LT_LANG(CXX)],
844eca46af7Smrg  [Go],			[_LT_LANG(GO)],
845eca46af7Smrg  [Java],		[_LT_LANG(GCJ)],
846eca46af7Smrg  [Fortran 77],		[_LT_LANG(F77)],
847eca46af7Smrg  [Fortran],		[_LT_LANG(FC)],
848eca46af7Smrg  [Windows Resource],	[_LT_LANG(RC)],
849eca46af7Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
850eca46af7Smrg    [_LT_LANG($1)],
851eca46af7Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
852eca46af7Smrg])# LT_LANG
85395b296d0Smrg
85495b296d0Smrg
855eca46af7Smrg# _LT_LANG(LANGNAME)
856eca46af7Smrg# ------------------
857eca46af7Smrgm4_defun([_LT_LANG],
858eca46af7Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
859eca46af7Smrg  [LT_SUPPORTED_TAG([$1])dnl
860eca46af7Smrg  m4_append([_LT_TAGS], [$1 ])dnl
861eca46af7Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
862eca46af7Smrg  _LT_LANG_$1_CONFIG($1)])dnl
863eca46af7Smrg])# _LT_LANG
86495b296d0Smrg
86514330f12Smrg
866eca46af7Smrgm4_ifndef([AC_PROG_GO], [
867eca46af7Smrg# NOTE: This macro has been submitted for inclusion into   #
868eca46af7Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
869eca46af7Smrg#  a released version of Autoconf we should remove this    #
870eca46af7Smrg#  macro and use it instead.                               #
871eca46af7Smrgm4_defun([AC_PROG_GO],
872eca46af7Smrg[AC_LANG_PUSH(Go)dnl
873eca46af7SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
874eca46af7SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
875eca46af7Smrg_AC_ARG_VAR_LDFLAGS()dnl
876eca46af7SmrgAC_CHECK_TOOL(GOC, gccgo)
877eca46af7Smrgif test -z "$GOC"; then
878eca46af7Smrg  if test -n "$ac_tool_prefix"; then
879eca46af7Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
880eca46af7Smrg  fi
88114330f12Smrgfi
882eca46af7Smrgif test -z "$GOC"; then
883eca46af7Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
88414330f12Smrgfi
885eca46af7Smrg])#m4_defun
886eca46af7Smrg])#m4_ifndef
88714330f12Smrg
88895b296d0Smrg
889eca46af7Smrg# _LT_LANG_DEFAULT_CONFIG
890eca46af7Smrg# -----------------------
891eca46af7Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
892eca46af7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
893eca46af7Smrg  [LT_LANG(CXX)],
894eca46af7Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
8952378475aSmrg
896eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
897eca46af7Smrg  [LT_LANG(F77)],
898eca46af7Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
8992378475aSmrg
900eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
901eca46af7Smrg  [LT_LANG(FC)],
902eca46af7Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
9032378475aSmrg
904eca46af7Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
905eca46af7Smrgdnl pulling things in needlessly.
906eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
907eca46af7Smrg  [LT_LANG(GCJ)],
908eca46af7Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
909eca46af7Smrg    [LT_LANG(GCJ)],
910eca46af7Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
911eca46af7Smrg      [LT_LANG(GCJ)],
912eca46af7Smrg      [m4_ifdef([AC_PROG_GCJ],
913eca46af7Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
914eca46af7Smrg       m4_ifdef([A][M_PROG_GCJ],
915eca46af7Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
916eca46af7Smrg       m4_ifdef([LT_PROG_GCJ],
917eca46af7Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
9182378475aSmrg
919eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
920eca46af7Smrg  [LT_LANG(GO)],
921eca46af7Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
9222378475aSmrg
923eca46af7SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
924eca46af7Smrg  [LT_LANG(RC)],
925eca46af7Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
926eca46af7Smrg])# _LT_LANG_DEFAULT_CONFIG
92739713583Smrg
928eca46af7Smrg# Obsolete macros:
929eca46af7SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
930eca46af7SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
931eca46af7SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
932eca46af7SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
933eca46af7SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
934eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
935eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
936eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
937eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
938eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
939eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
94095b296d0Smrg
94195b296d0Smrg
942eca46af7Smrg# _LT_TAG_COMPILER
943eca46af7Smrg# ----------------
944eca46af7Smrgm4_defun([_LT_TAG_COMPILER],
945eca46af7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
94695b296d0Smrg
947eca46af7Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
948eca46af7Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
949eca46af7Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
950eca46af7Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
95195b296d0Smrg
952eca46af7Smrg# If no C compiler was specified, use CC.
953eca46af7SmrgLTCC=${LTCC-"$CC"}
95495b296d0Smrg
955eca46af7Smrg# If no C compiler flags were specified, use CFLAGS.
956eca46af7SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
95795b296d0Smrg
958eca46af7Smrg# Allow CC to be a program name with arguments.
959eca46af7Smrgcompiler=$CC
960eca46af7Smrg])# _LT_TAG_COMPILER
9612378475aSmrg
96295b296d0Smrg
963eca46af7Smrg# _LT_COMPILER_BOILERPLATE
964eca46af7Smrg# ------------------------
965eca46af7Smrg# Check for compiler boilerplate output or warnings with
966eca46af7Smrg# the simple compiler test code.
967eca46af7Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
968eca46af7Smrg[m4_require([_LT_DECL_SED])dnl
969eca46af7Smrgac_outfile=conftest.$ac_objext
970eca46af7Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
971eca46af7Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
972eca46af7Smrg_lt_compiler_boilerplate=`cat conftest.err`
973eca46af7Smrg$RM conftest*
974eca46af7Smrg])# _LT_COMPILER_BOILERPLATE
97595b296d0Smrg
97695b296d0Smrg
977eca46af7Smrg# _LT_LINKER_BOILERPLATE
978eca46af7Smrg# ----------------------
979eca46af7Smrg# Check for linker boilerplate output or warnings with
980eca46af7Smrg# the simple link test code.
981eca46af7Smrgm4_defun([_LT_LINKER_BOILERPLATE],
982eca46af7Smrg[m4_require([_LT_DECL_SED])dnl
983eca46af7Smrgac_outfile=conftest.$ac_objext
984eca46af7Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
985eca46af7Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
986eca46af7Smrg_lt_linker_boilerplate=`cat conftest.err`
987eca46af7Smrg$RM -r conftest*
988eca46af7Smrg])# _LT_LINKER_BOILERPLATE
98995b296d0Smrg
990eca46af7Smrg# _LT_REQUIRED_DARWIN_CHECKS
991eca46af7Smrg# -------------------------
992eca46af7Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
993eca46af7Smrg  case $host_os in
994eca46af7Smrg    rhapsody* | darwin*)
995eca46af7Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
996eca46af7Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
997eca46af7Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
998eca46af7Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
999eca46af7Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1000eca46af7Smrg    _LT_DECL([], [DSYMUTIL], [1],
1001eca46af7Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1002eca46af7Smrg    _LT_DECL([], [NMEDIT], [1],
1003eca46af7Smrg      [Tool to change global to local symbols on Mac OS X])
1004eca46af7Smrg    _LT_DECL([], [LIPO], [1],
1005eca46af7Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
1006eca46af7Smrg    _LT_DECL([], [OTOOL], [1],
1007eca46af7Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1008eca46af7Smrg    _LT_DECL([], [OTOOL64], [1],
1009eca46af7Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
101095b296d0Smrg
1011eca46af7Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1012eca46af7Smrg      [lt_cv_apple_cc_single_mod=no
1013eca46af7Smrg      if test -z "$LT_MULTI_MODULE"; then
1014eca46af7Smrg	# By default we will add the -single_module flag. You can override
1015eca46af7Smrg	# by either setting the environment variable LT_MULTI_MODULE
1016eca46af7Smrg	# non-empty at configure time, or by adding -multi_module to the
1017eca46af7Smrg	# link flags.
1018eca46af7Smrg	rm -rf libconftest.dylib*
1019eca46af7Smrg	echo "int foo(void){return 1;}" > conftest.c
1020eca46af7Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1021eca46af7Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1022eca46af7Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1023eca46af7Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1024eca46af7Smrg        _lt_result=$?
1025eca46af7Smrg	# If there is a non-empty error log, and "single_module"
1026eca46af7Smrg	# appears in it, assume the flag caused a linker warning
1027eca46af7Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1028eca46af7Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1029eca46af7Smrg	# Otherwise, if the output was created with a 0 exit code from
1030eca46af7Smrg	# the compiler, it worked.
1031eca46af7Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1032eca46af7Smrg	  lt_cv_apple_cc_single_mod=yes
1033eca46af7Smrg	else
1034eca46af7Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1035eca46af7Smrg	fi
1036eca46af7Smrg	rm -rf libconftest.dylib*
1037eca46af7Smrg	rm -f conftest.*
1038eca46af7Smrg      fi])
103995b296d0Smrg
1040eca46af7Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1041eca46af7Smrg      [lt_cv_ld_exported_symbols_list],
1042eca46af7Smrg      [lt_cv_ld_exported_symbols_list=no
1043eca46af7Smrg      save_LDFLAGS=$LDFLAGS
1044eca46af7Smrg      echo "_main" > conftest.sym
1045eca46af7Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1046eca46af7Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1047eca46af7Smrg	[lt_cv_ld_exported_symbols_list=yes],
1048eca46af7Smrg	[lt_cv_ld_exported_symbols_list=no])
1049eca46af7Smrg	LDFLAGS=$save_LDFLAGS
1050eca46af7Smrg    ])
10512378475aSmrg
1052eca46af7Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1053eca46af7Smrg      [lt_cv_ld_force_load=no
1054eca46af7Smrg      cat > conftest.c << _LT_EOF
1055eca46af7Smrgint forced_loaded() { return 2;}
1056eca46af7Smrg_LT_EOF
1057eca46af7Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1058eca46af7Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1059eca46af7Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1060eca46af7Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1061eca46af7Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1062eca46af7Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1063eca46af7Smrg      cat > conftest.c << _LT_EOF
1064eca46af7Smrgint main() { return 0;}
1065eca46af7Smrg_LT_EOF
1066eca46af7Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1067eca46af7Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1068eca46af7Smrg      _lt_result=$?
1069eca46af7Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1070eca46af7Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1071eca46af7Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1072eca46af7Smrg	lt_cv_ld_force_load=yes
1073eca46af7Smrg      else
1074eca46af7Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1075eca46af7Smrg      fi
1076eca46af7Smrg        rm -f conftest.err libconftest.a conftest conftest.c
1077eca46af7Smrg        rm -rf conftest.dSYM
1078eca46af7Smrg    ])
1079eca46af7Smrg    case $host_os in
1080eca46af7Smrg    rhapsody* | darwin1.[[012]])
1081eca46af7Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1082eca46af7Smrg    darwin1.*)
1083eca46af7Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1084eca46af7Smrg    darwin*) # darwin 5.x on
1085eca46af7Smrg      # if running on 10.5 or later, the deployment target defaults
1086eca46af7Smrg      # to the OS version, if on x86, and 10.4, the deployment
1087eca46af7Smrg      # target defaults to 10.4. Don't you love it?
1088eca46af7Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1089eca46af7Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1090eca46af7Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1091eca46af7Smrg	10.[[012]][[,.]]*)
1092eca46af7Smrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1093eca46af7Smrg	10.*)
1094eca46af7Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1095eca46af7Smrg      esac
1096eca46af7Smrg    ;;
1097eca46af7Smrg  esac
1098eca46af7Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1099eca46af7Smrg      _lt_dar_single_mod='$single_module'
1100eca46af7Smrg    fi
1101eca46af7Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1102eca46af7Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1103eca46af7Smrg    else
1104eca46af7Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1105eca46af7Smrg    fi
1106eca46af7Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1107eca46af7Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1108eca46af7Smrg    else
1109eca46af7Smrg      _lt_dsymutil=
1110eca46af7Smrg    fi
1111eca46af7Smrg    ;;
1112eca46af7Smrg  esac
1113eca46af7Smrg])
111495b296d0Smrg
111595b296d0Smrg
1116eca46af7Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1117eca46af7Smrg# ---------------------------------
1118eca46af7Smrg# Checks for linker and compiler features on darwin
1119eca46af7Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1120eca46af7Smrg[
1121eca46af7Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1122eca46af7Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1123eca46af7Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1124eca46af7Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1125eca46af7Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1126eca46af7Smrg  if test yes = "$lt_cv_ld_force_load"; then
1127eca46af7Smrg    _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\"`'
1128eca46af7Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1129eca46af7Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1130eca46af7Smrg  else
1131eca46af7Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1132eca46af7Smrg  fi
1133eca46af7Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1134eca46af7Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1135eca46af7Smrg  case $cc_basename in
1136eca46af7Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1137eca46af7Smrg     *) _lt_dar_can_shared=$GCC ;;
1138eca46af7Smrg  esac
1139eca46af7Smrg  if test yes = "$_lt_dar_can_shared"; then
1140eca46af7Smrg    output_verbose_link_cmd=func_echo_all
1141eca46af7Smrg    _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"
1142eca46af7Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1143eca46af7Smrg    _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"
1144eca46af7Smrg    _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"
1145eca46af7Smrg    m4_if([$1], [CXX],
1146eca46af7Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1147eca46af7Smrg      _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"
1148eca46af7Smrg      _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"
1149eca46af7Smrg    fi
1150eca46af7Smrg],[])
1151eca46af7Smrg  else
1152eca46af7Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1153eca46af7Smrg  fi
115414330f12Smrg])
115595b296d0Smrg
1156eca46af7Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1157eca46af7Smrg# ----------------------------------
1158eca46af7Smrg# Links a minimal program and checks the executable
1159eca46af7Smrg# for the system default hardcoded library path. In most cases,
1160eca46af7Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1161eca46af7Smrg# the location of the communication and MPI libs are included too.
1162eca46af7Smrg# If we don't find anything, use the default library path according
1163eca46af7Smrg# to the aix ld manual.
1164eca46af7Smrg# Store the results from the different compilers for each TAGNAME.
1165eca46af7Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1166eca46af7Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1167eca46af7Smrg[m4_require([_LT_DECL_SED])dnl
1168eca46af7Smrgif test set = "${lt_cv_aix_libpath+set}"; then
1169eca46af7Smrg  aix_libpath=$lt_cv_aix_libpath
1170eca46af7Smrgelse
1171eca46af7Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1172eca46af7Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1173eca46af7Smrg  lt_aix_libpath_sed='[
1174eca46af7Smrg      /Import File Strings/,/^$/ {
1175eca46af7Smrg	  /^0/ {
1176eca46af7Smrg	      s/^0  *\([^ ]*\) *$/\1/
1177eca46af7Smrg	      p
1178eca46af7Smrg	  }
1179eca46af7Smrg      }]'
1180eca46af7Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1181eca46af7Smrg  # Check for a 64-bit object if we didn't find anything.
1182eca46af7Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1183eca46af7Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1184eca46af7Smrg  fi],[])
1185eca46af7Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1186eca46af7Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1187eca46af7Smrg  fi
1188eca46af7Smrg  ])
1189eca46af7Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1190eca46af7Smrgfi
1191eca46af7Smrg])# _LT_SYS_MODULE_PATH_AIX
119295b296d0Smrg
119395b296d0Smrg
1194eca46af7Smrg# _LT_SHELL_INIT(ARG)
1195eca46af7Smrg# -------------------
1196eca46af7Smrgm4_define([_LT_SHELL_INIT],
1197eca46af7Smrg[m4_divert_text([M4SH-INIT], [$1
1198eca46af7Smrg])])# _LT_SHELL_INIT
119995b296d0Smrg
120095b296d0Smrg
120195b296d0Smrg
1202eca46af7Smrg# _LT_PROG_ECHO_BACKSLASH
1203eca46af7Smrg# -----------------------
1204eca46af7Smrg# Find how we can fake an echo command that does not interpret backslash.
1205eca46af7Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1206eca46af7Smrg# of the generated configure script that will find a shell with a builtin
1207eca46af7Smrg# printf (that we can use as an echo command).
1208eca46af7Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1209eca46af7Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1210eca46af7SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1211eca46af7SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
121295b296d0Smrg
1213eca46af7SmrgAC_MSG_CHECKING([how to print strings])
1214eca46af7Smrg# Test print first, because it will be a builtin if present.
1215eca46af7Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1216eca46af7Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1217eca46af7Smrg  ECHO='print -r --'
1218eca46af7Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1219eca46af7Smrg  ECHO='printf %s\n'
1220eca46af7Smrgelse
1221eca46af7Smrg  # Use this function as a fallback that always works.
1222eca46af7Smrg  func_fallback_echo ()
1223eca46af7Smrg  {
1224eca46af7Smrg    eval 'cat <<_LTECHO_EOF
1225eca46af7Smrg$[]1
1226eca46af7Smrg_LTECHO_EOF'
1227eca46af7Smrg  }
1228eca46af7Smrg  ECHO='func_fallback_echo'
1229eca46af7Smrgfi
123095b296d0Smrg
1231eca46af7Smrg# func_echo_all arg...
1232eca46af7Smrg# Invoke $ECHO with all args, space-separated.
1233eca46af7Smrgfunc_echo_all ()
1234eca46af7Smrg{
1235eca46af7Smrg    $ECHO "$*"
1236eca46af7Smrg}
123795b296d0Smrg
1238eca46af7Smrgcase $ECHO in
1239eca46af7Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1240eca46af7Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1241eca46af7Smrg  *) AC_MSG_RESULT([cat]) ;;
1242eca46af7Smrgesac
124395b296d0Smrg
1244eca46af7Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1245eca46af7Smrg[_AS_DETECT_SUGGESTED([
1246eca46af7Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1247eca46af7Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1248eca46af7Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1249eca46af7Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1250eca46af7Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1251eca46af7Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1252eca46af7Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
125395b296d0Smrg
1254eca46af7Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1255eca46af7Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1256eca46af7Smrg])# _LT_PROG_ECHO_BACKSLASH
125795b296d0Smrg
125895b296d0Smrg
1259eca46af7Smrg# _LT_WITH_SYSROOT
1260eca46af7Smrg# ----------------
1261eca46af7SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1262eca46af7Smrg[AC_MSG_CHECKING([for sysroot])
1263eca46af7SmrgAC_ARG_WITH([sysroot],
1264eca46af7Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1265eca46af7Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1266eca46af7Smrg   if not specified).])],
1267eca46af7Smrg[], [with_sysroot=no])
126895b296d0Smrg
1269eca46af7Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1270eca46af7Smrgdnl in case the user passed a directory name.
1271eca46af7Smrglt_sysroot=
1272eca46af7Smrgcase $with_sysroot in #(
1273eca46af7Smrg yes)
1274eca46af7Smrg   if test yes = "$GCC"; then
1275eca46af7Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1276eca46af7Smrg   fi
1277eca46af7Smrg   ;; #(
1278eca46af7Smrg /*)
1279eca46af7Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1280eca46af7Smrg   ;; #(
1281eca46af7Smrg no|'')
1282eca46af7Smrg   ;; #(
1283eca46af7Smrg *)
1284eca46af7Smrg   AC_MSG_RESULT([$with_sysroot])
1285eca46af7Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1286eca46af7Smrg   ;;
1287eca46af7Smrgesac
128895b296d0Smrg
1289eca46af7Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1290eca46af7Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1291eca46af7Smrg[dependent libraries, and where our libraries should be installed.])])
129295b296d0Smrg
1293eca46af7Smrg# _LT_ENABLE_LOCK
1294eca46af7Smrg# ---------------
1295eca46af7Smrgm4_defun([_LT_ENABLE_LOCK],
1296eca46af7Smrg[AC_ARG_ENABLE([libtool-lock],
1297eca46af7Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1298eca46af7Smrg    [avoid locking (might break parallel builds)])])
1299eca46af7Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
130095b296d0Smrg
1301eca46af7Smrg# Some flags need to be propagated to the compiler or linker for good
1302eca46af7Smrg# libtool support.
1303eca46af7Smrgcase $host in
1304eca46af7Smrgia64-*-hpux*)
1305eca46af7Smrg  # Find out what ABI is being produced by ac_compile, and set mode
1306eca46af7Smrg  # options accordingly.
1307eca46af7Smrg  echo 'int i;' > conftest.$ac_ext
1308eca46af7Smrg  if AC_TRY_EVAL(ac_compile); then
1309eca46af7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1310eca46af7Smrg      *ELF-32*)
1311eca46af7Smrg	HPUX_IA64_MODE=32
1312eca46af7Smrg	;;
1313eca46af7Smrg      *ELF-64*)
1314eca46af7Smrg	HPUX_IA64_MODE=64
1315eca46af7Smrg	;;
1316eca46af7Smrg    esac
1317eca46af7Smrg  fi
1318eca46af7Smrg  rm -rf conftest*
1319eca46af7Smrg  ;;
1320eca46af7Smrg*-*-irix6*)
1321eca46af7Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1322eca46af7Smrg  # options accordingly.
1323eca46af7Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1324eca46af7Smrg  if AC_TRY_EVAL(ac_compile); then
1325eca46af7Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1326eca46af7Smrg      case `/usr/bin/file conftest.$ac_objext` in
1327eca46af7Smrg	*32-bit*)
1328eca46af7Smrg	  LD="${LD-ld} -melf32bsmip"
1329eca46af7Smrg	  ;;
1330eca46af7Smrg	*N32*)
1331eca46af7Smrg	  LD="${LD-ld} -melf32bmipn32"
1332eca46af7Smrg	  ;;
1333eca46af7Smrg	*64-bit*)
1334eca46af7Smrg	  LD="${LD-ld} -melf64bmip"
1335eca46af7Smrg	;;
1336eca46af7Smrg      esac
1337eca46af7Smrg    else
1338eca46af7Smrg      case `/usr/bin/file conftest.$ac_objext` in
1339eca46af7Smrg	*32-bit*)
1340eca46af7Smrg	  LD="${LD-ld} -32"
1341eca46af7Smrg	  ;;
1342eca46af7Smrg	*N32*)
1343eca46af7Smrg	  LD="${LD-ld} -n32"
1344eca46af7Smrg	  ;;
1345eca46af7Smrg	*64-bit*)
1346eca46af7Smrg	  LD="${LD-ld} -64"
1347eca46af7Smrg	  ;;
1348eca46af7Smrg      esac
1349eca46af7Smrg    fi
1350eca46af7Smrg  fi
1351eca46af7Smrg  rm -rf conftest*
1352eca46af7Smrg  ;;
135395b296d0Smrg
1354eca46af7Smrgmips64*-*linux*)
1355eca46af7Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1356eca46af7Smrg  # options accordingly.
1357eca46af7Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1358eca46af7Smrg  if AC_TRY_EVAL(ac_compile); then
1359eca46af7Smrg    emul=elf
1360eca46af7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1361eca46af7Smrg      *32-bit*)
1362eca46af7Smrg	emul="${emul}32"
1363eca46af7Smrg	;;
1364eca46af7Smrg      *64-bit*)
1365eca46af7Smrg	emul="${emul}64"
1366eca46af7Smrg	;;
1367eca46af7Smrg    esac
1368eca46af7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1369eca46af7Smrg      *MSB*)
1370eca46af7Smrg	emul="${emul}btsmip"
1371eca46af7Smrg	;;
1372eca46af7Smrg      *LSB*)
1373eca46af7Smrg	emul="${emul}ltsmip"
1374eca46af7Smrg	;;
1375eca46af7Smrg    esac
1376eca46af7Smrg    case `/usr/bin/file conftest.$ac_objext` in
1377eca46af7Smrg      *N32*)
1378eca46af7Smrg	emul="${emul}n32"
1379eca46af7Smrg	;;
1380eca46af7Smrg    esac
1381eca46af7Smrg    LD="${LD-ld} -m $emul"
1382eca46af7Smrg  fi
1383eca46af7Smrg  rm -rf conftest*
1384eca46af7Smrg  ;;
138595b296d0Smrg
1386eca46af7Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1387eca46af7Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1388eca46af7Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1389eca46af7Smrg  # options accordingly.  Note that the listed cases only cover the
1390eca46af7Smrg  # situations where additional linker options are needed (such as when
1391eca46af7Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1392eca46af7Smrg  # vice versa); the common cases where no linker options are needed do
1393eca46af7Smrg  # not appear in the list.
1394eca46af7Smrg  echo 'int i;' > conftest.$ac_ext
1395eca46af7Smrg  if AC_TRY_EVAL(ac_compile); then
1396eca46af7Smrg    case `/usr/bin/file conftest.o` in
1397eca46af7Smrg      *32-bit*)
1398eca46af7Smrg	case $host in
1399eca46af7Smrg	  x86_64-*kfreebsd*-gnu)
1400eca46af7Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1401eca46af7Smrg	    ;;
1402eca46af7Smrg	  x86_64-*linux*)
1403eca46af7Smrg	    case `/usr/bin/file conftest.o` in
1404eca46af7Smrg	      *x86-64*)
1405eca46af7Smrg		LD="${LD-ld} -m elf32_x86_64"
1406eca46af7Smrg		;;
1407eca46af7Smrg	      *)
1408eca46af7Smrg		LD="${LD-ld} -m elf_i386"
1409eca46af7Smrg		;;
1410eca46af7Smrg	    esac
1411eca46af7Smrg	    ;;
1412eca46af7Smrg	  powerpc64le-*linux*)
1413eca46af7Smrg	    LD="${LD-ld} -m elf32lppclinux"
1414eca46af7Smrg	    ;;
1415eca46af7Smrg	  powerpc64-*linux*)
1416eca46af7Smrg	    LD="${LD-ld} -m elf32ppclinux"
1417eca46af7Smrg	    ;;
1418eca46af7Smrg	  s390x-*linux*)
1419eca46af7Smrg	    LD="${LD-ld} -m elf_s390"
1420eca46af7Smrg	    ;;
1421eca46af7Smrg	  sparc64-*linux*)
1422eca46af7Smrg	    LD="${LD-ld} -m elf32_sparc"
1423eca46af7Smrg	    ;;
1424eca46af7Smrg	esac
1425eca46af7Smrg	;;
1426eca46af7Smrg      *64-bit*)
1427eca46af7Smrg	case $host in
1428eca46af7Smrg	  x86_64-*kfreebsd*-gnu)
1429eca46af7Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1430eca46af7Smrg	    ;;
1431eca46af7Smrg	  x86_64-*linux*)
1432eca46af7Smrg	    LD="${LD-ld} -m elf_x86_64"
1433eca46af7Smrg	    ;;
1434eca46af7Smrg	  powerpcle-*linux*)
1435eca46af7Smrg	    LD="${LD-ld} -m elf64lppc"
1436eca46af7Smrg	    ;;
1437eca46af7Smrg	  powerpc-*linux*)
1438eca46af7Smrg	    LD="${LD-ld} -m elf64ppc"
1439eca46af7Smrg	    ;;
1440eca46af7Smrg	  s390*-*linux*|s390*-*tpf*)
1441eca46af7Smrg	    LD="${LD-ld} -m elf64_s390"
1442eca46af7Smrg	    ;;
1443eca46af7Smrg	  sparc*-*linux*)
1444eca46af7Smrg	    LD="${LD-ld} -m elf64_sparc"
1445eca46af7Smrg	    ;;
1446eca46af7Smrg	esac
1447eca46af7Smrg	;;
1448eca46af7Smrg    esac
1449eca46af7Smrg  fi
1450eca46af7Smrg  rm -rf conftest*
1451eca46af7Smrg  ;;
145295b296d0Smrg
1453eca46af7Smrg*-*-sco3.2v5*)
1454eca46af7Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1455eca46af7Smrg  SAVE_CFLAGS=$CFLAGS
1456eca46af7Smrg  CFLAGS="$CFLAGS -belf"
1457eca46af7Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1458eca46af7Smrg    [AC_LANG_PUSH(C)
1459eca46af7Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1460eca46af7Smrg     AC_LANG_POP])
1461eca46af7Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
1462eca46af7Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1463eca46af7Smrg    CFLAGS=$SAVE_CFLAGS
1464eca46af7Smrg  fi
1465eca46af7Smrg  ;;
1466eca46af7Smrg*-*solaris*)
1467eca46af7Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1468eca46af7Smrg  # options accordingly.
1469eca46af7Smrg  echo 'int i;' > conftest.$ac_ext
1470eca46af7Smrg  if AC_TRY_EVAL(ac_compile); then
1471eca46af7Smrg    case `/usr/bin/file conftest.o` in
1472eca46af7Smrg    *64-bit*)
1473eca46af7Smrg      case $lt_cv_prog_gnu_ld in
1474eca46af7Smrg      yes*)
1475eca46af7Smrg        case $host in
1476eca46af7Smrg        i?86-*-solaris*|x86_64-*-solaris*)
1477eca46af7Smrg          LD="${LD-ld} -m elf_x86_64"
1478eca46af7Smrg          ;;
1479eca46af7Smrg        sparc*-*-solaris*)
1480eca46af7Smrg          LD="${LD-ld} -m elf64_sparc"
1481eca46af7Smrg          ;;
1482eca46af7Smrg        esac
1483eca46af7Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1484eca46af7Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1485eca46af7Smrg          LD=${LD-ld}_sol2
1486eca46af7Smrg        fi
1487eca46af7Smrg        ;;
1488eca46af7Smrg      *)
1489eca46af7Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1490eca46af7Smrg	  LD="${LD-ld} -64"
1491eca46af7Smrg	fi
1492eca46af7Smrg	;;
1493eca46af7Smrg      esac
1494eca46af7Smrg      ;;
1495eca46af7Smrg    esac
1496eca46af7Smrg  fi
1497eca46af7Smrg  rm -rf conftest*
1498eca46af7Smrg  ;;
1499eca46af7Smrgesac
150095b296d0Smrg
1501eca46af7Smrgneed_locks=$enable_libtool_lock
1502eca46af7Smrg])# _LT_ENABLE_LOCK
150395b296d0Smrg
150495b296d0Smrg
1505eca46af7Smrg# _LT_PROG_AR
1506eca46af7Smrg# -----------
1507eca46af7Smrgm4_defun([_LT_PROG_AR],
1508eca46af7Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1509eca46af7Smrg: ${AR=ar}
1510eca46af7Smrg: ${AR_FLAGS=cru}
1511eca46af7Smrg_LT_DECL([], [AR], [1], [The archiver])
1512eca46af7Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
151339713583Smrg
1514eca46af7SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1515eca46af7Smrg  [lt_cv_ar_at_file=no
1516eca46af7Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1517eca46af7Smrg     [echo conftest.$ac_objext > conftest.lst
1518eca46af7Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1519eca46af7Smrg      AC_TRY_EVAL([lt_ar_try])
1520eca46af7Smrg      if test 0 -eq "$ac_status"; then
1521eca46af7Smrg	# Ensure the archiver fails upon bogus file names.
1522eca46af7Smrg	rm -f conftest.$ac_objext libconftest.a
1523eca46af7Smrg	AC_TRY_EVAL([lt_ar_try])
1524eca46af7Smrg	if test 0 -ne "$ac_status"; then
1525eca46af7Smrg          lt_cv_ar_at_file=@
1526eca46af7Smrg        fi
1527eca46af7Smrg      fi
1528eca46af7Smrg      rm -f conftest.* libconftest.a
1529eca46af7Smrg     ])
1530eca46af7Smrg  ])
15312378475aSmrg
1532eca46af7Smrgif test no = "$lt_cv_ar_at_file"; then
1533eca46af7Smrg  archiver_list_spec=
1534eca46af7Smrgelse
1535eca46af7Smrg  archiver_list_spec=$lt_cv_ar_at_file
1536eca46af7Smrgfi
1537eca46af7Smrg_LT_DECL([], [archiver_list_spec], [1],
1538eca46af7Smrg  [How to feed a file listing to the archiver])
1539eca46af7Smrg])# _LT_PROG_AR
154095b296d0Smrg
154195b296d0Smrg
1542eca46af7Smrg# _LT_CMD_OLD_ARCHIVE
1543eca46af7Smrg# -------------------
1544eca46af7Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1545eca46af7Smrg[_LT_PROG_AR
154695b296d0Smrg
1547eca46af7SmrgAC_CHECK_TOOL(STRIP, strip, :)
1548eca46af7Smrgtest -z "$STRIP" && STRIP=:
1549eca46af7Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
155095b296d0Smrg
1551eca46af7SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1552eca46af7Smrgtest -z "$RANLIB" && RANLIB=:
1553eca46af7Smrg_LT_DECL([], [RANLIB], [1],
1554eca46af7Smrg    [Commands used to install an old-style archive])
155595b296d0Smrg
1556eca46af7Smrg# Determine commands to create old-style static archives.
1557eca46af7Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1558eca46af7Smrgold_postinstall_cmds='chmod 644 $oldlib'
1559eca46af7Smrgold_postuninstall_cmds=
156095b296d0Smrg
1561eca46af7Smrgif test -n "$RANLIB"; then
1562eca46af7Smrg  case $host_os in
1563eca46af7Smrg  bitrig* | openbsd*)
1564eca46af7Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1565eca46af7Smrg    ;;
1566eca46af7Smrg  *)
1567eca46af7Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1568eca46af7Smrg    ;;
1569eca46af7Smrg  esac
1570eca46af7Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1571eca46af7Smrgfi
157295b296d0Smrg
1573eca46af7Smrgcase $host_os in
1574eca46af7Smrg  darwin*)
1575eca46af7Smrg    lock_old_archive_extraction=yes ;;
1576eca46af7Smrg  *)
1577eca46af7Smrg    lock_old_archive_extraction=no ;;
1578eca46af7Smrgesac
1579eca46af7Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1580eca46af7Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1581eca46af7Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1582eca46af7Smrg    [Commands used to build an old-style archive])
1583eca46af7Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1584eca46af7Smrg    [Whether to use a lock for old archive extraction])
1585eca46af7Smrg])# _LT_CMD_OLD_ARCHIVE
158695b296d0Smrg
158795b296d0Smrg
1588eca46af7Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1589eca46af7Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1590eca46af7Smrg# ----------------------------------------------------------------
1591eca46af7Smrg# Check whether the given compiler option works
1592eca46af7SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1593eca46af7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1594eca46af7Smrgm4_require([_LT_DECL_SED])dnl
1595eca46af7SmrgAC_CACHE_CHECK([$1], [$2],
1596eca46af7Smrg  [$2=no
1597eca46af7Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1598eca46af7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1599eca46af7Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1600eca46af7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1601eca46af7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1602eca46af7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1603eca46af7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1604eca46af7Smrg   # The option is referenced via a variable to avoid confusing sed.
1605eca46af7Smrg   lt_compile=`echo "$ac_compile" | $SED \
1606eca46af7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1607eca46af7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1608eca46af7Smrg   -e 's:$: $lt_compiler_flag:'`
1609eca46af7Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1610eca46af7Smrg   (eval "$lt_compile" 2>conftest.err)
1611eca46af7Smrg   ac_status=$?
1612eca46af7Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1613eca46af7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1614eca46af7Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1615eca46af7Smrg     # The compiler can only warn and ignore the option if not recognized
1616eca46af7Smrg     # So say no if there are warnings other than the usual output.
1617eca46af7Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1618eca46af7Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1619eca46af7Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1620eca46af7Smrg       $2=yes
1621eca46af7Smrg     fi
1622eca46af7Smrg   fi
1623eca46af7Smrg   $RM conftest*
1624eca46af7Smrg])
162595b296d0Smrg
1626eca46af7Smrgif test yes = "[$]$2"; then
1627eca46af7Smrg    m4_if([$5], , :, [$5])
1628eca46af7Smrgelse
1629eca46af7Smrg    m4_if([$6], , :, [$6])
1630eca46af7Smrgfi
1631eca46af7Smrg])# _LT_COMPILER_OPTION
163295b296d0Smrg
1633eca46af7Smrg# Old name:
1634eca46af7SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1635eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
1636eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
163795b296d0Smrg
163895b296d0Smrg
1639eca46af7Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1640eca46af7Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1641eca46af7Smrg# ----------------------------------------------------
1642eca46af7Smrg# Check whether the given linker option works
1643eca46af7SmrgAC_DEFUN([_LT_LINKER_OPTION],
1644eca46af7Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1645eca46af7Smrgm4_require([_LT_DECL_SED])dnl
1646eca46af7SmrgAC_CACHE_CHECK([$1], [$2],
1647eca46af7Smrg  [$2=no
1648eca46af7Smrg   save_LDFLAGS=$LDFLAGS
1649eca46af7Smrg   LDFLAGS="$LDFLAGS $3"
1650eca46af7Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1651eca46af7Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1652eca46af7Smrg     # The linker can only warn and ignore the option if not recognized
1653eca46af7Smrg     # So say no if there are warnings
1654eca46af7Smrg     if test -s conftest.err; then
1655eca46af7Smrg       # Append any errors to the config.log.
1656eca46af7Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1657eca46af7Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1658eca46af7Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1659eca46af7Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1660eca46af7Smrg         $2=yes
1661eca46af7Smrg       fi
1662eca46af7Smrg     else
1663eca46af7Smrg       $2=yes
1664eca46af7Smrg     fi
1665eca46af7Smrg   fi
1666eca46af7Smrg   $RM -r conftest*
1667eca46af7Smrg   LDFLAGS=$save_LDFLAGS
166814330f12Smrg])
166995b296d0Smrg
1670eca46af7Smrgif test yes = "[$]$2"; then
1671eca46af7Smrg    m4_if([$4], , :, [$4])
1672eca46af7Smrgelse
1673eca46af7Smrg    m4_if([$5], , :, [$5])
1674eca46af7Smrgfi
1675eca46af7Smrg])# _LT_LINKER_OPTION
167695b296d0Smrg
1677eca46af7Smrg# Old name:
1678eca46af7SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1679eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
1680eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
168195b296d0Smrg
168295b296d0Smrg
1683eca46af7Smrg# LT_CMD_MAX_LEN
1684eca46af7Smrg#---------------
1685eca46af7SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1686eca46af7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1687eca46af7Smrg# find the maximum length of command line arguments
1688eca46af7SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1689eca46af7SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1690eca46af7Smrg  i=0
1691eca46af7Smrg  teststring=ABCD
169295b296d0Smrg
1693eca46af7Smrg  case $build_os in
1694eca46af7Smrg  msdosdjgpp*)
1695eca46af7Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1696eca46af7Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1697eca46af7Smrg    # during glob expansion).  Even if it were fixed, the result of this
1698eca46af7Smrg    # check would be larger than it should be.
1699eca46af7Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1700eca46af7Smrg    ;;
170195b296d0Smrg
1702eca46af7Smrg  gnu*)
1703eca46af7Smrg    # Under GNU Hurd, this test is not required because there is
1704eca46af7Smrg    # no limit to the length of command line arguments.
1705eca46af7Smrg    # Libtool will interpret -1 as no limit whatsoever
1706eca46af7Smrg    lt_cv_sys_max_cmd_len=-1;
1707eca46af7Smrg    ;;
170895b296d0Smrg
1709eca46af7Smrg  cygwin* | mingw* | cegcc*)
1710eca46af7Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1711eca46af7Smrg    # about 5 minutes as the teststring grows exponentially.
1712eca46af7Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1713eca46af7Smrg    # you end up with a "frozen" computer, even though with patience
1714eca46af7Smrg    # the test eventually succeeds (with a max line length of 256k).
1715eca46af7Smrg    # Instead, let's just punt: use the minimum linelength reported by
1716eca46af7Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1717eca46af7Smrg    lt_cv_sys_max_cmd_len=8192;
1718eca46af7Smrg    ;;
171995b296d0Smrg
1720eca46af7Smrg  mint*)
1721eca46af7Smrg    # On MiNT this can take a long time and run out of memory.
1722eca46af7Smrg    lt_cv_sys_max_cmd_len=8192;
1723eca46af7Smrg    ;;
172495b296d0Smrg
1725eca46af7Smrg  amigaos*)
1726eca46af7Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1727eca46af7Smrg    # So we just punt and use a minimum line length of 8192.
1728eca46af7Smrg    lt_cv_sys_max_cmd_len=8192;
1729eca46af7Smrg    ;;
173095b296d0Smrg
1731eca46af7Smrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1732eca46af7Smrg    # This has been around since 386BSD, at least.  Likely further.
1733eca46af7Smrg    if test -x /sbin/sysctl; then
1734eca46af7Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1735eca46af7Smrg    elif test -x /usr/sbin/sysctl; then
1736eca46af7Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
1737eca46af7Smrg    else
1738eca46af7Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
1739eca46af7Smrg    fi
1740eca46af7Smrg    # And add a safety zone
1741eca46af7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1742eca46af7Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1743eca46af7Smrg    ;;
174495b296d0Smrg
1745eca46af7Smrg  interix*)
1746eca46af7Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1747eca46af7Smrg    lt_cv_sys_max_cmd_len=196608
1748eca46af7Smrg    ;;
174995b296d0Smrg
1750eca46af7Smrg  os2*)
1751eca46af7Smrg    # The test takes a long time on OS/2.
1752eca46af7Smrg    lt_cv_sys_max_cmd_len=8192
1753eca46af7Smrg    ;;
175495b296d0Smrg
1755eca46af7Smrg  osf*)
1756eca46af7Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1757eca46af7Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1758eca46af7Smrg    # nice to cause kernel panics so lets avoid the loop below.
1759eca46af7Smrg    # First set a reasonable default.
1760eca46af7Smrg    lt_cv_sys_max_cmd_len=16384
1761eca46af7Smrg    #
1762eca46af7Smrg    if test -x /sbin/sysconfig; then
1763eca46af7Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1764eca46af7Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1765eca46af7Smrg      esac
1766eca46af7Smrg    fi
1767eca46af7Smrg    ;;
1768eca46af7Smrg  sco3.2v5*)
1769eca46af7Smrg    lt_cv_sys_max_cmd_len=102400
1770eca46af7Smrg    ;;
1771eca46af7Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1772eca46af7Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1773eca46af7Smrg    if test -n "$kargmax"; then
1774eca46af7Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1775eca46af7Smrg    else
1776eca46af7Smrg      lt_cv_sys_max_cmd_len=32768
1777eca46af7Smrg    fi
1778eca46af7Smrg    ;;
1779eca46af7Smrg  *)
1780eca46af7Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1781eca46af7Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1782eca46af7Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1783eca46af7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1784eca46af7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1785eca46af7Smrg    else
1786eca46af7Smrg      # Make teststring a little bigger before we do anything with it.
1787eca46af7Smrg      # a 1K string should be a reasonable start.
1788eca46af7Smrg      for i in 1 2 3 4 5 6 7 8; do
1789eca46af7Smrg        teststring=$teststring$teststring
1790eca46af7Smrg      done
1791eca46af7Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1792eca46af7Smrg      # If test is not a shell built-in, we'll probably end up computing a
1793eca46af7Smrg      # maximum length that is only half of the actual maximum length, but
1794eca46af7Smrg      # we can't tell.
1795eca46af7Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1796eca46af7Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1797eca46af7Smrg	      test 17 != "$i" # 1/2 MB should be enough
1798eca46af7Smrg      do
1799eca46af7Smrg        i=`expr $i + 1`
1800eca46af7Smrg        teststring=$teststring$teststring
1801eca46af7Smrg      done
1802eca46af7Smrg      # Only check the string length outside the loop.
1803eca46af7Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1804eca46af7Smrg      teststring=
1805eca46af7Smrg      # Add a significant safety factor because C++ compilers can tack on
1806eca46af7Smrg      # massive amounts of additional arguments before passing them to the
1807eca46af7Smrg      # linker.  It appears as though 1/2 is a usable value.
1808eca46af7Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1809eca46af7Smrg    fi
1810eca46af7Smrg    ;;
1811eca46af7Smrg  esac
1812eca46af7Smrg])
1813eca46af7Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
1814eca46af7Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
1815eca46af7Smrgelse
1816eca46af7Smrg  AC_MSG_RESULT(none)
181714330f12Smrgfi
1818eca46af7Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1819eca46af7Smrg_LT_DECL([], [max_cmd_len], [0],
1820eca46af7Smrg    [What is the maximum length of a command?])
1821eca46af7Smrg])# LT_CMD_MAX_LEN
182295b296d0Smrg
1823eca46af7Smrg# Old name:
1824eca46af7SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1825eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
1826eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
182795b296d0Smrg
182895b296d0Smrg
1829eca46af7Smrg# _LT_HEADER_DLFCN
1830eca46af7Smrg# ----------------
1831eca46af7Smrgm4_defun([_LT_HEADER_DLFCN],
1832eca46af7Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1833eca46af7Smrg])# _LT_HEADER_DLFCN
183495b296d0Smrg
183595b296d0Smrg
1836eca46af7Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1837eca46af7Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1838eca46af7Smrg# ----------------------------------------------------------------
1839eca46af7Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1840eca46af7Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1841eca46af7Smrgif test yes = "$cross_compiling"; then :
1842eca46af7Smrg  [$4]
1843eca46af7Smrgelse
1844eca46af7Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1845eca46af7Smrg  lt_status=$lt_dlunknown
1846eca46af7Smrg  cat > conftest.$ac_ext <<_LT_EOF
1847eca46af7Smrg[#line $LINENO "configure"
1848eca46af7Smrg#include "confdefs.h"
184995b296d0Smrg
1850eca46af7Smrg#if HAVE_DLFCN_H
1851eca46af7Smrg#include <dlfcn.h>
1852eca46af7Smrg#endif
185314330f12Smrg
1854eca46af7Smrg#include <stdio.h>
185514330f12Smrg
1856eca46af7Smrg#ifdef RTLD_GLOBAL
1857eca46af7Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1858eca46af7Smrg#else
1859eca46af7Smrg#  ifdef DL_GLOBAL
1860eca46af7Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1861eca46af7Smrg#  else
1862eca46af7Smrg#    define LT_DLGLOBAL		0
1863eca46af7Smrg#  endif
1864eca46af7Smrg#endif
186514330f12Smrg
1866eca46af7Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1867eca46af7Smrg   find out it does not work in some platform. */
1868eca46af7Smrg#ifndef LT_DLLAZY_OR_NOW
1869eca46af7Smrg#  ifdef RTLD_LAZY
1870eca46af7Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1871eca46af7Smrg#  else
1872eca46af7Smrg#    ifdef DL_LAZY
1873eca46af7Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1874eca46af7Smrg#    else
1875eca46af7Smrg#      ifdef RTLD_NOW
1876eca46af7Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1877eca46af7Smrg#      else
1878eca46af7Smrg#        ifdef DL_NOW
1879eca46af7Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1880eca46af7Smrg#        else
1881eca46af7Smrg#          define LT_DLLAZY_OR_NOW	0
1882eca46af7Smrg#        endif
1883eca46af7Smrg#      endif
1884eca46af7Smrg#    endif
1885eca46af7Smrg#  endif
1886eca46af7Smrg#endif
188714330f12Smrg
1888eca46af7Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
1889eca46af7Smrg   correspondingly for the symbols needed.  */
1890eca46af7Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1891eca46af7Smrgint fnord () __attribute__((visibility("default")));
1892eca46af7Smrg#endif
189395b296d0Smrg
1894eca46af7Smrgint fnord () { return 42; }
1895eca46af7Smrgint main ()
1896eca46af7Smrg{
1897eca46af7Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1898eca46af7Smrg  int status = $lt_dlunknown;
189995b296d0Smrg
1900eca46af7Smrg  if (self)
1901eca46af7Smrg    {
1902eca46af7Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1903eca46af7Smrg      else
1904eca46af7Smrg        {
1905eca46af7Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1906eca46af7Smrg          else puts (dlerror ());
1907eca46af7Smrg	}
1908eca46af7Smrg      /* dlclose (self); */
1909eca46af7Smrg    }
1910eca46af7Smrg  else
1911eca46af7Smrg    puts (dlerror ());
191295b296d0Smrg
1913eca46af7Smrg  return status;
1914eca46af7Smrg}]
1915eca46af7Smrg_LT_EOF
1916eca46af7Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1917eca46af7Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1918eca46af7Smrg    lt_status=$?
1919eca46af7Smrg    case x$lt_status in
1920eca46af7Smrg      x$lt_dlno_uscore) $1 ;;
1921eca46af7Smrg      x$lt_dlneed_uscore) $2 ;;
1922eca46af7Smrg      x$lt_dlunknown|x*) $3 ;;
1923eca46af7Smrg    esac
1924eca46af7Smrg  else :
1925eca46af7Smrg    # compilation failed
1926eca46af7Smrg    $3
1927eca46af7Smrg  fi
1928eca46af7Smrgfi
1929eca46af7Smrgrm -fr conftest*
1930eca46af7Smrg])# _LT_TRY_DLOPEN_SELF
19312378475aSmrg
19322378475aSmrg
1933eca46af7Smrg# LT_SYS_DLOPEN_SELF
1934eca46af7Smrg# ------------------
1935eca46af7SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1936eca46af7Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1937eca46af7Smrgif test yes != "$enable_dlopen"; then
1938eca46af7Smrg  enable_dlopen=unknown
1939eca46af7Smrg  enable_dlopen_self=unknown
1940eca46af7Smrg  enable_dlopen_self_static=unknown
1941eca46af7Smrgelse
1942eca46af7Smrg  lt_cv_dlopen=no
1943eca46af7Smrg  lt_cv_dlopen_libs=
194495b296d0Smrg
1945eca46af7Smrg  case $host_os in
1946eca46af7Smrg  beos*)
1947eca46af7Smrg    lt_cv_dlopen=load_add_on
1948eca46af7Smrg    lt_cv_dlopen_libs=
1949eca46af7Smrg    lt_cv_dlopen_self=yes
1950eca46af7Smrg    ;;
195195b296d0Smrg
1952eca46af7Smrg  mingw* | pw32* | cegcc*)
1953eca46af7Smrg    lt_cv_dlopen=LoadLibrary
1954eca46af7Smrg    lt_cv_dlopen_libs=
1955eca46af7Smrg    ;;
195695b296d0Smrg
1957eca46af7Smrg  cygwin*)
1958eca46af7Smrg    lt_cv_dlopen=dlopen
1959eca46af7Smrg    lt_cv_dlopen_libs=
1960eca46af7Smrg    ;;
196195b296d0Smrg
1962eca46af7Smrg  darwin*)
1963eca46af7Smrg    # if libdl is installed we need to link against it
1964eca46af7Smrg    AC_CHECK_LIB([dl], [dlopen],
1965eca46af7Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1966eca46af7Smrg    lt_cv_dlopen=dyld
1967eca46af7Smrg    lt_cv_dlopen_libs=
1968eca46af7Smrg    lt_cv_dlopen_self=yes
1969eca46af7Smrg    ])
1970eca46af7Smrg    ;;
197195b296d0Smrg
1972eca46af7Smrg  tpf*)
1973eca46af7Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
1974eca46af7Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1975eca46af7Smrg    lt_cv_dlopen=dlopen
1976eca46af7Smrg    lt_cv_dlopen_libs=
1977eca46af7Smrg    lt_cv_dlopen_self=no
1978eca46af7Smrg    ;;
197995b296d0Smrg
1980eca46af7Smrg  *)
1981eca46af7Smrg    AC_CHECK_FUNC([shl_load],
1982eca46af7Smrg	  [lt_cv_dlopen=shl_load],
1983eca46af7Smrg      [AC_CHECK_LIB([dld], [shl_load],
1984eca46af7Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1985eca46af7Smrg	[AC_CHECK_FUNC([dlopen],
1986eca46af7Smrg	      [lt_cv_dlopen=dlopen],
1987eca46af7Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1988eca46af7Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1989eca46af7Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1990eca46af7Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1991eca46af7Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1992eca46af7Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1993eca46af7Smrg	      ])
1994eca46af7Smrg	    ])
1995eca46af7Smrg	  ])
1996eca46af7Smrg	])
1997eca46af7Smrg      ])
1998eca46af7Smrg    ;;
1999eca46af7Smrg  esac
200095b296d0Smrg
2001eca46af7Smrg  if test no = "$lt_cv_dlopen"; then
2002eca46af7Smrg    enable_dlopen=no
2003eca46af7Smrg  else
2004eca46af7Smrg    enable_dlopen=yes
2005eca46af7Smrg  fi
200695b296d0Smrg
2007eca46af7Smrg  case $lt_cv_dlopen in
2008eca46af7Smrg  dlopen)
2009eca46af7Smrg    save_CPPFLAGS=$CPPFLAGS
2010eca46af7Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
201195b296d0Smrg
2012eca46af7Smrg    save_LDFLAGS=$LDFLAGS
2013eca46af7Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2014ff89ac2bSmrg
2015eca46af7Smrg    save_LIBS=$LIBS
2016eca46af7Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
201795b296d0Smrg
2018eca46af7Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2019eca46af7Smrg	  lt_cv_dlopen_self, [dnl
2020eca46af7Smrg	  _LT_TRY_DLOPEN_SELF(
2021eca46af7Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2022eca46af7Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2023eca46af7Smrg    ])
202495b296d0Smrg
2025eca46af7Smrg    if test yes = "$lt_cv_dlopen_self"; then
2026eca46af7Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2027eca46af7Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2028eca46af7Smrg	  lt_cv_dlopen_self_static, [dnl
2029eca46af7Smrg	  _LT_TRY_DLOPEN_SELF(
2030eca46af7Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2031eca46af7Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2032eca46af7Smrg      ])
2033eca46af7Smrg    fi
203495b296d0Smrg
2035eca46af7Smrg    CPPFLAGS=$save_CPPFLAGS
2036eca46af7Smrg    LDFLAGS=$save_LDFLAGS
2037eca46af7Smrg    LIBS=$save_LIBS
2038eca46af7Smrg    ;;
2039eca46af7Smrg  esac
204095b296d0Smrg
2041eca46af7Smrg  case $lt_cv_dlopen_self in
2042eca46af7Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2043eca46af7Smrg  *) enable_dlopen_self=unknown ;;
2044eca46af7Smrg  esac
204595b296d0Smrg
2046eca46af7Smrg  case $lt_cv_dlopen_self_static in
2047eca46af7Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2048eca46af7Smrg  *) enable_dlopen_self_static=unknown ;;
2049eca46af7Smrg  esac
2050eca46af7Smrgfi
2051eca46af7Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2052eca46af7Smrg	 [Whether dlopen is supported])
2053eca46af7Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2054eca46af7Smrg	 [Whether dlopen of programs is supported])
2055eca46af7Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2056eca46af7Smrg	 [Whether dlopen of statically linked programs is supported])
2057eca46af7Smrg])# LT_SYS_DLOPEN_SELF
205895b296d0Smrg
2059eca46af7Smrg# Old name:
2060eca46af7SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
206114330f12Smrgdnl aclocal-1.4 backwards compatibility:
2062eca46af7Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
20632378475aSmrg
206495b296d0Smrg
2065eca46af7Smrg# _LT_COMPILER_C_O([TAGNAME])
2066eca46af7Smrg# ---------------------------
2067eca46af7Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
2068eca46af7Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2069eca46af7Smrgm4_defun([_LT_COMPILER_C_O],
2070eca46af7Smrg[m4_require([_LT_DECL_SED])dnl
2071eca46af7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2072eca46af7Smrgm4_require([_LT_TAG_COMPILER])dnl
2073eca46af7SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2074eca46af7Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2075eca46af7Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2076eca46af7Smrg   $RM -r conftest 2>/dev/null
2077eca46af7Smrg   mkdir conftest
2078eca46af7Smrg   cd conftest
2079eca46af7Smrg   mkdir out
2080eca46af7Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
208195b296d0Smrg
2082eca46af7Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
2083eca46af7Smrg   # Insert the option either (1) after the last *FLAGS variable, or
2084eca46af7Smrg   # (2) before a word containing "conftest.", or (3) at the end.
2085eca46af7Smrg   # Note that $ac_compile itself does not contain backslashes and begins
2086eca46af7Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
2087eca46af7Smrg   lt_compile=`echo "$ac_compile" | $SED \
2088eca46af7Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2089eca46af7Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
2090eca46af7Smrg   -e 's:$: $lt_compiler_flag:'`
2091eca46af7Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2092eca46af7Smrg   (eval "$lt_compile" 2>out/conftest.err)
2093eca46af7Smrg   ac_status=$?
2094eca46af7Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2095eca46af7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2096eca46af7Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2097eca46af7Smrg   then
2098eca46af7Smrg     # The compiler can only warn and ignore the option if not recognized
2099eca46af7Smrg     # So say no if there are warnings
2100eca46af7Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2101eca46af7Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2102eca46af7Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2103eca46af7Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
2104eca46af7Smrg     fi
2105eca46af7Smrg   fi
2106eca46af7Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2107eca46af7Smrg   $RM conftest*
2108eca46af7Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2109eca46af7Smrg   # template instantiation
2110eca46af7Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2111eca46af7Smrg   $RM out/* && rmdir out
2112eca46af7Smrg   cd ..
2113eca46af7Smrg   $RM -r conftest
2114eca46af7Smrg   $RM conftest*
2115eca46af7Smrg])
2116eca46af7Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2117eca46af7Smrg	[Does compiler simultaneously support -c and -o options?])
2118eca46af7Smrg])# _LT_COMPILER_C_O
211995b296d0Smrg
212039713583Smrg
2121eca46af7Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2122eca46af7Smrg# ----------------------------------
2123eca46af7Smrg# Check to see if we can do hard links to lock some files if needed
2124eca46af7Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2125eca46af7Smrg[m4_require([_LT_ENABLE_LOCK])dnl
2126eca46af7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2127eca46af7Smrg_LT_COMPILER_C_O([$1])
21282378475aSmrg
2129eca46af7Smrghard_links=nottested
2130eca46af7Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2131eca46af7Smrg  # do not overwrite the value of need_locks provided by the user
2132eca46af7Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2133eca46af7Smrg  hard_links=yes
2134eca46af7Smrg  $RM conftest*
2135eca46af7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2136eca46af7Smrg  touch conftest.a
2137eca46af7Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2138eca46af7Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2139eca46af7Smrg  AC_MSG_RESULT([$hard_links])
2140eca46af7Smrg  if test no = "$hard_links"; then
2141eca46af7Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2142eca46af7Smrg    need_locks=warn
2143eca46af7Smrg  fi
2144eca46af7Smrgelse
2145eca46af7Smrg  need_locks=no
2146eca46af7Smrgfi
2147eca46af7Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2148eca46af7Smrg])# _LT_COMPILER_FILE_LOCKS
214995b296d0Smrg
21502378475aSmrg
2151eca46af7Smrg# _LT_CHECK_OBJDIR
2152eca46af7Smrg# ----------------
2153eca46af7Smrgm4_defun([_LT_CHECK_OBJDIR],
2154eca46af7Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2155eca46af7Smrg[rm -f .libs 2>/dev/null
2156eca46af7Smrgmkdir .libs 2>/dev/null
2157eca46af7Smrgif test -d .libs; then
2158eca46af7Smrg  lt_cv_objdir=.libs
2159eca46af7Smrgelse
2160eca46af7Smrg  # MS-DOS does not allow filenames that begin with a dot.
2161eca46af7Smrg  lt_cv_objdir=_libs
2162eca46af7Smrgfi
2163eca46af7Smrgrmdir .libs 2>/dev/null])
2164eca46af7Smrgobjdir=$lt_cv_objdir
2165eca46af7Smrg_LT_DECL([], [objdir], [0],
2166eca46af7Smrg         [The name of the directory that contains temporary libtool files])dnl
2167eca46af7Smrgm4_pattern_allow([LT_OBJDIR])dnl
2168eca46af7SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2169eca46af7Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2170eca46af7Smrg])# _LT_CHECK_OBJDIR
21712378475aSmrg
217214330f12Smrg
2173eca46af7Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2174eca46af7Smrg# --------------------------------------
2175eca46af7Smrg# Check hardcoding attributes.
2176eca46af7Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2177eca46af7Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2178eca46af7Smrg_LT_TAGVAR(hardcode_action, $1)=
2179eca46af7Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2180eca46af7Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2181eca46af7Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
218214330f12Smrg
2183eca46af7Smrg  # We can hardcode non-existent directories.
2184eca46af7Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2185eca46af7Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2186eca46af7Smrg     # have to relink, otherwise we might link with an installed library
2187eca46af7Smrg     # when we should be linking with a yet-to-be-installed one
2188eca46af7Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2189eca46af7Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2190eca46af7Smrg    # Linking always hardcodes the temporary library directory.
2191eca46af7Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
219214330f12Smrg  else
2193eca46af7Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2194eca46af7Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
219514330f12Smrg  fi
219695b296d0Smrgelse
2197eca46af7Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2198eca46af7Smrg  # directories.
2199eca46af7Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
220095b296d0Smrgfi
2201eca46af7SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
22022378475aSmrg
2203eca46af7Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2204eca46af7Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2205eca46af7Smrg  # Fast installation is not supported
2206eca46af7Smrg  enable_fast_install=no
2207eca46af7Smrgelif test yes = "$shlibpath_overrides_runpath" ||
2208eca46af7Smrg     test no = "$enable_shared"; then
2209eca46af7Smrg  # Fast installation is not necessary
2210eca46af7Smrg  enable_fast_install=needless
2211eca46af7Smrgfi
2212eca46af7Smrg_LT_TAGDECL([], [hardcode_action], [0],
2213eca46af7Smrg    [How to hardcode a shared library path into an executable])
2214eca46af7Smrg])# _LT_LINKER_HARDCODE_LIBPATH
221595b296d0Smrg
221614330f12Smrg
2217eca46af7Smrg# _LT_CMD_STRIPLIB
2218eca46af7Smrg# ----------------
2219eca46af7Smrgm4_defun([_LT_CMD_STRIPLIB],
2220eca46af7Smrg[m4_require([_LT_DECL_EGREP])
2221eca46af7Smrgstriplib=
2222eca46af7Smrgold_striplib=
2223eca46af7SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2224eca46af7Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2225eca46af7Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2226eca46af7Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2227eca46af7Smrg  AC_MSG_RESULT([yes])
222814330f12Smrgelse
2229eca46af7Smrg# FIXME - insert some real tests, host_os isn't really good enough
2230eca46af7Smrg  case $host_os in
2231eca46af7Smrg  darwin*)
2232eca46af7Smrg    if test -n "$STRIP"; then
2233eca46af7Smrg      striplib="$STRIP -x"
2234eca46af7Smrg      old_striplib="$STRIP -S"
2235eca46af7Smrg      AC_MSG_RESULT([yes])
2236eca46af7Smrg    else
2237eca46af7Smrg      AC_MSG_RESULT([no])
2238eca46af7Smrg    fi
2239eca46af7Smrg    ;;
2240eca46af7Smrg  *)
2241eca46af7Smrg    AC_MSG_RESULT([no])
2242eca46af7Smrg    ;;
2243eca46af7Smrg  esac
224414330f12Smrgfi
2245eca46af7Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2246eca46af7Smrg_LT_DECL([], [striplib], [1])
2247eca46af7Smrg])# _LT_CMD_STRIPLIB
224895b296d0Smrg
224995b296d0Smrg
225089b0dc75Smrg# _LT_PREPARE_MUNGE_PATH_LIST
225189b0dc75Smrg# ---------------------------
225289b0dc75Smrg# Make sure func_munge_path_list() is defined correctly.
225389b0dc75Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
225489b0dc75Smrg[[# func_munge_path_list VARIABLE PATH
225589b0dc75Smrg# -----------------------------------
225689b0dc75Smrg# VARIABLE is name of variable containing _space_ separated list of
225789b0dc75Smrg# directories to be munged by the contents of PATH, which is string
225889b0dc75Smrg# having a format:
225989b0dc75Smrg# "DIR[:DIR]:"
226089b0dc75Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
226189b0dc75Smrg# ":DIR[:DIR]"
226289b0dc75Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
226389b0dc75Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
226489b0dc75Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
226589b0dc75Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
226689b0dc75Smrg# "DIR[:DIR]"
226789b0dc75Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
226889b0dc75Smrgfunc_munge_path_list ()
226989b0dc75Smrg{
227089b0dc75Smrg    case x@S|@2 in
227189b0dc75Smrg    x)
227289b0dc75Smrg        ;;
227389b0dc75Smrg    *:)
227489b0dc75Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
227589b0dc75Smrg        ;;
227689b0dc75Smrg    x:*)
227789b0dc75Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
227889b0dc75Smrg        ;;
227989b0dc75Smrg    *::*)
228089b0dc75Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
228189b0dc75Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
228289b0dc75Smrg        ;;
228389b0dc75Smrg    *)
228489b0dc75Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
228589b0dc75Smrg        ;;
228689b0dc75Smrg    esac
228789b0dc75Smrg}
228889b0dc75Smrg]])# _LT_PREPARE_PATH_LIST
228989b0dc75Smrg
229089b0dc75Smrg
2291eca46af7Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2292eca46af7Smrg# -----------------------------
2293eca46af7Smrg# PORTME Fill in your ld.so characteristics
2294eca46af7Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2295eca46af7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2296eca46af7Smrgm4_require([_LT_DECL_EGREP])dnl
2297eca46af7Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2298eca46af7Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2299eca46af7Smrgm4_require([_LT_DECL_SED])dnl
2300eca46af7Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
230189b0dc75Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2302eca46af7SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2303eca46af7Smrgm4_if([$1],
2304eca46af7Smrg	[], [
2305eca46af7Smrgif test yes = "$GCC"; then
2306eca46af7Smrg  case $host_os in
2307eca46af7Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2308eca46af7Smrg    *) lt_awk_arg='/^libraries:/' ;;
2309eca46af7Smrg  esac
2310eca46af7Smrg  case $host_os in
2311eca46af7Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2312eca46af7Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2313eca46af7Smrg  esac
2314eca46af7Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2315eca46af7Smrg  case $lt_search_path_spec in
2316eca46af7Smrg  *\;*)
2317eca46af7Smrg    # if the path contains ";" then we assume it to be the separator
2318eca46af7Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2319eca46af7Smrg    # assumed that no part of a normal pathname contains ";" but that should
2320eca46af7Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2321eca46af7Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2322eca46af7Smrg    ;;
2323eca46af7Smrg  *)
2324eca46af7Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2325eca46af7Smrg    ;;
2326eca46af7Smrg  esac
2327eca46af7Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2328eca46af7Smrg  # and add multilib dir if necessary...
2329eca46af7Smrg  lt_tmp_lt_search_path_spec=
2330eca46af7Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2331eca46af7Smrg  # ...but if some path component already ends with the multilib dir we assume
2332eca46af7Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2333eca46af7Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2334eca46af7Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2335eca46af7Smrg    lt_multi_os_dir=
2336eca46af7Smrg    ;;
2337eca46af7Smrg  esac
2338eca46af7Smrg  for lt_sys_path in $lt_search_path_spec; do
2339eca46af7Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2340eca46af7Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2341eca46af7Smrg    elif test -n "$lt_multi_os_dir"; then
2342eca46af7Smrg      test -d "$lt_sys_path" && \
2343eca46af7Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2344eca46af7Smrg    fi
2345eca46af7Smrg  done
2346eca46af7Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2347eca46af7SmrgBEGIN {RS = " "; FS = "/|\n";} {
2348eca46af7Smrg  lt_foo = "";
2349eca46af7Smrg  lt_count = 0;
2350eca46af7Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2351eca46af7Smrg    if ($lt_i != "" && $lt_i != ".") {
2352eca46af7Smrg      if ($lt_i == "..") {
2353eca46af7Smrg        lt_count++;
2354eca46af7Smrg      } else {
2355eca46af7Smrg        if (lt_count == 0) {
2356eca46af7Smrg          lt_foo = "/" $lt_i lt_foo;
2357eca46af7Smrg        } else {
2358eca46af7Smrg          lt_count--;
2359eca46af7Smrg        }
2360eca46af7Smrg      }
2361eca46af7Smrg    }
2362eca46af7Smrg  }
2363eca46af7Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2364eca46af7Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2365eca46af7Smrg}'`
2366eca46af7Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2367eca46af7Smrg  # for these hosts.
2368eca46af7Smrg  case $host_os in
2369eca46af7Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2370eca46af7Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
2371eca46af7Smrg  esac
2372eca46af7Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
2373eca46af7Smrgelse
2374eca46af7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2375eca46af7Smrgfi])
2376eca46af7Smrglibrary_names_spec=
2377eca46af7Smrglibname_spec='lib$name'
2378eca46af7Smrgsoname_spec=
2379eca46af7Smrgshrext_cmds=.so
2380eca46af7Smrgpostinstall_cmds=
2381eca46af7Smrgpostuninstall_cmds=
2382eca46af7Smrgfinish_cmds=
2383eca46af7Smrgfinish_eval=
2384eca46af7Smrgshlibpath_var=
2385eca46af7Smrgshlibpath_overrides_runpath=unknown
2386eca46af7Smrgversion_type=none
2387eca46af7Smrgdynamic_linker="$host_os ld.so"
2388eca46af7Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2389eca46af7Smrgneed_lib_prefix=unknown
2390eca46af7Smrghardcode_into_libs=no
239195b296d0Smrg
2392eca46af7Smrg# when you set need_version to no, make sure it does not cause -set_version
2393eca46af7Smrg# flags to be left without arguments
2394eca46af7Smrgneed_version=unknown
239595b296d0Smrg
239689b0dc75SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
239789b0dc75Smrg[User-defined run-time library search path.])
239889b0dc75Smrg
2399eca46af7Smrgcase $host_os in
2400eca46af7Smrgaix3*)
2401eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2402eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2403eca46af7Smrg  shlibpath_var=LIBPATH
240495b296d0Smrg
2405eca46af7Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2406eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2407eca46af7Smrg  ;;
240814330f12Smrg
2409eca46af7Smrgaix[[4-9]]*)
2410eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2411eca46af7Smrg  need_lib_prefix=no
2412eca46af7Smrg  need_version=no
2413eca46af7Smrg  hardcode_into_libs=yes
2414eca46af7Smrg  if test ia64 = "$host_cpu"; then
2415eca46af7Smrg    # AIX 5 supports IA64
2416eca46af7Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2417eca46af7Smrg    shlibpath_var=LD_LIBRARY_PATH
2418eca46af7Smrg  else
2419eca46af7Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2420eca46af7Smrg    # for dependence libraries.  The import file would start with
2421eca46af7Smrg    # the line '#! .'.  This would cause the generated library to
2422eca46af7Smrg    # depend on '.', always an invalid library.  This was fixed in
2423eca46af7Smrg    # development snapshots of GCC prior to 3.0.
2424eca46af7Smrg    case $host_os in
2425eca46af7Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2426eca46af7Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2427eca46af7Smrg	   echo ' yes '
2428eca46af7Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2429eca46af7Smrg	:
2430eca46af7Smrg      else
2431eca46af7Smrg	can_build_shared=no
2432eca46af7Smrg      fi
2433eca46af7Smrg      ;;
2434eca46af7Smrg    esac
2435eca46af7Smrg    # Using Import Files as archive members, it is possible to support
2436eca46af7Smrg    # filename-based versioning of shared library archives on AIX. While
2437eca46af7Smrg    # this would work for both with and without runtime linking, it will
2438eca46af7Smrg    # prevent static linking of such archives. So we do filename-based
2439eca46af7Smrg    # shared library versioning with .so extension only, which is used
2440eca46af7Smrg    # when both runtime linking and shared linking is enabled.
2441eca46af7Smrg    # Unfortunately, runtime linking may impact performance, so we do
2442eca46af7Smrg    # not want this to be the default eventually. Also, we use the
2443eca46af7Smrg    # versioned .so libs for executables only if there is the -brtl
2444eca46af7Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2445eca46af7Smrg    # To allow for filename-based versioning support, we need to create
2446eca46af7Smrg    # libNAME.so.V as an archive file, containing:
2447eca46af7Smrg    # *) an Import File, referring to the versioned filename of the
2448eca46af7Smrg    #    archive as well as the shared archive member, telling the
2449eca46af7Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
2450eca46af7Smrg    #    list of exported symbols of that shared object, eventually
2451eca46af7Smrg    #    decorated with the 'weak' keyword
2452eca46af7Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2453eca46af7Smrg    #    it being seen by the linker.
2454eca46af7Smrg    # At run time we better use the real file rather than another symlink,
2455eca46af7Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2456eca46af7Smrg
2457eca46af7Smrg    case $with_aix_soname,$aix_use_runtimelinking in
2458eca46af7Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2459eca46af7Smrg    # soname into executable. Probably we can add versioning support to
2460eca46af7Smrg    # collect2, so additional links can be useful in future.
2461eca46af7Smrg    aix,yes) # traditional libtool
2462eca46af7Smrg      dynamic_linker='AIX unversionable lib.so'
2463eca46af7Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2464eca46af7Smrg      # instead of lib<name>.a to let people know that these are not
2465eca46af7Smrg      # typical AIX shared libraries.
2466eca46af7Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2467eca46af7Smrg      ;;
2468eca46af7Smrg    aix,no) # traditional AIX only
2469eca46af7Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2470eca46af7Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2471eca46af7Smrg      # and later when we are not doing run time linking.
2472eca46af7Smrg      library_names_spec='$libname$release.a $libname.a'
2473eca46af7Smrg      soname_spec='$libname$release$shared_ext$major'
2474eca46af7Smrg      ;;
2475eca46af7Smrg    svr4,*) # full svr4 only
2476eca46af7Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2477eca46af7Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2478eca46af7Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2479eca46af7Smrg      shlibpath_overrides_runpath=yes
2480eca46af7Smrg      ;;
2481eca46af7Smrg    *,yes) # both, prefer svr4
2482eca46af7Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2483eca46af7Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2484eca46af7Smrg      # unpreferred sharedlib libNAME.a needs extra handling
2485eca46af7Smrg      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"'
2486eca46af7Smrg      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"'
2487eca46af7Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2488eca46af7Smrg      shlibpath_overrides_runpath=yes
2489eca46af7Smrg      ;;
2490eca46af7Smrg    *,no) # both, prefer aix
2491eca46af7Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2492eca46af7Smrg      library_names_spec='$libname$release.a $libname.a'
2493eca46af7Smrg      soname_spec='$libname$release$shared_ext$major'
2494eca46af7Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2495eca46af7Smrg      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)'
2496eca46af7Smrg      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"'
2497eca46af7Smrg      ;;
2498eca46af7Smrg    esac
2499eca46af7Smrg    shlibpath_var=LIBPATH
2500eca46af7Smrg  fi
2501eca46af7Smrg  ;;
250295b296d0Smrg
2503eca46af7Smrgamigaos*)
2504eca46af7Smrg  case $host_cpu in
2505eca46af7Smrg  powerpc)
2506eca46af7Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2507eca46af7Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2508eca46af7Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2509eca46af7Smrg    ;;
2510eca46af7Smrg  m68k)
2511eca46af7Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2512eca46af7Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2513eca46af7Smrg    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'
2514eca46af7Smrg    ;;
2515eca46af7Smrg  esac
2516eca46af7Smrg  ;;
251795b296d0Smrg
2518eca46af7Smrgbeos*)
2519eca46af7Smrg  library_names_spec='$libname$shared_ext'
2520eca46af7Smrg  dynamic_linker="$host_os ld.so"
2521eca46af7Smrg  shlibpath_var=LIBRARY_PATH
2522eca46af7Smrg  ;;
252395b296d0Smrg
2524eca46af7Smrgbsdi[[45]]*)
2525eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2526eca46af7Smrg  need_version=no
2527eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2528eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2529eca46af7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2530eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2531eca46af7Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2532eca46af7Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2533eca46af7Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2534eca46af7Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2535eca46af7Smrg  # libtool to hard-code these into programs
25362378475aSmrg  ;;
25372378475aSmrg
2538eca46af7Smrgcygwin* | mingw* | pw32* | cegcc*)
2539eca46af7Smrg  version_type=windows
2540eca46af7Smrg  shrext_cmds=.dll
2541eca46af7Smrg  need_version=no
2542eca46af7Smrg  need_lib_prefix=no
254395b296d0Smrg
2544eca46af7Smrg  case $GCC,$cc_basename in
2545eca46af7Smrg  yes,*)
2546eca46af7Smrg    # gcc
2547eca46af7Smrg    library_names_spec='$libname.dll.a'
2548eca46af7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2549eca46af7Smrg    postinstall_cmds='base_file=`basename \$file`~
2550eca46af7Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2551eca46af7Smrg      dldir=$destdir/`dirname \$dlpath`~
2552eca46af7Smrg      test -d \$dldir || mkdir -p \$dldir~
2553eca46af7Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2554eca46af7Smrg      chmod a+x \$dldir/$dlname~
2555eca46af7Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2556eca46af7Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2557eca46af7Smrg      fi'
2558eca46af7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2559eca46af7Smrg      dlpath=$dir/\$dldll~
2560eca46af7Smrg       $RM \$dlpath'
2561eca46af7Smrg    shlibpath_overrides_runpath=yes
2562eca46af7Smrg
2563eca46af7Smrg    case $host_os in
2564eca46af7Smrg    cygwin*)
2565eca46af7Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2566eca46af7Smrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2567eca46af7Smrgm4_if([$1], [],[
2568eca46af7Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2569eca46af7Smrg      ;;
2570eca46af7Smrg    mingw* | cegcc*)
2571eca46af7Smrg      # MinGW DLLs use traditional 'lib' prefix
2572eca46af7Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2573eca46af7Smrg      ;;
2574eca46af7Smrg    pw32*)
2575eca46af7Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2576eca46af7Smrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
257795b296d0Smrg      ;;
257895b296d0Smrg    esac
2579eca46af7Smrg    dynamic_linker='Win32 ld.exe'
2580eca46af7Smrg    ;;
258195b296d0Smrg
2582eca46af7Smrg  *,cl*)
2583eca46af7Smrg    # Native MSVC
2584eca46af7Smrg    libname_spec='$name'
2585eca46af7Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2586eca46af7Smrg    library_names_spec='$libname.dll.lib'
258714330f12Smrg
2588eca46af7Smrg    case $build_os in
2589eca46af7Smrg    mingw*)
2590eca46af7Smrg      sys_lib_search_path_spec=
2591eca46af7Smrg      lt_save_ifs=$IFS
2592eca46af7Smrg      IFS=';'
2593eca46af7Smrg      for lt_path in $LIB
2594eca46af7Smrg      do
2595eca46af7Smrg        IFS=$lt_save_ifs
2596eca46af7Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2597eca46af7Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2598eca46af7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2599eca46af7Smrg      done
2600eca46af7Smrg      IFS=$lt_save_ifs
2601eca46af7Smrg      # Convert to MSYS style.
2602eca46af7Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2603eca46af7Smrg      ;;
2604eca46af7Smrg    cygwin*)
2605eca46af7Smrg      # Convert to unix form, then to dos form, then back to unix form
2606eca46af7Smrg      # but this time dos style (no spaces!) so that the unix form looks
2607eca46af7Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2608eca46af7Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2609eca46af7Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2610eca46af7Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2611eca46af7Smrg      ;;
2612eca46af7Smrg    *)
2613eca46af7Smrg      sys_lib_search_path_spec=$LIB
2614eca46af7Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2615eca46af7Smrg        # It is most probably a Windows format PATH.
2616eca46af7Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2617eca46af7Smrg      else
2618eca46af7Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
261914330f12Smrg      fi
2620eca46af7Smrg      # FIXME: find the short name or the path components, as spaces are
2621eca46af7Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2622eca46af7Smrg      ;;
2623eca46af7Smrg    esac
262495b296d0Smrg
2625eca46af7Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2626eca46af7Smrg    postinstall_cmds='base_file=`basename \$file`~
2627eca46af7Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2628eca46af7Smrg      dldir=$destdir/`dirname \$dlpath`~
2629eca46af7Smrg      test -d \$dldir || mkdir -p \$dldir~
2630eca46af7Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2631eca46af7Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2632eca46af7Smrg      dlpath=$dir/\$dldll~
2633eca46af7Smrg       $RM \$dlpath'
2634eca46af7Smrg    shlibpath_overrides_runpath=yes
2635eca46af7Smrg    dynamic_linker='Win32 link.exe'
263614330f12Smrg    ;;
2637eca46af7Smrg
263814330f12Smrg  *)
2639eca46af7Smrg    # Assume MSVC wrapper
2640eca46af7Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2641eca46af7Smrg    dynamic_linker='Win32 ld.exe'
264214330f12Smrg    ;;
264314330f12Smrg  esac
2644eca46af7Smrg  # FIXME: first we should search . and the directory the executable is in
2645eca46af7Smrg  shlibpath_var=PATH
2646eca46af7Smrg  ;;
264795b296d0Smrg
2648eca46af7Smrgdarwin* | rhapsody*)
2649eca46af7Smrg  dynamic_linker="$host_os dyld"
2650eca46af7Smrg  version_type=darwin
2651eca46af7Smrg  need_lib_prefix=no
2652eca46af7Smrg  need_version=no
2653eca46af7Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2654eca46af7Smrg  soname_spec='$libname$release$major$shared_ext'
2655eca46af7Smrg  shlibpath_overrides_runpath=yes
2656eca46af7Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2657eca46af7Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2658eca46af7Smrgm4_if([$1], [],[
2659eca46af7Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2660eca46af7Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2661eca46af7Smrg  ;;
266295b296d0Smrg
2663eca46af7Smrgdgux*)
2664eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2665eca46af7Smrg  need_lib_prefix=no
2666eca46af7Smrg  need_version=no
2667eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2668eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2669eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2670eca46af7Smrg  ;;
267195b296d0Smrg
2672eca46af7Smrgfreebsd* | dragonfly*)
2673eca46af7Smrg  # DragonFly does not have aout.  When/if they implement a new
2674eca46af7Smrg  # versioning mechanism, adjust this.
2675eca46af7Smrg  if test -x /usr/bin/objformat; then
2676eca46af7Smrg    objformat=`/usr/bin/objformat`
2677eca46af7Smrg  else
2678eca46af7Smrg    case $host_os in
2679eca46af7Smrg    freebsd[[23]].*) objformat=aout ;;
2680eca46af7Smrg    *) objformat=elf ;;
2681eca46af7Smrg    esac
2682eca46af7Smrg  fi
2683eca46af7Smrg  # Handle Gentoo/FreeBSD as it was Linux
2684eca46af7Smrg  case $host_vendor in
2685eca46af7Smrg    gentoo)
2686eca46af7Smrg      version_type=linux ;;
2687eca46af7Smrg    *)
2688eca46af7Smrg      version_type=freebsd-$objformat ;;
2689eca46af7Smrg  esac
269095b296d0Smrg
2691eca46af7Smrg  case $version_type in
2692eca46af7Smrg    freebsd-elf*)
2693eca46af7Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
269489b0dc75Smrg      soname_spec='$libname$release$shared_ext$major'
2695eca46af7Smrg      need_version=no
2696eca46af7Smrg      need_lib_prefix=no
2697eca46af7Smrg      ;;
2698eca46af7Smrg    freebsd-*)
2699eca46af7Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2700eca46af7Smrg      need_version=yes
2701eca46af7Smrg      ;;
2702eca46af7Smrg    linux)
2703eca46af7Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
2704eca46af7Smrg      soname_spec='${libname}${release}${shared_ext}$major'
2705eca46af7Smrg      need_lib_prefix=no
2706eca46af7Smrg      need_version=no
2707eca46af7Smrg      ;;
2708eca46af7Smrg  esac
2709eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2710eca46af7Smrg  case $host_os in
2711eca46af7Smrg  freebsd2.*)
2712eca46af7Smrg    shlibpath_overrides_runpath=yes
271314330f12Smrg    ;;
2714eca46af7Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2715eca46af7Smrg    shlibpath_overrides_runpath=yes
2716eca46af7Smrg    hardcode_into_libs=yes
271714330f12Smrg    ;;
2718eca46af7Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2719eca46af7Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2720eca46af7Smrg    shlibpath_overrides_runpath=no
2721eca46af7Smrg    hardcode_into_libs=yes
272214330f12Smrg    ;;
2723eca46af7Smrg  *) # from 4.6 on, and DragonFly
2724eca46af7Smrg    shlibpath_overrides_runpath=yes
2725eca46af7Smrg    hardcode_into_libs=yes
272614330f12Smrg    ;;
2727eca46af7Smrg  esac
2728eca46af7Smrg  ;;
272995b296d0Smrg
2730eca46af7Smrghaiku*)
2731eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2732eca46af7Smrg  need_lib_prefix=no
2733eca46af7Smrg  need_version=no
2734eca46af7Smrg  dynamic_linker="$host_os runtime_loader"
2735eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2736eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2737eca46af7Smrg  shlibpath_var=LIBRARY_PATH
2738eca46af7Smrg  shlibpath_overrides_runpath=no
2739eca46af7Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2740eca46af7Smrg  hardcode_into_libs=yes
2741eca46af7Smrg  ;;
274295b296d0Smrg
2743eca46af7Smrghpux9* | hpux10* | hpux11*)
2744eca46af7Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2745eca46af7Smrg  # link against other versions.
2746eca46af7Smrg  version_type=sunos
2747eca46af7Smrg  need_lib_prefix=no
2748eca46af7Smrg  need_version=no
2749eca46af7Smrg  case $host_cpu in
2750eca46af7Smrg  ia64*)
2751eca46af7Smrg    shrext_cmds='.so'
2752eca46af7Smrg    hardcode_into_libs=yes
2753eca46af7Smrg    dynamic_linker="$host_os dld.so"
2754eca46af7Smrg    shlibpath_var=LD_LIBRARY_PATH
2755eca46af7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2756eca46af7Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2757eca46af7Smrg    soname_spec='$libname$release$shared_ext$major'
2758eca46af7Smrg    if test 32 = "$HPUX_IA64_MODE"; then
2759eca46af7Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
276089b0dc75Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
276114330f12Smrg    else
2762eca46af7Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
276389b0dc75Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
276414330f12Smrg    fi
276514330f12Smrg    ;;
2766eca46af7Smrg  hppa*64*)
2767eca46af7Smrg    shrext_cmds='.sl'
2768eca46af7Smrg    hardcode_into_libs=yes
2769eca46af7Smrg    dynamic_linker="$host_os dld.sl"
2770eca46af7Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2771eca46af7Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2772eca46af7Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2773eca46af7Smrg    soname_spec='$libname$release$shared_ext$major'
2774eca46af7Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2775eca46af7Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
277614330f12Smrg    ;;
277714330f12Smrg  *)
2778eca46af7Smrg    shrext_cmds='.sl'
2779eca46af7Smrg    dynamic_linker="$host_os dld.sl"
2780eca46af7Smrg    shlibpath_var=SHLIB_PATH
2781eca46af7Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2782eca46af7Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2783eca46af7Smrg    soname_spec='$libname$release$shared_ext$major'
278414330f12Smrg    ;;
278514330f12Smrg  esac
2786eca46af7Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2787eca46af7Smrg  postinstall_cmds='chmod 555 $lib'
2788eca46af7Smrg  # or fails outright, so override atomically:
2789eca46af7Smrg  install_override_mode=555
2790eca46af7Smrg  ;;
279195b296d0Smrg
2792eca46af7Smrginterix[[3-9]]*)
2793eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2794eca46af7Smrg  need_lib_prefix=no
2795eca46af7Smrg  need_version=no
2796eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2797eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2798eca46af7Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2799eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2800eca46af7Smrg  shlibpath_overrides_runpath=no
2801eca46af7Smrg  hardcode_into_libs=yes
2802eca46af7Smrg  ;;
280395b296d0Smrg
2804eca46af7Smrgirix5* | irix6* | nonstopux*)
2805eca46af7Smrg  case $host_os in
2806eca46af7Smrg    nonstopux*) version_type=nonstopux ;;
2807eca46af7Smrg    *)
2808eca46af7Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2809eca46af7Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2810eca46af7Smrg	else
2811eca46af7Smrg		version_type=irix
2812eca46af7Smrg	fi ;;
2813eca46af7Smrg  esac
2814eca46af7Smrg  need_lib_prefix=no
2815eca46af7Smrg  need_version=no
2816eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2817eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2818eca46af7Smrg  case $host_os in
2819eca46af7Smrg  irix5* | nonstopux*)
2820eca46af7Smrg    libsuff= shlibsuff=
2821eca46af7Smrg    ;;
2822eca46af7Smrg  *)
2823eca46af7Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2824eca46af7Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2825eca46af7Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2826eca46af7Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2827eca46af7Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2828eca46af7Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2829eca46af7Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2830eca46af7Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2831eca46af7Smrg    esac
2832eca46af7Smrg    ;;
2833eca46af7Smrg  esac
2834eca46af7Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2835eca46af7Smrg  shlibpath_overrides_runpath=no
2836eca46af7Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2837eca46af7Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2838eca46af7Smrg  hardcode_into_libs=yes
2839eca46af7Smrg  ;;
284095b296d0Smrg
2841eca46af7Smrg# No shared lib support for Linux oldld, aout, or coff.
2842eca46af7Smrglinux*oldld* | linux*aout* | linux*coff*)
2843eca46af7Smrg  dynamic_linker=no
2844eca46af7Smrg  ;;
284595b296d0Smrg
2846eca46af7Smrglinux*android*)
2847eca46af7Smrg  version_type=none # Android doesn't support versioned libraries.
2848eca46af7Smrg  need_lib_prefix=no
2849eca46af7Smrg  need_version=no
2850eca46af7Smrg  library_names_spec='$libname$release$shared_ext'
2851eca46af7Smrg  soname_spec='$libname$release$shared_ext'
2852eca46af7Smrg  finish_cmds=
2853eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2854eca46af7Smrg  shlibpath_overrides_runpath=yes
285595b296d0Smrg
2856eca46af7Smrg  # This implies no fast_install, which is unacceptable.
2857eca46af7Smrg  # Some rework will be needed to allow for fast_install
2858eca46af7Smrg  # before this can be enabled.
2859eca46af7Smrg  hardcode_into_libs=yes
286095b296d0Smrg
2861eca46af7Smrg  dynamic_linker='Android linker'
2862eca46af7Smrg  # Don't embed -rpath directories since the linker doesn't support them.
2863eca46af7Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2864eca46af7Smrg  ;;
2865e6f085baSmrg
2866eca46af7Smrg# This must be glibc/ELF.
2867eca46af7Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2868eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2869eca46af7Smrg  need_lib_prefix=no
2870eca46af7Smrg  need_version=no
2871eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2872eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2873eca46af7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2874eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2875eca46af7Smrg  shlibpath_overrides_runpath=no
2876e6f085baSmrg
2877eca46af7Smrg  # Some binutils ld are patched to set DT_RUNPATH
2878eca46af7Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2879eca46af7Smrg    [lt_cv_shlibpath_overrides_runpath=no
2880eca46af7Smrg    save_LDFLAGS=$LDFLAGS
2881eca46af7Smrg    save_libdir=$libdir
2882eca46af7Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2883eca46af7Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2884eca46af7Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2885eca46af7Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2886eca46af7Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2887eca46af7Smrg    LDFLAGS=$save_LDFLAGS
2888eca46af7Smrg    libdir=$save_libdir
2889eca46af7Smrg    ])
2890eca46af7Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2891e6f085baSmrg
2892eca46af7Smrg  # This implies no fast_install, which is unacceptable.
2893eca46af7Smrg  # Some rework will be needed to allow for fast_install
2894eca46af7Smrg  # before this can be enabled.
2895eca46af7Smrg  hardcode_into_libs=yes
2896e6f085baSmrg
289789b0dc75Smrg  # Ideally, we could use ldconfig to report *all* directores which are
289889b0dc75Smrg  # searched for libraries, however this is still not possible.  Aside from not
289989b0dc75Smrg  # being certain /sbin/ldconfig is available, command
290089b0dc75Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
290189b0dc75Smrg  # even though it is searched at run-time.  Try to do the best guess by
290289b0dc75Smrg  # appending ld.so.conf contents (and includes) to the search path.
2903eca46af7Smrg  if test -f /etc/ld.so.conf; then
2904eca46af7Smrg    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' ' '`
2905eca46af7Smrg    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
2906eca46af7Smrg  fi
2907e6f085baSmrg
2908eca46af7Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2909eca46af7Smrg  # powerpc, because MkLinux only supported shared libraries with the
2910eca46af7Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2911eca46af7Smrg  # most powerpc-linux boxes support dynamic linking these days and
2912eca46af7Smrg  # people can always --disable-shared, the test was removed, and we
2913eca46af7Smrg  # assume the GNU/Linux dynamic linker is in use.
2914eca46af7Smrg  dynamic_linker='GNU/Linux ld.so'
2915eca46af7Smrg  ;;
2916e6f085baSmrg
2917eca46af7Smrgnetbsd*)
2918eca46af7Smrg  version_type=sunos
2919eca46af7Smrg  need_lib_prefix=no
2920eca46af7Smrg  need_version=no
2921eca46af7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2922eca46af7Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2923eca46af7Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2924eca46af7Smrg    dynamic_linker='NetBSD (a.out) ld.so'
292595b296d0Smrg  else
2926eca46af7Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2927eca46af7Smrg    soname_spec='$libname$release$shared_ext$major'
2928eca46af7Smrg    dynamic_linker='NetBSD ld.elf_so'
29292378475aSmrg  fi
2930eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2931eca46af7Smrg  shlibpath_overrides_runpath=yes
2932eca46af7Smrg  hardcode_into_libs=yes
2933eca46af7Smrg  ;;
293414330f12Smrg
2935eca46af7Smrgnewsos6)
2936eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2937eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2938eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2939eca46af7Smrg  shlibpath_overrides_runpath=yes
2940eca46af7Smrg  ;;
294114330f12Smrg
2942eca46af7Smrg*nto* | *qnx*)
2943eca46af7Smrg  version_type=qnx
2944eca46af7Smrg  need_lib_prefix=no
2945eca46af7Smrg  need_version=no
2946eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2947eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
2948eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2949eca46af7Smrg  shlibpath_overrides_runpath=no
2950eca46af7Smrg  hardcode_into_libs=yes
2951eca46af7Smrg  dynamic_linker='ldqnx.so'
2952eca46af7Smrg  ;;
295395b296d0Smrg
2954eca46af7Smrgopenbsd* | bitrig*)
2955eca46af7Smrg  version_type=sunos
2956eca46af7Smrg  sys_lib_dlsearch_path_spec=/usr/lib
2957eca46af7Smrg  need_lib_prefix=no
2958eca46af7Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2959eca46af7Smrg    need_version=no
2960eca46af7Smrg  else
2961eca46af7Smrg    need_version=yes
2962eca46af7Smrg  fi
2963eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2964eca46af7Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2965eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
2966eca46af7Smrg  shlibpath_overrides_runpath=yes
2967eca46af7Smrg  ;;
296895b296d0Smrg
2969eca46af7Smrgos2*)
2970eca46af7Smrg  libname_spec='$name'
2971eca46af7Smrg  version_type=windows
2972eca46af7Smrg  shrext_cmds=.dll
2973eca46af7Smrg  need_version=no
2974eca46af7Smrg  need_lib_prefix=no
2975eca46af7Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2976eca46af7Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2977eca46af7Smrg    v=$($ECHO $release$versuffix | tr -d .-);
2978eca46af7Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2979eca46af7Smrg    $ECHO $n$v`$shared_ext'
2980eca46af7Smrg  library_names_spec='${libname}_dll.$libext'
2981eca46af7Smrg  dynamic_linker='OS/2 ld.exe'
2982eca46af7Smrg  shlibpath_var=BEGINLIBPATH
2983eca46af7Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2984eca46af7Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2985eca46af7Smrg  postinstall_cmds='base_file=`basename \$file`~
2986eca46af7Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2987eca46af7Smrg    dldir=$destdir/`dirname \$dlpath`~
2988eca46af7Smrg    test -d \$dldir || mkdir -p \$dldir~
2989eca46af7Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
2990eca46af7Smrg    chmod a+x \$dldir/$dlname~
2991eca46af7Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2992eca46af7Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2993eca46af7Smrg    fi'
2994eca46af7Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2995eca46af7Smrg    dlpath=$dir/\$dldll~
2996eca46af7Smrg    $RM \$dlpath'
2997eca46af7Smrg  ;;
299895b296d0Smrg
2999eca46af7Smrgosf3* | osf4* | osf5*)
3000eca46af7Smrg  version_type=osf
3001eca46af7Smrg  need_lib_prefix=no
3002eca46af7Smrg  need_version=no
3003eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
3004eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3005eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3006eca46af7Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
3007eca46af7Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
3008eca46af7Smrg  ;;
300995b296d0Smrg
3010eca46af7Smrgrdos*)
3011eca46af7Smrg  dynamic_linker=no
3012eca46af7Smrg  ;;
3013e6f085baSmrg
3014eca46af7Smrgsolaris*)
3015eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3016eca46af7Smrg  need_lib_prefix=no
3017eca46af7Smrg  need_version=no
3018eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3019eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
3020eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3021eca46af7Smrg  shlibpath_overrides_runpath=yes
3022eca46af7Smrg  hardcode_into_libs=yes
3023eca46af7Smrg  # ldd complains unless libraries are executable
3024eca46af7Smrg  postinstall_cmds='chmod +x $lib'
3025eca46af7Smrg  ;;
302695b296d0Smrg
3027eca46af7Smrgsunos4*)
3028eca46af7Smrg  version_type=sunos
3029eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3030eca46af7Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3031eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3032eca46af7Smrg  shlibpath_overrides_runpath=yes
3033eca46af7Smrg  if test yes = "$with_gnu_ld"; then
3034eca46af7Smrg    need_lib_prefix=no
303514330f12Smrg  fi
3036eca46af7Smrg  need_version=yes
3037eca46af7Smrg  ;;
303895b296d0Smrg
3039eca46af7Smrgsysv4 | sysv4.3*)
3040eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3041eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3042eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
3043eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3044eca46af7Smrg  case $host_vendor in
3045eca46af7Smrg    sni)
3046eca46af7Smrg      shlibpath_overrides_runpath=no
3047eca46af7Smrg      need_lib_prefix=no
3048eca46af7Smrg      runpath_var=LD_RUN_PATH
3049eca46af7Smrg      ;;
3050eca46af7Smrg    siemens)
3051eca46af7Smrg      need_lib_prefix=no
3052eca46af7Smrg      ;;
3053eca46af7Smrg    motorola)
3054eca46af7Smrg      need_lib_prefix=no
3055eca46af7Smrg      need_version=no
3056eca46af7Smrg      shlibpath_overrides_runpath=no
3057eca46af7Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
3058eca46af7Smrg      ;;
3059eca46af7Smrg  esac
3060eca46af7Smrg  ;;
306114330f12Smrg
3062eca46af7Smrgsysv4*MP*)
3063eca46af7Smrg  if test -d /usr/nec; then
3064eca46af7Smrg    version_type=linux # correct to gnu/linux during the next big refactor
3065eca46af7Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3066eca46af7Smrg    soname_spec='$libname$shared_ext.$major'
3067eca46af7Smrg    shlibpath_var=LD_LIBRARY_PATH
3068eca46af7Smrg  fi
3069eca46af7Smrg  ;;
307014330f12Smrg
3071eca46af7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3072eca46af7Smrg  version_type=sco
3073eca46af7Smrg  need_lib_prefix=no
3074eca46af7Smrg  need_version=no
3075eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3076eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
3077eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3078eca46af7Smrg  shlibpath_overrides_runpath=yes
3079eca46af7Smrg  hardcode_into_libs=yes
3080eca46af7Smrg  if test yes = "$with_gnu_ld"; then
3081eca46af7Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
3082eca46af7Smrg  else
3083eca46af7Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
3084eca46af7Smrg    case $host_os in
3085eca46af7Smrg      sco3.2v5*)
3086eca46af7Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3087eca46af7Smrg	;;
3088eca46af7Smrg    esac
3089eca46af7Smrg  fi
3090eca46af7Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
3091eca46af7Smrg  ;;
309214330f12Smrg
3093eca46af7Smrgtpf*)
3094eca46af7Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3095eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3096eca46af7Smrg  need_lib_prefix=no
3097eca46af7Smrg  need_version=no
3098eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3099eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3100eca46af7Smrg  shlibpath_overrides_runpath=no
3101eca46af7Smrg  hardcode_into_libs=yes
3102eca46af7Smrg  ;;
310314330f12Smrg
3104eca46af7Smrguts4*)
3105eca46af7Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3106eca46af7Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3107eca46af7Smrg  soname_spec='$libname$release$shared_ext$major'
3108eca46af7Smrg  shlibpath_var=LD_LIBRARY_PATH
3109eca46af7Smrg  ;;
311014330f12Smrg
3111eca46af7Smrg*)
3112eca46af7Smrg  dynamic_linker=no
3113eca46af7Smrg  ;;
3114eca46af7Smrgesac
3115eca46af7SmrgAC_MSG_RESULT([$dynamic_linker])
3116eca46af7Smrgtest no = "$dynamic_linker" && can_build_shared=no
311714330f12Smrg
3118eca46af7Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3119eca46af7Smrgif test yes = "$GCC"; then
3120eca46af7Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3121eca46af7Smrgfi
312214330f12Smrg
3123eca46af7Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3124eca46af7Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3125eca46af7Smrgfi
312689b0dc75Smrg
3127eca46af7Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3128eca46af7Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
312914330f12Smrgfi
313014330f12Smrg
313189b0dc75Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
313289b0dc75Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
313389b0dc75Smrg
313489b0dc75Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
313589b0dc75Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
313689b0dc75Smrg
313789b0dc75Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
313889b0dc75Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
313989b0dc75Smrg
3140eca46af7Smrg_LT_DECL([], [variables_saved_for_relink], [1],
3141eca46af7Smrg    [Variables whose values should be saved in libtool wrapper scripts and
3142eca46af7Smrg    restored at link time])
3143eca46af7Smrg_LT_DECL([], [need_lib_prefix], [0],
3144eca46af7Smrg    [Do we need the "lib" prefix for modules?])
3145eca46af7Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3146eca46af7Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
3147eca46af7Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3148eca46af7Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3149eca46af7Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3150eca46af7Smrg    [Is shlibpath searched before the hard-coded library search path?])
3151eca46af7Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3152eca46af7Smrg_LT_DECL([], [library_names_spec], [1],
3153eca46af7Smrg    [[List of archive names.  First name is the real one, the rest are links.
3154eca46af7Smrg    The last name is the one that the linker finds with -lNAME]])
3155eca46af7Smrg_LT_DECL([], [soname_spec], [1],
3156eca46af7Smrg    [[The coded name of the library, if different from the real name]])
3157eca46af7Smrg_LT_DECL([], [install_override_mode], [1],
3158eca46af7Smrg    [Permission mode override for installation of shared libraries])
3159eca46af7Smrg_LT_DECL([], [postinstall_cmds], [2],
3160eca46af7Smrg    [Command to use after installation of a shared archive])
3161eca46af7Smrg_LT_DECL([], [postuninstall_cmds], [2],
3162eca46af7Smrg    [Command to use after uninstallation of a shared archive])
3163eca46af7Smrg_LT_DECL([], [finish_cmds], [2],
3164eca46af7Smrg    [Commands used to finish a libtool library installation in a directory])
3165eca46af7Smrg_LT_DECL([], [finish_eval], [1],
3166eca46af7Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
3167eca46af7Smrg    not shown]])
3168eca46af7Smrg_LT_DECL([], [hardcode_into_libs], [0],
3169eca46af7Smrg    [Whether we should hardcode library paths into libraries])
3170eca46af7Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3171eca46af7Smrg    [Compile-time system search path for libraries])
317289b0dc75Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
317389b0dc75Smrg    [Detected run-time system search path for libraries])
317489b0dc75Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
317589b0dc75Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3176eca46af7Smrg])# _LT_SYS_DYNAMIC_LINKER
317714330f12Smrg
317814330f12Smrg
3179eca46af7Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
3180eca46af7Smrg# --------------------------
3181eca46af7Smrg# find a file program that can recognize shared library
3182eca46af7SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3183eca46af7Smrg[m4_require([_LT_DECL_EGREP])dnl
3184eca46af7SmrgAC_MSG_CHECKING([for $1])
3185eca46af7SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3186eca46af7Smrg[case $MAGIC_CMD in
3187eca46af7Smrg[[\\/*] |  ?:[\\/]*])
3188eca46af7Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
3189eca46af7Smrg  ;;
3190eca46af7Smrg*)
3191eca46af7Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3192eca46af7Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3193eca46af7Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3194eca46af7Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3195eca46af7Smrgdnl not every word.  This closes a longstanding sh security hole.
3196eca46af7Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3197eca46af7Smrg  for ac_dir in $ac_dummy; do
3198eca46af7Smrg    IFS=$lt_save_ifs
3199eca46af7Smrg    test -z "$ac_dir" && ac_dir=.
3200eca46af7Smrg    if test -f "$ac_dir/$1"; then
3201eca46af7Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3202eca46af7Smrg      if test -n "$file_magic_test_file"; then
3203eca46af7Smrg	case $deplibs_check_method in
3204eca46af7Smrg	"file_magic "*)
3205eca46af7Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3206eca46af7Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3207eca46af7Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3208eca46af7Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
3209eca46af7Smrg	    :
3210eca46af7Smrg	  else
3211eca46af7Smrg	    cat <<_LT_EOF 1>&2
321214330f12Smrg
3213eca46af7Smrg*** Warning: the command libtool uses to detect shared libraries,
3214eca46af7Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3215eca46af7Smrg*** The result is that libtool may fail to recognize shared libraries
3216eca46af7Smrg*** as such.  This will affect the creation of libtool libraries that
3217eca46af7Smrg*** depend on shared libraries, but programs linked with such libtool
3218eca46af7Smrg*** libraries will work regardless of this problem.  Nevertheless, you
3219eca46af7Smrg*** may want to report the problem to your system manager and/or to
3220eca46af7Smrg*** bug-libtool@gnu.org
322114330f12Smrg
3222eca46af7Smrg_LT_EOF
3223eca46af7Smrg	  fi ;;
3224eca46af7Smrg	esac
3225eca46af7Smrg      fi
3226eca46af7Smrg      break
3227eca46af7Smrg    fi
3228eca46af7Smrg  done
3229eca46af7Smrg  IFS=$lt_save_ifs
3230eca46af7Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
3231eca46af7Smrg  ;;
3232eca46af7Smrgesac])
3233eca46af7SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3234eca46af7Smrgif test -n "$MAGIC_CMD"; then
3235eca46af7Smrg  AC_MSG_RESULT($MAGIC_CMD)
323614330f12Smrgelse
3237eca46af7Smrg  AC_MSG_RESULT(no)
323814330f12Smrgfi
3239eca46af7Smrg_LT_DECL([], [MAGIC_CMD], [0],
3240eca46af7Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3241eca46af7Smrg])# _LT_PATH_TOOL_PREFIX
324214330f12Smrg
3243eca46af7Smrg# Old name:
3244eca46af7SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3245eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
3246eca46af7Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
324714330f12Smrg
324814330f12Smrg
3249eca46af7Smrg# _LT_PATH_MAGIC
3250eca46af7Smrg# --------------
3251eca46af7Smrg# find a file program that can recognize a shared library
3252eca46af7Smrgm4_defun([_LT_PATH_MAGIC],
3253eca46af7Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
3254eca46af7Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
3255eca46af7Smrg  if test -n "$ac_tool_prefix"; then
3256eca46af7Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
325714330f12Smrg  else
3258eca46af7Smrg    MAGIC_CMD=:
325914330f12Smrg  fi
326014330f12Smrgfi
3261eca46af7Smrg])# _LT_PATH_MAGIC
326214330f12Smrg
326314330f12Smrg
3264eca46af7Smrg# LT_PATH_LD
3265eca46af7Smrg# ----------
3266eca46af7Smrg# find the pathname to the GNU or non-GNU linker
3267eca46af7SmrgAC_DEFUN([LT_PATH_LD],
3268eca46af7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3269eca46af7SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3270eca46af7SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3271eca46af7Smrgm4_require([_LT_DECL_SED])dnl
3272eca46af7Smrgm4_require([_LT_DECL_EGREP])dnl
3273eca46af7Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
327414330f12Smrg
3275eca46af7SmrgAC_ARG_WITH([gnu-ld],
3276eca46af7Smrg    [AS_HELP_STRING([--with-gnu-ld],
3277eca46af7Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3278eca46af7Smrg    [test no = "$withval" || with_gnu_ld=yes],
3279eca46af7Smrg    [with_gnu_ld=no])dnl
3280eca46af7Smrg
3281eca46af7Smrgac_prog=ld
3282eca46af7Smrgif test yes = "$GCC"; then
3283eca46af7Smrg  # Check if gcc -print-prog-name=ld gives a path.
3284eca46af7Smrg  AC_MSG_CHECKING([for ld used by $CC])
3285eca46af7Smrg  case $host in
3286eca46af7Smrg  *-*-mingw*)
3287eca46af7Smrg    # gcc leaves a trailing carriage return, which upsets mingw
3288eca46af7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3289eca46af7Smrg  *)
3290eca46af7Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3291eca46af7Smrg  esac
3292eca46af7Smrg  case $ac_prog in
3293eca46af7Smrg    # Accept absolute paths.
3294eca46af7Smrg    [[\\/]]* | ?:[[\\/]]*)
3295eca46af7Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
3296eca46af7Smrg      # Canonicalize the pathname of ld
3297eca46af7Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3298eca46af7Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3299eca46af7Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
3300eca46af7Smrg      done
3301eca46af7Smrg      test -z "$LD" && LD=$ac_prog
3302eca46af7Smrg      ;;
3303eca46af7Smrg  "")
3304eca46af7Smrg    # If it fails, then pretend we aren't using GCC.
3305eca46af7Smrg    ac_prog=ld
330614330f12Smrg    ;;
330714330f12Smrg  *)
3308eca46af7Smrg    # If it is relative, then search for the first ld in PATH.
3309eca46af7Smrg    with_gnu_ld=unknown
331014330f12Smrg    ;;
331114330f12Smrg  esac
3312eca46af7Smrgelif test yes = "$with_gnu_ld"; then
3313eca46af7Smrg  AC_MSG_CHECKING([for GNU ld])
3314eca46af7Smrgelse
3315eca46af7Smrg  AC_MSG_CHECKING([for non-GNU ld])
331614330f12Smrgfi
3317eca46af7SmrgAC_CACHE_VAL(lt_cv_path_LD,
3318eca46af7Smrg[if test -z "$LD"; then
3319eca46af7Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3320eca46af7Smrg  for ac_dir in $PATH; do
3321eca46af7Smrg    IFS=$lt_save_ifs
3322eca46af7Smrg    test -z "$ac_dir" && ac_dir=.
3323eca46af7Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3324eca46af7Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
3325eca46af7Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
3326eca46af7Smrg      # but apparently some variants of GNU ld only accept -v.
3327eca46af7Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
3328eca46af7Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
3329eca46af7Smrg      *GNU* | *'with BFD'*)
3330eca46af7Smrg	test no != "$with_gnu_ld" && break
3331eca46af7Smrg	;;
3332eca46af7Smrg      *)
3333eca46af7Smrg	test yes != "$with_gnu_ld" && break
3334eca46af7Smrg	;;
3335eca46af7Smrg      esac
3336eca46af7Smrg    fi
3337eca46af7Smrg  done
3338eca46af7Smrg  IFS=$lt_save_ifs
3339eca46af7Smrgelse
3340eca46af7Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
3341eca46af7Smrgfi])
3342eca46af7SmrgLD=$lt_cv_path_LD
3343eca46af7Smrgif test -n "$LD"; then
3344eca46af7Smrg  AC_MSG_RESULT($LD)
3345eca46af7Smrgelse
3346eca46af7Smrg  AC_MSG_RESULT(no)
3347eca46af7Smrgfi
3348eca46af7Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3349eca46af7Smrg_LT_PATH_LD_GNU
3350eca46af7SmrgAC_SUBST([LD])
335114330f12Smrg
3352eca46af7Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3353eca46af7Smrg])# LT_PATH_LD
335414330f12Smrg
3355eca46af7Smrg# Old names:
3356eca46af7SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3357eca46af7SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3358eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
3359eca46af7Smrgdnl AC_DEFUN([AM_PROG_LD], [])
3360eca46af7Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3361eca46af7Smrg
3362eca46af7Smrg
3363eca46af7Smrg# _LT_PATH_LD_GNU
3364eca46af7Smrg#- --------------
3365eca46af7Smrgm4_defun([_LT_PATH_LD_GNU],
3366eca46af7Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
3367eca46af7Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
3368eca46af7Smrgcase `$LD -v 2>&1 </dev/null` in
3369eca46af7Smrg*GNU* | *'with BFD'*)
3370eca46af7Smrg  lt_cv_prog_gnu_ld=yes
3371eca46af7Smrg  ;;
3372eca46af7Smrg*)
3373eca46af7Smrg  lt_cv_prog_gnu_ld=no
3374eca46af7Smrg  ;;
3375eca46af7Smrgesac])
3376eca46af7Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3377eca46af7Smrg])# _LT_PATH_LD_GNU
3378eca46af7Smrg
3379eca46af7Smrg
3380eca46af7Smrg# _LT_CMD_RELOAD
3381eca46af7Smrg# --------------
3382eca46af7Smrg# find reload flag for linker
3383eca46af7Smrg#   -- PORTME Some linkers may need a different reload flag.
3384eca46af7Smrgm4_defun([_LT_CMD_RELOAD],
3385eca46af7Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
3386eca46af7Smrg  lt_cv_ld_reload_flag,
3387eca46af7Smrg  [lt_cv_ld_reload_flag='-r'])
3388eca46af7Smrgreload_flag=$lt_cv_ld_reload_flag
3389eca46af7Smrgcase $reload_flag in
3390eca46af7Smrg"" | " "*) ;;
3391eca46af7Smrg*) reload_flag=" $reload_flag" ;;
3392eca46af7Smrgesac
3393eca46af7Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
3394eca46af7Smrgcase $host_os in
3395eca46af7Smrg  cygwin* | mingw* | pw32* | cegcc*)
3396eca46af7Smrg    if test yes != "$GCC"; then
3397eca46af7Smrg      reload_cmds=false
3398eca46af7Smrg    fi
339914330f12Smrg    ;;
3400eca46af7Smrg  darwin*)
3401eca46af7Smrg    if test yes = "$GCC"; then
3402eca46af7Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
340314330f12Smrg    else
3404eca46af7Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
340514330f12Smrg    fi
3406eca46af7Smrg    ;;
3407eca46af7Smrgesac
3408eca46af7Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3409eca46af7Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3410eca46af7Smrg])# _LT_CMD_RELOAD
3411eca46af7Smrg
3412eca46af7Smrg
3413eca46af7Smrg# _LT_PATH_DD
3414eca46af7Smrg# -----------
3415eca46af7Smrg# find a working dd
3416eca46af7Smrgm4_defun([_LT_PATH_DD],
3417eca46af7Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3418eca46af7Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3419eca46af7Smrgcat conftest.i conftest.i >conftest2.i
3420eca46af7Smrg: ${lt_DD:=$DD}
3421eca46af7SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3422eca46af7Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3423eca46af7Smrg  cmp -s conftest.i conftest.out \
3424eca46af7Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
342514330f12Smrgfi])
3426eca46af7Smrgrm -f conftest.i conftest2.i conftest.out])
3427eca46af7Smrg])# _LT_PATH_DD
342814330f12Smrg
3429eca46af7Smrg
3430eca46af7Smrg# _LT_CMD_TRUNCATE
3431eca46af7Smrg# ----------------
3432eca46af7Smrg# find command to truncate a binary pipe
3433eca46af7Smrgm4_defun([_LT_CMD_TRUNCATE],
3434eca46af7Smrg[m4_require([_LT_PATH_DD])
3435eca46af7SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3436eca46af7Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3437eca46af7Smrgcat conftest.i conftest.i >conftest2.i
3438eca46af7Smrglt_cv_truncate_bin=
3439eca46af7Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3440eca46af7Smrg  cmp -s conftest.i conftest.out \
3441eca46af7Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3442eca46af7Smrgfi
3443eca46af7Smrgrm -f conftest.i conftest2.i conftest.out
3444eca46af7Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3445eca46af7Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3446eca46af7Smrg  [Command to truncate a binary pipe])
3447eca46af7Smrg])# _LT_CMD_TRUNCATE
3448eca46af7Smrg
3449eca46af7Smrg
3450eca46af7Smrg# _LT_CHECK_MAGIC_METHOD
3451eca46af7Smrg# ----------------------
3452eca46af7Smrg# how to check for library dependencies
3453eca46af7Smrg#  -- PORTME fill in with the dynamic library characteristics
3454eca46af7Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3455eca46af7Smrg[m4_require([_LT_DECL_EGREP])
3456eca46af7Smrgm4_require([_LT_DECL_OBJDUMP])
3457eca46af7SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
3458eca46af7Smrglt_cv_deplibs_check_method,
3459eca46af7Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
3460eca46af7Smrglt_cv_file_magic_test_file=
3461eca46af7Smrglt_cv_deplibs_check_method='unknown'
3462eca46af7Smrg# Need to set the preceding variable on all platforms that support
3463eca46af7Smrg# interlibrary dependencies.
3464eca46af7Smrg# 'none' -- dependencies not supported.
3465eca46af7Smrg# 'unknown' -- same as none, but documents that we really don't know.
3466eca46af7Smrg# 'pass_all' -- all dependencies passed with no checks.
3467eca46af7Smrg# 'test_compile' -- check by making test program.
3468eca46af7Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3469eca46af7Smrg# that responds to the $file_magic_cmd with a given extended regex.
3470eca46af7Smrg# If you have 'file' or equivalent on your system and you're not sure
3471eca46af7Smrg# whether 'pass_all' will *always* work, you probably want this one.
347214330f12Smrg
347314330f12Smrgcase $host_os in
3474eca46af7Smrgaix[[4-9]]*)
3475eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
3476eca46af7Smrg  ;;
347714330f12Smrg
3478eca46af7Smrgbeos*)
3479eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
348014330f12Smrg  ;;
348114330f12Smrg
3482eca46af7Smrgbsdi[[45]]*)
3483eca46af7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
3484eca46af7Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
3485eca46af7Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
3486eca46af7Smrg  ;;
3487eca46af7Smrg
3488eca46af7Smrgcygwin*)
3489eca46af7Smrg  # func_win32_libid is a shell function defined in ltmain.sh
3490eca46af7Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3491eca46af7Smrg  lt_cv_file_magic_cmd='func_win32_libid'
3492eca46af7Smrg  ;;
3493eca46af7Smrg
3494eca46af7Smrgmingw* | pw32*)
3495eca46af7Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3496eca46af7Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3497eca46af7Smrg  # unless we find 'file', for example because we are cross-compiling.
3498eca46af7Smrg  if ( file / ) >/dev/null 2>&1; then
3499eca46af7Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3500eca46af7Smrg    lt_cv_file_magic_cmd='func_win32_libid'
350114330f12Smrg  else
3502eca46af7Smrg    # Keep this pattern in sync with the one in func_win32_libid.
3503eca46af7Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3504eca46af7Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3505eca46af7Smrg  fi
3506eca46af7Smrg  ;;
3507eca46af7Smrg
3508eca46af7Smrgcegcc*)
3509eca46af7Smrg  # use the weaker test based on 'objdump'. See mingw*.
3510eca46af7Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3511eca46af7Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3512eca46af7Smrg  ;;
3513eca46af7Smrg
3514eca46af7Smrgdarwin* | rhapsody*)
3515eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
3516eca46af7Smrg  ;;
3517eca46af7Smrg
3518eca46af7Smrgfreebsd* | dragonfly*)
3519eca46af7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3520eca46af7Smrg    case $host_cpu in
3521eca46af7Smrg    i*86 )
3522eca46af7Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
3523eca46af7Smrg      # Let's accept both of them until this is cleared up.
3524eca46af7Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
3525eca46af7Smrg      lt_cv_file_magic_cmd=/usr/bin/file
3526eca46af7Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
35272378475aSmrg      ;;
352814330f12Smrg    esac
3529eca46af7Smrg  else
3530eca46af7Smrg    lt_cv_deplibs_check_method=pass_all
353114330f12Smrg  fi
353214330f12Smrg  ;;
353314330f12Smrg
3534eca46af7Smrghaiku*)
3535eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
3536eca46af7Smrg  ;;
3537eca46af7Smrg
3538eca46af7Smrghpux10.20* | hpux11*)
3539eca46af7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
354014330f12Smrg  case $host_cpu in
3541eca46af7Smrg  ia64*)
3542eca46af7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
3543eca46af7Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
354414330f12Smrg    ;;
3545eca46af7Smrg  hppa*64*)
3546eca46af7Smrg    [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]']
3547eca46af7Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
3548eca46af7Smrg    ;;
3549eca46af7Smrg  *)
3550eca46af7Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
3551eca46af7Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
355214330f12Smrg    ;;
355314330f12Smrg  esac
355414330f12Smrg  ;;
355514330f12Smrg
3556eca46af7Smrginterix[[3-9]]*)
3557eca46af7Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
3558eca46af7Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
355914330f12Smrg  ;;
356014330f12Smrg
3561eca46af7Smrgirix5* | irix6* | nonstopux*)
3562eca46af7Smrg  case $LD in
3563eca46af7Smrg  *-32|*"-32 ") libmagic=32-bit;;
3564eca46af7Smrg  *-n32|*"-n32 ") libmagic=N32;;
3565eca46af7Smrg  *-64|*"-64 ") libmagic=64-bit;;
3566eca46af7Smrg  *) libmagic=never-match;;
3567eca46af7Smrg  esac
3568eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
3569eca46af7Smrg  ;;
357014330f12Smrg
3571eca46af7Smrg# This must be glibc/ELF.
3572eca46af7Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
3573eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
3574eca46af7Smrg  ;;
357514330f12Smrg
3576eca46af7Smrgnetbsd*)
3577eca46af7Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
3578eca46af7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3579eca46af7Smrg  else
3580eca46af7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
3581eca46af7Smrg  fi
3582eca46af7Smrg  ;;
358314330f12Smrg
3584eca46af7Smrgnewos6*)
3585eca46af7Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
3586eca46af7Smrg  lt_cv_file_magic_cmd=/usr/bin/file
3587eca46af7Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
3588eca46af7Smrg  ;;
358914330f12Smrg
3590eca46af7Smrg*nto* | *qnx*)
3591eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
3592eca46af7Smrg  ;;
359314330f12Smrg
3594eca46af7Smrgopenbsd* | bitrig*)
3595eca46af7Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
3596eca46af7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
3597eca46af7Smrg  else
3598eca46af7Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
3599eca46af7Smrg  fi
3600eca46af7Smrg  ;;
360114330f12Smrg
3602eca46af7Smrgosf3* | osf4* | osf5*)
3603eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
360414330f12Smrg  ;;
360514330f12Smrg
3606eca46af7Smrgrdos*)
3607eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
360814330f12Smrg  ;;
360914330f12Smrg
3610eca46af7Smrgsolaris*)
3611eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
361214330f12Smrg  ;;
361314330f12Smrg
3614eca46af7Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3615eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
361614330f12Smrg  ;;
361714330f12Smrg
3618eca46af7Smrgsysv4 | sysv4.3*)
3619eca46af7Smrg  case $host_vendor in
3620eca46af7Smrg  motorola)
3621eca46af7Smrg    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]]'
3622eca46af7Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
362314330f12Smrg    ;;
3624eca46af7Smrg  ncr)
3625eca46af7Smrg    lt_cv_deplibs_check_method=pass_all
362614330f12Smrg    ;;
3627eca46af7Smrg  sequent)
3628eca46af7Smrg    lt_cv_file_magic_cmd='/bin/file'
3629eca46af7Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
363014330f12Smrg    ;;
3631eca46af7Smrg  sni)
3632eca46af7Smrg    lt_cv_file_magic_cmd='/bin/file'
3633eca46af7Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
3634eca46af7Smrg    lt_cv_file_magic_test_file=/lib/libc.so
3635eca46af7Smrg    ;;
3636eca46af7Smrg  siemens)
3637eca46af7Smrg    lt_cv_deplibs_check_method=pass_all
3638eca46af7Smrg    ;;
3639eca46af7Smrg  pc)
3640eca46af7Smrg    lt_cv_deplibs_check_method=pass_all
364114330f12Smrg    ;;
364214330f12Smrg  esac
364314330f12Smrg  ;;
364414330f12Smrg
3645eca46af7Smrgtpf*)
3646eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
364714330f12Smrg  ;;
3648eca46af7Smrgos2*)
3649eca46af7Smrg  lt_cv_deplibs_check_method=pass_all
365014330f12Smrg  ;;
3651eca46af7Smrgesac
3652eca46af7Smrg])
365314330f12Smrg
3654eca46af7Smrgfile_magic_glob=
3655eca46af7Smrgwant_nocaseglob=no
3656eca46af7Smrgif test "$build" = "$host"; then
3657eca46af7Smrg  case $host_os in
3658eca46af7Smrg  mingw* | pw32*)
3659eca46af7Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3660eca46af7Smrg      want_nocaseglob=yes
366114330f12Smrg    else
3662eca46af7Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
366314330f12Smrg    fi
366414330f12Smrg    ;;
366514330f12Smrg  esac
3666eca46af7Smrgfi
366714330f12Smrg
3668eca46af7Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
3669eca46af7Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
3670eca46af7Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
367114330f12Smrg
3672eca46af7Smrg_LT_DECL([], [deplibs_check_method], [1],
3673eca46af7Smrg    [Method to check whether dependent libraries are shared objects])
3674eca46af7Smrg_LT_DECL([], [file_magic_cmd], [1],
3675eca46af7Smrg    [Command to use when deplibs_check_method = "file_magic"])
3676eca46af7Smrg_LT_DECL([], [file_magic_glob], [1],
3677eca46af7Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3678eca46af7Smrg_LT_DECL([], [want_nocaseglob], [1],
3679eca46af7Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3680eca46af7Smrg])# _LT_CHECK_MAGIC_METHOD
3681eca46af7Smrg
3682eca46af7Smrg
3683eca46af7Smrg# LT_PATH_NM
3684eca46af7Smrg# ----------
3685eca46af7Smrg# find the pathname to a BSD- or MS-compatible name lister
3686eca46af7SmrgAC_DEFUN([LT_PATH_NM],
3687eca46af7Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3688eca46af7SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
3689eca46af7Smrg[if test -n "$NM"; then
3690eca46af7Smrg  # Let the user override the test.
3691eca46af7Smrg  lt_cv_path_NM=$NM
3692eca46af7Smrgelse
3693eca46af7Smrg  lt_nm_to_check=${ac_tool_prefix}nm
3694eca46af7Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
3695eca46af7Smrg    lt_nm_to_check="$lt_nm_to_check nm"
3696eca46af7Smrg  fi
3697eca46af7Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3698eca46af7Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3699eca46af7Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3700eca46af7Smrg      IFS=$lt_save_ifs
3701eca46af7Smrg      test -z "$ac_dir" && ac_dir=.
3702eca46af7Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
3703eca46af7Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
3704eca46af7Smrg	# Check to see if the nm accepts a BSD-compat flag.
3705eca46af7Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
3706eca46af7Smrg	#   nm: unknown option "B" ignored
3707eca46af7Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3708eca46af7Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3709eca46af7Smrg	case $build_os in
3710eca46af7Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3711eca46af7Smrg	*) lt_bad_file=/dev/null ;;
3712eca46af7Smrg	esac
3713eca46af7Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3714eca46af7Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
3715eca46af7Smrg	  lt_cv_path_NM="$tmp_nm -B"
3716eca46af7Smrg	  break 2
3717eca46af7Smrg	  ;;
3718eca46af7Smrg	*)
3719eca46af7Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
3720eca46af7Smrg	  */dev/null*)
3721eca46af7Smrg	    lt_cv_path_NM="$tmp_nm -p"
3722eca46af7Smrg	    break 2
3723eca46af7Smrg	    ;;
3724eca46af7Smrg	  *)
3725eca46af7Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
3726eca46af7Smrg	    continue # so that we can try to find one that supports BSD flags
3727eca46af7Smrg	    ;;
3728eca46af7Smrg	  esac
3729eca46af7Smrg	  ;;
3730eca46af7Smrg	esac
3731eca46af7Smrg      fi
3732eca46af7Smrg    done
3733eca46af7Smrg    IFS=$lt_save_ifs
3734eca46af7Smrg  done
3735eca46af7Smrg  : ${lt_cv_path_NM=no}
3736eca46af7Smrgfi])
3737eca46af7Smrgif test no != "$lt_cv_path_NM"; then
3738eca46af7Smrg  NM=$lt_cv_path_NM
3739eca46af7Smrgelse
3740eca46af7Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3741eca46af7Smrg  if test -n "$DUMPBIN"; then :
3742eca46af7Smrg    # Let the user override the test.
3743eca46af7Smrg  else
3744eca46af7Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3745eca46af7Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
3746eca46af7Smrg    *COFF*)
3747eca46af7Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
3748eca46af7Smrg      ;;
37492378475aSmrg    *)
3750eca46af7Smrg      DUMPBIN=:
3751eca46af7Smrg      ;;
3752eca46af7Smrg    esac
3753eca46af7Smrg  fi
3754eca46af7Smrg  AC_SUBST([DUMPBIN])
3755eca46af7Smrg  if test : != "$DUMPBIN"; then
3756eca46af7Smrg    NM=$DUMPBIN
3757eca46af7Smrg  fi
3758eca46af7Smrgfi
3759eca46af7Smrgtest -z "$NM" && NM=nm
3760eca46af7SmrgAC_SUBST([NM])
3761eca46af7Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3762eca46af7Smrg
3763eca46af7SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3764eca46af7Smrg  [lt_cv_nm_interface="BSD nm"
3765eca46af7Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3766eca46af7Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3767eca46af7Smrg  (eval "$ac_compile" 2>conftest.err)
3768eca46af7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3769eca46af7Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3770eca46af7Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3771eca46af7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3772eca46af7Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3773eca46af7Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3774eca46af7Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3775eca46af7Smrg    lt_cv_nm_interface="MS dumpbin"
3776eca46af7Smrg  fi
3777eca46af7Smrg  rm -f conftest*])
3778eca46af7Smrg])# LT_PATH_NM
3779eca46af7Smrg
3780eca46af7Smrg# Old names:
3781eca46af7SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3782eca46af7SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3783eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
3784eca46af7Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3785eca46af7Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3786eca46af7Smrg
3787eca46af7Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3788eca46af7Smrg# --------------------------------
3789eca46af7Smrg# how to determine the name of the shared library
3790eca46af7Smrg# associated with a specific link library.
3791eca46af7Smrg#  -- PORTME fill in with the dynamic library characteristics
3792eca46af7Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3793eca46af7Smrg[m4_require([_LT_DECL_EGREP])
3794eca46af7Smrgm4_require([_LT_DECL_OBJDUMP])
3795eca46af7Smrgm4_require([_LT_DECL_DLLTOOL])
3796eca46af7SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3797eca46af7Smrglt_cv_sharedlib_from_linklib_cmd,
3798eca46af7Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3799eca46af7Smrg
3800eca46af7Smrgcase $host_os in
3801eca46af7Smrgcygwin* | mingw* | pw32* | cegcc*)
3802eca46af7Smrg  # two different shell functions defined in ltmain.sh;
3803eca46af7Smrg  # decide which one to use based on capabilities of $DLLTOOL
3804eca46af7Smrg  case `$DLLTOOL --help 2>&1` in
3805eca46af7Smrg  *--identify-strict*)
3806eca46af7Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
380714330f12Smrg    ;;
380814330f12Smrg  *)
3809eca46af7Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
381014330f12Smrg    ;;
381114330f12Smrg  esac
381214330f12Smrg  ;;
3813eca46af7Smrg*)
3814eca46af7Smrg  # fallback: assume linklib IS sharedlib
3815eca46af7Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
381614330f12Smrg  ;;
3817eca46af7Smrgesac
3818eca46af7Smrg])
3819eca46af7Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3820eca46af7Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
382114330f12Smrg
3822eca46af7Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3823eca46af7Smrg    [Command to associate shared and link libraries])
3824eca46af7Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
382514330f12Smrg
382614330f12Smrg
3827eca46af7Smrg# _LT_PATH_MANIFEST_TOOL
3828eca46af7Smrg# ----------------------
3829eca46af7Smrg# locate the manifest tool
3830eca46af7Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3831eca46af7Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3832eca46af7Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3833eca46af7SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3834eca46af7Smrg  [lt_cv_path_mainfest_tool=no
3835eca46af7Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3836eca46af7Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3837eca46af7Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3838eca46af7Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3839eca46af7Smrg    lt_cv_path_mainfest_tool=yes
384014330f12Smrg  fi
3841eca46af7Smrg  rm -f conftest*])
3842eca46af7Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
3843eca46af7Smrg  MANIFEST_TOOL=:
3844eca46af7Smrgfi
3845eca46af7Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3846eca46af7Smrg])# _LT_PATH_MANIFEST_TOOL
384714330f12Smrg
384814330f12Smrg
3849eca46af7Smrg# _LT_DLL_DEF_P([FILE])
3850eca46af7Smrg# ---------------------
3851eca46af7Smrg# True iff FILE is a Windows DLL '.def' file.
3852eca46af7Smrg# Keep in sync with func_dll_def_p in the libtool script
3853eca46af7SmrgAC_DEFUN([_LT_DLL_DEF_P],
3854eca46af7Smrg[dnl
3855eca46af7Smrg  test DEF = "`$SED -n dnl
3856eca46af7Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3857eca46af7Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3858eca46af7Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3859eca46af7Smrg    -e q dnl                          Only consider the first "real" line
3860eca46af7Smrg    $1`" dnl
3861eca46af7Smrg])# _LT_DLL_DEF_P
386214330f12Smrg
386314330f12Smrg
3864eca46af7Smrg# LT_LIB_M
3865eca46af7Smrg# --------
3866eca46af7Smrg# check for math library
3867eca46af7SmrgAC_DEFUN([LT_LIB_M],
3868eca46af7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3869eca46af7SmrgLIBM=
3870eca46af7Smrgcase $host in
3871eca46af7Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
3872eca46af7Smrg  # These system don't have libm, or don't need it
387314330f12Smrg  ;;
3874eca46af7Smrg*-ncr-sysv4.3*)
3875eca46af7Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
3876eca46af7Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
387714330f12Smrg  ;;
3878eca46af7Smrg*)
3879eca46af7Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
388014330f12Smrg  ;;
3881eca46af7Smrgesac
3882eca46af7SmrgAC_SUBST([LIBM])
3883eca46af7Smrg])# LT_LIB_M
38842378475aSmrg
3885eca46af7Smrg# Old name:
3886eca46af7SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3887eca46af7Smrgdnl aclocal-1.4 backwards compatibility:
3888eca46af7Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
388914330f12Smrg
389014330f12Smrg
3891eca46af7Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3892eca46af7Smrg# -------------------------------
3893eca46af7Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3894eca46af7Smrg[m4_require([_LT_TAG_COMPILER])dnl
389514330f12Smrg
3896eca46af7Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
389714330f12Smrg
3898eca46af7Smrgif test yes = "$GCC"; then
3899eca46af7Smrg  case $cc_basename in
3900eca46af7Smrg  nvcc*)
3901eca46af7Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3902eca46af7Smrg  *)
3903eca46af7Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
390414330f12Smrg  esac
390514330f12Smrg
3906eca46af7Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3907eca46af7Smrg    lt_cv_prog_compiler_rtti_exceptions,
3908eca46af7Smrg    [-fno-rtti -fno-exceptions], [],
3909eca46af7Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3910eca46af7Smrgfi
3911eca46af7Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3912eca46af7Smrg	[Compiler flag to turn off builtin functions])
3913eca46af7Smrg])# _LT_COMPILER_NO_RTTI
391414330f12Smrg
3915eca46af7Smrg
3916eca46af7Smrg# _LT_CMD_GLOBAL_SYMBOLS
3917eca46af7Smrg# ----------------------
3918eca46af7Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3919eca46af7Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3920eca46af7SmrgAC_REQUIRE([AC_PROG_CC])dnl
3921eca46af7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3922eca46af7SmrgAC_REQUIRE([LT_PATH_NM])dnl
3923eca46af7SmrgAC_REQUIRE([LT_PATH_LD])dnl
3924eca46af7Smrgm4_require([_LT_DECL_SED])dnl
3925eca46af7Smrgm4_require([_LT_DECL_EGREP])dnl
3926eca46af7Smrgm4_require([_LT_TAG_COMPILER])dnl
3927eca46af7Smrg
3928eca46af7Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3929eca46af7SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3930eca46af7SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3931eca46af7Smrg[
3932eca46af7Smrg# These are sane defaults that work on at least a few old systems.
3933eca46af7Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3934eca46af7Smrg
3935eca46af7Smrg# Character class describing NM global symbol codes.
3936eca46af7Smrgsymcode='[[BCDEGRST]]'
3937eca46af7Smrg
3938eca46af7Smrg# Regexp to match symbols that can be accessed directly from C.
3939eca46af7Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3940eca46af7Smrg
3941eca46af7Smrg# Define system-specific variables.
3942eca46af7Smrgcase $host_os in
3943eca46af7Smrgaix*)
3944eca46af7Smrg  symcode='[[BCDT]]'
3945eca46af7Smrg  ;;
3946eca46af7Smrgcygwin* | mingw* | pw32* | cegcc*)
3947eca46af7Smrg  symcode='[[ABCDGISTW]]'
3948eca46af7Smrg  ;;
3949eca46af7Smrghpux*)
3950eca46af7Smrg  if test ia64 = "$host_cpu"; then
3951eca46af7Smrg    symcode='[[ABCDEGRST]]'
395214330f12Smrg  fi
395314330f12Smrg  ;;
3954eca46af7Smrgirix* | nonstopux*)
3955eca46af7Smrg  symcode='[[BCDEGRST]]'
395614330f12Smrg  ;;
3957eca46af7Smrgosf*)
3958eca46af7Smrg  symcode='[[BCDEGQRST]]'
395914330f12Smrg  ;;
3960eca46af7Smrgsolaris*)
3961eca46af7Smrg  symcode='[[BDRT]]'
3962eca46af7Smrg  ;;
3963eca46af7Smrgsco3.2v5*)
3964eca46af7Smrg  symcode='[[DT]]'
3965eca46af7Smrg  ;;
3966eca46af7Smrgsysv4.2uw2*)
3967eca46af7Smrg  symcode='[[DT]]'
3968eca46af7Smrg  ;;
3969eca46af7Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3970eca46af7Smrg  symcode='[[ABDT]]'
3971eca46af7Smrg  ;;
3972eca46af7Smrgsysv4)
3973eca46af7Smrg  symcode='[[DFNSTU]]'
397414330f12Smrg  ;;
397514330f12Smrgesac
39762378475aSmrg
3977eca46af7Smrg# If we're using GNU nm, then use its standard symbol codes.
3978eca46af7Smrgcase `$NM -V 2>&1` in
3979eca46af7Smrg*GNU* | *'with BFD'*)
3980eca46af7Smrg  symcode='[[ABCDGIRSTW]]' ;;
3981eca46af7Smrgesac
39822378475aSmrg
3983eca46af7Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3984eca46af7Smrg  # Gets list of data symbols to import.
3985eca46af7Smrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3986eca46af7Smrg  # Adjust the below global symbol transforms to fixup imported variables.
3987eca46af7Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3988eca46af7Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3989eca46af7Smrg  lt_c_name_lib_hook="\
3990eca46af7Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3991eca46af7Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3992eca46af7Smrgelse
3993eca46af7Smrg  # Disable hooks by default.
3994eca46af7Smrg  lt_cv_sys_global_symbol_to_import=
3995eca46af7Smrg  lt_cdecl_hook=
3996eca46af7Smrg  lt_c_name_hook=
3997eca46af7Smrg  lt_c_name_lib_hook=
399814330f12Smrgfi
39992378475aSmrg
4000eca46af7Smrg# Transform an extracted symbol line into a proper C declaration.
4001eca46af7Smrg# Some systems (esp. on ia64) link data and code symbols differently,
4002eca46af7Smrg# so use this general approach.
4003eca46af7Smrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
4004eca46af7Smrg$lt_cdecl_hook\
4005eca46af7Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
4006eca46af7Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
40072378475aSmrg
4008eca46af7Smrg# Transform an extracted symbol line into symbol name and symbol address
4009eca46af7Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4010eca46af7Smrg$lt_c_name_hook\
4011eca46af7Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4012eca46af7Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4013eca46af7Smrg
4014eca46af7Smrg# Transform an extracted symbol line into symbol name with lib prefix and
4015eca46af7Smrg# symbol address.
4016eca46af7Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4017eca46af7Smrg$lt_c_name_lib_hook\
4018eca46af7Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4019eca46af7Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4020eca46af7Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
40212378475aSmrg
4022eca46af7Smrg# Handle CRLF in mingw tool chain
4023eca46af7Smrgopt_cr=
4024eca46af7Smrgcase $build_os in
4025eca46af7Smrgmingw*)
4026eca46af7Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
402714330f12Smrg  ;;
4028eca46af7Smrgesac
40292378475aSmrg
4030eca46af7Smrg# Try without a prefix underscore, then with it.
4031eca46af7Smrgfor ac_symprfx in "" "_"; do
403214330f12Smrg
4033eca46af7Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
4034eca46af7Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
403514330f12Smrg
4036eca46af7Smrg  # Write the raw and C identifiers.
4037eca46af7Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4038eca46af7Smrg    # Fake it for dumpbin and say T for any non-static function,
4039eca46af7Smrg    # D for any global variable and I for any imported variable.
4040eca46af7Smrg    # Also find C++ and __fastcall symbols from MSVC++,
4041eca46af7Smrg    # which start with @ or ?.
4042eca46af7Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
4043eca46af7Smrg"     {last_section=section; section=\$ 3};"\
4044eca46af7Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
4045eca46af7Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4046eca46af7Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4047eca46af7Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4048eca46af7Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
4049eca46af7Smrg"     \$ 0!~/External *\|/{next};"\
4050eca46af7Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
4051eca46af7Smrg"     {if(hide[section]) next};"\
4052eca46af7Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4053eca46af7Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4054eca46af7Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4055eca46af7Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
4056eca46af7Smrg"     ' prfx=^$ac_symprfx]"
40572378475aSmrg  else
4058eca46af7Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
405914330f12Smrg  fi
4060eca46af7Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
40612378475aSmrg
4062eca46af7Smrg  # Check to see that the pipe works correctly.
4063eca46af7Smrg  pipe_works=no
40642378475aSmrg
4065eca46af7Smrg  rm -f conftest*
4066eca46af7Smrg  cat > conftest.$ac_ext <<_LT_EOF
4067eca46af7Smrg#ifdef __cplusplus
4068eca46af7Smrgextern "C" {
4069eca46af7Smrg#endif
4070eca46af7Smrgchar nm_test_var;
4071eca46af7Smrgvoid nm_test_func(void);
4072eca46af7Smrgvoid nm_test_func(void){}
4073eca46af7Smrg#ifdef __cplusplus
4074eca46af7Smrg}
4075eca46af7Smrg#endif
4076eca46af7Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
4077eca46af7Smrg_LT_EOF
407814330f12Smrg
4079eca46af7Smrg  if AC_TRY_EVAL(ac_compile); then
4080eca46af7Smrg    # Now try to grab the symbols.
4081eca46af7Smrg    nlist=conftest.nm
4082eca46af7Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
4083eca46af7Smrg      # Try sorting and uniquifying the output.
4084eca46af7Smrg      if sort "$nlist" | uniq > "$nlist"T; then
4085eca46af7Smrg	mv -f "$nlist"T "$nlist"
4086eca46af7Smrg      else
4087eca46af7Smrg	rm -f "$nlist"T
4088eca46af7Smrg      fi
408914330f12Smrg
4090eca46af7Smrg      # Make sure that we snagged all the symbols we need.
4091eca46af7Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
4092eca46af7Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
4093eca46af7Smrg	  cat <<_LT_EOF > conftest.$ac_ext
4094eca46af7Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4095eca46af7Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4096eca46af7Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
4097eca46af7Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
4098eca46af7Smrg# define LT@&t@_DLSYM_CONST
4099eca46af7Smrg#elif defined __osf__
4100eca46af7Smrg/* This system does not cope well with relocations in const data.  */
4101eca46af7Smrg# define LT@&t@_DLSYM_CONST
4102eca46af7Smrg#else
4103eca46af7Smrg# define LT@&t@_DLSYM_CONST const
4104eca46af7Smrg#endif
4105ff89ac2bSmrg
4106eca46af7Smrg#ifdef __cplusplus
4107eca46af7Smrgextern "C" {
4108eca46af7Smrg#endif
4109ff89ac2bSmrg
4110eca46af7Smrg_LT_EOF
4111eca46af7Smrg	  # Now generate the symbol file.
4112eca46af7Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
411395b296d0Smrg
4114eca46af7Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
411595b296d0Smrg
4116eca46af7Smrg/* The mapping between symbol names and symbols.  */
4117eca46af7SmrgLT@&t@_DLSYM_CONST struct {
4118eca46af7Smrg  const char *name;
4119eca46af7Smrg  void       *address;
4120eca46af7Smrg}
4121eca46af7Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
4122eca46af7Smrg{
4123eca46af7Smrg  { "@PROGRAM@", (void *) 0 },
4124eca46af7Smrg_LT_EOF
4125eca46af7Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
4126eca46af7Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
4127eca46af7Smrg  {0, (void *) 0}
4128eca46af7Smrg};
412995b296d0Smrg
4130eca46af7Smrg/* This works around a problem in FreeBSD linker */
4131eca46af7Smrg#ifdef FREEBSD_WORKAROUND
4132eca46af7Smrgstatic const void *lt_preloaded_setup() {
4133eca46af7Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
4134eca46af7Smrg}
4135eca46af7Smrg#endif
413695b296d0Smrg
4137eca46af7Smrg#ifdef __cplusplus
4138eca46af7Smrg}
4139eca46af7Smrg#endif
4140eca46af7Smrg_LT_EOF
4141eca46af7Smrg	  # Now try linking the two files.
4142eca46af7Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
4143eca46af7Smrg	  lt_globsym_save_LIBS=$LIBS
4144eca46af7Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4145eca46af7Smrg	  LIBS=conftstm.$ac_objext
4146eca46af7Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4147eca46af7Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
4148eca46af7Smrg	    pipe_works=yes
4149eca46af7Smrg	  fi
4150eca46af7Smrg	  LIBS=$lt_globsym_save_LIBS
4151eca46af7Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
4152eca46af7Smrg	else
4153eca46af7Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4154eca46af7Smrg	fi
4155eca46af7Smrg      else
4156eca46af7Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
4157eca46af7Smrg      fi
4158eca46af7Smrg    else
4159eca46af7Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
416014330f12Smrg    fi
416114330f12Smrg  else
4162eca46af7Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
4163eca46af7Smrg    cat conftest.$ac_ext >&5
41642378475aSmrg  fi
4165eca46af7Smrg  rm -rf conftest* conftst*
416614330f12Smrg
4167eca46af7Smrg  # Do not use the global_symbol_pipe unless it works.
4168eca46af7Smrg  if test yes = "$pipe_works"; then
4169eca46af7Smrg    break
417014330f12Smrg  else
4171eca46af7Smrg    lt_cv_sys_global_symbol_pipe=
417214330f12Smrg  fi
4173eca46af7Smrgdone
4174eca46af7Smrg])
4175eca46af7Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
4176eca46af7Smrg  lt_cv_sys_global_symbol_to_cdecl=
4177eca46af7Smrgfi
4178eca46af7Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
4179eca46af7Smrg  AC_MSG_RESULT(failed)
4180eca46af7Smrgelse
4181eca46af7Smrg  AC_MSG_RESULT(ok)
4182eca46af7Smrgfi
418395b296d0Smrg
4184eca46af7Smrg# Response file support.
4185eca46af7Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
4186eca46af7Smrg  nm_file_list_spec='@'
4187eca46af7Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
4188eca46af7Smrg  nm_file_list_spec='@'
4189eca46af7Smrgfi
419095b296d0Smrg
4191eca46af7Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
4192eca46af7Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
4193eca46af7Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
4194eca46af7Smrg    [Transform the output of nm in a proper C declaration])
4195eca46af7Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4196eca46af7Smrg    [Transform the output of nm into a list of symbols to manually relocate])
4197eca46af7Smrg_LT_DECL([global_symbol_to_c_name_address],
4198eca46af7Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
4199eca46af7Smrg    [Transform the output of nm in a C name address pair])
4200eca46af7Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
4201eca46af7Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
4202eca46af7Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4203eca46af7Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4204eca46af7Smrg    [The name lister interface])
4205eca46af7Smrg_LT_DECL([], [nm_file_list_spec], [1],
4206eca46af7Smrg    [Specify filename containing input files for $NM])
4207eca46af7Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
420895b296d0Smrg
420995b296d0Smrg
4210eca46af7Smrg# _LT_COMPILER_PIC([TAGNAME])
4211eca46af7Smrg# ---------------------------
4212eca46af7Smrgm4_defun([_LT_COMPILER_PIC],
4213eca46af7Smrg[m4_require([_LT_TAG_COMPILER])dnl
4214eca46af7Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
4215eca46af7Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4216eca46af7Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
421795b296d0Smrg
4218eca46af7Smrgm4_if([$1], [CXX], [
4219eca46af7Smrg  # C++ specific cases for pic, static, wl, etc.
4220eca46af7Smrg  if test yes = "$GXX"; then
4221eca46af7Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4222eca46af7Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
422395b296d0Smrg
4224eca46af7Smrg    case $host_os in
4225eca46af7Smrg    aix*)
4226eca46af7Smrg      # All AIX code is PIC.
4227eca46af7Smrg      if test ia64 = "$host_cpu"; then
4228eca46af7Smrg	# AIX 5 now supports IA64 processor
4229eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4230eca46af7Smrg      fi
4231eca46af7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4232eca46af7Smrg      ;;
423395b296d0Smrg
4234eca46af7Smrg    amigaos*)
4235eca46af7Smrg      case $host_cpu in
4236eca46af7Smrg      powerpc)
4237eca46af7Smrg            # see comment about AmigaOS4 .so support
4238eca46af7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4239eca46af7Smrg        ;;
4240eca46af7Smrg      m68k)
4241eca46af7Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4242eca46af7Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4243eca46af7Smrg            # like '-m68040'.
4244eca46af7Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4245eca46af7Smrg        ;;
4246eca46af7Smrg      esac
4247eca46af7Smrg      ;;
424814330f12Smrg
424914330f12Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
425014330f12Smrg      # PIC is the default for these OSes.
425114330f12Smrg      ;;
425214330f12Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
425314330f12Smrg      # This hack is so that the source file can tell whether it is being
425414330f12Smrg      # built for inclusion in a dll (and should export symbols for example).
425514330f12Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
425614330f12Smrg      # (--disable-auto-import) libraries
425714330f12Smrg      m4_if([$1], [GCJ], [],
425814330f12Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4259eca46af7Smrg      case $host_os in
4260eca46af7Smrg      os2*)
4261eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4262eca46af7Smrg	;;
4263eca46af7Smrg      esac
426414330f12Smrg      ;;
426514330f12Smrg    darwin* | rhapsody*)
426614330f12Smrg      # PIC is the default on this platform
426714330f12Smrg      # Common symbols not allowed in MH_DYLIB files
426814330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
426914330f12Smrg      ;;
427014330f12Smrg    *djgpp*)
427114330f12Smrg      # DJGPP does not support shared libraries at all
427214330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
427314330f12Smrg      ;;
427414330f12Smrg    haiku*)
427514330f12Smrg      # PIC is the default for Haiku.
427614330f12Smrg      # The "-static" flag exists, but is broken.
427714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
427814330f12Smrg      ;;
427914330f12Smrg    interix[[3-9]]*)
428014330f12Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
428114330f12Smrg      # Instead, we relocate shared libraries at runtime.
42822378475aSmrg      ;;
42832378475aSmrg    sysv4*MP*)
42842378475aSmrg      if test -d /usr/nec; then
428514330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
42862378475aSmrg      fi
42872378475aSmrg      ;;
428814330f12Smrg    hpux*)
428914330f12Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
429014330f12Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
429114330f12Smrg      # sets the default TLS model and affects inlining.
429214330f12Smrg      case $host_cpu in
429314330f12Smrg      hppa*64*)
429414330f12Smrg	;;
429514330f12Smrg      *)
429614330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
429714330f12Smrg	;;
429814330f12Smrg      esac
42992378475aSmrg      ;;
430014330f12Smrg    *qnx* | *nto*)
430114330f12Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
430214330f12Smrg      # it will coredump.
430314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
430414330f12Smrg      ;;
430514330f12Smrg    *)
430614330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
430714330f12Smrg      ;;
430814330f12Smrg    esac
430914330f12Smrg  else
431014330f12Smrg    case $host_os in
431114330f12Smrg      aix[[4-9]]*)
431214330f12Smrg	# All AIX code is PIC.
4313eca46af7Smrg	if test ia64 = "$host_cpu"; then
431414330f12Smrg	  # AIX 5 now supports IA64 processor
431514330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
431614330f12Smrg	else
431714330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
431814330f12Smrg	fi
431914330f12Smrg	;;
432014330f12Smrg      chorus*)
432114330f12Smrg	case $cc_basename in
432214330f12Smrg	cxch68*)
432314330f12Smrg	  # Green Hills C++ Compiler
432414330f12Smrg	  # _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"
432514330f12Smrg	  ;;
432614330f12Smrg	esac
432714330f12Smrg	;;
432814330f12Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
432914330f12Smrg	# This hack is so that the source file can tell whether it is being
433014330f12Smrg	# built for inclusion in a dll (and should export symbols for example).
433114330f12Smrg	m4_if([$1], [GCJ], [],
433214330f12Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
433314330f12Smrg	;;
433414330f12Smrg      dgux*)
433514330f12Smrg	case $cc_basename in
433614330f12Smrg	  ec++*)
433714330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
433814330f12Smrg	    ;;
433914330f12Smrg	  ghcx*)
434014330f12Smrg	    # Green Hills C++ Compiler
434114330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
434214330f12Smrg	    ;;
434314330f12Smrg	  *)
434414330f12Smrg	    ;;
434514330f12Smrg	esac
434614330f12Smrg	;;
434714330f12Smrg      freebsd* | dragonfly*)
434814330f12Smrg	# FreeBSD uses GNU C++
434914330f12Smrg	;;
435014330f12Smrg      hpux9* | hpux10* | hpux11*)
435114330f12Smrg	case $cc_basename in
435214330f12Smrg	  CC*)
435314330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4354eca46af7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4355eca46af7Smrg	    if test ia64 != "$host_cpu"; then
435614330f12Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
435714330f12Smrg	    fi
435814330f12Smrg	    ;;
435914330f12Smrg	  aCC*)
436014330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4361eca46af7Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
436214330f12Smrg	    case $host_cpu in
436314330f12Smrg	    hppa*64*|ia64*)
436414330f12Smrg	      # +Z the default
436514330f12Smrg	      ;;
436614330f12Smrg	    *)
436714330f12Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
436814330f12Smrg	      ;;
436914330f12Smrg	    esac
437014330f12Smrg	    ;;
437114330f12Smrg	  *)
437214330f12Smrg	    ;;
437314330f12Smrg	esac
437414330f12Smrg	;;
437514330f12Smrg      interix*)
437614330f12Smrg	# This is c89, which is MS Visual C++ (no shared libs)
437714330f12Smrg	# Anyone wants to do a port?
437814330f12Smrg	;;
437914330f12Smrg      irix5* | irix6* | nonstopux*)
438014330f12Smrg	case $cc_basename in
438114330f12Smrg	  CC*)
438214330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
438314330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
438414330f12Smrg	    # CC pic flag -KPIC is the default.
438514330f12Smrg	    ;;
438614330f12Smrg	  *)
438714330f12Smrg	    ;;
438814330f12Smrg	esac
438914330f12Smrg	;;
4390eca46af7Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
439114330f12Smrg	case $cc_basename in
439214330f12Smrg	  KCC*)
439314330f12Smrg	    # KAI C++ Compiler
439414330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
439514330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
439614330f12Smrg	    ;;
439714330f12Smrg	  ecpc* )
4398eca46af7Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
439914330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440014330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
440114330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
440214330f12Smrg	    ;;
440314330f12Smrg	  icpc* )
440414330f12Smrg	    # Intel C++, used to be incompatible with GCC.
440514330f12Smrg	    # ICC 10 doesn't accept -KPIC any more.
440614330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440714330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
440814330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
440914330f12Smrg	    ;;
441014330f12Smrg	  pgCC* | pgcpp*)
441114330f12Smrg	    # Portland Group C++ compiler
441214330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441314330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
441414330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
441514330f12Smrg	    ;;
441614330f12Smrg	  cxx*)
441714330f12Smrg	    # Compaq C++
441814330f12Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
441914330f12Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
442014330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
442114330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
442214330f12Smrg	    ;;
442314330f12Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
442414330f12Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
442514330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
442614330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
442714330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
442814330f12Smrg	    ;;
442914330f12Smrg	  *)
443014330f12Smrg	    case `$CC -V 2>&1 | sed 5q` in
443114330f12Smrg	    *Sun\ C*)
443214330f12Smrg	      # Sun C++ 5.9
443314330f12Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
443414330f12Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
443514330f12Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
443614330f12Smrg	      ;;
443714330f12Smrg	    esac
443814330f12Smrg	    ;;
443914330f12Smrg	esac
444014330f12Smrg	;;
444114330f12Smrg      lynxos*)
444214330f12Smrg	;;
444314330f12Smrg      m88k*)
444414330f12Smrg	;;
444514330f12Smrg      mvs*)
444614330f12Smrg	case $cc_basename in
444714330f12Smrg	  cxx*)
444814330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
444914330f12Smrg	    ;;
445014330f12Smrg	  *)
445114330f12Smrg	    ;;
445214330f12Smrg	esac
445314330f12Smrg	;;
445414330f12Smrg      netbsd*)
445514330f12Smrg	;;
445614330f12Smrg      *qnx* | *nto*)
445714330f12Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
445814330f12Smrg        # it will coredump.
445914330f12Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
446014330f12Smrg        ;;
446114330f12Smrg      osf3* | osf4* | osf5*)
446214330f12Smrg	case $cc_basename in
446314330f12Smrg	  KCC*)
446414330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
446514330f12Smrg	    ;;
446614330f12Smrg	  RCC*)
446714330f12Smrg	    # Rational C++ 2.4.1
446814330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
446914330f12Smrg	    ;;
447014330f12Smrg	  cxx*)
447114330f12Smrg	    # Digital/Compaq C++
447214330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
447314330f12Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
447414330f12Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
447514330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
447614330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
447714330f12Smrg	    ;;
447814330f12Smrg	  *)
447914330f12Smrg	    ;;
448014330f12Smrg	esac
448114330f12Smrg	;;
448214330f12Smrg      psos*)
448314330f12Smrg	;;
448414330f12Smrg      solaris*)
448514330f12Smrg	case $cc_basename in
448614330f12Smrg	  CC* | sunCC*)
448714330f12Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
448814330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
448914330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449014330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
449114330f12Smrg	    ;;
449214330f12Smrg	  gcx*)
449314330f12Smrg	    # Green Hills C++ Compiler
449414330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
449514330f12Smrg	    ;;
449614330f12Smrg	  *)
449714330f12Smrg	    ;;
449814330f12Smrg	esac
449914330f12Smrg	;;
450014330f12Smrg      sunos4*)
450114330f12Smrg	case $cc_basename in
450214330f12Smrg	  CC*)
450314330f12Smrg	    # Sun C++ 4.x
450414330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450514330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
450614330f12Smrg	    ;;
450714330f12Smrg	  lcc*)
450814330f12Smrg	    # Lucid
450914330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
451014330f12Smrg	    ;;
451114330f12Smrg	  *)
451214330f12Smrg	    ;;
451314330f12Smrg	esac
451414330f12Smrg	;;
451514330f12Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
451614330f12Smrg	case $cc_basename in
451714330f12Smrg	  CC*)
451814330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
451914330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
452014330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
452114330f12Smrg	    ;;
452214330f12Smrg	esac
452314330f12Smrg	;;
452414330f12Smrg      tandem*)
452514330f12Smrg	case $cc_basename in
452614330f12Smrg	  NCC*)
452714330f12Smrg	    # NonStop-UX NCC 3.20
452814330f12Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
452914330f12Smrg	    ;;
453014330f12Smrg	  *)
453114330f12Smrg	    ;;
453214330f12Smrg	esac
453314330f12Smrg	;;
453414330f12Smrg      vxworks*)
453514330f12Smrg	;;
453614330f12Smrg      *)
453714330f12Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
453814330f12Smrg	;;
453914330f12Smrg    esac
454014330f12Smrg  fi
454114330f12Smrg],
454214330f12Smrg[
4543eca46af7Smrg  if test yes = "$GCC"; then
454414330f12Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
454514330f12Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
454695b296d0Smrg
454714330f12Smrg    case $host_os in
454814330f12Smrg      aix*)
454914330f12Smrg      # All AIX code is PIC.
4550eca46af7Smrg      if test ia64 = "$host_cpu"; then
455114330f12Smrg	# AIX 5 now supports IA64 processor
455214330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
45532378475aSmrg      fi
4554eca46af7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
45552378475aSmrg      ;;
455695b296d0Smrg
455714330f12Smrg    amigaos*)
455814330f12Smrg      case $host_cpu in
455914330f12Smrg      powerpc)
456014330f12Smrg            # see comment about AmigaOS4 .so support
456114330f12Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
456214330f12Smrg        ;;
456314330f12Smrg      m68k)
456414330f12Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4565eca46af7Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4566eca46af7Smrg            # like '-m68040'.
456714330f12Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
456814330f12Smrg        ;;
456914330f12Smrg      esac
45702378475aSmrg      ;;
457195b296d0Smrg
457214330f12Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
457314330f12Smrg      # PIC is the default for these OSes.
45742378475aSmrg      ;;
457595b296d0Smrg
457614330f12Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
457714330f12Smrg      # This hack is so that the source file can tell whether it is being
457814330f12Smrg      # built for inclusion in a dll (and should export symbols for example).
457914330f12Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
458014330f12Smrg      # (--disable-auto-import) libraries
458114330f12Smrg      m4_if([$1], [GCJ], [],
458214330f12Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4583eca46af7Smrg      case $host_os in
4584eca46af7Smrg      os2*)
4585eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4586eca46af7Smrg	;;
4587eca46af7Smrg      esac
45882378475aSmrg      ;;
458995b296d0Smrg
459014330f12Smrg    darwin* | rhapsody*)
459114330f12Smrg      # PIC is the default on this platform
459214330f12Smrg      # Common symbols not allowed in MH_DYLIB files
459314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
459414330f12Smrg      ;;
45952378475aSmrg
459614330f12Smrg    haiku*)
459714330f12Smrg      # PIC is the default for Haiku.
459814330f12Smrg      # The "-static" flag exists, but is broken.
459914330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
460014330f12Smrg      ;;
46012378475aSmrg
460214330f12Smrg    hpux*)
460314330f12Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
460414330f12Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
460514330f12Smrg      # sets the default TLS model and affects inlining.
460614330f12Smrg      case $host_cpu in
460714330f12Smrg      hppa*64*)
460814330f12Smrg	# +Z the default
460914330f12Smrg	;;
461014330f12Smrg      *)
461114330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
461214330f12Smrg	;;
461314330f12Smrg      esac
461414330f12Smrg      ;;
46152378475aSmrg
461614330f12Smrg    interix[[3-9]]*)
461714330f12Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
461814330f12Smrg      # Instead, we relocate shared libraries at runtime.
461914330f12Smrg      ;;
462095b296d0Smrg
462114330f12Smrg    msdosdjgpp*)
462214330f12Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
462314330f12Smrg      # on systems that don't support them.
462414330f12Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
462514330f12Smrg      enable_shared=no
462614330f12Smrg      ;;
462795b296d0Smrg
462814330f12Smrg    *nto* | *qnx*)
462914330f12Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
463014330f12Smrg      # it will coredump.
463114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
463214330f12Smrg      ;;
463395b296d0Smrg
463414330f12Smrg    sysv4*MP*)
463514330f12Smrg      if test -d /usr/nec; then
463614330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
463714330f12Smrg      fi
463814330f12Smrg      ;;
463995b296d0Smrg
464014330f12Smrg    *)
464114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
464214330f12Smrg      ;;
464314330f12Smrg    esac
464495b296d0Smrg
464514330f12Smrg    case $cc_basename in
464614330f12Smrg    nvcc*) # Cuda Compiler Driver 2.2
464714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4648eca46af7Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4649eca46af7Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4650eca46af7Smrg      fi
465114330f12Smrg      ;;
465214330f12Smrg    esac
465314330f12Smrg  else
465414330f12Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
465514330f12Smrg    case $host_os in
465614330f12Smrg    aix*)
465714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4658eca46af7Smrg      if test ia64 = "$host_cpu"; then
465914330f12Smrg	# AIX 5 now supports IA64 processor
466014330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
466114330f12Smrg      else
466214330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
466314330f12Smrg      fi
466414330f12Smrg      ;;
4665ff89ac2bSmrg
4666eca46af7Smrg    darwin* | rhapsody*)
4667eca46af7Smrg      # PIC is the default on this platform
4668eca46af7Smrg      # Common symbols not allowed in MH_DYLIB files
4669eca46af7Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4670eca46af7Smrg      case $cc_basename in
4671eca46af7Smrg      nagfor*)
4672eca46af7Smrg        # NAG Fortran compiler
4673eca46af7Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4674eca46af7Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4675eca46af7Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4676eca46af7Smrg        ;;
4677eca46af7Smrg      esac
4678eca46af7Smrg      ;;
4679eca46af7Smrg
468014330f12Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
468114330f12Smrg      # This hack is so that the source file can tell whether it is being
468214330f12Smrg      # built for inclusion in a dll (and should export symbols for example).
468314330f12Smrg      m4_if([$1], [GCJ], [],
468414330f12Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4685eca46af7Smrg      case $host_os in
4686eca46af7Smrg      os2*)
4687eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4688eca46af7Smrg	;;
4689eca46af7Smrg      esac
469014330f12Smrg      ;;
469195b296d0Smrg
469214330f12Smrg    hpux9* | hpux10* | hpux11*)
469314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
469414330f12Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
469514330f12Smrg      # not for PA HP-UX.
469614330f12Smrg      case $host_cpu in
469714330f12Smrg      hppa*64*|ia64*)
469814330f12Smrg	# +Z the default
469914330f12Smrg	;;
470014330f12Smrg      *)
470114330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
470214330f12Smrg	;;
470314330f12Smrg      esac
470414330f12Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4705eca46af7Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
470614330f12Smrg      ;;
470795b296d0Smrg
470814330f12Smrg    irix5* | irix6* | nonstopux*)
470914330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471014330f12Smrg      # PIC (with -KPIC) is the default.
471114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
471214330f12Smrg      ;;
47132378475aSmrg
4714eca46af7Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
471514330f12Smrg      case $cc_basename in
4716eca46af7Smrg      # old Intel for x86_64, which still supported -KPIC.
471714330f12Smrg      ecc*)
471814330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471914330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
472014330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
472114330f12Smrg        ;;
472214330f12Smrg      # icc used to be incompatible with GCC.
472314330f12Smrg      # ICC 10 doesn't accept -KPIC any more.
472414330f12Smrg      icc* | ifort*)
472514330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
472614330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
472714330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
472814330f12Smrg        ;;
472914330f12Smrg      # Lahey Fortran 8.1.
473014330f12Smrg      lf95*)
473114330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
473214330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
473314330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
473414330f12Smrg	;;
473514330f12Smrg      nagfor*)
473614330f12Smrg	# NAG Fortran compiler
473714330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
473814330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
473914330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
474014330f12Smrg	;;
4741eca46af7Smrg      tcc*)
4742eca46af7Smrg	# Fabrice Bellard et al's Tiny C Compiler
4743eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4744eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4745eca46af7Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4746eca46af7Smrg	;;
474714330f12Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
474814330f12Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
474914330f12Smrg	# which looks to be a dead project)
475014330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
475114330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
475214330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
475314330f12Smrg        ;;
475414330f12Smrg      ccc*)
475514330f12Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
475614330f12Smrg        # All Alpha code is PIC.
475714330f12Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
475814330f12Smrg        ;;
475914330f12Smrg      xl* | bgxl* | bgf* | mpixl*)
476014330f12Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
476114330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
476214330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
476314330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
476414330f12Smrg	;;
476514330f12Smrg      *)
476614330f12Smrg	case `$CC -V 2>&1 | sed 5q` in
4767eca46af7Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
476814330f12Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
476914330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
477014330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
477114330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
477214330f12Smrg	  ;;
4773eca46af7Smrg	*Sun\ F* | *Sun*Fortran*)
4774eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4775eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4776eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4777eca46af7Smrg	  ;;
477814330f12Smrg	*Sun\ C*)
477914330f12Smrg	  # Sun C 5.9
478014330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
478114330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
478214330f12Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
478314330f12Smrg	  ;;
4784eca46af7Smrg        *Intel*\ [[CF]]*Compiler*)
4785eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4786eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4787eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4788eca46af7Smrg	  ;;
4789eca46af7Smrg	*Portland\ Group*)
4790eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4791eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4792eca46af7Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4793eca46af7Smrg	  ;;
479414330f12Smrg	esac
479514330f12Smrg	;;
479614330f12Smrg      esac
479714330f12Smrg      ;;
479895b296d0Smrg
479914330f12Smrg    newsos6)
480014330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
480114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
480214330f12Smrg      ;;
480395b296d0Smrg
480414330f12Smrg    *nto* | *qnx*)
480514330f12Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
480614330f12Smrg      # it will coredump.
480714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
480814330f12Smrg      ;;
48092378475aSmrg
481014330f12Smrg    osf3* | osf4* | osf5*)
481114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
481214330f12Smrg      # All OSF/1 code is PIC.
481314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
481414330f12Smrg      ;;
48152378475aSmrg
481614330f12Smrg    rdos*)
481714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
481814330f12Smrg      ;;
48192378475aSmrg
482014330f12Smrg    solaris*)
482114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
482214330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
482314330f12Smrg      case $cc_basename in
482414330f12Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
482514330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
482614330f12Smrg      *)
482714330f12Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
482814330f12Smrg      esac
482914330f12Smrg      ;;
48302378475aSmrg
483114330f12Smrg    sunos4*)
483214330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
483314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
483414330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483514330f12Smrg      ;;
48362378475aSmrg
483714330f12Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
483814330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
483914330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
484014330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484114330f12Smrg      ;;
484295b296d0Smrg
484314330f12Smrg    sysv4*MP*)
4844eca46af7Smrg      if test -d /usr/nec; then
484514330f12Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
484614330f12Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484714330f12Smrg      fi
484814330f12Smrg      ;;
484995b296d0Smrg
485014330f12Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
485114330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
485214330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
485314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
485414330f12Smrg      ;;
485595b296d0Smrg
485614330f12Smrg    unicos*)
485714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
485814330f12Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
485914330f12Smrg      ;;
486095b296d0Smrg
486114330f12Smrg    uts4*)
486214330f12Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
486314330f12Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
486414330f12Smrg      ;;
486595b296d0Smrg
486614330f12Smrg    *)
486714330f12Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
486814330f12Smrg      ;;
486914330f12Smrg    esac
487014330f12Smrg  fi
487114330f12Smrg])
487214330f12Smrgcase $host_os in
4873eca46af7Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
487414330f12Smrg  *djgpp*)
487514330f12Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
487614330f12Smrg    ;;
487714330f12Smrg  *)
487814330f12Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
487914330f12Smrg    ;;
488014330f12Smrgesac
488195b296d0Smrg
488214330f12SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
488314330f12Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
488414330f12Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
488514330f12Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
488695b296d0Smrg
488714330f12Smrg#
488814330f12Smrg# Check to make sure the PIC flag actually works.
488914330f12Smrg#
489014330f12Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
489114330f12Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
489214330f12Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
489314330f12Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
489414330f12Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
489514330f12Smrg     "" | " "*) ;;
489614330f12Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
489714330f12Smrg     esac],
489814330f12Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
489914330f12Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
490014330f12Smrgfi
490114330f12Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
490214330f12Smrg	[Additional compiler flags for building library objects])
49032378475aSmrg
490414330f12Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
490514330f12Smrg	[How to pass a linker flag through the compiler])
490614330f12Smrg#
490714330f12Smrg# Check to make sure the static flag actually works.
490814330f12Smrg#
490914330f12Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
491014330f12Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
491114330f12Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
491214330f12Smrg  $lt_tmp_static_flag,
491314330f12Smrg  [],
491414330f12Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
491514330f12Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
491614330f12Smrg	[Compiler flag to prevent dynamic linking])
491714330f12Smrg])# _LT_COMPILER_PIC
491895b296d0Smrg
491995b296d0Smrg
492014330f12Smrg# _LT_LINKER_SHLIBS([TAGNAME])
492114330f12Smrg# ----------------------------
492214330f12Smrg# See if the linker supports building shared libraries.
492314330f12Smrgm4_defun([_LT_LINKER_SHLIBS],
492414330f12Smrg[AC_REQUIRE([LT_PATH_LD])dnl
492514330f12SmrgAC_REQUIRE([LT_PATH_NM])dnl
492614330f12Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
492714330f12Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
492814330f12Smrgm4_require([_LT_DECL_EGREP])dnl
492914330f12Smrgm4_require([_LT_DECL_SED])dnl
493014330f12Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
493114330f12Smrgm4_require([_LT_TAG_COMPILER])dnl
493214330f12SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
493314330f12Smrgm4_if([$1], [CXX], [
493414330f12Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
493514330f12Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
493614330f12Smrg  case $host_os in
493714330f12Smrg  aix[[4-9]]*)
493814330f12Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4939eca46af7Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4940eca46af7Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4941eca46af7Smrg    # weak defined symbols like other global defined symbols, whereas
4942eca46af7Smrg    # GNU nm marks them as "W".
4943eca46af7Smrg    # While the 'weak' keyword is ignored in the Export File, we need
4944eca46af7Smrg    # it in the Import File for the 'aix-soname' feature, so we have
4945eca46af7Smrg    # to replace the "-B" option with "-P" for AIX nm.
494614330f12Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4947eca46af7Smrg      _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'
49482378475aSmrg    else
4949eca46af7Smrg      _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'
49502378475aSmrg    fi
495114330f12Smrg    ;;
495214330f12Smrg  pw32*)
4953eca46af7Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
495414330f12Smrg    ;;
495514330f12Smrg  cygwin* | mingw* | cegcc*)
495614330f12Smrg    case $cc_basename in
4957eca46af7Smrg    cl*)
4958eca46af7Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4959eca46af7Smrg      ;;
496014330f12Smrg    *)
496114330f12Smrg      _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'
496214330f12Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
496314330f12Smrg      ;;
496414330f12Smrg    esac
496514330f12Smrg    ;;
496614330f12Smrg  *)
496714330f12Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
496814330f12Smrg    ;;
496914330f12Smrg  esac
497014330f12Smrg], [
497114330f12Smrg  runpath_var=
497214330f12Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
497314330f12Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
497414330f12Smrg  _LT_TAGVAR(archive_cmds, $1)=
497514330f12Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
497614330f12Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
497714330f12Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
497814330f12Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
497914330f12Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
498014330f12Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
498114330f12Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
498214330f12Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
498314330f12Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
498414330f12Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
498514330f12Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
498614330f12Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
498714330f12Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
498814330f12Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
498914330f12Smrg  _LT_TAGVAR(module_cmds, $1)=
499014330f12Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
499114330f12Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
499214330f12Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
499314330f12Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
499414330f12Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
499514330f12Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
499614330f12Smrg  # included in the symbol list
499714330f12Smrg  _LT_TAGVAR(include_expsyms, $1)=
499814330f12Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4999eca46af7Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
5000eca46af7Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
5001eca46af7Smrg  # as well as any symbol that contains 'd'.
500214330f12Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
500314330f12Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
500414330f12Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
500514330f12Smrg  # the symbol is explicitly referenced.  Since portable code cannot
500614330f12Smrg  # rely on this symbol name, it's probably fine to never include it in
500714330f12Smrg  # preloaded symbol tables.
500814330f12Smrg  # Exclude shared library initialization/finalization symbols.
500914330f12Smrgdnl Note also adjust exclude_expsyms for C++ above.
501014330f12Smrg  extract_expsyms_cmds=
501195b296d0Smrg
501214330f12Smrg  case $host_os in
501314330f12Smrg  cygwin* | mingw* | pw32* | cegcc*)
501414330f12Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
501514330f12Smrg    # When not using gcc, we currently assume that we are using
501614330f12Smrg    # Microsoft Visual C++.
5017eca46af7Smrg    if test yes != "$GCC"; then
501814330f12Smrg      with_gnu_ld=no
501914330f12Smrg    fi
502014330f12Smrg    ;;
502114330f12Smrg  interix*)
502214330f12Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
502314330f12Smrg    with_gnu_ld=yes
502414330f12Smrg    ;;
5025eca46af7Smrg  openbsd* | bitrig*)
502614330f12Smrg    with_gnu_ld=no
502714330f12Smrg    ;;
502814330f12Smrg  esac
50292378475aSmrg
503014330f12Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
503114330f12Smrg
503214330f12Smrg  # On some targets, GNU ld is compatible enough with the native linker
503314330f12Smrg  # that we're better off using the native interface for both.
503414330f12Smrg  lt_use_gnu_ld_interface=no
5035eca46af7Smrg  if test yes = "$with_gnu_ld"; then
503614330f12Smrg    case $host_os in
503714330f12Smrg      aix*)
503814330f12Smrg	# The AIX port of GNU ld has always aspired to compatibility
503914330f12Smrg	# with the native linker.  However, as the warning in the GNU ld
504014330f12Smrg	# block says, versions before 2.19.5* couldn't really create working
504114330f12Smrg	# shared libraries, regardless of the interface used.
504214330f12Smrg	case `$LD -v 2>&1` in
504314330f12Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
504414330f12Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
504514330f12Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
504614330f12Smrg	  *)
504714330f12Smrg	    lt_use_gnu_ld_interface=yes
50482378475aSmrg	    ;;
504914330f12Smrg	esac
505014330f12Smrg	;;
505114330f12Smrg      *)
505214330f12Smrg	lt_use_gnu_ld_interface=yes
505314330f12Smrg	;;
505414330f12Smrg    esac
505514330f12Smrg  fi
505695b296d0Smrg
5057eca46af7Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
505814330f12Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5059eca46af7Smrg    wlarc='$wl'
506095b296d0Smrg
506114330f12Smrg    # Set some defaults for GNU ld with shared library support. These
506214330f12Smrg    # are reset later if shared libraries are not supported. Putting them
506314330f12Smrg    # here allows them to be overridden if necessary.
506414330f12Smrg    runpath_var=LD_RUN_PATH
5065eca46af7Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5066eca46af7Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
506714330f12Smrg    # ancient GNU ld didn't support --whole-archive et. al.
506814330f12Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5069eca46af7Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
507014330f12Smrg    else
507114330f12Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
507214330f12Smrg    fi
507314330f12Smrg    supports_anon_versioning=no
5074eca46af7Smrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
507514330f12Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
507614330f12Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
507714330f12Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
507814330f12Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
507914330f12Smrg      *\ 2.11.*) ;; # other 2.11 versions
508014330f12Smrg      *) supports_anon_versioning=yes ;;
508114330f12Smrg    esac
50822378475aSmrg
508314330f12Smrg    # See if GNU ld supports shared libraries.
508414330f12Smrg    case $host_os in
508514330f12Smrg    aix[[3-9]]*)
508614330f12Smrg      # On AIX/PPC, the GNU linker is very broken
5087eca46af7Smrg      if test ia64 != "$host_cpu"; then
508814330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
508914330f12Smrg	cat <<_LT_EOF 1>&2
50902378475aSmrg
509114330f12Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
509214330f12Smrg*** to be unable to reliably create shared libraries on AIX.
509314330f12Smrg*** Therefore, libtool is disabling shared libraries support.  If you
509414330f12Smrg*** really care for shared libraries, you may want to install binutils
509514330f12Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
509614330f12Smrg*** You will then need to restart the configuration process.
509795b296d0Smrg
509814330f12Smrg_LT_EOF
509914330f12Smrg      fi
510014330f12Smrg      ;;
51012378475aSmrg
510214330f12Smrg    amigaos*)
510314330f12Smrg      case $host_cpu in
510414330f12Smrg      powerpc)
510514330f12Smrg            # see comment about AmigaOS4 .so support
5106eca46af7Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
510714330f12Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
510814330f12Smrg        ;;
510914330f12Smrg      m68k)
511014330f12Smrg            _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)'
511114330f12Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
511214330f12Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
51132378475aSmrg        ;;
511414330f12Smrg      esac
511514330f12Smrg      ;;
511695b296d0Smrg
511714330f12Smrg    beos*)
511814330f12Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
511914330f12Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
512014330f12Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
512114330f12Smrg	# support --undefined.  This deserves some investigation.  FIXME
5122eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
512314330f12Smrg      else
512414330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
512514330f12Smrg      fi
512614330f12Smrg      ;;
512714330f12Smrg
512814330f12Smrg    cygwin* | mingw* | pw32* | cegcc*)
512914330f12Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
513014330f12Smrg      # as there is no search path for DLLs.
513114330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5132eca46af7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
513314330f12Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
513414330f12Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
513514330f12Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
513614330f12Smrg      _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'
513714330f12Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
513814330f12Smrg
513914330f12Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5140eca46af7Smrg        _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'
5141eca46af7Smrg	# If the export-symbols file already is a .def file, use it as
5142eca46af7Smrg	# is; otherwise, prepend EXPORTS...
5143eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5144eca46af7Smrg          cp $export_symbols $output_objdir/$soname.def;
5145eca46af7Smrg        else
5146eca46af7Smrg          echo EXPORTS > $output_objdir/$soname.def;
5147eca46af7Smrg          cat $export_symbols >> $output_objdir/$soname.def;
5148eca46af7Smrg        fi~
5149eca46af7Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
515014330f12Smrg      else
515114330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
515214330f12Smrg      fi
515314330f12Smrg      ;;
515495b296d0Smrg
515514330f12Smrg    haiku*)
5156eca46af7Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
515714330f12Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
515814330f12Smrg      ;;
515995b296d0Smrg
5160eca46af7Smrg    os2*)
5161eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5162eca46af7Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5163eca46af7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5164eca46af7Smrg      shrext_cmds=.dll
5165eca46af7Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5166eca46af7Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5167eca46af7Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5168eca46af7Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5169eca46af7Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5170eca46af7Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5171eca46af7Smrg	emximp -o $lib $output_objdir/$libname.def'
5172eca46af7Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5173eca46af7Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5174eca46af7Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5175eca46af7Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5176eca46af7Smrg	prefix_cmds="$SED"~
5177eca46af7Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5178eca46af7Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5179eca46af7Smrg	fi~
5180eca46af7Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5181eca46af7Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5182eca46af7Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5183eca46af7Smrg	emximp -o $lib $output_objdir/$libname.def'
5184eca46af7Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5185eca46af7Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5186eca46af7Smrg      ;;
5187eca46af7Smrg
518814330f12Smrg    interix[[3-9]]*)
518914330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
519014330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5191eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5192eca46af7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
519314330f12Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
519414330f12Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
519514330f12Smrg      # default) and relocated if they conflict, which is a slow very memory
519614330f12Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
519714330f12Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
519814330f12Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5199eca46af7Smrg      _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'
5200eca46af7Smrg      _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'
520114330f12Smrg      ;;
520214330f12Smrg
520314330f12Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
520414330f12Smrg      tmp_diet=no
5205eca46af7Smrg      if test linux-dietlibc = "$host_os"; then
520614330f12Smrg	case $cc_basename in
520714330f12Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
520814330f12Smrg	esac
520914330f12Smrg      fi
521014330f12Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5211eca46af7Smrg	 && test no = "$tmp_diet"
521214330f12Smrg      then
521314330f12Smrg	tmp_addflag=' $pic_flag'
521414330f12Smrg	tmp_sharedflag='-shared'
521514330f12Smrg	case $cc_basename,$host_cpu in
521614330f12Smrg        pgcc*)				# Portland Group C compiler
5217eca46af7Smrg	  _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'
521814330f12Smrg	  tmp_addflag=' $pic_flag'
521914330f12Smrg	  ;;
522014330f12Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
522114330f12Smrg					# Portland Group f77 and f90 compilers
5222eca46af7Smrg	  _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'
522314330f12Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
522414330f12Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
522514330f12Smrg	  tmp_addflag=' -i_dynamic' ;;
522614330f12Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
522714330f12Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
522814330f12Smrg	ifc* | ifort*)			# Intel Fortran compiler
522914330f12Smrg	  tmp_addflag=' -nofor_main' ;;
523014330f12Smrg	lf95*)				# Lahey Fortran 8.1
523114330f12Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
523214330f12Smrg	  tmp_sharedflag='--shared' ;;
5233eca46af7Smrg        nagfor*)                        # NAGFOR 5.3
5234eca46af7Smrg          tmp_sharedflag='-Wl,-shared' ;;
523514330f12Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
523614330f12Smrg	  tmp_sharedflag='-qmkshrobj'
523714330f12Smrg	  tmp_addflag= ;;
523814330f12Smrg	nvcc*)	# Cuda Compiler Driver 2.2
5239eca46af7Smrg	  _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'
524014330f12Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
524114330f12Smrg	  ;;
524214330f12Smrg	esac
524314330f12Smrg	case `$CC -V 2>&1 | sed 5q` in
524414330f12Smrg	*Sun\ C*)			# Sun C 5.9
5245eca46af7Smrg	  _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'
524614330f12Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
524714330f12Smrg	  tmp_sharedflag='-G' ;;
524814330f12Smrg	*Sun\ F*)			# Sun Fortran 8.3
524914330f12Smrg	  tmp_sharedflag='-G' ;;
525014330f12Smrg	esac
5251eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
525295b296d0Smrg
5253eca46af7Smrg        if test yes = "$supports_anon_versioning"; then
525414330f12Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5255eca46af7Smrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5256eca46af7Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5257eca46af7Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
525814330f12Smrg        fi
525995b296d0Smrg
526014330f12Smrg	case $cc_basename in
5261eca46af7Smrg	tcc*)
5262eca46af7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5263eca46af7Smrg	  ;;
526414330f12Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
526514330f12Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
526614330f12Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5267eca46af7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
526814330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5269eca46af7Smrg	  if test yes = "$supports_anon_versioning"; then
527014330f12Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5271eca46af7Smrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5272eca46af7Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5273eca46af7Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
527414330f12Smrg	  fi
527514330f12Smrg	  ;;
527614330f12Smrg	esac
527714330f12Smrg      else
52782378475aSmrg        _LT_TAGVAR(ld_shlibs, $1)=no
527914330f12Smrg      fi
528014330f12Smrg      ;;
528195b296d0Smrg
528214330f12Smrg    netbsd*)
528314330f12Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
528414330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
528514330f12Smrg	wlarc=
528614330f12Smrg      else
5287eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5288eca46af7Smrg	_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'
528914330f12Smrg      fi
529014330f12Smrg      ;;
529195b296d0Smrg
529214330f12Smrg    solaris*)
529314330f12Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
529414330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
529514330f12Smrg	cat <<_LT_EOF 1>&2
529695b296d0Smrg
529714330f12Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
529814330f12Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
529914330f12Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
530014330f12Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
530114330f12Smrg*** your PATH or compiler configuration so that the native linker is
530214330f12Smrg*** used, and then restart.
53032378475aSmrg
530414330f12Smrg_LT_EOF
530514330f12Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5306eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5307eca46af7Smrg	_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'
530814330f12Smrg      else
530914330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
531014330f12Smrg      fi
531114330f12Smrg      ;;
531295b296d0Smrg
531314330f12Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
531414330f12Smrg      case `$LD -v 2>&1` in
531514330f12Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
531614330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
531714330f12Smrg	cat <<_LT_EOF 1>&2
53182378475aSmrg
5319eca46af7Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
532014330f12Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
532114330f12Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
532214330f12Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
532314330f12Smrg*** your PATH or compiler configuration so that the native linker is
532414330f12Smrg*** used, and then restart.
53252378475aSmrg
532614330f12Smrg_LT_EOF
532714330f12Smrg	;;
532814330f12Smrg	*)
532914330f12Smrg	  # For security reasons, it is highly recommended that you always
533014330f12Smrg	  # use absolute paths for naming shared libraries, and exclude the
533114330f12Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
533214330f12Smrg	  # requires that you compile everything twice, which is a pain.
533314330f12Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5334eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5335eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5336eca46af7Smrg	    _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'
533714330f12Smrg	  else
53382378475aSmrg	    _LT_TAGVAR(ld_shlibs, $1)=no
533914330f12Smrg	  fi
53402378475aSmrg	;;
534114330f12Smrg      esac
534214330f12Smrg      ;;
534314330f12Smrg
534414330f12Smrg    sunos4*)
534514330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
534614330f12Smrg      wlarc=
534714330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
534814330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
534914330f12Smrg      ;;
535014330f12Smrg
535114330f12Smrg    *)
535214330f12Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5353eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5354eca46af7Smrg	_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'
535514330f12Smrg      else
535614330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
535714330f12Smrg      fi
535814330f12Smrg      ;;
535914330f12Smrg    esac
536014330f12Smrg
5361eca46af7Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
536214330f12Smrg      runpath_var=
536314330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
536414330f12Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
536514330f12Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
536614330f12Smrg    fi
536714330f12Smrg  else
536814330f12Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
536914330f12Smrg    case $host_os in
537014330f12Smrg    aix3*)
537114330f12Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
537214330f12Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
537314330f12Smrg      _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'
537414330f12Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
537514330f12Smrg      # are no directories specified by -L.
537614330f12Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5377eca46af7Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
537814330f12Smrg	# Neither direct hardcoding nor static linking is supported with a
537914330f12Smrg	# broken collect2.
538014330f12Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
538114330f12Smrg      fi
538214330f12Smrg      ;;
53832378475aSmrg
538414330f12Smrg    aix[[4-9]]*)
5385eca46af7Smrg      if test ia64 = "$host_cpu"; then
538614330f12Smrg	# On IA64, the linker does run time linking by default, so we don't
538714330f12Smrg	# have to do anything special.
538814330f12Smrg	aix_use_runtimelinking=no
538914330f12Smrg	exp_sym_flag='-Bexport'
5390eca46af7Smrg	no_entry_flag=
539114330f12Smrg      else
539214330f12Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5393eca46af7Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5394eca46af7Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5395eca46af7Smrg	# weak defined symbols like other global defined symbols, whereas
5396eca46af7Smrg	# GNU nm marks them as "W".
5397eca46af7Smrg	# While the 'weak' keyword is ignored in the Export File, we need
5398eca46af7Smrg	# it in the Import File for the 'aix-soname' feature, so we have
5399eca46af7Smrg	# to replace the "-B" option with "-P" for AIX nm.
540014330f12Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5401eca46af7Smrg	  _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'
540214330f12Smrg	else
5403eca46af7Smrg	  _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'
540414330f12Smrg	fi
540514330f12Smrg	aix_use_runtimelinking=no
540695b296d0Smrg
540714330f12Smrg	# Test if we are trying to use run time linking or normal
540814330f12Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5409eca46af7Smrg	# have runtime linking enabled, and use it for executables.
5410eca46af7Smrg	# For shared libraries, we enable/disable runtime linking
5411eca46af7Smrg	# depending on the kind of the shared library created -
5412eca46af7Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5413eca46af7Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5414eca46af7Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5415eca46af7Smrg	#            lib.a           static archive
5416eca46af7Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5417eca46af7Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5418eca46af7Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5419eca46af7Smrg	#            lib.a(lib.so.V) shared, rtl:no
5420eca46af7Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5421eca46af7Smrg	#            lib.a           static archive
542214330f12Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
542314330f12Smrg	  for ld_flag in $LDFLAGS; do
5424eca46af7Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
542514330f12Smrg	    aix_use_runtimelinking=yes
542614330f12Smrg	    break
542714330f12Smrg	  fi
542814330f12Smrg	  done
5429eca46af7Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5430eca46af7Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5431eca46af7Smrg	    # so we don't have lib.a shared libs to link our executables.
5432eca46af7Smrg	    # We have to force runtime linking in this case.
5433eca46af7Smrg	    aix_use_runtimelinking=yes
5434eca46af7Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5435eca46af7Smrg	  fi
543614330f12Smrg	  ;;
543714330f12Smrg	esac
54382378475aSmrg
543914330f12Smrg	exp_sym_flag='-bexport'
544014330f12Smrg	no_entry_flag='-bnoentry'
544114330f12Smrg      fi
54422378475aSmrg
544314330f12Smrg      # When large executables or shared objects are built, AIX ld can
544414330f12Smrg      # have problems creating the table of contents.  If linking a library
544514330f12Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
544614330f12Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
544714330f12Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
54482378475aSmrg
544914330f12Smrg      _LT_TAGVAR(archive_cmds, $1)=''
545014330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
545114330f12Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
545214330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
545314330f12Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5454eca46af7Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5455eca46af7Smrg      case $with_aix_soname,$aix_use_runtimelinking in
5456eca46af7Smrg      aix,*) ;; # traditional, no import file
5457eca46af7Smrg      svr4,* | *,yes) # use import file
5458eca46af7Smrg	# The Import File defines what to hardcode.
5459eca46af7Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5460eca46af7Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5461eca46af7Smrg	;;
5462eca46af7Smrg      esac
546395b296d0Smrg
5464eca46af7Smrg      if test yes = "$GCC"; then
546514330f12Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
546614330f12Smrg	# We only want to do this on AIX 4.2 and lower, the check
546714330f12Smrg	# below for broken collect2 doesn't work under 4.3+
5468eca46af7Smrg	  collect2name=`$CC -print-prog-name=collect2`
546914330f12Smrg	  if test -f "$collect2name" &&
547014330f12Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
547114330f12Smrg	  then
547214330f12Smrg	  # We have reworked collect2
547314330f12Smrg	  :
547414330f12Smrg	  else
547514330f12Smrg	  # We have old collect2
547614330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
547714330f12Smrg	  # It fails to find uninstalled libraries when the uninstalled
547814330f12Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
547914330f12Smrg	  # to unsupported forces relinking
548014330f12Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
548114330f12Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
548214330f12Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
548314330f12Smrg	  fi
548414330f12Smrg	  ;;
548514330f12Smrg	esac
548614330f12Smrg	shared_flag='-shared'
5487eca46af7Smrg	if test yes = "$aix_use_runtimelinking"; then
5488eca46af7Smrg	  shared_flag="$shared_flag "'$wl-G'
548914330f12Smrg	fi
5490eca46af7Smrg	# Need to ensure runtime linking is disabled for the traditional
5491eca46af7Smrg	# shared library, or the linker may eventually find shared libraries
5492eca46af7Smrg	# /with/ Import File - we do not want to mix them.
5493eca46af7Smrg	shared_flag_aix='-shared'
5494eca46af7Smrg	shared_flag_svr4='-shared $wl-G'
549514330f12Smrg      else
549614330f12Smrg	# not using gcc
5497eca46af7Smrg	if test ia64 = "$host_cpu"; then
549814330f12Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
549914330f12Smrg	# chokes on -Wl,-G. The following line is correct:
550014330f12Smrg	  shared_flag='-G'
550114330f12Smrg	else
5502eca46af7Smrg	  if test yes = "$aix_use_runtimelinking"; then
5503eca46af7Smrg	    shared_flag='$wl-G'
550414330f12Smrg	  else
5505eca46af7Smrg	    shared_flag='$wl-bM:SRE'
550614330f12Smrg	  fi
5507eca46af7Smrg	  shared_flag_aix='$wl-bM:SRE'
5508eca46af7Smrg	  shared_flag_svr4='$wl-G'
550914330f12Smrg	fi
551014330f12Smrg      fi
551195b296d0Smrg
5512eca46af7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
551314330f12Smrg      # It seems that -bexpall does not export symbols beginning with
551414330f12Smrg      # underscore (_), so it is better to generate a list of symbols to export.
551514330f12Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5516eca46af7Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
551714330f12Smrg	# Warning - without using the other runtime loading flags (-brtl),
551814330f12Smrg	# -berok will link without error, but may produce a broken library.
551914330f12Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
552014330f12Smrg        # Determine the default libpath from the value encoded in an
552114330f12Smrg        # empty executable.
552214330f12Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5523eca46af7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5524eca46af7Smrg        _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
552514330f12Smrg      else
5526eca46af7Smrg	if test ia64 = "$host_cpu"; then
5527eca46af7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
552814330f12Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5529eca46af7Smrg	  _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"
553014330f12Smrg	else
553114330f12Smrg	 # Determine the default libpath from the value encoded in an
553214330f12Smrg	 # empty executable.
553314330f12Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5534eca46af7Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
553514330f12Smrg	  # Warning - without using the other run time loading flags,
553614330f12Smrg	  # -berok will link without error, but may produce a broken library.
5537eca46af7Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5538eca46af7Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5539eca46af7Smrg	  if test yes = "$with_gnu_ld"; then
554014330f12Smrg	    # We only use this code for GNU lds that support --whole-archive.
5541eca46af7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
554214330f12Smrg	  else
554314330f12Smrg	    # Exported symbols can be pulled into shared objects from archives
554414330f12Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
554514330f12Smrg	  fi
554614330f12Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5547eca46af7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5548eca46af7Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5549eca46af7Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5550eca46af7Smrg	  if test svr4 != "$with_aix_soname"; then
5551eca46af7Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
5552eca46af7Smrg	    _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'
5553eca46af7Smrg	  fi
5554eca46af7Smrg	  if test aix != "$with_aix_soname"; then
5555eca46af7Smrg	    _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'
5556eca46af7Smrg	  else
5557eca46af7Smrg	    # used by -dlpreopen to get the symbols
5558eca46af7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5559eca46af7Smrg	  fi
5560eca46af7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
556114330f12Smrg	fi
556214330f12Smrg      fi
556314330f12Smrg      ;;
556495b296d0Smrg
556514330f12Smrg    amigaos*)
556614330f12Smrg      case $host_cpu in
556714330f12Smrg      powerpc)
556814330f12Smrg            # see comment about AmigaOS4 .so support
5569eca46af7Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
557014330f12Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
557114330f12Smrg        ;;
557214330f12Smrg      m68k)
557314330f12Smrg            _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)'
557414330f12Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
557514330f12Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
557614330f12Smrg        ;;
557714330f12Smrg      esac
557814330f12Smrg      ;;
55792378475aSmrg
558014330f12Smrg    bsdi[[45]]*)
558114330f12Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
558214330f12Smrg      ;;
55832378475aSmrg
558414330f12Smrg    cygwin* | mingw* | pw32* | cegcc*)
558514330f12Smrg      # When not using gcc, we currently assume that we are using
558614330f12Smrg      # Microsoft Visual C++.
558714330f12Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
558814330f12Smrg      # no search path for DLLs.
558914330f12Smrg      case $cc_basename in
559014330f12Smrg      cl*)
559114330f12Smrg	# Native MSVC
559214330f12Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
559314330f12Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
559414330f12Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
559514330f12Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
559614330f12Smrg	# Tell ltmain to make .lib files, not .a files.
559714330f12Smrg	libext=lib
559814330f12Smrg	# Tell ltmain to make .dll files, not .so files.
5599eca46af7Smrg	shrext_cmds=.dll
560014330f12Smrg	# FIXME: Setting linknames here is a bad hack.
5601eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5602eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5603eca46af7Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
5604eca46af7Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5605eca46af7Smrg          else
5606eca46af7Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5607eca46af7Smrg          fi~
5608eca46af7Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5609eca46af7Smrg          linknames='
561014330f12Smrg	# The linker will not automatically build a static lib if we build a DLL.
561114330f12Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
561214330f12Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5613eca46af7Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
561414330f12Smrg	_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'
561514330f12Smrg	# Don't use ranlib
561614330f12Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
561714330f12Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5618eca46af7Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5619eca46af7Smrg          case $lt_outputfile in
5620eca46af7Smrg            *.exe|*.EXE) ;;
5621eca46af7Smrg            *)
5622eca46af7Smrg              lt_outputfile=$lt_outputfile.exe
5623eca46af7Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5624eca46af7Smrg              ;;
5625eca46af7Smrg          esac~
5626eca46af7Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5627eca46af7Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5628eca46af7Smrg            $RM "$lt_outputfile.manifest";
5629eca46af7Smrg          fi'
56302378475aSmrg	;;
563114330f12Smrg      *)
563214330f12Smrg	# Assume MSVC wrapper
563314330f12Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
563414330f12Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
563514330f12Smrg	# Tell ltmain to make .lib files, not .a files.
563614330f12Smrg	libext=lib
563714330f12Smrg	# Tell ltmain to make .dll files, not .so files.
5638eca46af7Smrg	shrext_cmds=.dll
563914330f12Smrg	# FIXME: Setting linknames here is a bad hack.
564014330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
564114330f12Smrg	# The linker will automatically build a .lib file if we build a DLL.
564214330f12Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
564314330f12Smrg	# FIXME: Should let the user specify the lib program.
564414330f12Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
564514330f12Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
56462378475aSmrg	;;
564714330f12Smrg      esac
564814330f12Smrg      ;;
564995b296d0Smrg
565014330f12Smrg    darwin* | rhapsody*)
565114330f12Smrg      _LT_DARWIN_LINKER_FEATURES($1)
565214330f12Smrg      ;;
565395b296d0Smrg
565414330f12Smrg    dgux*)
565514330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
565614330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
565714330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
565814330f12Smrg      ;;
565995b296d0Smrg
566014330f12Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
566114330f12Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
566214330f12Smrg    # does not break anything, and helps significantly (at the cost of a little
566314330f12Smrg    # extra space).
566414330f12Smrg    freebsd2.2*)
566514330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
566614330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
566714330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
566814330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
566914330f12Smrg      ;;
567095b296d0Smrg
567114330f12Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5672eca46af7Smrg    freebsd2.*)
567314330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
567414330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
567514330f12Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
567614330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
567714330f12Smrg      ;;
567895b296d0Smrg
567914330f12Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
568014330f12Smrg    freebsd* | dragonfly*)
568114330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
568214330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
568314330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
568414330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
568514330f12Smrg      ;;
56862378475aSmrg
568714330f12Smrg    hpux9*)
5688eca46af7Smrg      if test yes = "$GCC"; then
5689eca46af7Smrg	_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'
569014330f12Smrg      else
5691eca46af7Smrg	_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'
569214330f12Smrg      fi
5693eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
569414330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
569514330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
56962378475aSmrg
569714330f12Smrg      # hardcode_minus_L: Not really in the search PATH,
569814330f12Smrg      # but as the default location of the library.
569914330f12Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5700eca46af7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
570114330f12Smrg      ;;
57022378475aSmrg
570314330f12Smrg    hpux10*)
5704eca46af7Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5705eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
570614330f12Smrg      else
570714330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
570814330f12Smrg      fi
5709eca46af7Smrg      if test no = "$with_gnu_ld"; then
5710eca46af7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
571114330f12Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
571214330f12Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
571314330f12Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5714eca46af7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
571514330f12Smrg	# hardcode_minus_L: Not really in the search PATH,
571614330f12Smrg	# but as the default location of the library.
571714330f12Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
571814330f12Smrg      fi
571914330f12Smrg      ;;
572095b296d0Smrg
572114330f12Smrg    hpux11*)
5722eca46af7Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
572314330f12Smrg	case $host_cpu in
572414330f12Smrg	hppa*64*)
5725eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
572614330f12Smrg	  ;;
572714330f12Smrg	ia64*)
5728eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
572914330f12Smrg	  ;;
573014330f12Smrg	*)
5731eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
573214330f12Smrg	  ;;
573314330f12Smrg	esac
573414330f12Smrg      else
573514330f12Smrg	case $host_cpu in
573614330f12Smrg	hppa*64*)
5737eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
573814330f12Smrg	  ;;
573914330f12Smrg	ia64*)
5740eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
574114330f12Smrg	  ;;
574214330f12Smrg	*)
574314330f12Smrg	m4_if($1, [], [
574414330f12Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
574514330f12Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
574614330f12Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
574714330f12Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5748eca46af7Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
574914330f12Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5750eca46af7Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
575114330f12Smrg	  ;;
575214330f12Smrg	esac
575314330f12Smrg      fi
5754eca46af7Smrg      if test no = "$with_gnu_ld"; then
5755eca46af7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
575614330f12Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
575795b296d0Smrg
575814330f12Smrg	case $host_cpu in
575914330f12Smrg	hppa*64*|ia64*)
576014330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
576114330f12Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
576214330f12Smrg	  ;;
576314330f12Smrg	*)
576414330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
576514330f12Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5766eca46af7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
57672378475aSmrg
576814330f12Smrg	  # hardcode_minus_L: Not really in the search PATH,
576914330f12Smrg	  # but as the default location of the library.
577014330f12Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
577114330f12Smrg	  ;;
577214330f12Smrg	esac
577314330f12Smrg      fi
577414330f12Smrg      ;;
57752378475aSmrg
577614330f12Smrg    irix5* | irix6* | nonstopux*)
5777eca46af7Smrg      if test yes = "$GCC"; then
5778eca46af7Smrg	_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'
577914330f12Smrg	# Try to use the -exported_symbol ld option, if it does not
578014330f12Smrg	# work, assume that -exports_file does not work either and
578114330f12Smrg	# implicitly export all symbols.
578214330f12Smrg	# This should be the same for all languages, so no per-tag cache variable.
578314330f12Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
578414330f12Smrg	  [lt_cv_irix_exported_symbol],
5785eca46af7Smrg	  [save_LDFLAGS=$LDFLAGS
5786eca46af7Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
578714330f12Smrg	   AC_LINK_IFELSE(
578814330f12Smrg	     [AC_LANG_SOURCE(
578914330f12Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
579014330f12Smrg			      [C++], [[int foo (void) { return 0; }]],
579114330f12Smrg			      [Fortran 77], [[
579214330f12Smrg      subroutine foo
579314330f12Smrg      end]],
579414330f12Smrg			      [Fortran], [[
579514330f12Smrg      subroutine foo
579614330f12Smrg      end]])])],
579714330f12Smrg	      [lt_cv_irix_exported_symbol=yes],
579814330f12Smrg	      [lt_cv_irix_exported_symbol=no])
5799eca46af7Smrg           LDFLAGS=$save_LDFLAGS])
5800eca46af7Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5801eca46af7Smrg          _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'
580214330f12Smrg	fi
580314330f12Smrg      else
5804eca46af7Smrg	_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'
5805eca46af7Smrg	_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'
580614330f12Smrg      fi
580714330f12Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5808eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
580914330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
581014330f12Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
581114330f12Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
581214330f12Smrg      ;;
58132378475aSmrg
5814eca46af7Smrg    linux*)
5815eca46af7Smrg      case $cc_basename in
5816eca46af7Smrg      tcc*)
5817eca46af7Smrg	# Fabrice Bellard et al's Tiny C Compiler
5818eca46af7Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5819eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5820eca46af7Smrg	;;
5821eca46af7Smrg      esac
5822eca46af7Smrg      ;;
5823eca46af7Smrg
582414330f12Smrg    netbsd*)
582514330f12Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
582614330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
582714330f12Smrg      else
582814330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
582914330f12Smrg      fi
583014330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
583114330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
583214330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
583314330f12Smrg      ;;
583495b296d0Smrg
583514330f12Smrg    newsos6)
583614330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
583714330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5838eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
583914330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
584014330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
584114330f12Smrg      ;;
584295b296d0Smrg
584314330f12Smrg    *nto* | *qnx*)
584414330f12Smrg      ;;
584595b296d0Smrg
5846eca46af7Smrg    openbsd* | bitrig*)
584714330f12Smrg      if test -f /usr/libexec/ld.so; then
584814330f12Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
584914330f12Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
585014330f12Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5851eca46af7Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
585214330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5853eca46af7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5854eca46af7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5855eca46af7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
585614330f12Smrg	else
5857eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5858eca46af7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
585914330f12Smrg	fi
586014330f12Smrg      else
586114330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
586214330f12Smrg      fi
586314330f12Smrg      ;;
58642378475aSmrg
586514330f12Smrg    os2*)
586614330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
586714330f12Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
586814330f12Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5869eca46af7Smrg      shrext_cmds=.dll
5870eca46af7Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5871eca46af7Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5872eca46af7Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5873eca46af7Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5874eca46af7Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5875eca46af7Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5876eca46af7Smrg	emximp -o $lib $output_objdir/$libname.def'
5877eca46af7Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5878eca46af7Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5879eca46af7Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5880eca46af7Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5881eca46af7Smrg	prefix_cmds="$SED"~
5882eca46af7Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5883eca46af7Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5884eca46af7Smrg	fi~
5885eca46af7Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5886eca46af7Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5887eca46af7Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5888eca46af7Smrg	emximp -o $lib $output_objdir/$libname.def'
5889eca46af7Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5890eca46af7Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
589114330f12Smrg      ;;
589295b296d0Smrg
589314330f12Smrg    osf3*)
5894eca46af7Smrg      if test yes = "$GCC"; then
5895eca46af7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5896eca46af7Smrg	_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'
589714330f12Smrg      else
589814330f12Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5899eca46af7Smrg	_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'
590014330f12Smrg      fi
590114330f12Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5902eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
590314330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
590414330f12Smrg      ;;
590595b296d0Smrg
590614330f12Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5907eca46af7Smrg      if test yes = "$GCC"; then
5908eca46af7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5909eca46af7Smrg	_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'
5910eca46af7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
591114330f12Smrg      else
591214330f12Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5913eca46af7Smrg	_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'
591414330f12Smrg	_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~
5915eca46af7Smrg          $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'
591695b296d0Smrg
591714330f12Smrg	# Both c and cxx compiler support -rpath directly
591814330f12Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
591914330f12Smrg      fi
592014330f12Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
592114330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
592214330f12Smrg      ;;
59232378475aSmrg
592414330f12Smrg    solaris*)
592514330f12Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5926eca46af7Smrg      if test yes = "$GCC"; then
5927eca46af7Smrg	wlarc='$wl'
5928eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
592914330f12Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5930eca46af7Smrg          $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'
593114330f12Smrg      else
593214330f12Smrg	case `$CC -V 2>&1` in
593314330f12Smrg	*"Compilers 5.0"*)
593414330f12Smrg	  wlarc=''
5935eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
593614330f12Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5937eca46af7Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
593814330f12Smrg	  ;;
593914330f12Smrg	*)
5940eca46af7Smrg	  wlarc='$wl'
5941eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
594214330f12Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5943eca46af7Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
594414330f12Smrg	  ;;
594514330f12Smrg	esac
594614330f12Smrg      fi
594714330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
594814330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
594914330f12Smrg      case $host_os in
595014330f12Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
595114330f12Smrg      *)
595214330f12Smrg	# The compiler driver will combine and reorder linker options,
5953eca46af7Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
595414330f12Smrg	# but is careful enough not to reorder.
595514330f12Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5956eca46af7Smrg	if test yes = "$GCC"; then
5957eca46af7Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
595814330f12Smrg	else
595914330f12Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
596014330f12Smrg	fi
596114330f12Smrg	;;
596214330f12Smrg      esac
596314330f12Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
596414330f12Smrg      ;;
59652378475aSmrg
596614330f12Smrg    sunos4*)
5967eca46af7Smrg      if test sequent = "$host_vendor"; then
596814330f12Smrg	# Use $CC to link under sequent, because it throws in some extra .o
596914330f12Smrg	# files that make .init and .fini sections work.
5970eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
597114330f12Smrg      else
597214330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
597314330f12Smrg      fi
597414330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
597514330f12Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
597614330f12Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
597714330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
597814330f12Smrg      ;;
59792378475aSmrg
598014330f12Smrg    sysv4)
598114330f12Smrg      case $host_vendor in
598214330f12Smrg	sni)
598314330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
598414330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
598514330f12Smrg	;;
598614330f12Smrg	siemens)
598714330f12Smrg	  ## LD is ld it makes a PLAMLIB
598814330f12Smrg	  ## CC just makes a GrossModule.
598914330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
599014330f12Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
599114330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
59922378475aSmrg        ;;
599314330f12Smrg	motorola)
599414330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599514330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
599614330f12Smrg	;;
599714330f12Smrg      esac
599814330f12Smrg      runpath_var='LD_RUN_PATH'
599914330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600014330f12Smrg      ;;
600114330f12Smrg
600214330f12Smrg    sysv4.3*)
600314330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
600414330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600514330f12Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
600614330f12Smrg      ;;
600714330f12Smrg
600814330f12Smrg    sysv4*MP*)
600914330f12Smrg      if test -d /usr/nec; then
601014330f12Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
601114330f12Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
601214330f12Smrg	runpath_var=LD_RUN_PATH
601314330f12Smrg	hardcode_runpath_var=yes
601414330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
601514330f12Smrg      fi
601614330f12Smrg      ;;
601795b296d0Smrg
60182378475aSmrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6019eca46af7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
60202378475aSmrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
60212378475aSmrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
60222378475aSmrg      runpath_var='LD_RUN_PATH'
602395b296d0Smrg
6024eca46af7Smrg      if test yes = "$GCC"; then
6025eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6026eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602714330f12Smrg      else
6028eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6029eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
603014330f12Smrg      fi
60312378475aSmrg      ;;
603295b296d0Smrg
603314330f12Smrg    sysv5* | sco3.2v5* | sco5v6*)
6034eca46af7Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
603514330f12Smrg      # link with -lc, and that would cause any symbols used from libc to
603614330f12Smrg      # always be unresolved, which means just about no library would
603714330f12Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
603814330f12Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
603914330f12Smrg      # as -z defs.
6040eca46af7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6041eca46af7Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
604214330f12Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
604314330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6044eca46af7Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
604514330f12Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
604614330f12Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6047eca46af7Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
604814330f12Smrg      runpath_var='LD_RUN_PATH'
604995b296d0Smrg
6050eca46af7Smrg      if test yes = "$GCC"; then
6051eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6052eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
605314330f12Smrg      else
6054eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6055eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
605614330f12Smrg      fi
60572378475aSmrg      ;;
605895b296d0Smrg
605914330f12Smrg    uts4*)
606014330f12Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
606114330f12Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
606214330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
606314330f12Smrg      ;;
606495b296d0Smrg
606514330f12Smrg    *)
606614330f12Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
606714330f12Smrg      ;;
60682378475aSmrg    esac
606995b296d0Smrg
6070eca46af7Smrg    if test sni = "$host_vendor"; then
607114330f12Smrg      case $host in
607214330f12Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6073eca46af7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
607414330f12Smrg	;;
607514330f12Smrg      esac
607614330f12Smrg    fi
607714330f12Smrg  fi
607814330f12Smrg])
607914330f12SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6080eca46af7Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
608195b296d0Smrg
608214330f12Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
608395b296d0Smrg
608414330f12Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
608514330f12Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
608614330f12Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
608714330f12Smrg    [The commands to extract the exported symbol list from a shared archive])
608839713583Smrg
608914330f12Smrg#
609014330f12Smrg# Do we need to explicitly link libc?
609114330f12Smrg#
609214330f12Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
609314330f12Smrgx|xyes)
609414330f12Smrg  # Assume -lc should be added
609514330f12Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
609639713583Smrg
6097eca46af7Smrg  if test yes,yes = "$GCC,$enable_shared"; then
609814330f12Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
609914330f12Smrg    *'~'*)
610014330f12Smrg      # FIXME: we may have to deal with multi-command sequences.
610114330f12Smrg      ;;
610214330f12Smrg    '$CC '*)
610314330f12Smrg      # Test whether the compiler implicitly links with -lc since on some
610414330f12Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
610514330f12Smrg      # to ld, don't add -lc before -lgcc.
610614330f12Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
610714330f12Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
610814330f12Smrg	[$RM conftest*
610914330f12Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
611014330f12Smrg
611114330f12Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
611214330f12Smrg	  soname=conftest
611314330f12Smrg	  lib=conftest
611414330f12Smrg	  libobjs=conftest.$ac_objext
611514330f12Smrg	  deplibs=
611614330f12Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
611714330f12Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
611814330f12Smrg	  compiler_flags=-v
611914330f12Smrg	  linker_flags=-v
612014330f12Smrg	  verstring=
612114330f12Smrg	  output_objdir=.
612214330f12Smrg	  libname=conftest
612314330f12Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
612414330f12Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
612514330f12Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
612614330f12Smrg	  then
612714330f12Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
612814330f12Smrg	  else
612914330f12Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
613014330f12Smrg	  fi
613114330f12Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
613214330f12Smrg	else
613314330f12Smrg	  cat conftest.err 1>&5
613414330f12Smrg	fi
613514330f12Smrg	$RM conftest*
613614330f12Smrg	])
613714330f12Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
613814330f12Smrg      ;;
613914330f12Smrg    esac
614014330f12Smrg  fi
614114330f12Smrg  ;;
614214330f12Smrgesac
614339713583Smrg
614414330f12Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
614514330f12Smrg    [Whether or not to add -lc for building shared libraries])
614614330f12Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
614714330f12Smrg    [enable_shared_with_static_runtimes], [0],
614814330f12Smrg    [Whether or not to disallow shared libs when runtime libs are static])
614914330f12Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
615014330f12Smrg    [Compiler flag to allow reflexive dlopens])
615114330f12Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
615214330f12Smrg    [Compiler flag to generate shared objects directly from archives])
615314330f12Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
615414330f12Smrg    [Whether the compiler copes with passing no objects directly])
615514330f12Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
615614330f12Smrg    [Create an old-style archive from a shared archive])
615714330f12Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
615814330f12Smrg    [Create a temporary old-style archive to link instead of a shared archive])
615914330f12Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
616014330f12Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
616114330f12Smrg_LT_TAGDECL([], [module_cmds], [2],
616214330f12Smrg    [Commands used to build a loadable module if different from building
616314330f12Smrg    a shared archive.])
616414330f12Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
616514330f12Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
616614330f12Smrg    [Whether we are building with GNU ld or not])
616714330f12Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
616814330f12Smrg    [Flag that allows shared libraries with undefined symbols to be built])
616914330f12Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
617014330f12Smrg    [Flag that enforces no undefined symbols])
617114330f12Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
617214330f12Smrg    [Flag to hardcode $libdir into a binary during linking.
617314330f12Smrg    This must work even if $libdir does not exist])
617414330f12Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
617514330f12Smrg    [Whether we need a single "-rpath" flag with a separated argument])
617614330f12Smrg_LT_TAGDECL([], [hardcode_direct], [0],
6177eca46af7Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
617814330f12Smrg    DIR into the resulting binary])
617914330f12Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6180eca46af7Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
618114330f12Smrg    DIR into the resulting binary and the resulting library dependency is
6182eca46af7Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
618314330f12Smrg    library is relocated])
618414330f12Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
618514330f12Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
618614330f12Smrg    into the resulting binary])
618714330f12Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
618814330f12Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
618914330f12Smrg    into the resulting binary])
619014330f12Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
619114330f12Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
619214330f12Smrg    into the library and all subsequent libraries and executables linked
619314330f12Smrg    against it])
619414330f12Smrg_LT_TAGDECL([], [inherit_rpath], [0],
619514330f12Smrg    [Set to yes if linker adds runtime paths of dependent libraries
619614330f12Smrg    to runtime path list])
619714330f12Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
619814330f12Smrg    [Whether libtool must link a program against all its dependency libraries])
619914330f12Smrg_LT_TAGDECL([], [always_export_symbols], [0],
620014330f12Smrg    [Set to "yes" if exported symbols are required])
620114330f12Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
620214330f12Smrg    [The commands to list exported symbols])
620314330f12Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
620414330f12Smrg    [Symbols that should not be listed in the preloaded symbols])
620514330f12Smrg_LT_TAGDECL([], [include_expsyms], [1],
620614330f12Smrg    [Symbols that must always be exported])
620714330f12Smrg_LT_TAGDECL([], [prelink_cmds], [2],
620814330f12Smrg    [Commands necessary for linking programs (against libraries) with templates])
620914330f12Smrg_LT_TAGDECL([], [postlink_cmds], [2],
621014330f12Smrg    [Commands necessary for finishing linking programs])
621114330f12Smrg_LT_TAGDECL([], [file_list_spec], [1],
621214330f12Smrg    [Specify filename containing input files])
621314330f12Smrgdnl FIXME: Not yet implemented
621414330f12Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
621514330f12Smrgdnl    [Compiler flag to generate thread safe objects])
621614330f12Smrg])# _LT_LINKER_SHLIBS
621739713583Smrg
621839713583Smrg
621914330f12Smrg# _LT_LANG_C_CONFIG([TAG])
622014330f12Smrg# ------------------------
622114330f12Smrg# Ensure that the configuration variables for a C compiler are suitably
622214330f12Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6223eca46af7Smrg# the compiler configuration to 'libtool'.
622414330f12Smrgm4_defun([_LT_LANG_C_CONFIG],
622514330f12Smrg[m4_require([_LT_DECL_EGREP])dnl
6226eca46af7Smrglt_save_CC=$CC
622714330f12SmrgAC_LANG_PUSH(C)
622839713583Smrg
622914330f12Smrg# Source file extension for C test sources.
623014330f12Smrgac_ext=c
623139713583Smrg
623214330f12Smrg# Object file extension for compiled C test sources.
623314330f12Smrgobjext=o
623414330f12Smrg_LT_TAGVAR(objext, $1)=$objext
623595b296d0Smrg
623614330f12Smrg# Code to be used in simple compile tests
623714330f12Smrglt_simple_compile_test_code="int some_variable = 0;"
623895b296d0Smrg
623914330f12Smrg# Code to be used in simple link tests
624014330f12Smrglt_simple_link_test_code='int main(){return(0);}'
624139713583Smrg
624214330f12Smrg_LT_TAG_COMPILER
624314330f12Smrg# Save the default compiler, since it gets overwritten when the other
624414330f12Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
624514330f12Smrgcompiler_DEFAULT=$CC
624639713583Smrg
624714330f12Smrg# save warnings/boilerplate of simple test code
624814330f12Smrg_LT_COMPILER_BOILERPLATE
624914330f12Smrg_LT_LINKER_BOILERPLATE
625039713583Smrg
625114330f12Smrgif test -n "$compiler"; then
625214330f12Smrg  _LT_COMPILER_NO_RTTI($1)
625314330f12Smrg  _LT_COMPILER_PIC($1)
625414330f12Smrg  _LT_COMPILER_C_O($1)
625514330f12Smrg  _LT_COMPILER_FILE_LOCKS($1)
625614330f12Smrg  _LT_LINKER_SHLIBS($1)
625714330f12Smrg  _LT_SYS_DYNAMIC_LINKER($1)
625814330f12Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
625914330f12Smrg  LT_SYS_DLOPEN_SELF
626014330f12Smrg  _LT_CMD_STRIPLIB
626139713583Smrg
6262eca46af7Smrg  # Report what library types will actually be built
626314330f12Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
626414330f12Smrg  AC_MSG_RESULT([$can_build_shared])
626539713583Smrg
626614330f12Smrg  AC_MSG_CHECKING([whether to build shared libraries])
6267eca46af7Smrg  test no = "$can_build_shared" && enable_shared=no
626839713583Smrg
626914330f12Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
627014330f12Smrg  # are all built from PIC.
627114330f12Smrg  case $host_os in
627214330f12Smrg  aix3*)
6273eca46af7Smrg    test yes = "$enable_shared" && enable_static=no
627414330f12Smrg    if test -n "$RANLIB"; then
627514330f12Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
627614330f12Smrg      postinstall_cmds='$RANLIB $lib'
62772378475aSmrg    fi
62782378475aSmrg    ;;
627939713583Smrg
628014330f12Smrg  aix[[4-9]]*)
6281eca46af7Smrg    if test ia64 != "$host_cpu"; then
6282eca46af7Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6283eca46af7Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
6284eca46af7Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6285eca46af7Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6286eca46af7Smrg      esac
62872378475aSmrg    fi
62882378475aSmrg    ;;
62892378475aSmrg  esac
629014330f12Smrg  AC_MSG_RESULT([$enable_shared])
62912378475aSmrg
629214330f12Smrg  AC_MSG_CHECKING([whether to build static libraries])
629314330f12Smrg  # Make sure either enable_shared or enable_static is yes.
6294eca46af7Smrg  test yes = "$enable_shared" || enable_static=yes
629514330f12Smrg  AC_MSG_RESULT([$enable_static])
62962378475aSmrg
629714330f12Smrg  _LT_CONFIG($1)
62982378475aSmrgfi
629914330f12SmrgAC_LANG_POP
6300eca46af7SmrgCC=$lt_save_CC
630114330f12Smrg])# _LT_LANG_C_CONFIG
630239713583Smrg
630339713583Smrg
630414330f12Smrg# _LT_LANG_CXX_CONFIG([TAG])
63052378475aSmrg# --------------------------
630614330f12Smrg# Ensure that the configuration variables for a C++ compiler are suitably
630714330f12Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6308eca46af7Smrg# the compiler configuration to 'libtool'.
630914330f12Smrgm4_defun([_LT_LANG_CXX_CONFIG],
631014330f12Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
631114330f12Smrgm4_require([_LT_DECL_EGREP])dnl
631214330f12Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6313eca46af7Smrgif test -n "$CXX" && ( test no != "$CXX" &&
6314eca46af7Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6315eca46af7Smrg    (test g++ != "$CXX"))); then
631614330f12Smrg  AC_PROG_CXXCPP
631714330f12Smrgelse
631814330f12Smrg  _lt_caught_CXX_error=yes
631914330f12Smrgfi
632095b296d0Smrg
632114330f12SmrgAC_LANG_PUSH(C++)
63222378475aSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
63232378475aSmrg_LT_TAGVAR(allow_undefined_flag, $1)=
63242378475aSmrg_LT_TAGVAR(always_export_symbols, $1)=no
63252378475aSmrg_LT_TAGVAR(archive_expsym_cmds, $1)=
632614330f12Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
63272378475aSmrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
63282378475aSmrg_LT_TAGVAR(hardcode_direct, $1)=no
63292378475aSmrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
63302378475aSmrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
63312378475aSmrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
63322378475aSmrg_LT_TAGVAR(hardcode_minus_L, $1)=no
633314330f12Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
63342378475aSmrg_LT_TAGVAR(hardcode_automatic, $1)=no
63352378475aSmrg_LT_TAGVAR(inherit_rpath, $1)=no
63362378475aSmrg_LT_TAGVAR(module_cmds, $1)=
63372378475aSmrg_LT_TAGVAR(module_expsym_cmds, $1)=
63382378475aSmrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
63392378475aSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
634014330f12Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
634114330f12Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
63422378475aSmrg_LT_TAGVAR(no_undefined_flag, $1)=
63432378475aSmrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
63442378475aSmrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
634539713583Smrg
634614330f12Smrg# Source file extension for C++ test sources.
634714330f12Smrgac_ext=cpp
634839713583Smrg
634914330f12Smrg# Object file extension for compiled C++ test sources.
63502378475aSmrgobjext=o
63512378475aSmrg_LT_TAGVAR(objext, $1)=$objext
63522378475aSmrg
63532378475aSmrg# No sense in running all these tests if we already determined that
635414330f12Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
63552378475aSmrg# are currently assumed to apply to all compilers on this platform,
63562378475aSmrg# and will be corrupted by setting them based on a non-working compiler.
6357eca46af7Smrgif test yes != "$_lt_caught_CXX_error"; then
63582378475aSmrg  # Code to be used in simple compile tests
635914330f12Smrg  lt_simple_compile_test_code="int some_variable = 0;"
636039713583Smrg
63612378475aSmrg  # Code to be used in simple link tests
636214330f12Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
636339713583Smrg
63642378475aSmrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
63652378475aSmrg  _LT_TAG_COMPILER
636639713583Smrg
63672378475aSmrg  # save warnings/boilerplate of simple test code
63682378475aSmrg  _LT_COMPILER_BOILERPLATE
63692378475aSmrg  _LT_LINKER_BOILERPLATE
637039713583Smrg
63712378475aSmrg  # Allow CC to be a program name with arguments.
637214330f12Smrg  lt_save_CC=$CC
637314330f12Smrg  lt_save_CFLAGS=$CFLAGS
637414330f12Smrg  lt_save_LD=$LD
63752378475aSmrg  lt_save_GCC=$GCC
637614330f12Smrg  GCC=$GXX
637714330f12Smrg  lt_save_with_gnu_ld=$with_gnu_ld
637814330f12Smrg  lt_save_path_LD=$lt_cv_path_LD
637914330f12Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
638014330f12Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
638114330f12Smrg  else
638214330f12Smrg    $as_unset lt_cv_prog_gnu_ld
638314330f12Smrg  fi
638414330f12Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
638514330f12Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
638614330f12Smrg  else
638714330f12Smrg    $as_unset lt_cv_path_LD
638814330f12Smrg  fi
638914330f12Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
639014330f12Smrg  CC=${CXX-"c++"}
639114330f12Smrg  CFLAGS=$CXXFLAGS
63922378475aSmrg  compiler=$CC
63932378475aSmrg  _LT_TAGVAR(compiler, $1)=$CC
63942378475aSmrg  _LT_CC_BASENAME([$compiler])
639595b296d0Smrg
639614330f12Smrg  if test -n "$compiler"; then
639714330f12Smrg    # We don't want -fno-exception when compiling C++ code, so set the
639814330f12Smrg    # no_builtin_flag separately
6399eca46af7Smrg    if test yes = "$GXX"; then
640014330f12Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
640114330f12Smrg    else
640214330f12Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
640314330f12Smrg    fi
64042378475aSmrg
6405eca46af7Smrg    if test yes = "$GXX"; then
640614330f12Smrg      # Set up default GNU C++ configuration
64072378475aSmrg
640814330f12Smrg      LT_PATH_LD
640995b296d0Smrg
641014330f12Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
641114330f12Smrg      # archiving commands below assume that GNU ld is being used.
6412eca46af7Smrg      if test yes = "$with_gnu_ld"; then
6413eca46af7Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6414eca46af7Smrg        _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'
641595b296d0Smrg
6416eca46af7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6417eca46af7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
641895b296d0Smrg
641914330f12Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
642014330f12Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
642114330f12Smrg        #     investigate it a little bit more. (MM)
6422eca46af7Smrg        wlarc='$wl'
64232378475aSmrg
642414330f12Smrg        # ancient GNU ld didn't support --whole-archive et. al.
642514330f12Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
642614330f12Smrg	  $GREP 'no-whole-archive' > /dev/null; then
6427eca46af7Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
642814330f12Smrg        else
642914330f12Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
643014330f12Smrg        fi
643114330f12Smrg      else
643214330f12Smrg        with_gnu_ld=no
643314330f12Smrg        wlarc=
64342378475aSmrg
643514330f12Smrg        # A generic and very simple default shared library creation
643614330f12Smrg        # command for GNU C++ for the case where it uses the native
643714330f12Smrg        # linker, instead of GNU ld.  If possible, this setting should
643814330f12Smrg        # overridden to take advantage of the native linker features on
643914330f12Smrg        # the platform it is being used on.
644014330f12Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
644114330f12Smrg      fi
64422378475aSmrg
644314330f12Smrg      # Commands to make compiler produce verbose output that lists
644414330f12Smrg      # what "hidden" libraries, object files and flags are used when
644514330f12Smrg      # linking a shared library.
644614330f12Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
64472378475aSmrg
644814330f12Smrg    else
644914330f12Smrg      GXX=no
645014330f12Smrg      with_gnu_ld=no
645114330f12Smrg      wlarc=
645214330f12Smrg    fi
64532378475aSmrg
645414330f12Smrg    # PORTME: fill in a description of your system's C++ link characteristics
645514330f12Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
645614330f12Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
645714330f12Smrg    case $host_os in
645814330f12Smrg      aix3*)
645914330f12Smrg        # FIXME: insert proper C++ library support
646014330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
646114330f12Smrg        ;;
646214330f12Smrg      aix[[4-9]]*)
6463eca46af7Smrg        if test ia64 = "$host_cpu"; then
646414330f12Smrg          # On IA64, the linker does run time linking by default, so we don't
646514330f12Smrg          # have to do anything special.
646614330f12Smrg          aix_use_runtimelinking=no
646714330f12Smrg          exp_sym_flag='-Bexport'
6468eca46af7Smrg          no_entry_flag=
646914330f12Smrg        else
647014330f12Smrg          aix_use_runtimelinking=no
64712378475aSmrg
647214330f12Smrg          # Test if we are trying to use run time linking or normal
647314330f12Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6474eca46af7Smrg          # have runtime linking enabled, and use it for executables.
6475eca46af7Smrg          # For shared libraries, we enable/disable runtime linking
6476eca46af7Smrg          # depending on the kind of the shared library created -
6477eca46af7Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6478eca46af7Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6479eca46af7Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6480eca46af7Smrg          #            lib.a           static archive
6481eca46af7Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6482eca46af7Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6483eca46af7Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6484eca46af7Smrg          #            lib.a(lib.so.V) shared, rtl:no
6485eca46af7Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6486eca46af7Smrg          #            lib.a           static archive
648714330f12Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
648814330f12Smrg	    for ld_flag in $LDFLAGS; do
648914330f12Smrg	      case $ld_flag in
649014330f12Smrg	      *-brtl*)
649114330f12Smrg	        aix_use_runtimelinking=yes
649214330f12Smrg	        break
649314330f12Smrg	        ;;
649414330f12Smrg	      esac
649514330f12Smrg	    done
6496eca46af7Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6497eca46af7Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6498eca46af7Smrg	      # so we don't have lib.a shared libs to link our executables.
6499eca46af7Smrg	      # We have to force runtime linking in this case.
6500eca46af7Smrg	      aix_use_runtimelinking=yes
6501eca46af7Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6502eca46af7Smrg	    fi
650314330f12Smrg	    ;;
650414330f12Smrg          esac
650595b296d0Smrg
650614330f12Smrg          exp_sym_flag='-bexport'
650714330f12Smrg          no_entry_flag='-bnoentry'
650814330f12Smrg        fi
65092378475aSmrg
651014330f12Smrg        # When large executables or shared objects are built, AIX ld can
651114330f12Smrg        # have problems creating the table of contents.  If linking a library
651214330f12Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
651314330f12Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
651414330f12Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
65152378475aSmrg
651614330f12Smrg        _LT_TAGVAR(archive_cmds, $1)=''
651714330f12Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
651814330f12Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
651914330f12Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
652014330f12Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6521eca46af7Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6522eca46af7Smrg        case $with_aix_soname,$aix_use_runtimelinking in
6523eca46af7Smrg        aix,*) ;;	# no import file
6524eca46af7Smrg        svr4,* | *,yes) # use import file
6525eca46af7Smrg          # The Import File defines what to hardcode.
6526eca46af7Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
6527eca46af7Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6528eca46af7Smrg          ;;
6529eca46af7Smrg        esac
65302378475aSmrg
6531eca46af7Smrg        if test yes = "$GXX"; then
653214330f12Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
653314330f12Smrg          # We only want to do this on AIX 4.2 and lower, the check
653414330f12Smrg          # below for broken collect2 doesn't work under 4.3+
6535eca46af7Smrg	  collect2name=`$CC -print-prog-name=collect2`
653614330f12Smrg	  if test -f "$collect2name" &&
653714330f12Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
653814330f12Smrg	  then
653914330f12Smrg	    # We have reworked collect2
654014330f12Smrg	    :
654114330f12Smrg	  else
654214330f12Smrg	    # We have old collect2
654314330f12Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
654414330f12Smrg	    # It fails to find uninstalled libraries when the uninstalled
654514330f12Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
654614330f12Smrg	    # to unsupported forces relinking
654714330f12Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
654814330f12Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
654914330f12Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
655014330f12Smrg	  fi
655114330f12Smrg          esac
655214330f12Smrg          shared_flag='-shared'
6553eca46af7Smrg	  if test yes = "$aix_use_runtimelinking"; then
6554eca46af7Smrg	    shared_flag=$shared_flag' $wl-G'
655514330f12Smrg	  fi
6556eca46af7Smrg	  # Need to ensure runtime linking is disabled for the traditional
6557eca46af7Smrg	  # shared library, or the linker may eventually find shared libraries
6558eca46af7Smrg	  # /with/ Import File - we do not want to mix them.
6559eca46af7Smrg	  shared_flag_aix='-shared'
6560eca46af7Smrg	  shared_flag_svr4='-shared $wl-G'
656114330f12Smrg        else
656214330f12Smrg          # not using gcc
6563eca46af7Smrg          if test ia64 = "$host_cpu"; then
656414330f12Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
656514330f12Smrg	  # chokes on -Wl,-G. The following line is correct:
656614330f12Smrg	  shared_flag='-G'
656714330f12Smrg          else
6568eca46af7Smrg	    if test yes = "$aix_use_runtimelinking"; then
6569eca46af7Smrg	      shared_flag='$wl-G'
657014330f12Smrg	    else
6571eca46af7Smrg	      shared_flag='$wl-bM:SRE'
657214330f12Smrg	    fi
6573eca46af7Smrg	    shared_flag_aix='$wl-bM:SRE'
6574eca46af7Smrg	    shared_flag_svr4='$wl-G'
657514330f12Smrg          fi
657614330f12Smrg        fi
65772378475aSmrg
6578eca46af7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
657914330f12Smrg        # It seems that -bexpall does not export symbols beginning with
658014330f12Smrg        # underscore (_), so it is better to generate a list of symbols to
658114330f12Smrg	# export.
658214330f12Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6583eca46af7Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
658414330f12Smrg          # Warning - without using the other runtime loading flags (-brtl),
658514330f12Smrg          # -berok will link without error, but may produce a broken library.
6586eca46af7Smrg          # The "-G" linker flag allows undefined symbols.
6587eca46af7Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
658814330f12Smrg          # Determine the default libpath from the value encoded in an empty
658914330f12Smrg          # executable.
659014330f12Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6591eca46af7Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
65922378475aSmrg
6593eca46af7Smrg          _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
659414330f12Smrg        else
6595eca46af7Smrg          if test ia64 = "$host_cpu"; then
6596eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
659714330f12Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6598eca46af7Smrg	    _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"
659914330f12Smrg          else
660014330f12Smrg	    # Determine the default libpath from the value encoded in an
660114330f12Smrg	    # empty executable.
660214330f12Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6603eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
660414330f12Smrg	    # Warning - without using the other run time loading flags,
660514330f12Smrg	    # -berok will link without error, but may produce a broken library.
6606eca46af7Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6607eca46af7Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6608eca46af7Smrg	    if test yes = "$with_gnu_ld"; then
660914330f12Smrg	      # We only use this code for GNU lds that support --whole-archive.
6610eca46af7Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
661114330f12Smrg	    else
661214330f12Smrg	      # Exported symbols can be pulled into shared objects from archives
661314330f12Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
661414330f12Smrg	    fi
661514330f12Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6616eca46af7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6617eca46af7Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6618eca46af7Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6619eca46af7Smrg	    if test svr4 != "$with_aix_soname"; then
6620eca46af7Smrg	      # This is similar to how AIX traditionally builds its shared
6621eca46af7Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6622eca46af7Smrg	      _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'
6623eca46af7Smrg	    fi
6624eca46af7Smrg	    if test aix != "$with_aix_soname"; then
6625eca46af7Smrg	      _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'
6626eca46af7Smrg	    else
6627eca46af7Smrg	      # used by -dlpreopen to get the symbols
6628eca46af7Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6629eca46af7Smrg	    fi
6630eca46af7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
663114330f12Smrg          fi
66322378475aSmrg        fi
66332378475aSmrg        ;;
66342378475aSmrg
663514330f12Smrg      beos*)
663614330f12Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
663714330f12Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
663814330f12Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
663914330f12Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6640eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
664114330f12Smrg	else
664214330f12Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
664314330f12Smrg	fi
664414330f12Smrg	;;
66452378475aSmrg
664614330f12Smrg      chorus*)
664714330f12Smrg        case $cc_basename in
664814330f12Smrg          *)
664914330f12Smrg	  # FIXME: insert proper C++ library support
665014330f12Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
665114330f12Smrg	  ;;
665214330f12Smrg        esac
665314330f12Smrg        ;;
66542378475aSmrg
665514330f12Smrg      cygwin* | mingw* | pw32* | cegcc*)
665614330f12Smrg	case $GXX,$cc_basename in
665714330f12Smrg	,cl* | no,cl*)
665814330f12Smrg	  # Native MSVC
665914330f12Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
666014330f12Smrg	  # no search path for DLLs.
666114330f12Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
666214330f12Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
666314330f12Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
666414330f12Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
666514330f12Smrg	  # Tell ltmain to make .lib files, not .a files.
666614330f12Smrg	  libext=lib
666714330f12Smrg	  # Tell ltmain to make .dll files, not .so files.
6668eca46af7Smrg	  shrext_cmds=.dll
666914330f12Smrg	  # FIXME: Setting linknames here is a bad hack.
6670eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6671eca46af7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6672eca46af7Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
6673eca46af7Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6674eca46af7Smrg            else
6675eca46af7Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6676eca46af7Smrg            fi~
6677eca46af7Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6678eca46af7Smrg            linknames='
667914330f12Smrg	  # The linker will not automatically build a static lib if we build a DLL.
668014330f12Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
668114330f12Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
668214330f12Smrg	  # Don't use ranlib
668314330f12Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
668414330f12Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6685eca46af7Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6686eca46af7Smrg            case $lt_outputfile in
6687eca46af7Smrg              *.exe|*.EXE) ;;
6688eca46af7Smrg              *)
6689eca46af7Smrg                lt_outputfile=$lt_outputfile.exe
6690eca46af7Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6691eca46af7Smrg                ;;
6692eca46af7Smrg            esac~
6693eca46af7Smrg            func_to_tool_file "$lt_outputfile"~
6694eca46af7Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6695eca46af7Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6696eca46af7Smrg              $RM "$lt_outputfile.manifest";
6697eca46af7Smrg            fi'
669814330f12Smrg	  ;;
669914330f12Smrg	*)
670014330f12Smrg	  # g++
670114330f12Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
670214330f12Smrg	  # as there is no search path for DLLs.
670314330f12Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6704eca46af7Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
670514330f12Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
670614330f12Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
670714330f12Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
670814330f12Smrg
670914330f12Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6710eca46af7Smrg	    _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'
6711eca46af7Smrg	    # If the export-symbols file already is a .def file, use it as
6712eca46af7Smrg	    # is; otherwise, prepend EXPORTS...
6713eca46af7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6714eca46af7Smrg              cp $export_symbols $output_objdir/$soname.def;
6715eca46af7Smrg            else
6716eca46af7Smrg              echo EXPORTS > $output_objdir/$soname.def;
6717eca46af7Smrg              cat $export_symbols >> $output_objdir/$soname.def;
6718eca46af7Smrg            fi~
6719eca46af7Smrg            $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'
672014330f12Smrg	  else
672114330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
672214330f12Smrg	  fi
672314330f12Smrg	  ;;
672414330f12Smrg	esac
672514330f12Smrg	;;
672614330f12Smrg      darwin* | rhapsody*)
672714330f12Smrg        _LT_DARWIN_LINKER_FEATURES($1)
672814330f12Smrg	;;
67292378475aSmrg
6730eca46af7Smrg      os2*)
6731eca46af7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6732eca46af7Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6733eca46af7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6734eca46af7Smrg	shrext_cmds=.dll
6735eca46af7Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6736eca46af7Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6737eca46af7Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6738eca46af7Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6739eca46af7Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6740eca46af7Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6741eca46af7Smrg	  emximp -o $lib $output_objdir/$libname.def'
6742eca46af7Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6743eca46af7Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6744eca46af7Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6745eca46af7Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6746eca46af7Smrg	  prefix_cmds="$SED"~
6747eca46af7Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6748eca46af7Smrg	    prefix_cmds="$prefix_cmds -e 1d";
6749eca46af7Smrg	  fi~
6750eca46af7Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6751eca46af7Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6752eca46af7Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6753eca46af7Smrg	  emximp -o $lib $output_objdir/$libname.def'
6754eca46af7Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6755eca46af7Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6756eca46af7Smrg	;;
6757eca46af7Smrg
675814330f12Smrg      dgux*)
675914330f12Smrg        case $cc_basename in
676014330f12Smrg          ec++*)
676114330f12Smrg	    # FIXME: insert proper C++ library support
676214330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
676314330f12Smrg	    ;;
676414330f12Smrg          ghcx*)
676514330f12Smrg	    # Green Hills C++ Compiler
676614330f12Smrg	    # FIXME: insert proper C++ library support
676714330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
676814330f12Smrg	    ;;
676914330f12Smrg          *)
677014330f12Smrg	    # FIXME: insert proper C++ library support
677114330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
677214330f12Smrg	    ;;
677314330f12Smrg        esac
677414330f12Smrg        ;;
677539713583Smrg
6776eca46af7Smrg      freebsd2.*)
677714330f12Smrg        # C++ shared libraries reported to be fairly broken before
677814330f12Smrg	# switch to ELF
677914330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
678014330f12Smrg        ;;
678139713583Smrg
678214330f12Smrg      freebsd-elf*)
678314330f12Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
678414330f12Smrg        ;;
678539713583Smrg
678614330f12Smrg      freebsd* | dragonfly*)
678714330f12Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
678814330f12Smrg        # conventions
678914330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
679014330f12Smrg        ;;
679139713583Smrg
679214330f12Smrg      haiku*)
6793eca46af7Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
679414330f12Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
679514330f12Smrg        ;;
679639713583Smrg
679714330f12Smrg      hpux9*)
6798eca46af7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
679914330f12Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6800eca46af7Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
680114330f12Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
680214330f12Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
680314330f12Smrg				             # but as the default
680414330f12Smrg				             # location of the library.
680539713583Smrg
680614330f12Smrg        case $cc_basename in
680714330f12Smrg          CC*)
680814330f12Smrg            # FIXME: insert proper C++ library support
680914330f12Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
681014330f12Smrg            ;;
681114330f12Smrg          aCC*)
6812eca46af7Smrg            _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'
681314330f12Smrg            # Commands to make compiler produce verbose output that lists
681414330f12Smrg            # what "hidden" libraries, object files and flags are used when
681514330f12Smrg            # linking a shared library.
681614330f12Smrg            #
681714330f12Smrg            # There doesn't appear to be a way to prevent this compiler from
681814330f12Smrg            # explicitly linking system object files so we need to strip them
681914330f12Smrg            # from the output so that they don't get included in the library
682014330f12Smrg            # dependencies.
6821eca46af7Smrg            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"'
682214330f12Smrg            ;;
682314330f12Smrg          *)
6824eca46af7Smrg            if test yes = "$GXX"; then
6825eca46af7Smrg              _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'
682614330f12Smrg            else
682714330f12Smrg              # FIXME: insert proper C++ library support
682814330f12Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
682914330f12Smrg            fi
683014330f12Smrg            ;;
683114330f12Smrg        esac
683214330f12Smrg        ;;
683339713583Smrg
683414330f12Smrg      hpux10*|hpux11*)
6835eca46af7Smrg        if test no = "$with_gnu_ld"; then
6836eca46af7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
683714330f12Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
683839713583Smrg
683914330f12Smrg          case $host_cpu in
684014330f12Smrg            hppa*64*|ia64*)
684114330f12Smrg              ;;
684214330f12Smrg            *)
6843eca46af7Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
684414330f12Smrg              ;;
684514330f12Smrg          esac
684614330f12Smrg        fi
684714330f12Smrg        case $host_cpu in
684814330f12Smrg          hppa*64*|ia64*)
684914330f12Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
685014330f12Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
685114330f12Smrg            ;;
685214330f12Smrg          *)
685314330f12Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
685414330f12Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
685514330f12Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
685614330f12Smrg					         # but as the default
685714330f12Smrg					         # location of the library.
685814330f12Smrg            ;;
685914330f12Smrg        esac
686095b296d0Smrg
686114330f12Smrg        case $cc_basename in
686214330f12Smrg          CC*)
686314330f12Smrg	    # FIXME: insert proper C++ library support
686414330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
686514330f12Smrg	    ;;
686614330f12Smrg          aCC*)
686714330f12Smrg	    case $host_cpu in
686814330f12Smrg	      hppa*64*)
6869eca46af7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
687014330f12Smrg	        ;;
687114330f12Smrg	      ia64*)
6872eca46af7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
687314330f12Smrg	        ;;
687414330f12Smrg	      *)
6875eca46af7Smrg	        _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'
687614330f12Smrg	        ;;
687714330f12Smrg	    esac
687814330f12Smrg	    # Commands to make compiler produce verbose output that lists
687914330f12Smrg	    # what "hidden" libraries, object files and flags are used when
688014330f12Smrg	    # linking a shared library.
688114330f12Smrg	    #
688214330f12Smrg	    # There doesn't appear to be a way to prevent this compiler from
688314330f12Smrg	    # explicitly linking system object files so we need to strip them
688414330f12Smrg	    # from the output so that they don't get included in the library
688514330f12Smrg	    # dependencies.
6886eca46af7Smrg	    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"'
688714330f12Smrg	    ;;
688814330f12Smrg          *)
6889eca46af7Smrg	    if test yes = "$GXX"; then
6890eca46af7Smrg	      if test no = "$with_gnu_ld"; then
689114330f12Smrg	        case $host_cpu in
689214330f12Smrg	          hppa*64*)
6893eca46af7Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
689414330f12Smrg	            ;;
689514330f12Smrg	          ia64*)
6896eca46af7Smrg	            _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'
689714330f12Smrg	            ;;
689814330f12Smrg	          *)
6899eca46af7Smrg	            _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'
690014330f12Smrg	            ;;
690114330f12Smrg	        esac
690214330f12Smrg	      fi
690314330f12Smrg	    else
690414330f12Smrg	      # FIXME: insert proper C++ library support
690514330f12Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
690614330f12Smrg	    fi
690714330f12Smrg	    ;;
690814330f12Smrg        esac
690914330f12Smrg        ;;
691095b296d0Smrg
691114330f12Smrg      interix[[3-9]]*)
691214330f12Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
691314330f12Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6914eca46af7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6915eca46af7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
691614330f12Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
691714330f12Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
691814330f12Smrg	# default) and relocated if they conflict, which is a slow very memory
691914330f12Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
692014330f12Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
692114330f12Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6922eca46af7Smrg	_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'
6923eca46af7Smrg	_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'
692414330f12Smrg	;;
692514330f12Smrg      irix5* | irix6*)
692614330f12Smrg        case $cc_basename in
692714330f12Smrg          CC*)
692814330f12Smrg	    # SGI C++
6929eca46af7Smrg	    _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'
693095b296d0Smrg
693114330f12Smrg	    # Archives containing C++ object files must be created using
693214330f12Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
693314330f12Smrg	    # necessary to make sure instantiated templates are included
693414330f12Smrg	    # in the archive.
693514330f12Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
693614330f12Smrg	    ;;
693714330f12Smrg          *)
6938eca46af7Smrg	    if test yes = "$GXX"; then
6939eca46af7Smrg	      if test no = "$with_gnu_ld"; then
6940eca46af7Smrg	        _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'
694114330f12Smrg	      else
6942eca46af7Smrg	        _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'
694314330f12Smrg	      fi
694414330f12Smrg	    fi
694514330f12Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
694614330f12Smrg	    ;;
694714330f12Smrg        esac
6948eca46af7Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
694914330f12Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
695014330f12Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
695114330f12Smrg        ;;
695295b296d0Smrg
6953eca46af7Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
695414330f12Smrg        case $cc_basename in
695514330f12Smrg          KCC*)
695614330f12Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
695795b296d0Smrg
695814330f12Smrg	    # KCC will only create a shared library if the output file
695914330f12Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
696014330f12Smrg	    # to its proper name (with version) after linking.
6961eca46af7Smrg	    _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'
6962eca46af7Smrg	    _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'
696314330f12Smrg	    # Commands to make compiler produce verbose output that lists
696414330f12Smrg	    # what "hidden" libraries, object files and flags are used when
696514330f12Smrg	    # linking a shared library.
696614330f12Smrg	    #
696714330f12Smrg	    # There doesn't appear to be a way to prevent this compiler from
696814330f12Smrg	    # explicitly linking system object files so we need to strip them
696914330f12Smrg	    # from the output so that they don't get included in the library
697014330f12Smrg	    # dependencies.
6971eca46af7Smrg	    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"'
697295b296d0Smrg
6973eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6974eca46af7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
697595b296d0Smrg
697614330f12Smrg	    # Archives containing C++ object files must be created using
697714330f12Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
697814330f12Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
697914330f12Smrg	    ;;
698014330f12Smrg	  icpc* | ecpc* )
698114330f12Smrg	    # Intel C++
698214330f12Smrg	    with_gnu_ld=yes
698314330f12Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
698414330f12Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
698514330f12Smrg	    # earlier do not add the objects themselves.
698614330f12Smrg	    case `$CC -V 2>&1` in
698714330f12Smrg	      *"Version 7."*)
6988eca46af7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6989eca46af7Smrg		_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'
699014330f12Smrg		;;
699114330f12Smrg	      *)  # Version 8.0 or newer
699214330f12Smrg	        tmp_idyn=
699314330f12Smrg	        case $host_cpu in
699414330f12Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
699514330f12Smrg		esac
6996eca46af7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6997eca46af7Smrg		_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'
699814330f12Smrg		;;
699914330f12Smrg	    esac
700014330f12Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
7001eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7002eca46af7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7003eca46af7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
700414330f12Smrg	    ;;
700514330f12Smrg          pgCC* | pgcpp*)
700614330f12Smrg            # Portland Group C++ compiler
700714330f12Smrg	    case `$CC -V` in
700814330f12Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
700914330f12Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7010eca46af7Smrg               rm -rf $tpldir~
7011eca46af7Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7012eca46af7Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
701314330f12Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7014eca46af7Smrg                rm -rf $tpldir~
7015eca46af7Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7016eca46af7Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7017eca46af7Smrg                $RANLIB $oldlib'
701814330f12Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7019eca46af7Smrg                rm -rf $tpldir~
7020eca46af7Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7021eca46af7Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
702214330f12Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7023eca46af7Smrg                rm -rf $tpldir~
7024eca46af7Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7025eca46af7Smrg                $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'
702614330f12Smrg	      ;;
702714330f12Smrg	    *) # Version 6 and above use weak symbols
7028eca46af7Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7029eca46af7Smrg	      _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'
703014330f12Smrg	      ;;
703114330f12Smrg	    esac
703295b296d0Smrg
7033eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7034eca46af7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7035eca46af7Smrg	    _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'
703614330f12Smrg            ;;
703714330f12Smrg	  cxx*)
703814330f12Smrg	    # Compaq C++
7039eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7040eca46af7Smrg	    _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'
7041ff89ac2bSmrg
704214330f12Smrg	    runpath_var=LD_RUN_PATH
704314330f12Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
704414330f12Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
70452378475aSmrg
704614330f12Smrg	    # Commands to make compiler produce verbose output that lists
704714330f12Smrg	    # what "hidden" libraries, object files and flags are used when
704814330f12Smrg	    # linking a shared library.
704914330f12Smrg	    #
705014330f12Smrg	    # There doesn't appear to be a way to prevent this compiler from
705114330f12Smrg	    # explicitly linking system object files so we need to strip them
705214330f12Smrg	    # from the output so that they don't get included in the library
705314330f12Smrg	    # dependencies.
7054eca46af7Smrg	    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'
705514330f12Smrg	    ;;
705614330f12Smrg	  xl* | mpixl* | bgxl*)
705714330f12Smrg	    # IBM XL 8.0 on PPC, with GNU ld
7058eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7059eca46af7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7060eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7061eca46af7Smrg	    if test yes = "$supports_anon_versioning"; then
706214330f12Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7063eca46af7Smrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7064eca46af7Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7065eca46af7Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
706614330f12Smrg	    fi
706714330f12Smrg	    ;;
706814330f12Smrg	  *)
706914330f12Smrg	    case `$CC -V 2>&1 | sed 5q` in
707014330f12Smrg	    *Sun\ C*)
707114330f12Smrg	      # Sun C++ 5.9
707214330f12Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7073eca46af7Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7074eca46af7Smrg	      _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'
707514330f12Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7076eca46af7Smrg	      _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'
707714330f12Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
70782378475aSmrg
707914330f12Smrg	      # Not sure whether something based on
708014330f12Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
708114330f12Smrg	      # would be better.
708214330f12Smrg	      output_verbose_link_cmd='func_echo_all'
70832378475aSmrg
708414330f12Smrg	      # Archives containing C++ object files must be created using
708514330f12Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
708614330f12Smrg	      # necessary to make sure instantiated templates are included
708714330f12Smrg	      # in the archive.
708814330f12Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
708914330f12Smrg	      ;;
709014330f12Smrg	    esac
709114330f12Smrg	    ;;
709214330f12Smrg	esac
709314330f12Smrg	;;
70942378475aSmrg
709514330f12Smrg      lynxos*)
709614330f12Smrg        # FIXME: insert proper C++ library support
709714330f12Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
709814330f12Smrg	;;
70992378475aSmrg
710014330f12Smrg      m88k*)
710114330f12Smrg        # FIXME: insert proper C++ library support
710214330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
710314330f12Smrg	;;
71042378475aSmrg
710514330f12Smrg      mvs*)
710614330f12Smrg        case $cc_basename in
710714330f12Smrg          cxx*)
710814330f12Smrg	    # FIXME: insert proper C++ library support
710914330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
711014330f12Smrg	    ;;
711114330f12Smrg	  *)
711214330f12Smrg	    # FIXME: insert proper C++ library support
711314330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
711414330f12Smrg	    ;;
711514330f12Smrg	esac
711614330f12Smrg	;;
71172378475aSmrg
711814330f12Smrg      netbsd*)
711914330f12Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
712014330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
712114330f12Smrg	  wlarc=
712214330f12Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
712314330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
712414330f12Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
712514330f12Smrg	fi
712614330f12Smrg	# Workaround some broken pre-1.5 toolchains
712714330f12Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
712814330f12Smrg	;;
71292378475aSmrg
713014330f12Smrg      *nto* | *qnx*)
713114330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
713214330f12Smrg	;;
71332378475aSmrg
7134eca46af7Smrg      openbsd* | bitrig*)
713514330f12Smrg	if test -f /usr/libexec/ld.so; then
713614330f12Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
713714330f12Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
713814330f12Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
713914330f12Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7140eca46af7Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7141eca46af7Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7142eca46af7Smrg	    _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'
7143eca46af7Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7144eca46af7Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
714514330f12Smrg	  fi
714614330f12Smrg	  output_verbose_link_cmd=func_echo_all
714714330f12Smrg	else
714814330f12Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
714914330f12Smrg	fi
715014330f12Smrg	;;
71512378475aSmrg
715214330f12Smrg      osf3* | osf4* | osf5*)
715314330f12Smrg        case $cc_basename in
715414330f12Smrg          KCC*)
715514330f12Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
71562378475aSmrg
715714330f12Smrg	    # KCC will only create a shared library if the output file
715814330f12Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
715914330f12Smrg	    # to its proper name (with version) after linking.
7160eca46af7Smrg	    _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'
71612378475aSmrg
7162eca46af7Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
716314330f12Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71642378475aSmrg
716514330f12Smrg	    # Archives containing C++ object files must be created using
716614330f12Smrg	    # the KAI C++ compiler.
716714330f12Smrg	    case $host in
716814330f12Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
716914330f12Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
717014330f12Smrg	    esac
717114330f12Smrg	    ;;
717214330f12Smrg          RCC*)
717314330f12Smrg	    # Rational C++ 2.4.1
717414330f12Smrg	    # FIXME: insert proper C++ library support
717514330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
717614330f12Smrg	    ;;
717714330f12Smrg          cxx*)
717814330f12Smrg	    case $host in
717914330f12Smrg	      osf3*)
7180eca46af7Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7181eca46af7Smrg	        _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'
7182eca46af7Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
718314330f12Smrg		;;
718414330f12Smrg	      *)
718514330f12Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7186eca46af7Smrg	        _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'
718714330f12Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7188eca46af7Smrg                  echo "-hidden">> $lib.exp~
7189eca46af7Smrg                  $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~
7190eca46af7Smrg                  $RM $lib.exp'
719114330f12Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
719214330f12Smrg		;;
719314330f12Smrg	    esac
71942378475aSmrg
719514330f12Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
71962378475aSmrg
719714330f12Smrg	    # Commands to make compiler produce verbose output that lists
719814330f12Smrg	    # what "hidden" libraries, object files and flags are used when
719914330f12Smrg	    # linking a shared library.
720014330f12Smrg	    #
720114330f12Smrg	    # There doesn't appear to be a way to prevent this compiler from
720214330f12Smrg	    # explicitly linking system object files so we need to strip them
720314330f12Smrg	    # from the output so that they don't get included in the library
720414330f12Smrg	    # dependencies.
7205eca46af7Smrg	    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"'
720614330f12Smrg	    ;;
720714330f12Smrg	  *)
7208eca46af7Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7209eca46af7Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
721014330f12Smrg	      case $host in
721114330f12Smrg	        osf3*)
7212eca46af7Smrg	          _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'
721314330f12Smrg		  ;;
721414330f12Smrg	        *)
7215eca46af7Smrg	          _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'
721614330f12Smrg		  ;;
721714330f12Smrg	      esac
72182378475aSmrg
7219eca46af7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
722014330f12Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
72212378475aSmrg
722214330f12Smrg	      # Commands to make compiler produce verbose output that lists
722314330f12Smrg	      # what "hidden" libraries, object files and flags are used when
722414330f12Smrg	      # linking a shared library.
722514330f12Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
72262378475aSmrg
722714330f12Smrg	    else
722814330f12Smrg	      # FIXME: insert proper C++ library support
722914330f12Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
723014330f12Smrg	    fi
723114330f12Smrg	    ;;
723214330f12Smrg        esac
723314330f12Smrg        ;;
72342378475aSmrg
723514330f12Smrg      psos*)
723614330f12Smrg        # FIXME: insert proper C++ library support
723714330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
723814330f12Smrg        ;;
72392378475aSmrg
724014330f12Smrg      sunos4*)
724114330f12Smrg        case $cc_basename in
724214330f12Smrg          CC*)
724314330f12Smrg	    # Sun C++ 4.x
724414330f12Smrg	    # FIXME: insert proper C++ library support
724514330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724614330f12Smrg	    ;;
724714330f12Smrg          lcc*)
724814330f12Smrg	    # Lucid
724914330f12Smrg	    # FIXME: insert proper C++ library support
725014330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
725114330f12Smrg	    ;;
725214330f12Smrg          *)
725314330f12Smrg	    # FIXME: insert proper C++ library support
725414330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
725514330f12Smrg	    ;;
725614330f12Smrg        esac
725714330f12Smrg        ;;
72582378475aSmrg
725914330f12Smrg      solaris*)
726014330f12Smrg        case $cc_basename in
726114330f12Smrg          CC* | sunCC*)
726214330f12Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
726314330f12Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
726414330f12Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7265eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
726614330f12Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7267eca46af7Smrg              $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'
72682378475aSmrg
726914330f12Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
727014330f12Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
727114330f12Smrg	    case $host_os in
727214330f12Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
727314330f12Smrg	      *)
727414330f12Smrg		# The compiler driver will combine and reorder linker options,
7275eca46af7Smrg		# but understands '-z linker_flag'.
727614330f12Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
727714330f12Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
727814330f12Smrg	        ;;
727914330f12Smrg	    esac
728014330f12Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
72812378475aSmrg
728214330f12Smrg	    output_verbose_link_cmd='func_echo_all'
72832378475aSmrg
728414330f12Smrg	    # Archives containing C++ object files must be created using
728514330f12Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
728614330f12Smrg	    # necessary to make sure instantiated templates are included
728714330f12Smrg	    # in the archive.
728814330f12Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
728914330f12Smrg	    ;;
729014330f12Smrg          gcx*)
729114330f12Smrg	    # Green Hills C++ Compiler
7292eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
72932378475aSmrg
729414330f12Smrg	    # The C++ compiler must be used to create the archive.
729514330f12Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
729614330f12Smrg	    ;;
729714330f12Smrg          *)
729814330f12Smrg	    # GNU C++ compiler with Solaris linker
7299eca46af7Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7300eca46af7Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
730114330f12Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7302eca46af7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
730314330f12Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7304eca46af7Smrg                  $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'
73052378475aSmrg
730614330f12Smrg	        # Commands to make compiler produce verbose output that lists
730714330f12Smrg	        # what "hidden" libraries, object files and flags are used when
730814330f12Smrg	        # linking a shared library.
730914330f12Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
731014330f12Smrg	      else
7311eca46af7Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
731214330f12Smrg	        # platform.
7313eca46af7Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
731414330f12Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7315eca46af7Smrg                  $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'
73162378475aSmrg
731714330f12Smrg	        # Commands to make compiler produce verbose output that lists
731814330f12Smrg	        # what "hidden" libraries, object files and flags are used when
731914330f12Smrg	        # linking a shared library.
732014330f12Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
732114330f12Smrg	      fi
73222378475aSmrg
7323eca46af7Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
732414330f12Smrg	      case $host_os in
732514330f12Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
732614330f12Smrg		*)
7327eca46af7Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
732814330f12Smrg		  ;;
732914330f12Smrg	      esac
733014330f12Smrg	    fi
733114330f12Smrg	    ;;
733214330f12Smrg        esac
733314330f12Smrg        ;;
73342378475aSmrg
733514330f12Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7336eca46af7Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
733714330f12Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
733814330f12Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
733914330f12Smrg      runpath_var='LD_RUN_PATH'
73402378475aSmrg
734114330f12Smrg      case $cc_basename in
734214330f12Smrg        CC*)
7343eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7344eca46af7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
734514330f12Smrg	  ;;
734614330f12Smrg	*)
7347eca46af7Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7348eca46af7Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
734914330f12Smrg	  ;;
735014330f12Smrg      esac
735114330f12Smrg      ;;
73522378475aSmrg
735314330f12Smrg      sysv5* | sco3.2v5* | sco5v6*)
7354eca46af7Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
735514330f12Smrg	# link with -lc, and that would cause any symbols used from libc to
735614330f12Smrg	# always be unresolved, which means just about no library would
735714330f12Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
735814330f12Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
735914330f12Smrg	# as -z defs.
7360eca46af7Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7361eca46af7Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
736214330f12Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
736314330f12Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7364eca46af7Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
736514330f12Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
736614330f12Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7367eca46af7Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
736814330f12Smrg	runpath_var='LD_RUN_PATH'
736995b296d0Smrg
737014330f12Smrg	case $cc_basename in
737114330f12Smrg          CC*)
7372eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7373eca46af7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737414330f12Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7375eca46af7Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
737614330f12Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7377eca46af7Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
737814330f12Smrg	    ;;
737914330f12Smrg	  *)
7380eca46af7Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7381eca46af7Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
738214330f12Smrg	    ;;
738314330f12Smrg	esac
738414330f12Smrg      ;;
738595b296d0Smrg
738614330f12Smrg      tandem*)
738714330f12Smrg        case $cc_basename in
738814330f12Smrg          NCC*)
738914330f12Smrg	    # NonStop-UX NCC 3.20
739014330f12Smrg	    # FIXME: insert proper C++ library support
739114330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
739214330f12Smrg	    ;;
739314330f12Smrg          *)
739414330f12Smrg	    # FIXME: insert proper C++ library support
739514330f12Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
739614330f12Smrg	    ;;
739714330f12Smrg        esac
739814330f12Smrg        ;;
739995b296d0Smrg
740014330f12Smrg      vxworks*)
740114330f12Smrg        # FIXME: insert proper C++ library support
740214330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
740314330f12Smrg        ;;
740495b296d0Smrg
740514330f12Smrg      *)
740614330f12Smrg        # FIXME: insert proper C++ library support
740714330f12Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
740814330f12Smrg        ;;
740914330f12Smrg    esac
741095b296d0Smrg
741114330f12Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7412eca46af7Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
741395b296d0Smrg
7414eca46af7Smrg    _LT_TAGVAR(GCC, $1)=$GXX
7415eca46af7Smrg    _LT_TAGVAR(LD, $1)=$LD
741695b296d0Smrg
741714330f12Smrg    ## CAVEAT EMPTOR:
741814330f12Smrg    ## There is no encapsulation within the following macros, do not change
741914330f12Smrg    ## the running order or otherwise move them around unless you know exactly
742014330f12Smrg    ## what you are doing...
742114330f12Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
742214330f12Smrg    _LT_COMPILER_PIC($1)
742314330f12Smrg    _LT_COMPILER_C_O($1)
742414330f12Smrg    _LT_COMPILER_FILE_LOCKS($1)
742514330f12Smrg    _LT_LINKER_SHLIBS($1)
742614330f12Smrg    _LT_SYS_DYNAMIC_LINKER($1)
742714330f12Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
742895b296d0Smrg
742914330f12Smrg    _LT_CONFIG($1)
743014330f12Smrg  fi # test -n "$compiler"
743195b296d0Smrg
743214330f12Smrg  CC=$lt_save_CC
743314330f12Smrg  CFLAGS=$lt_save_CFLAGS
743414330f12Smrg  LDCXX=$LD
743514330f12Smrg  LD=$lt_save_LD
743614330f12Smrg  GCC=$lt_save_GCC
743714330f12Smrg  with_gnu_ld=$lt_save_with_gnu_ld
743814330f12Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
743914330f12Smrg  lt_cv_path_LD=$lt_save_path_LD
744014330f12Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
744114330f12Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7442eca46af7Smrgfi # test yes != "$_lt_caught_CXX_error"
744339713583Smrg
744414330f12SmrgAC_LANG_POP
744514330f12Smrg])# _LT_LANG_CXX_CONFIG
744639713583Smrg
74472378475aSmrg
744814330f12Smrg# _LT_FUNC_STRIPNAME_CNF
744914330f12Smrg# ----------------------
745014330f12Smrg# func_stripname_cnf prefix suffix name
74512378475aSmrg# strip PREFIX and SUFFIX off of NAME.
74522378475aSmrg# PREFIX and SUFFIX must not contain globbing or regex special
74532378475aSmrg# characters, hashes, percent signs, but SUFFIX may contain a leading
74542378475aSmrg# dot (in which case that matches only a dot).
745514330f12Smrg#
745614330f12Smrg# This function is identical to the (non-XSI) version of func_stripname,
745714330f12Smrg# except this one can be used by m4 code that may be executed by configure,
745814330f12Smrg# rather than the libtool script.
745914330f12Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
746014330f12SmrgAC_REQUIRE([_LT_DECL_SED])
746114330f12SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
746214330f12Smrgfunc_stripname_cnf ()
74632378475aSmrg{
7464eca46af7Smrg  case @S|@2 in
7465eca46af7Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7466eca46af7Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
746795b296d0Smrg  esac
746814330f12Smrg} # func_stripname_cnf
746914330f12Smrg])# _LT_FUNC_STRIPNAME_CNF
747095b296d0Smrg
747189b0dc75Smrg
747214330f12Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
747314330f12Smrg# ---------------------------------
747414330f12Smrg# Figure out "hidden" library dependencies from verbose
747514330f12Smrg# compiler output when linking a shared library.
747614330f12Smrg# Parse the compiler output and extract the necessary
747714330f12Smrg# objects, libraries and library flags.
747814330f12Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
747914330f12Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
748014330f12SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
748114330f12Smrg# Dependencies to place before and after the object being linked:
748214330f12Smrg_LT_TAGVAR(predep_objects, $1)=
748314330f12Smrg_LT_TAGVAR(postdep_objects, $1)=
748414330f12Smrg_LT_TAGVAR(predeps, $1)=
748514330f12Smrg_LT_TAGVAR(postdeps, $1)=
748614330f12Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
748795b296d0Smrg
748814330f12Smrgdnl we can't use the lt_simple_compile_test_code here,
748914330f12Smrgdnl because it contains code intended for an executable,
749014330f12Smrgdnl not a library.  It's possible we should let each
749114330f12Smrgdnl tag define a new lt_????_link_test_code variable,
749214330f12Smrgdnl but it's only used here...
749314330f12Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
749414330f12Smrgint a;
749514330f12Smrgvoid foo (void) { a = 0; }
74962378475aSmrg_LT_EOF
749714330f12Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
749814330f12Smrgclass Foo
74992378475aSmrg{
750014330f12Smrgpublic:
750114330f12Smrg  Foo (void) { a = 0; }
750214330f12Smrgprivate:
750314330f12Smrg  int a;
750414330f12Smrg};
75052378475aSmrg_LT_EOF
750614330f12Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
750714330f12Smrg      subroutine foo
750814330f12Smrg      implicit none
750914330f12Smrg      integer*4 a
751014330f12Smrg      a=0
751114330f12Smrg      return
751214330f12Smrg      end
751314330f12Smrg_LT_EOF
751414330f12Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
751514330f12Smrg      subroutine foo
751614330f12Smrg      implicit none
751714330f12Smrg      integer a
751814330f12Smrg      a=0
751914330f12Smrg      return
752014330f12Smrg      end
752114330f12Smrg_LT_EOF
752214330f12Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
752314330f12Smrgpublic class foo {
752414330f12Smrg  private int a;
752514330f12Smrg  public void bar (void) {
752614330f12Smrg    a = 0;
752714330f12Smrg  }
752814330f12Smrg};
75292378475aSmrg_LT_EOF
7530eca46af7Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7531eca46af7Smrgpackage foo
7532eca46af7Smrgfunc foo() {
7533eca46af7Smrg}
7534eca46af7Smrg_LT_EOF
75352378475aSmrg])
753695b296d0Smrg
753714330f12Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
753814330f12Smrgcase "$CC $CFLAGS " in #(
753914330f12Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
754014330f12Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7541eca46af7Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
754214330f12Smrgesac
754395b296d0Smrg
754414330f12Smrgdnl Parse the compiler output and extract the necessary
754514330f12Smrgdnl objects, libraries and library flags.
754614330f12Smrgif AC_TRY_EVAL(ac_compile); then
754714330f12Smrg  # Parse the compiler output and extract the necessary
754814330f12Smrg  # objects, libraries and library flags.
754995b296d0Smrg
755014330f12Smrg  # Sentinel used to keep track of whether or not we are before
755114330f12Smrg  # the conftest object file.
755214330f12Smrg  pre_test_object_deps_done=no
755395b296d0Smrg
755414330f12Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7555eca46af7Smrg    case $prev$p in
75562378475aSmrg
755714330f12Smrg    -L* | -R* | -l*)
755814330f12Smrg       # Some compilers place space between "-{L,R}" and the path.
755914330f12Smrg       # Remove the space.
7560eca46af7Smrg       if test x-L = "$p" ||
7561eca46af7Smrg          test x-R = "$p"; then
756214330f12Smrg	 prev=$p
756314330f12Smrg	 continue
756414330f12Smrg       fi
75652378475aSmrg
756614330f12Smrg       # Expand the sysroot to ease extracting the directories later.
756714330f12Smrg       if test -z "$prev"; then
756814330f12Smrg         case $p in
756914330f12Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
757014330f12Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
757114330f12Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
757214330f12Smrg         esac
757314330f12Smrg       fi
757414330f12Smrg       case $p in
757514330f12Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
757614330f12Smrg       esac
7577eca46af7Smrg       if test no = "$pre_test_object_deps_done"; then
7578eca46af7Smrg	 case $prev in
757914330f12Smrg	 -L | -R)
758014330f12Smrg	   # Internal compiler library paths should come after those
758114330f12Smrg	   # provided the user.  The postdeps already come after the
758214330f12Smrg	   # user supplied libs so there is no need to process them.
758314330f12Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7584eca46af7Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
758514330f12Smrg	   else
7586eca46af7Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
758714330f12Smrg	   fi
758814330f12Smrg	   ;;
758914330f12Smrg	 # The "-l" case would never come before the object being
759014330f12Smrg	 # linked, so don't bother handling this case.
759114330f12Smrg	 esac
759214330f12Smrg       else
759314330f12Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7594eca46af7Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
759514330f12Smrg	 else
7596eca46af7Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
759714330f12Smrg	 fi
759814330f12Smrg       fi
759914330f12Smrg       prev=
760014330f12Smrg       ;;
76012378475aSmrg
760214330f12Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
760314330f12Smrg    *.$objext)
760414330f12Smrg       # This assumes that the test object file only shows up
760514330f12Smrg       # once in the compiler output.
760614330f12Smrg       if test "$p" = "conftest.$objext"; then
760714330f12Smrg	 pre_test_object_deps_done=yes
760814330f12Smrg	 continue
760914330f12Smrg       fi
76102378475aSmrg
7611eca46af7Smrg       if test no = "$pre_test_object_deps_done"; then
761214330f12Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7613eca46af7Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
761414330f12Smrg	 else
761514330f12Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
761614330f12Smrg	 fi
761714330f12Smrg       else
761814330f12Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7619eca46af7Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
762014330f12Smrg	 else
762114330f12Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
762214330f12Smrg	 fi
762314330f12Smrg       fi
762414330f12Smrg       ;;
76252378475aSmrg
762614330f12Smrg    *) ;; # Ignore the rest.
762795b296d0Smrg
762814330f12Smrg    esac
762914330f12Smrg  done
76302378475aSmrg
763114330f12Smrg  # Clean up.
763214330f12Smrg  rm -f a.out a.exe
763314330f12Smrgelse
763414330f12Smrg  echo "libtool.m4: error: problem compiling $1 test program"
763514330f12Smrgfi
763695b296d0Smrg
763714330f12Smrg$RM -f confest.$objext
763814330f12SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
763995b296d0Smrg
764014330f12Smrg# PORTME: override above test on systems where it is broken
764114330f12Smrgm4_if([$1], [CXX],
764214330f12Smrg[case $host_os in
764314330f12Smrginterix[[3-9]]*)
764414330f12Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
764514330f12Smrg  # hack all around it, let's just trust "g++" to DTRT.
764614330f12Smrg  _LT_TAGVAR(predep_objects,$1)=
764714330f12Smrg  _LT_TAGVAR(postdep_objects,$1)=
764814330f12Smrg  _LT_TAGVAR(postdeps,$1)=
764914330f12Smrg  ;;
765014330f12Smrgesac
76512378475aSmrg])
765239713583Smrg
765314330f12Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
765414330f12Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
765514330f12Smrgesac
765614330f12Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
765714330f12Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7658eca46af7Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
765914330f12Smrgfi
766014330f12Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
766114330f12Smrg    [The directories searched by this compiler when creating a shared library])
766214330f12Smrg_LT_TAGDECL([], [predep_objects], [1],
766314330f12Smrg    [Dependencies to place before and after the objects being linked to
766414330f12Smrg    create a shared library])
766514330f12Smrg_LT_TAGDECL([], [postdep_objects], [1])
766614330f12Smrg_LT_TAGDECL([], [predeps], [1])
766714330f12Smrg_LT_TAGDECL([], [postdeps], [1])
766814330f12Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
766914330f12Smrg    [The library search path used internally by the compiler when linking
767014330f12Smrg    a shared library])
767114330f12Smrg])# _LT_SYS_HIDDEN_LIBDEPS
767239713583Smrg
767395b296d0Smrg
767414330f12Smrg# _LT_LANG_F77_CONFIG([TAG])
767514330f12Smrg# --------------------------
767614330f12Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
767714330f12Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7678eca46af7Smrg# to write the compiler configuration to 'libtool'.
767914330f12Smrgm4_defun([_LT_LANG_F77_CONFIG],
768014330f12Smrg[AC_LANG_PUSH(Fortran 77)
7681eca46af7Smrgif test -z "$F77" || test no = "$F77"; then
768214330f12Smrg  _lt_disable_F77=yes
768314330f12Smrgfi
768495b296d0Smrg
768514330f12Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
768614330f12Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
768714330f12Smrg_LT_TAGVAR(always_export_symbols, $1)=no
768814330f12Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
768914330f12Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
769014330f12Smrg_LT_TAGVAR(hardcode_direct, $1)=no
769114330f12Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
769214330f12Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
769314330f12Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
769414330f12Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
769514330f12Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
769614330f12Smrg_LT_TAGVAR(inherit_rpath, $1)=no
769714330f12Smrg_LT_TAGVAR(module_cmds, $1)=
769814330f12Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
769914330f12Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
770014330f12Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
770114330f12Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
770214330f12Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
770314330f12Smrg_LT_TAGVAR(no_undefined_flag, $1)=
770414330f12Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
770514330f12Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
770695b296d0Smrg
770714330f12Smrg# Source file extension for f77 test sources.
770814330f12Smrgac_ext=f
770995b296d0Smrg
771014330f12Smrg# Object file extension for compiled f77 test sources.
771114330f12Smrgobjext=o
771214330f12Smrg_LT_TAGVAR(objext, $1)=$objext
771395b296d0Smrg
771414330f12Smrg# No sense in running all these tests if we already determined that
771514330f12Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
771614330f12Smrg# are currently assumed to apply to all compilers on this platform,
771714330f12Smrg# and will be corrupted by setting them based on a non-working compiler.
7718eca46af7Smrgif test yes != "$_lt_disable_F77"; then
771914330f12Smrg  # Code to be used in simple compile tests
772014330f12Smrg  lt_simple_compile_test_code="\
772114330f12Smrg      subroutine t
772214330f12Smrg      return
772314330f12Smrg      end
772414330f12Smrg"
772595b296d0Smrg
772614330f12Smrg  # Code to be used in simple link tests
772714330f12Smrg  lt_simple_link_test_code="\
772814330f12Smrg      program t
772914330f12Smrg      end
773014330f12Smrg"
773195b296d0Smrg
773214330f12Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
773314330f12Smrg  _LT_TAG_COMPILER
773495b296d0Smrg
773514330f12Smrg  # save warnings/boilerplate of simple test code
773614330f12Smrg  _LT_COMPILER_BOILERPLATE
773714330f12Smrg  _LT_LINKER_BOILERPLATE
773895b296d0Smrg
773914330f12Smrg  # Allow CC to be a program name with arguments.
7740eca46af7Smrg  lt_save_CC=$CC
774114330f12Smrg  lt_save_GCC=$GCC
774214330f12Smrg  lt_save_CFLAGS=$CFLAGS
774314330f12Smrg  CC=${F77-"f77"}
774414330f12Smrg  CFLAGS=$FFLAGS
774514330f12Smrg  compiler=$CC
774614330f12Smrg  _LT_TAGVAR(compiler, $1)=$CC
774714330f12Smrg  _LT_CC_BASENAME([$compiler])
774814330f12Smrg  GCC=$G77
774914330f12Smrg  if test -n "$compiler"; then
775014330f12Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
775114330f12Smrg    AC_MSG_RESULT([$can_build_shared])
77522378475aSmrg
775314330f12Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7754eca46af7Smrg    test no = "$can_build_shared" && enable_shared=no
775514330f12Smrg
775614330f12Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
775714330f12Smrg    # are all built from PIC.
775814330f12Smrg    case $host_os in
775914330f12Smrg      aix3*)
7760eca46af7Smrg        test yes = "$enable_shared" && enable_static=no
776114330f12Smrg        if test -n "$RANLIB"; then
776214330f12Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
776314330f12Smrg          postinstall_cmds='$RANLIB $lib'
776414330f12Smrg        fi
776514330f12Smrg        ;;
776614330f12Smrg      aix[[4-9]]*)
7767eca46af7Smrg	if test ia64 != "$host_cpu"; then
7768eca46af7Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7769eca46af7Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7770eca46af7Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7771eca46af7Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7772eca46af7Smrg	  esac
77732378475aSmrg	fi
777414330f12Smrg        ;;
777514330f12Smrg    esac
777614330f12Smrg    AC_MSG_RESULT([$enable_shared])
777795b296d0Smrg
777814330f12Smrg    AC_MSG_CHECKING([whether to build static libraries])
777914330f12Smrg    # Make sure either enable_shared or enable_static is yes.
7780eca46af7Smrg    test yes = "$enable_shared" || enable_static=yes
778114330f12Smrg    AC_MSG_RESULT([$enable_static])
778295b296d0Smrg
7783eca46af7Smrg    _LT_TAGVAR(GCC, $1)=$G77
7784eca46af7Smrg    _LT_TAGVAR(LD, $1)=$LD
778595b296d0Smrg
778614330f12Smrg    ## CAVEAT EMPTOR:
778714330f12Smrg    ## There is no encapsulation within the following macros, do not change
778814330f12Smrg    ## the running order or otherwise move them around unless you know exactly
778914330f12Smrg    ## what you are doing...
779014330f12Smrg    _LT_COMPILER_PIC($1)
779114330f12Smrg    _LT_COMPILER_C_O($1)
779214330f12Smrg    _LT_COMPILER_FILE_LOCKS($1)
779314330f12Smrg    _LT_LINKER_SHLIBS($1)
779414330f12Smrg    _LT_SYS_DYNAMIC_LINKER($1)
779514330f12Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
779614330f12Smrg
779714330f12Smrg    _LT_CONFIG($1)
779814330f12Smrg  fi # test -n "$compiler"
779914330f12Smrg
780014330f12Smrg  GCC=$lt_save_GCC
7801eca46af7Smrg  CC=$lt_save_CC
7802eca46af7Smrg  CFLAGS=$lt_save_CFLAGS
7803eca46af7Smrgfi # test yes != "$_lt_disable_F77"
780414330f12Smrg
780514330f12SmrgAC_LANG_POP
780614330f12Smrg])# _LT_LANG_F77_CONFIG
78072378475aSmrg
780895b296d0Smrg
780914330f12Smrg# _LT_LANG_FC_CONFIG([TAG])
781014330f12Smrg# -------------------------
781114330f12Smrg# Ensure that the configuration variables for a Fortran compiler are
781214330f12Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7813eca46af7Smrg# to write the compiler configuration to 'libtool'.
781414330f12Smrgm4_defun([_LT_LANG_FC_CONFIG],
781514330f12Smrg[AC_LANG_PUSH(Fortran)
781695b296d0Smrg
7817eca46af7Smrgif test -z "$FC" || test no = "$FC"; then
781814330f12Smrg  _lt_disable_FC=yes
781914330f12Smrgfi
782095b296d0Smrg
782114330f12Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
782214330f12Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
782314330f12Smrg_LT_TAGVAR(always_export_symbols, $1)=no
782414330f12Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
782514330f12Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
782614330f12Smrg_LT_TAGVAR(hardcode_direct, $1)=no
782714330f12Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
782814330f12Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
782914330f12Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
783014330f12Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
783114330f12Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
783214330f12Smrg_LT_TAGVAR(inherit_rpath, $1)=no
783314330f12Smrg_LT_TAGVAR(module_cmds, $1)=
783414330f12Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
783514330f12Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
783614330f12Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
783714330f12Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
783814330f12Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
783914330f12Smrg_LT_TAGVAR(no_undefined_flag, $1)=
784014330f12Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
784114330f12Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
784295b296d0Smrg
784314330f12Smrg# Source file extension for fc test sources.
784414330f12Smrgac_ext=${ac_fc_srcext-f}
784595b296d0Smrg
784614330f12Smrg# Object file extension for compiled fc test sources.
784714330f12Smrgobjext=o
784814330f12Smrg_LT_TAGVAR(objext, $1)=$objext
784995b296d0Smrg
785014330f12Smrg# No sense in running all these tests if we already determined that
785114330f12Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
785214330f12Smrg# are currently assumed to apply to all compilers on this platform,
785314330f12Smrg# and will be corrupted by setting them based on a non-working compiler.
7854eca46af7Smrgif test yes != "$_lt_disable_FC"; then
785514330f12Smrg  # Code to be used in simple compile tests
785614330f12Smrg  lt_simple_compile_test_code="\
785714330f12Smrg      subroutine t
785814330f12Smrg      return
785914330f12Smrg      end
786014330f12Smrg"
786195b296d0Smrg
786214330f12Smrg  # Code to be used in simple link tests
786314330f12Smrg  lt_simple_link_test_code="\
786414330f12Smrg      program t
786514330f12Smrg      end
786614330f12Smrg"
786795b296d0Smrg
786814330f12Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
786914330f12Smrg  _LT_TAG_COMPILER
787095b296d0Smrg
787114330f12Smrg  # save warnings/boilerplate of simple test code
787214330f12Smrg  _LT_COMPILER_BOILERPLATE
787314330f12Smrg  _LT_LINKER_BOILERPLATE
787495b296d0Smrg
787514330f12Smrg  # Allow CC to be a program name with arguments.
7876eca46af7Smrg  lt_save_CC=$CC
787714330f12Smrg  lt_save_GCC=$GCC
787814330f12Smrg  lt_save_CFLAGS=$CFLAGS
787914330f12Smrg  CC=${FC-"f95"}
788014330f12Smrg  CFLAGS=$FCFLAGS
788114330f12Smrg  compiler=$CC
788214330f12Smrg  GCC=$ac_cv_fc_compiler_gnu
788395b296d0Smrg
788414330f12Smrg  _LT_TAGVAR(compiler, $1)=$CC
788514330f12Smrg  _LT_CC_BASENAME([$compiler])
788695b296d0Smrg
788714330f12Smrg  if test -n "$compiler"; then
788814330f12Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
788914330f12Smrg    AC_MSG_RESULT([$can_build_shared])
789095b296d0Smrg
789114330f12Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7892eca46af7Smrg    test no = "$can_build_shared" && enable_shared=no
789339713583Smrg
789414330f12Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
789514330f12Smrg    # are all built from PIC.
789614330f12Smrg    case $host_os in
789714330f12Smrg      aix3*)
7898eca46af7Smrg        test yes = "$enable_shared" && enable_static=no
789914330f12Smrg        if test -n "$RANLIB"; then
790014330f12Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
790114330f12Smrg          postinstall_cmds='$RANLIB $lib'
790214330f12Smrg        fi
790314330f12Smrg        ;;
790414330f12Smrg      aix[[4-9]]*)
7905eca46af7Smrg	if test ia64 != "$host_cpu"; then
7906eca46af7Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7907eca46af7Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7908eca46af7Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7909eca46af7Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7910eca46af7Smrg	  esac
7911ff89ac2bSmrg	fi
791214330f12Smrg        ;;
791314330f12Smrg    esac
791414330f12Smrg    AC_MSG_RESULT([$enable_shared])
791595b296d0Smrg
791614330f12Smrg    AC_MSG_CHECKING([whether to build static libraries])
791714330f12Smrg    # Make sure either enable_shared or enable_static is yes.
7918eca46af7Smrg    test yes = "$enable_shared" || enable_static=yes
791914330f12Smrg    AC_MSG_RESULT([$enable_static])
792095b296d0Smrg
7921eca46af7Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7922eca46af7Smrg    _LT_TAGVAR(LD, $1)=$LD
792395b296d0Smrg
792414330f12Smrg    ## CAVEAT EMPTOR:
792514330f12Smrg    ## There is no encapsulation within the following macros, do not change
792614330f12Smrg    ## the running order or otherwise move them around unless you know exactly
792714330f12Smrg    ## what you are doing...
792814330f12Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
792914330f12Smrg    _LT_COMPILER_PIC($1)
793014330f12Smrg    _LT_COMPILER_C_O($1)
793114330f12Smrg    _LT_COMPILER_FILE_LOCKS($1)
793214330f12Smrg    _LT_LINKER_SHLIBS($1)
793314330f12Smrg    _LT_SYS_DYNAMIC_LINKER($1)
793414330f12Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
793595b296d0Smrg
793614330f12Smrg    _LT_CONFIG($1)
793714330f12Smrg  fi # test -n "$compiler"
793895b296d0Smrg
793914330f12Smrg  GCC=$lt_save_GCC
794014330f12Smrg  CC=$lt_save_CC
794114330f12Smrg  CFLAGS=$lt_save_CFLAGS
7942eca46af7Smrgfi # test yes != "$_lt_disable_FC"
794395b296d0Smrg
794414330f12SmrgAC_LANG_POP
794514330f12Smrg])# _LT_LANG_FC_CONFIG
794695b296d0Smrg
794795b296d0Smrg
794814330f12Smrg# _LT_LANG_GCJ_CONFIG([TAG])
794914330f12Smrg# --------------------------
795014330f12Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
795114330f12Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7952eca46af7Smrg# to write the compiler configuration to 'libtool'.
795314330f12Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
795414330f12Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
795514330f12SmrgAC_LANG_SAVE
795695b296d0Smrg
795714330f12Smrg# Source file extension for Java test sources.
795814330f12Smrgac_ext=java
795939713583Smrg
796014330f12Smrg# Object file extension for compiled Java test sources.
796114330f12Smrgobjext=o
796214330f12Smrg_LT_TAGVAR(objext, $1)=$objext
79632378475aSmrg
796414330f12Smrg# Code to be used in simple compile tests
796514330f12Smrglt_simple_compile_test_code="class foo {}"
796695b296d0Smrg
796714330f12Smrg# Code to be used in simple link tests
796814330f12Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
796914330f12Smrg
797014330f12Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
797114330f12Smrg_LT_TAG_COMPILER
79722378475aSmrg
797314330f12Smrg# save warnings/boilerplate of simple test code
797414330f12Smrg_LT_COMPILER_BOILERPLATE
797514330f12Smrg_LT_LINKER_BOILERPLATE
79762378475aSmrg
797714330f12Smrg# Allow CC to be a program name with arguments.
797814330f12Smrglt_save_CC=$CC
797914330f12Smrglt_save_CFLAGS=$CFLAGS
798014330f12Smrglt_save_GCC=$GCC
798114330f12SmrgGCC=yes
798214330f12SmrgCC=${GCJ-"gcj"}
798314330f12SmrgCFLAGS=$GCJFLAGS
798414330f12Smrgcompiler=$CC
798514330f12Smrg_LT_TAGVAR(compiler, $1)=$CC
7986eca46af7Smrg_LT_TAGVAR(LD, $1)=$LD
798714330f12Smrg_LT_CC_BASENAME([$compiler])
79882378475aSmrg
798914330f12Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
799014330f12Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
79912378475aSmrg
799214330f12Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
799314330f12Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
799414330f12Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
799595b296d0Smrg
799614330f12Smrgif test -n "$compiler"; then
799714330f12Smrg  _LT_COMPILER_NO_RTTI($1)
799814330f12Smrg  _LT_COMPILER_PIC($1)
799914330f12Smrg  _LT_COMPILER_C_O($1)
800014330f12Smrg  _LT_COMPILER_FILE_LOCKS($1)
800114330f12Smrg  _LT_LINKER_SHLIBS($1)
800214330f12Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
800395b296d0Smrg
800414330f12Smrg  _LT_CONFIG($1)
800514330f12Smrgfi
800695b296d0Smrg
800714330f12SmrgAC_LANG_RESTORE
800895b296d0Smrg
800914330f12SmrgGCC=$lt_save_GCC
801014330f12SmrgCC=$lt_save_CC
801114330f12SmrgCFLAGS=$lt_save_CFLAGS
801214330f12Smrg])# _LT_LANG_GCJ_CONFIG
80132378475aSmrg
80142378475aSmrg
8015eca46af7Smrg# _LT_LANG_GO_CONFIG([TAG])
8016eca46af7Smrg# --------------------------
8017eca46af7Smrg# Ensure that the configuration variables for the GNU Go compiler
8018eca46af7Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8019eca46af7Smrg# to write the compiler configuration to 'libtool'.
8020eca46af7Smrgm4_defun([_LT_LANG_GO_CONFIG],
8021eca46af7Smrg[AC_REQUIRE([LT_PROG_GO])dnl
8022eca46af7SmrgAC_LANG_SAVE
8023eca46af7Smrg
8024eca46af7Smrg# Source file extension for Go test sources.
8025eca46af7Smrgac_ext=go
8026eca46af7Smrg
8027eca46af7Smrg# Object file extension for compiled Go test sources.
8028eca46af7Smrgobjext=o
8029eca46af7Smrg_LT_TAGVAR(objext, $1)=$objext
8030eca46af7Smrg
8031eca46af7Smrg# Code to be used in simple compile tests
8032eca46af7Smrglt_simple_compile_test_code="package main; func main() { }"
8033eca46af7Smrg
8034eca46af7Smrg# Code to be used in simple link tests
8035eca46af7Smrglt_simple_link_test_code='package main; func main() { }'
8036eca46af7Smrg
8037eca46af7Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8038eca46af7Smrg_LT_TAG_COMPILER
8039eca46af7Smrg
8040eca46af7Smrg# save warnings/boilerplate of simple test code
8041eca46af7Smrg_LT_COMPILER_BOILERPLATE
8042eca46af7Smrg_LT_LINKER_BOILERPLATE
8043eca46af7Smrg
8044eca46af7Smrg# Allow CC to be a program name with arguments.
8045eca46af7Smrglt_save_CC=$CC
8046eca46af7Smrglt_save_CFLAGS=$CFLAGS
8047eca46af7Smrglt_save_GCC=$GCC
8048eca46af7SmrgGCC=yes
8049eca46af7SmrgCC=${GOC-"gccgo"}
8050eca46af7SmrgCFLAGS=$GOFLAGS
8051eca46af7Smrgcompiler=$CC
8052eca46af7Smrg_LT_TAGVAR(compiler, $1)=$CC
8053eca46af7Smrg_LT_TAGVAR(LD, $1)=$LD
8054eca46af7Smrg_LT_CC_BASENAME([$compiler])
8055eca46af7Smrg
8056eca46af7Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
8057eca46af7Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8058eca46af7Smrg
8059eca46af7Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8060eca46af7Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8061eca46af7Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8062eca46af7Smrg
8063eca46af7Smrgif test -n "$compiler"; then
8064eca46af7Smrg  _LT_COMPILER_NO_RTTI($1)
8065eca46af7Smrg  _LT_COMPILER_PIC($1)
8066eca46af7Smrg  _LT_COMPILER_C_O($1)
8067eca46af7Smrg  _LT_COMPILER_FILE_LOCKS($1)
8068eca46af7Smrg  _LT_LINKER_SHLIBS($1)
8069eca46af7Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8070eca46af7Smrg
8071eca46af7Smrg  _LT_CONFIG($1)
8072eca46af7Smrgfi
8073eca46af7Smrg
8074eca46af7SmrgAC_LANG_RESTORE
8075eca46af7Smrg
8076eca46af7SmrgGCC=$lt_save_GCC
8077eca46af7SmrgCC=$lt_save_CC
8078eca46af7SmrgCFLAGS=$lt_save_CFLAGS
8079eca46af7Smrg])# _LT_LANG_GO_CONFIG
8080eca46af7Smrg
8081eca46af7Smrg
808214330f12Smrg# _LT_LANG_RC_CONFIG([TAG])
808314330f12Smrg# -------------------------
808414330f12Smrg# Ensure that the configuration variables for the Windows resource compiler
808514330f12Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8086eca46af7Smrg# to write the compiler configuration to 'libtool'.
808714330f12Smrgm4_defun([_LT_LANG_RC_CONFIG],
808814330f12Smrg[AC_REQUIRE([LT_PROG_RC])dnl
808914330f12SmrgAC_LANG_SAVE
80902378475aSmrg
809114330f12Smrg# Source file extension for RC test sources.
809214330f12Smrgac_ext=rc
80932378475aSmrg
809414330f12Smrg# Object file extension for compiled RC test sources.
809514330f12Smrgobjext=o
809614330f12Smrg_LT_TAGVAR(objext, $1)=$objext
80972378475aSmrg
809814330f12Smrg# Code to be used in simple compile tests
809914330f12Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
81002378475aSmrg
810114330f12Smrg# Code to be used in simple link tests
8102eca46af7Smrglt_simple_link_test_code=$lt_simple_compile_test_code
81032378475aSmrg
810414330f12Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
810514330f12Smrg_LT_TAG_COMPILER
81062378475aSmrg
810714330f12Smrg# save warnings/boilerplate of simple test code
810814330f12Smrg_LT_COMPILER_BOILERPLATE
810914330f12Smrg_LT_LINKER_BOILERPLATE
81102378475aSmrg
811114330f12Smrg# Allow CC to be a program name with arguments.
8112eca46af7Smrglt_save_CC=$CC
811314330f12Smrglt_save_CFLAGS=$CFLAGS
811414330f12Smrglt_save_GCC=$GCC
811514330f12SmrgGCC=
811614330f12SmrgCC=${RC-"windres"}
811714330f12SmrgCFLAGS=
811814330f12Smrgcompiler=$CC
811914330f12Smrg_LT_TAGVAR(compiler, $1)=$CC
812014330f12Smrg_LT_CC_BASENAME([$compiler])
812114330f12Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
81222378475aSmrg
812314330f12Smrgif test -n "$compiler"; then
812414330f12Smrg  :
812514330f12Smrg  _LT_CONFIG($1)
812614330f12Smrgfi
81272378475aSmrg
812814330f12SmrgGCC=$lt_save_GCC
812914330f12SmrgAC_LANG_RESTORE
813014330f12SmrgCC=$lt_save_CC
813114330f12SmrgCFLAGS=$lt_save_CFLAGS
813214330f12Smrg])# _LT_LANG_RC_CONFIG
813395b296d0Smrg
813495b296d0Smrg
813514330f12Smrg# LT_PROG_GCJ
813614330f12Smrg# -----------
813714330f12SmrgAC_DEFUN([LT_PROG_GCJ],
813814330f12Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
813914330f12Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
814014330f12Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
8141eca46af7Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
814214330f12Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
814314330f12Smrg])
814495b296d0Smrg
814514330f12Smrg# Old name:
814614330f12SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
814714330f12Smrgdnl aclocal-1.4 backwards compatibility:
814814330f12Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
814995b296d0Smrg
81502378475aSmrg
8151eca46af7Smrg# LT_PROG_GO
8152eca46af7Smrg# ----------
8153eca46af7SmrgAC_DEFUN([LT_PROG_GO],
8154eca46af7Smrg[AC_CHECK_TOOL(GOC, gccgo,)
8155eca46af7Smrg])
8156eca46af7Smrg
8157eca46af7Smrg
815814330f12Smrg# LT_PROG_RC
815914330f12Smrg# ----------
816014330f12SmrgAC_DEFUN([LT_PROG_RC],
816114330f12Smrg[AC_CHECK_TOOL(RC, windres,)
816214330f12Smrg])
816395b296d0Smrg
816414330f12Smrg# Old name:
816514330f12SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
816614330f12Smrgdnl aclocal-1.4 backwards compatibility:
816714330f12Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
81682378475aSmrg
81692378475aSmrg
817014330f12Smrg# _LT_DECL_EGREP
817114330f12Smrg# --------------
817214330f12Smrg# If we don't have a new enough Autoconf to choose the best grep
817314330f12Smrg# available, choose the one first in the user's PATH.
817414330f12Smrgm4_defun([_LT_DECL_EGREP],
817514330f12Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
817614330f12SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
817714330f12Smrgtest -z "$GREP" && GREP=grep
817814330f12Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
817914330f12Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
818014330f12Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
818114330f12Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
818214330f12SmrgAC_SUBST([GREP])
818395b296d0Smrg])
818495b296d0Smrg
8185ff89ac2bSmrg
818614330f12Smrg# _LT_DECL_OBJDUMP
818714330f12Smrg# --------------
818814330f12Smrg# If we don't have a new enough Autoconf to choose the best objdump
818914330f12Smrg# available, choose the one first in the user's PATH.
819014330f12Smrgm4_defun([_LT_DECL_OBJDUMP],
819114330f12Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
819214330f12Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
819314330f12Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
819414330f12SmrgAC_SUBST([OBJDUMP])
819514330f12Smrg])
819614330f12Smrg
819714330f12Smrg# _LT_DECL_DLLTOOL
819814330f12Smrg# ----------------
819914330f12Smrg# Ensure DLLTOOL variable is set.
820014330f12Smrgm4_defun([_LT_DECL_DLLTOOL],
820114330f12Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
820214330f12Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
820314330f12Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
820414330f12SmrgAC_SUBST([DLLTOOL])
820514330f12Smrg])
8206ff89ac2bSmrg
820714330f12Smrg# _LT_DECL_SED
820814330f12Smrg# ------------
820914330f12Smrg# Check for a fully-functional sed program, that truncates
821014330f12Smrg# as few characters as possible.  Prefer GNU sed if found.
821114330f12Smrgm4_defun([_LT_DECL_SED],
821214330f12Smrg[AC_PROG_SED
821314330f12Smrgtest -z "$SED" && SED=sed
821414330f12SmrgXsed="$SED -e 1s/^X//"
821514330f12Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
821614330f12Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
821714330f12Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
821814330f12Smrg])# _LT_DECL_SED
8219ff89ac2bSmrg
822014330f12Smrgm4_ifndef([AC_PROG_SED], [
822114330f12Smrg# NOTE: This macro has been submitted for inclusion into   #
822214330f12Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
822314330f12Smrg#  a released version of Autoconf we should remove this    #
822414330f12Smrg#  macro and use it instead.                               #
8225ff89ac2bSmrg
822614330f12Smrgm4_defun([AC_PROG_SED],
822714330f12Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
822814330f12SmrgAC_CACHE_VAL(lt_cv_path_SED,
822914330f12Smrg[# Loop through the user's path and test for sed and gsed.
823014330f12Smrg# Then use that list of sed's as ones to test for truncation.
823114330f12Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
823214330f12Smrgfor as_dir in $PATH
823314330f12Smrgdo
823414330f12Smrg  IFS=$as_save_IFS
823514330f12Smrg  test -z "$as_dir" && as_dir=.
823614330f12Smrg  for lt_ac_prog in sed gsed; do
823714330f12Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
823814330f12Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
823914330f12Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
824014330f12Smrg      fi
824114330f12Smrg    done
824214330f12Smrg  done
824314330f12Smrgdone
824414330f12SmrgIFS=$as_save_IFS
824514330f12Smrglt_ac_max=0
824614330f12Smrglt_ac_count=0
824714330f12Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
824814330f12Smrg# along with /bin/sed that truncates output.
824914330f12Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8250eca46af7Smrg  test ! -f "$lt_ac_sed" && continue
825114330f12Smrg  cat /dev/null > conftest.in
825214330f12Smrg  lt_ac_count=0
825314330f12Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
825414330f12Smrg  # Check for GNU sed and select it if it is found.
825514330f12Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
825614330f12Smrg    lt_cv_path_SED=$lt_ac_sed
825714330f12Smrg    break
825814330f12Smrg  fi
825914330f12Smrg  while true; do
826014330f12Smrg    cat conftest.in conftest.in >conftest.tmp
826114330f12Smrg    mv conftest.tmp conftest.in
826214330f12Smrg    cp conftest.in conftest.nl
826314330f12Smrg    echo >>conftest.nl
826414330f12Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
826514330f12Smrg    cmp -s conftest.out conftest.nl || break
826614330f12Smrg    # 10000 chars as input seems more than enough
8267eca46af7Smrg    test 10 -lt "$lt_ac_count" && break
826814330f12Smrg    lt_ac_count=`expr $lt_ac_count + 1`
8269eca46af7Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
827014330f12Smrg      lt_ac_max=$lt_ac_count
827114330f12Smrg      lt_cv_path_SED=$lt_ac_sed
827214330f12Smrg    fi
827314330f12Smrg  done
827414330f12Smrgdone
827595b296d0Smrg])
827614330f12SmrgSED=$lt_cv_path_SED
827714330f12SmrgAC_SUBST([SED])
827814330f12SmrgAC_MSG_RESULT([$SED])
827914330f12Smrg])#AC_PROG_SED
828014330f12Smrg])#m4_ifndef
828139713583Smrg
828214330f12Smrg# Old name:
828314330f12SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
828414330f12Smrgdnl aclocal-1.4 backwards compatibility:
828514330f12Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
82862378475aSmrg
82872378475aSmrg
828814330f12Smrg# _LT_CHECK_SHELL_FEATURES
828914330f12Smrg# ------------------------
829014330f12Smrg# Find out whether the shell is Bourne or XSI compatible,
829114330f12Smrg# or has some other useful features.
829214330f12Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8293eca46af7Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
829414330f12Smrg  lt_unset=unset
829514330f12Smrgelse
829614330f12Smrg  lt_unset=false
829714330f12Smrgfi
829814330f12Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
82992378475aSmrg
830014330f12Smrg# test EBCDIC or ASCII
830114330f12Smrgcase `echo X|tr X '\101'` in
830214330f12Smrg A) # ASCII based system
830314330f12Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
830414330f12Smrg  lt_SP2NL='tr \040 \012'
830514330f12Smrg  lt_NL2SP='tr \015\012 \040\040'
830614330f12Smrg  ;;
830714330f12Smrg *) # EBCDIC based system
830814330f12Smrg  lt_SP2NL='tr \100 \n'
830914330f12Smrg  lt_NL2SP='tr \r\n \100\100'
831014330f12Smrg  ;;
8311eca46af7Smrgesac
8312eca46af7Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
8313eca46af7Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
8314eca46af7Smrg])# _LT_CHECK_SHELL_FEATURES
831595b296d0Smrg
831695b296d0Smrg
831714330f12Smrg# _LT_PATH_CONVERSION_FUNCTIONS
831814330f12Smrg# -----------------------------
8319eca46af7Smrg# Determine what file name conversion functions should be used by
832014330f12Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
832114330f12Smrg# for certain cross-compile configurations and native mingw.
832214330f12Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
832314330f12Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
832414330f12SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
832514330f12SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
832614330f12SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
832714330f12Smrg[case $host in
832814330f12Smrg  *-*-mingw* )
832914330f12Smrg    case $build in
833014330f12Smrg      *-*-mingw* ) # actually msys
833114330f12Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
833214330f12Smrg        ;;
833314330f12Smrg      *-*-cygwin* )
833414330f12Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
833514330f12Smrg        ;;
833614330f12Smrg      * ) # otherwise, assume *nix
833714330f12Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
833814330f12Smrg        ;;
833914330f12Smrg    esac
834014330f12Smrg    ;;
834114330f12Smrg  *-*-cygwin* )
834214330f12Smrg    case $build in
834314330f12Smrg      *-*-mingw* ) # actually msys
834414330f12Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
834514330f12Smrg        ;;
834614330f12Smrg      *-*-cygwin* )
834714330f12Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
834814330f12Smrg        ;;
834914330f12Smrg      * ) # otherwise, assume *nix
835014330f12Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
835114330f12Smrg        ;;
835214330f12Smrg    esac
835314330f12Smrg    ;;
835414330f12Smrg  * ) # unhandled hosts (and "normal" native builds)
835514330f12Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
835614330f12Smrg    ;;
835714330f12Smrgesac
835814330f12Smrg])
835914330f12Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
836014330f12SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
836114330f12Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
836214330f12Smrg         [0], [convert $build file names to $host format])dnl
836314330f12Smrg
836414330f12SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
836514330f12SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
836614330f12Smrg[#assume ordinary cross tools, or native build.
836714330f12Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
836814330f12Smrgcase $host in
836914330f12Smrg  *-*-mingw* )
837014330f12Smrg    case $build in
837114330f12Smrg      *-*-mingw* ) # actually msys
837214330f12Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
837314330f12Smrg        ;;
837414330f12Smrg    esac
837514330f12Smrg    ;;
837614330f12Smrgesac
837714330f12Smrg])
837814330f12Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
837914330f12SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
838014330f12Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
838114330f12Smrg         [0], [convert $build files to toolchain format])dnl
838214330f12Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
838314330f12Smrg
838414330f12Smrg# Helper functions for option handling.                    -*- Autoconf -*-
838595b296d0Smrg#
838689b0dc75Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8387eca46af7Smrg#   Foundation, Inc.
838814330f12Smrg#   Written by Gary V. Vaughan, 2004
838995b296d0Smrg#
839014330f12Smrg# This file is free software; the Free Software Foundation gives
839114330f12Smrg# unlimited permission to copy and/or distribute it, with or without
839214330f12Smrg# modifications, as long as this notice is preserved.
839395b296d0Smrg
8394eca46af7Smrg# serial 8 ltoptions.m4
839595b296d0Smrg
839614330f12Smrg# This is to help aclocal find these macros, as it can't see m4_define.
839714330f12SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
839895b296d0Smrg
839995b296d0Smrg
840014330f12Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
840114330f12Smrg# ------------------------------------------
840214330f12Smrgm4_define([_LT_MANGLE_OPTION],
840314330f12Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
840495b296d0Smrg
840595b296d0Smrg
840614330f12Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
840714330f12Smrg# ---------------------------------------
840814330f12Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
840914330f12Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
841014330f12Smrg# saved as a flag.
841114330f12Smrgm4_define([_LT_SET_OPTION],
841214330f12Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
841314330f12Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
841414330f12Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
8415eca46af7Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
841614330f12Smrg])
841795b296d0Smrg
841895b296d0Smrg
841914330f12Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
842014330f12Smrg# ------------------------------------------------------------
842114330f12Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
842214330f12Smrgm4_define([_LT_IF_OPTION],
842314330f12Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
842495b296d0Smrg
842595b296d0Smrg
842614330f12Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
842714330f12Smrg# -------------------------------------------------------
842814330f12Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
842914330f12Smrg# are set.
843014330f12Smrgm4_define([_LT_UNLESS_OPTIONS],
843114330f12Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
843214330f12Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
843314330f12Smrg		      [m4_define([$0_found])])])[]dnl
843414330f12Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
843514330f12Smrg])[]dnl
843614330f12Smrg])
843795b296d0Smrg
843895b296d0Smrg
843914330f12Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
844014330f12Smrg# ----------------------------------------
844114330f12Smrg# OPTION-LIST is a space-separated list of Libtool options associated
844214330f12Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
844314330f12Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
844414330f12Smrg# the unknown option and exit.
844514330f12Smrgm4_defun([_LT_SET_OPTIONS],
844614330f12Smrg[# Set options
844714330f12Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
844814330f12Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
844995b296d0Smrg
845014330f12Smrgm4_if([$1],[LT_INIT],[
845114330f12Smrg  dnl
845214330f12Smrg  dnl Simply set some default values (i.e off) if boolean options were not
845314330f12Smrg  dnl specified:
845414330f12Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
845514330f12Smrg  ])
845614330f12Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
845714330f12Smrg  ])
845814330f12Smrg  dnl
845914330f12Smrg  dnl If no reference was made to various pairs of opposing options, then
846014330f12Smrg  dnl we run the default mode handler for the pair.  For example, if neither
8461eca46af7Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
846214330f12Smrg  dnl archives by default:
846314330f12Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
846414330f12Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
846514330f12Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
846614330f12Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8467eca46af7Smrg		   [_LT_ENABLE_FAST_INSTALL])
8468eca46af7Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8469eca46af7Smrg		   [_LT_WITH_AIX_SONAME([aix])])
847014330f12Smrg  ])
847114330f12Smrg])# _LT_SET_OPTIONS
847295b296d0Smrg
847395b296d0Smrg
847495b296d0Smrg
847514330f12Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
847614330f12Smrg# -----------------------------------------
847714330f12Smrgm4_define([_LT_MANGLE_DEFUN],
847814330f12Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
847995b296d0Smrg
848095b296d0Smrg
848114330f12Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
848214330f12Smrg# -----------------------------------------------
848314330f12Smrgm4_define([LT_OPTION_DEFINE],
848414330f12Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
848514330f12Smrg])# LT_OPTION_DEFINE
848695b296d0Smrg
848795b296d0Smrg
848814330f12Smrg# dlopen
848914330f12Smrg# ------
849014330f12SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
849114330f12Smrg])
849295b296d0Smrg
849314330f12SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
849414330f12Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
849514330f12SmrgAC_DIAGNOSE([obsolete],
849614330f12Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8497eca46af7Smrgput the 'dlopen' option into LT_INIT's first parameter.])
849814330f12Smrg])
849995b296d0Smrg
850014330f12Smrgdnl aclocal-1.4 backwards compatibility:
850114330f12Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
850295b296d0Smrg
850395b296d0Smrg
850414330f12Smrg# win32-dll
850514330f12Smrg# ---------
850614330f12Smrg# Declare package support for building win32 dll's.
850714330f12SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
850814330f12Smrg[enable_win32_dll=yes
850995b296d0Smrg
851014330f12Smrgcase $host in
851114330f12Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
851214330f12Smrg  AC_CHECK_TOOL(AS, as, false)
851314330f12Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
851414330f12Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
851514330f12Smrg  ;;
851614330f12Smrgesac
85172378475aSmrg
851814330f12Smrgtest -z "$AS" && AS=as
851914330f12Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
85202378475aSmrg
852114330f12Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
852214330f12Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
852395b296d0Smrg
852414330f12Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
852514330f12Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
852614330f12Smrg])# win32-dll
85272378475aSmrg
852814330f12SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
852914330f12Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
853014330f12Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
853114330f12SmrgAC_DIAGNOSE([obsolete],
853214330f12Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8533eca46af7Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
853414330f12Smrg])
85352378475aSmrg
853614330f12Smrgdnl aclocal-1.4 backwards compatibility:
853714330f12Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
85382378475aSmrg
853995b296d0Smrg
854014330f12Smrg# _LT_ENABLE_SHARED([DEFAULT])
854114330f12Smrg# ----------------------------
8542eca46af7Smrg# implement the --enable-shared flag, and supports the 'shared' and
8543eca46af7Smrg# 'disable-shared' LT_INIT options.
8544eca46af7Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
854514330f12Smrgm4_define([_LT_ENABLE_SHARED],
854614330f12Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
854714330f12SmrgAC_ARG_ENABLE([shared],
854814330f12Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
854914330f12Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
855014330f12Smrg    [p=${PACKAGE-default}
855114330f12Smrg    case $enableval in
855214330f12Smrg    yes) enable_shared=yes ;;
855314330f12Smrg    no) enable_shared=no ;;
855414330f12Smrg    *)
855514330f12Smrg      enable_shared=no
855614330f12Smrg      # Look at the argument we got.  We use all the common list separators.
8557eca46af7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
855814330f12Smrg      for pkg in $enableval; do
8559eca46af7Smrg	IFS=$lt_save_ifs
856014330f12Smrg	if test "X$pkg" = "X$p"; then
856114330f12Smrg	  enable_shared=yes
856214330f12Smrg	fi
856314330f12Smrg      done
8564eca46af7Smrg      IFS=$lt_save_ifs
856514330f12Smrg      ;;
856614330f12Smrg    esac],
856714330f12Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
856895b296d0Smrg
856914330f12Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
857014330f12Smrg	[Whether or not to build shared libraries])
857114330f12Smrg])# _LT_ENABLE_SHARED
857295b296d0Smrg
857314330f12SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
857414330f12SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
857595b296d0Smrg
857614330f12Smrg# Old names:
857714330f12SmrgAC_DEFUN([AC_ENABLE_SHARED],
857814330f12Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
857914330f12Smrg])
858095b296d0Smrg
858114330f12SmrgAC_DEFUN([AC_DISABLE_SHARED],
858214330f12Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
858314330f12Smrg])
858495b296d0Smrg
858514330f12SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
858614330f12SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
858795b296d0Smrg
858814330f12Smrgdnl aclocal-1.4 backwards compatibility:
858914330f12Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
859014330f12Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
859195b296d0Smrg
859295b296d0Smrg
859395b296d0Smrg
859414330f12Smrg# _LT_ENABLE_STATIC([DEFAULT])
859514330f12Smrg# ----------------------------
8596eca46af7Smrg# implement the --enable-static flag, and support the 'static' and
8597eca46af7Smrg# 'disable-static' LT_INIT options.
8598eca46af7Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
859914330f12Smrgm4_define([_LT_ENABLE_STATIC],
860014330f12Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
860114330f12SmrgAC_ARG_ENABLE([static],
860214330f12Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
860314330f12Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
860414330f12Smrg    [p=${PACKAGE-default}
860514330f12Smrg    case $enableval in
860614330f12Smrg    yes) enable_static=yes ;;
860714330f12Smrg    no) enable_static=no ;;
860814330f12Smrg    *)
860914330f12Smrg     enable_static=no
861014330f12Smrg      # Look at the argument we got.  We use all the common list separators.
8611eca46af7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
861214330f12Smrg      for pkg in $enableval; do
8613eca46af7Smrg	IFS=$lt_save_ifs
861414330f12Smrg	if test "X$pkg" = "X$p"; then
861514330f12Smrg	  enable_static=yes
861614330f12Smrg	fi
861714330f12Smrg      done
8618eca46af7Smrg      IFS=$lt_save_ifs
861914330f12Smrg      ;;
862014330f12Smrg    esac],
862114330f12Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
862214330f12Smrg
862314330f12Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
862414330f12Smrg	[Whether or not to build static libraries])
862514330f12Smrg])# _LT_ENABLE_STATIC
862614330f12Smrg
862714330f12SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
862814330f12SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
862995b296d0Smrg
863014330f12Smrg# Old names:
863114330f12SmrgAC_DEFUN([AC_ENABLE_STATIC],
863214330f12Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
863314330f12Smrg])
863495b296d0Smrg
863514330f12SmrgAC_DEFUN([AC_DISABLE_STATIC],
863614330f12Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
863714330f12Smrg])
86382378475aSmrg
863914330f12SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
864014330f12SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8641ff89ac2bSmrg
864214330f12Smrgdnl aclocal-1.4 backwards compatibility:
864314330f12Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
864414330f12Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8645ff89ac2bSmrg
8646ff89ac2bSmrg
8647ff89ac2bSmrg
864814330f12Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
864914330f12Smrg# ----------------------------------
8650eca46af7Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
8651eca46af7Smrg# and 'disable-fast-install' LT_INIT options.
8652eca46af7Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
865314330f12Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
865414330f12Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
865514330f12SmrgAC_ARG_ENABLE([fast-install],
865614330f12Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
865714330f12Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
865814330f12Smrg    [p=${PACKAGE-default}
865914330f12Smrg    case $enableval in
866014330f12Smrg    yes) enable_fast_install=yes ;;
866114330f12Smrg    no) enable_fast_install=no ;;
866214330f12Smrg    *)
866314330f12Smrg      enable_fast_install=no
866414330f12Smrg      # Look at the argument we got.  We use all the common list separators.
8665eca46af7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
866614330f12Smrg      for pkg in $enableval; do
8667eca46af7Smrg	IFS=$lt_save_ifs
866814330f12Smrg	if test "X$pkg" = "X$p"; then
866914330f12Smrg	  enable_fast_install=yes
867014330f12Smrg	fi
867114330f12Smrg      done
8672eca46af7Smrg      IFS=$lt_save_ifs
867314330f12Smrg      ;;
867414330f12Smrg    esac],
867514330f12Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8676ff89ac2bSmrg
867714330f12Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
867814330f12Smrg	 [Whether or not to optimize for fast installation])dnl
867914330f12Smrg])# _LT_ENABLE_FAST_INSTALL
8680ff89ac2bSmrg
868114330f12SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
868214330f12SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8683ff89ac2bSmrg
868414330f12Smrg# Old names:
868514330f12SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
868614330f12Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
868714330f12SmrgAC_DIAGNOSE([obsolete],
868814330f12Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8689eca46af7Smrgthe 'fast-install' option into LT_INIT's first parameter.])
869014330f12Smrg])
8691ff89ac2bSmrg
869214330f12SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
869314330f12Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
869414330f12SmrgAC_DIAGNOSE([obsolete],
869514330f12Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8696eca46af7Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
869714330f12Smrg])
86982378475aSmrg
869914330f12Smrgdnl aclocal-1.4 backwards compatibility:
870014330f12Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
870114330f12Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
87022378475aSmrg
87032378475aSmrg
8704eca46af7Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
8705eca46af7Smrg# ----------------------------------
8706eca46af7Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8707eca46af7Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8708eca46af7Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8709eca46af7Smrgm4_define([_LT_WITH_AIX_SONAME],
8710eca46af7Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8711eca46af7Smrgshared_archive_member_spec=
8712eca46af7Smrgcase $host,$enable_shared in
8713eca46af7Smrgpower*-*-aix[[5-9]]*,yes)
8714eca46af7Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8715eca46af7Smrg  AC_ARG_WITH([aix-soname],
8716eca46af7Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8717eca46af7Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8718eca46af7Smrg    [case $withval in
8719eca46af7Smrg    aix|svr4|both)
8720eca46af7Smrg      ;;
8721eca46af7Smrg    *)
8722eca46af7Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8723eca46af7Smrg      ;;
8724eca46af7Smrg    esac
8725eca46af7Smrg    lt_cv_with_aix_soname=$with_aix_soname],
8726eca46af7Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8727eca46af7Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8728eca46af7Smrg    with_aix_soname=$lt_cv_with_aix_soname])
8729eca46af7Smrg  AC_MSG_RESULT([$with_aix_soname])
8730eca46af7Smrg  if test aix != "$with_aix_soname"; then
8731eca46af7Smrg    # For the AIX way of multilib, we name the shared archive member
8732eca46af7Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8733eca46af7Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8734eca46af7Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8735eca46af7Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8736eca46af7Smrg    if test 64 = "${OBJECT_MODE-32}"; then
8737eca46af7Smrg      shared_archive_member_spec=shr_64
8738eca46af7Smrg    else
8739eca46af7Smrg      shared_archive_member_spec=shr
8740eca46af7Smrg    fi
8741eca46af7Smrg  fi
8742eca46af7Smrg  ;;
8743eca46af7Smrg*)
8744eca46af7Smrg  with_aix_soname=aix
8745eca46af7Smrg  ;;
8746eca46af7Smrgesac
8747eca46af7Smrg
8748eca46af7Smrg_LT_DECL([], [shared_archive_member_spec], [0],
8749eca46af7Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8750eca46af7Smrg])# _LT_WITH_AIX_SONAME
8751eca46af7Smrg
8752eca46af7SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8753eca46af7SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8754eca46af7SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8755eca46af7Smrg
8756eca46af7Smrg
875714330f12Smrg# _LT_WITH_PIC([MODE])
875814330f12Smrg# --------------------
8759eca46af7Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
876014330f12Smrg# LT_INIT options.
8761eca46af7Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
876214330f12Smrgm4_define([_LT_WITH_PIC],
876314330f12Smrg[AC_ARG_WITH([pic],
8764eca46af7Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
876514330f12Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8766eca46af7Smrg    [lt_p=${PACKAGE-default}
8767eca46af7Smrg    case $withval in
8768eca46af7Smrg    yes|no) pic_mode=$withval ;;
8769eca46af7Smrg    *)
8770eca46af7Smrg      pic_mode=default
8771eca46af7Smrg      # Look at the argument we got.  We use all the common list separators.
8772eca46af7Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8773eca46af7Smrg      for lt_pkg in $withval; do
8774eca46af7Smrg	IFS=$lt_save_ifs
8775eca46af7Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8776eca46af7Smrg	  pic_mode=yes
8777eca46af7Smrg	fi
8778eca46af7Smrg      done
8779eca46af7Smrg      IFS=$lt_save_ifs
8780eca46af7Smrg      ;;
8781eca46af7Smrg    esac],
8782eca46af7Smrg    [pic_mode=m4_default([$1], [default])])
87832378475aSmrg
878414330f12Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
878514330f12Smrg])# _LT_WITH_PIC
87862378475aSmrg
878714330f12SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
878814330f12SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
87892378475aSmrg
879014330f12Smrg# Old name:
879114330f12SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
879214330f12Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
879314330f12SmrgAC_DIAGNOSE([obsolete],
879414330f12Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8795eca46af7Smrgput the 'pic-only' option into LT_INIT's first parameter.])
879614330f12Smrg])
87972378475aSmrg
879814330f12Smrgdnl aclocal-1.4 backwards compatibility:
879914330f12Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
88002378475aSmrg
88012378475aSmrg
880214330f12Smrgm4_define([_LTDL_MODE], [])
880314330f12SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
880414330f12Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
880514330f12SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
880614330f12Smrg		 [m4_define([_LTDL_MODE], [recursive])])
880714330f12SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
880814330f12Smrg		 [m4_define([_LTDL_MODE], [subproject])])
88092378475aSmrg
881014330f12Smrgm4_define([_LTDL_TYPE], [])
881114330f12SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
881214330f12Smrg		 [m4_define([_LTDL_TYPE], [installable])])
881314330f12SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
881414330f12Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
88152378475aSmrg
881614330f12Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
88172378475aSmrg#
881889b0dc75Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8819eca46af7Smrg# Foundation, Inc.
882014330f12Smrg# Written by Gary V. Vaughan, 2004
88212378475aSmrg#
882214330f12Smrg# This file is free software; the Free Software Foundation gives
882314330f12Smrg# unlimited permission to copy and/or distribute it, with or without
882414330f12Smrg# modifications, as long as this notice is preserved.
88252378475aSmrg
882614330f12Smrg# serial 6 ltsugar.m4
88272378475aSmrg
882814330f12Smrg# This is to help aclocal find these macros, as it can't see m4_define.
882914330f12SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
88302378475aSmrg
883195b296d0Smrg
883214330f12Smrg# lt_join(SEP, ARG1, [ARG2...])
883314330f12Smrg# -----------------------------
883414330f12Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
883514330f12Smrg# associated separator.
883614330f12Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
883714330f12Smrg# versions in m4sugar had bugs.
883814330f12Smrgm4_define([lt_join],
883914330f12Smrg[m4_if([$#], [1], [],
884014330f12Smrg       [$#], [2], [[$2]],
884114330f12Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
884214330f12Smrgm4_define([_lt_join],
884314330f12Smrg[m4_if([$#$2], [2], [],
884414330f12Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
884595b296d0Smrg
884695b296d0Smrg
884714330f12Smrg# lt_car(LIST)
884814330f12Smrg# lt_cdr(LIST)
884914330f12Smrg# ------------
885014330f12Smrg# Manipulate m4 lists.
885114330f12Smrg# These macros are necessary as long as will still need to support
8852eca46af7Smrg# Autoconf-2.59, which quotes differently.
885314330f12Smrgm4_define([lt_car], [[$1]])
885414330f12Smrgm4_define([lt_cdr],
885514330f12Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
885614330f12Smrg       [$#], 1, [],
885714330f12Smrg       [m4_dquote(m4_shift($@))])])
885814330f12Smrgm4_define([lt_unquote], $1)
885995b296d0Smrg
886014330f12Smrg
886114330f12Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
886214330f12Smrg# ------------------------------------------
8863eca46af7Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
886414330f12Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
886514330f12Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
886614330f12Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
886714330f12Smrg# than defined and empty).
886895b296d0Smrg#
886914330f12Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
887014330f12Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
887114330f12Smrgm4_define([lt_append],
887214330f12Smrg[m4_define([$1],
887314330f12Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
887495b296d0Smrg
88752378475aSmrg
88762378475aSmrg
887714330f12Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
887814330f12Smrg# ----------------------------------------------------------
887914330f12Smrg# Produce a SEP delimited list of all paired combinations of elements of
888014330f12Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
888114330f12Smrg# has the form PREFIXmINFIXSUFFIXn.
888214330f12Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
888314330f12Smrgm4_define([lt_combine],
888414330f12Smrg[m4_if(m4_eval([$# > 3]), [1],
888514330f12Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
888614330f12Smrg[[m4_foreach([_Lt_prefix], [$2],
888714330f12Smrg	     [m4_foreach([_Lt_suffix],
888814330f12Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
888914330f12Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
889014330f12Smrg
889114330f12Smrg
889214330f12Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
889314330f12Smrg# -----------------------------------------------------------------------
889414330f12Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
889514330f12Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
889614330f12Smrgm4_define([lt_if_append_uniq],
889714330f12Smrg[m4_ifdef([$1],
889814330f12Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
889914330f12Smrg		 [lt_append([$1], [$2], [$3])$4],
890014330f12Smrg		 [$5])],
890114330f12Smrg	  [lt_append([$1], [$2], [$3])$4])])
890214330f12Smrg
890314330f12Smrg
890414330f12Smrg# lt_dict_add(DICT, KEY, VALUE)
890514330f12Smrg# -----------------------------
890614330f12Smrgm4_define([lt_dict_add],
890714330f12Smrg[m4_define([$1($2)], [$3])])
890814330f12Smrg
890914330f12Smrg
891014330f12Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
891114330f12Smrg# --------------------------------------------
891214330f12Smrgm4_define([lt_dict_add_subkey],
891314330f12Smrg[m4_define([$1($2:$3)], [$4])])
891414330f12Smrg
891514330f12Smrg
891614330f12Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
891714330f12Smrg# ----------------------------------
891814330f12Smrgm4_define([lt_dict_fetch],
891914330f12Smrg[m4_ifval([$3],
892014330f12Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
892114330f12Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
892214330f12Smrg
89232378475aSmrg
892414330f12Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
892514330f12Smrg# -----------------------------------------------------------------
892614330f12Smrgm4_define([lt_if_dict_fetch],
892714330f12Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
892814330f12Smrg	[$5],
892914330f12Smrg    [$6])])
893095b296d0Smrg
893195b296d0Smrg
893214330f12Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
893314330f12Smrg# --------------------------------------------------------------
893414330f12Smrgm4_define([lt_dict_filter],
893514330f12Smrg[m4_if([$5], [], [],
893614330f12Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
893714330f12Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
893814330f12Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
893914330f12Smrg])
894095b296d0Smrg
894114330f12Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
894295b296d0Smrg#
894389b0dc75Smrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
894414330f12Smrg#   Written by Scott James Remnant, 2004
89452378475aSmrg#
894614330f12Smrg# This file is free software; the Free Software Foundation gives
894714330f12Smrg# unlimited permission to copy and/or distribute it, with or without
894814330f12Smrg# modifications, as long as this notice is preserved.
894995b296d0Smrg
895014330f12Smrg# @configure_input@
89512378475aSmrg
895289b0dc75Smrg# serial 4179 ltversion.m4
895314330f12Smrg# This file is part of GNU Libtool
89542378475aSmrg
895589b0dc75Smrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
895689b0dc75Smrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
895795b296d0Smrg
895814330f12SmrgAC_DEFUN([LTVERSION_VERSION],
895989b0dc75Smrg[macro_version='2.4.6'
896089b0dc75Smrgmacro_revision='2.4.6'
896114330f12Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
896214330f12Smrg_LT_DECL(, macro_revision, 0)
896314330f12Smrg])
896495b296d0Smrg
896514330f12Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
896639713583Smrg#
896789b0dc75Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8968eca46af7Smrg#   Foundation, Inc.
896914330f12Smrg#   Written by Scott James Remnant, 2004.
89702378475aSmrg#
897114330f12Smrg# This file is free software; the Free Software Foundation gives
897214330f12Smrg# unlimited permission to copy and/or distribute it, with or without
897314330f12Smrg# modifications, as long as this notice is preserved.
89742378475aSmrg
8975eca46af7Smrg# serial 5 lt~obsolete.m4
8976eca46af7Smrg
8977eca46af7Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
8978eca46af7Smrg#
8979eca46af7Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
8980eca46af7Smrg# which have later been changed to m4_define as they aren't part of the
8981eca46af7Smrg# exported API, or moved to Autoconf or Automake where they belong.
8982eca46af7Smrg#
8983eca46af7Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8984eca46af7Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8985eca46af7Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
8986eca46af7Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8987eca46af7Smrg# and doesn't know about Autoconf macros at all.)
8988eca46af7Smrg#
8989eca46af7Smrg# So we provide this file, which has a silly filename so it's always
8990eca46af7Smrg# included after everything else.  This provides aclocal with the
8991eca46af7Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8992eca46af7Smrg# because those macros already exist, or will be overwritten later.
8993eca46af7Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
8994eca46af7Smrg#
8995eca46af7Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8996eca46af7Smrg# Yes, that means every name once taken will need to remain here until
8997eca46af7Smrg# we give up compatibility with versions before 1.7, at which point
8998eca46af7Smrg# we need to keep only those names which we still refer to.
8999eca46af7Smrg
9000eca46af7Smrg# This is to help aclocal find these macros, as it can't see m4_define.
9001eca46af7SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
9002eca46af7Smrg
9003eca46af7Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
9004eca46af7Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
9005eca46af7Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
9006eca46af7Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
9007eca46af7Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
9008eca46af7Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
9009eca46af7Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
9010eca46af7Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
9011eca46af7Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
9012eca46af7Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
9013eca46af7Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
9014eca46af7Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
9015eca46af7Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
9016eca46af7Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
9017eca46af7Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
9018eca46af7Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
9019eca46af7Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
9020eca46af7Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
9021eca46af7Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
9022eca46af7Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
9023eca46af7Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
9024eca46af7Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
9025eca46af7Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
9026eca46af7Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
9027eca46af7Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
9028eca46af7Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
9029eca46af7Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
9030eca46af7Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
9031eca46af7Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
9032eca46af7Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
9033eca46af7Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
9034eca46af7Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
9035eca46af7Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
9036eca46af7Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
9037eca46af7Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
9038eca46af7Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
9039eca46af7Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
9040eca46af7Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
9041eca46af7Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
9042eca46af7Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
9043eca46af7Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
9044eca46af7Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
9045eca46af7Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
9046eca46af7Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
9047eca46af7Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
9048eca46af7Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
9049eca46af7Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
9050eca46af7Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
9051eca46af7Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
9052eca46af7Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
9053eca46af7Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
9054eca46af7Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
9055eca46af7Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
9056eca46af7Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
9057eca46af7Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
9058eca46af7Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
9059eca46af7Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
9060eca46af7Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
9061eca46af7Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
9062eca46af7Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
9063eca46af7Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
9064eca46af7Smrg
9065eca46af7Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
9066eca46af7Smrg# serial 1 (pkg-config-0.24)
9067eca46af7Smrg# 
9068eca46af7Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9069eca46af7Smrg#
9070eca46af7Smrg# This program is free software; you can redistribute it and/or modify
9071eca46af7Smrg# it under the terms of the GNU General Public License as published by
9072eca46af7Smrg# the Free Software Foundation; either version 2 of the License, or
9073eca46af7Smrg# (at your option) any later version.
9074eca46af7Smrg#
9075eca46af7Smrg# This program is distributed in the hope that it will be useful, but
9076eca46af7Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
9077eca46af7Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
9078eca46af7Smrg# General Public License for more details.
9079eca46af7Smrg#
9080eca46af7Smrg# You should have received a copy of the GNU General Public License
9081eca46af7Smrg# along with this program; if not, write to the Free Software
9082eca46af7Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
9083eca46af7Smrg#
9084eca46af7Smrg# As a special exception to the GNU General Public License, if you
9085eca46af7Smrg# distribute this file as part of a program that contains a
9086eca46af7Smrg# configuration script generated by Autoconf, you may include it under
9087eca46af7Smrg# the same distribution terms that you use for the rest of that program.
9088eca46af7Smrg
9089eca46af7Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
9090eca46af7Smrg# ----------------------------------
9091eca46af7SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9092eca46af7Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9093eca46af7Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9094eca46af7Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9095eca46af7SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9096eca46af7SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9097eca46af7SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9098eca46af7Smrg
9099eca46af7Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9100eca46af7Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9101eca46af7Smrgfi
9102eca46af7Smrgif test -n "$PKG_CONFIG"; then
9103eca46af7Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
9104eca46af7Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9105eca46af7Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9106eca46af7Smrg		AC_MSG_RESULT([yes])
9107eca46af7Smrg	else
9108eca46af7Smrg		AC_MSG_RESULT([no])
9109eca46af7Smrg		PKG_CONFIG=""
9110eca46af7Smrg	fi
9111eca46af7Smrgfi[]dnl
9112eca46af7Smrg])# PKG_PROG_PKG_CONFIG
9113eca46af7Smrg
9114eca46af7Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9115eca46af7Smrg#
9116eca46af7Smrg# Check to see whether a particular set of modules exists.  Similar
9117eca46af7Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
9118eca46af7Smrg#
9119eca46af7Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9120eca46af7Smrg# only at the first occurence in configure.ac, so if the first place
9121eca46af7Smrg# it's called might be skipped (such as if it is within an "if", you
9122eca46af7Smrg# have to call PKG_CHECK_EXISTS manually
9123eca46af7Smrg# --------------------------------------------------------------
9124eca46af7SmrgAC_DEFUN([PKG_CHECK_EXISTS],
9125eca46af7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9126eca46af7Smrgif test -n "$PKG_CONFIG" && \
9127eca46af7Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9128eca46af7Smrg  m4_default([$2], [:])
9129eca46af7Smrgm4_ifvaln([$3], [else
9130eca46af7Smrg  $3])dnl
9131eca46af7Smrgfi])
9132eca46af7Smrg
9133eca46af7Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9134eca46af7Smrg# ---------------------------------------------
9135eca46af7Smrgm4_define([_PKG_CONFIG],
9136eca46af7Smrg[if test -n "$$1"; then
9137eca46af7Smrg    pkg_cv_[]$1="$$1"
9138eca46af7Smrg elif test -n "$PKG_CONFIG"; then
9139eca46af7Smrg    PKG_CHECK_EXISTS([$3],
9140eca46af7Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9141eca46af7Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
9142eca46af7Smrg		     [pkg_failed=yes])
9143eca46af7Smrg else
9144eca46af7Smrg    pkg_failed=untried
9145eca46af7Smrgfi[]dnl
9146eca46af7Smrg])# _PKG_CONFIG
9147eca46af7Smrg
9148eca46af7Smrg# _PKG_SHORT_ERRORS_SUPPORTED
9149eca46af7Smrg# -----------------------------
9150eca46af7SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9151eca46af7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9152eca46af7Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9153eca46af7Smrg        _pkg_short_errors_supported=yes
9154eca46af7Smrgelse
9155eca46af7Smrg        _pkg_short_errors_supported=no
9156eca46af7Smrgfi[]dnl
9157eca46af7Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
9158eca46af7Smrg
9159eca46af7Smrg
9160eca46af7Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9161eca46af7Smrg# [ACTION-IF-NOT-FOUND])
9162eca46af7Smrg#
9163eca46af7Smrg#
9164eca46af7Smrg# Note that if there is a possibility the first call to
9165eca46af7Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
9166eca46af7Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9167eca46af7Smrg#
9168eca46af7Smrg#
9169eca46af7Smrg# --------------------------------------------------------------
9170eca46af7SmrgAC_DEFUN([PKG_CHECK_MODULES],
9171eca46af7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9172eca46af7SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9173eca46af7SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9174eca46af7Smrg
9175eca46af7Smrgpkg_failed=no
9176eca46af7SmrgAC_MSG_CHECKING([for $1])
9177eca46af7Smrg
9178eca46af7Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9179eca46af7Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9180eca46af7Smrg
9181eca46af7Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9182eca46af7Smrgand $1[]_LIBS to avoid the need to call pkg-config.
9183eca46af7SmrgSee the pkg-config man page for more details.])
9184eca46af7Smrg
9185eca46af7Smrgif test $pkg_failed = yes; then
9186eca46af7Smrg   	AC_MSG_RESULT([no])
9187eca46af7Smrg        _PKG_SHORT_ERRORS_SUPPORTED
9188eca46af7Smrg        if test $_pkg_short_errors_supported = yes; then
9189eca46af7Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9190eca46af7Smrg        else 
9191eca46af7Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9192eca46af7Smrg        fi
9193eca46af7Smrg	# Put the nasty error message in config.log where it belongs
9194eca46af7Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9195eca46af7Smrg
9196eca46af7Smrg	m4_default([$4], [AC_MSG_ERROR(
9197eca46af7Smrg[Package requirements ($2) were not met:
9198eca46af7Smrg
9199eca46af7Smrg$$1_PKG_ERRORS
9200eca46af7Smrg
9201eca46af7SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9202eca46af7Smrginstalled software in a non-standard prefix.
9203eca46af7Smrg
9204eca46af7Smrg_PKG_TEXT])[]dnl
9205eca46af7Smrg        ])
9206eca46af7Smrgelif test $pkg_failed = untried; then
9207eca46af7Smrg     	AC_MSG_RESULT([no])
9208eca46af7Smrg	m4_default([$4], [AC_MSG_FAILURE(
9209eca46af7Smrg[The pkg-config script could not be found or is too old.  Make sure it
9210eca46af7Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
9211eca46af7Smrgpath to pkg-config.
9212eca46af7Smrg
9213eca46af7Smrg_PKG_TEXT
9214eca46af7Smrg
9215eca46af7SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9216eca46af7Smrg        ])
9217eca46af7Smrgelse
9218eca46af7Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9219eca46af7Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9220eca46af7Smrg        AC_MSG_RESULT([yes])
9221eca46af7Smrg	$3
9222eca46af7Smrgfi[]dnl
9223eca46af7Smrg])# PKG_CHECK_MODULES
9224eca46af7Smrg
92252378475aSmrg
9226eca46af7Smrg# PKG_INSTALLDIR(DIRECTORY)
9227eca46af7Smrg# -------------------------
9228eca46af7Smrg# Substitutes the variable pkgconfigdir as the location where a module
9229eca46af7Smrg# should install pkg-config .pc files. By default the directory is
9230eca46af7Smrg# $libdir/pkgconfig, but the default can be changed by passing
9231eca46af7Smrg# DIRECTORY. The user can override through the --with-pkgconfigdir
9232eca46af7Smrg# parameter.
9233eca46af7SmrgAC_DEFUN([PKG_INSTALLDIR],
9234eca46af7Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9235eca46af7Smrgm4_pushdef([pkg_description],
9236eca46af7Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9237eca46af7SmrgAC_ARG_WITH([pkgconfigdir],
9238eca46af7Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9239eca46af7Smrg    [with_pkgconfigdir=]pkg_default)
9240eca46af7SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9241eca46af7Smrgm4_popdef([pkg_default])
9242eca46af7Smrgm4_popdef([pkg_description])
9243eca46af7Smrg]) dnl PKG_INSTALLDIR
9244eca46af7Smrg
9245eca46af7Smrg
9246eca46af7Smrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
9247eca46af7Smrg# -------------------------
9248eca46af7Smrg# Substitutes the variable noarch_pkgconfigdir as the location where a
9249eca46af7Smrg# module should install arch-independent pkg-config .pc files. By
9250eca46af7Smrg# default the directory is $datadir/pkgconfig, but the default can be
9251eca46af7Smrg# changed by passing DIRECTORY. The user can override through the
9252eca46af7Smrg# --with-noarch-pkgconfigdir parameter.
9253eca46af7SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9254eca46af7Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9255eca46af7Smrgm4_pushdef([pkg_description],
9256eca46af7Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9257eca46af7SmrgAC_ARG_WITH([noarch-pkgconfigdir],
9258eca46af7Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9259eca46af7Smrg    [with_noarch_pkgconfigdir=]pkg_default)
9260eca46af7SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9261eca46af7Smrgm4_popdef([pkg_default])
9262eca46af7Smrgm4_popdef([pkg_description])
9263eca46af7Smrg]) dnl PKG_NOARCH_INSTALLDIR
9264eca46af7Smrg
9265eca46af7Smrg
9266eca46af7Smrg# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9267eca46af7Smrg# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9268eca46af7Smrg# -------------------------------------------
9269eca46af7Smrg# Retrieves the value of the pkg-config variable for the given module.
9270eca46af7SmrgAC_DEFUN([PKG_CHECK_VAR],
9271eca46af7Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9272eca46af7SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
927395b296d0Smrg
9274eca46af7Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9275eca46af7SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
927614330f12Smrg
9277eca46af7SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9278eca46af7Smrg])# PKG_CHECK_VAR
927995b296d0Smrg
928014330f12Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
928114330f12Smrgdnl
928214330f12Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9283eca46af7Smrgdnl
928414330f12Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
928514330f12Smrgdnl copy of this software and associated documentation files (the "Software"),
928614330f12Smrgdnl to deal in the Software without restriction, including without limitation
928714330f12Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
928814330f12Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
928914330f12Smrgdnl Software is furnished to do so, subject to the following conditions:
929014330f12Smrgdnl
929114330f12Smrgdnl The above copyright notice and this permission notice (including the next
929214330f12Smrgdnl paragraph) shall be included in all copies or substantial portions of the
929314330f12Smrgdnl Software.
929414330f12Smrgdnl
929514330f12Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
929614330f12Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
929714330f12Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
929814330f12Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
929914330f12Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
930014330f12Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
930114330f12Smrgdnl DEALINGS IN THE SOFTWARE.
930214330f12Smrg
930314330f12Smrg# XORG_MACROS_VERSION(required-version)
930414330f12Smrg# -------------------------------------
930514330f12Smrg# Minimum version: 1.1.0
930639713583Smrg#
930714330f12Smrg# If you're using a macro added in Version 1.1 or newer, include this in
930814330f12Smrg# your configure.ac with the minimum required version, such as:
930914330f12Smrg# XORG_MACROS_VERSION(1.1)
931039713583Smrg#
931114330f12Smrg# To ensure that this macro is defined, also add:
931214330f12Smrg# m4_ifndef([XORG_MACROS_VERSION],
931314330f12Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
931439713583Smrg#
931514330f12Smrg#
9316eca46af7Smrg# See the "minimum version" comment for each macro you use to see what
9317eca46af7Smrg# version you require.
9318eca46af7Smrgm4_defun([XORG_MACROS_VERSION],[
931989b0dc75Smrgm4_define([vers_have], [1.19.0])
9320eca46af7Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
9321eca46af7Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
9322eca46af7Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
9323eca46af7Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
9324eca46af7Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
9325eca46af7Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
9326eca46af7Smrgm4_undefine([vers_have])
9327eca46af7Smrgm4_undefine([maj_have])
9328eca46af7Smrgm4_undefine([maj_needed])
9329eca46af7Smrg]) # XORG_MACROS_VERSION
9330eca46af7Smrg
9331eca46af7Smrg# XORG_PROG_RAWCPP()
9332eca46af7Smrg# ------------------
9333eca46af7Smrg# Minimum version: 1.0.0
9334eca46af7Smrg#
9335eca46af7Smrg# Find cpp program and necessary flags for use in pre-processing text files
9336eca46af7Smrg# such as man pages and config files
9337eca46af7SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
9338eca46af7SmrgAC_REQUIRE([AC_PROG_CPP])
9339eca46af7SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
9340eca46af7Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9341eca46af7Smrg
9342eca46af7Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
9343eca46af7Smrg# which is not the best choice for supporting other OS'es, but covers most
9344eca46af7Smrg# of the ones we need for now.
9345eca46af7SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
9346eca46af7SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
9347eca46af7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9348eca46af7Smrg	AC_MSG_RESULT([no])
9349eca46af7Smrgelse
9350eca46af7Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9351eca46af7Smrg		RAWCPPFLAGS=-undef
9352eca46af7Smrg		AC_MSG_RESULT([yes])
9353eca46af7Smrg	# under Cygwin unix is still defined even with -undef
9354eca46af7Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
9355eca46af7Smrg		RAWCPPFLAGS="-undef -ansi"
9356eca46af7Smrg		AC_MSG_RESULT([yes, with -ansi])
9357eca46af7Smrg	else
9358eca46af7Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
9359eca46af7Smrg	fi
9360eca46af7Smrgfi
9361eca46af7Smrgrm -f conftest.$ac_ext
9362eca46af7Smrg
9363eca46af7SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
9364eca46af7SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
9365eca46af7Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9366eca46af7Smrg	AC_MSG_RESULT([no])
9367eca46af7Smrgelse
9368eca46af7Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
936989b0dc75Smrg		TRADITIONALCPPFLAGS="-traditional"
9370eca46af7Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
9371eca46af7Smrg		AC_MSG_RESULT([yes])
9372eca46af7Smrg	else
9373eca46af7Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
9374eca46af7Smrg	fi
9375eca46af7Smrgfi
9376eca46af7Smrgrm -f conftest.$ac_ext
9377eca46af7SmrgAC_SUBST(RAWCPPFLAGS)
937889b0dc75SmrgAC_SUBST(TRADITIONALCPPFLAGS)
9379eca46af7Smrg]) # XORG_PROG_RAWCPP
9380eca46af7Smrg
9381eca46af7Smrg# XORG_MANPAGE_SECTIONS()
9382eca46af7Smrg# -----------------------
9383eca46af7Smrg# Minimum version: 1.0.0
9384eca46af7Smrg#
9385eca46af7Smrg# Determine which sections man pages go in for the different man page types
9386eca46af7Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
9387eca46af7Smrg# Not sure if there's any better way than just hardcoding by OS name.
9388eca46af7Smrg# Override default settings by setting environment variables
9389eca46af7Smrg# Added MAN_SUBSTS in version 1.8
9390eca46af7Smrg# Added AC_PROG_SED in version 1.8
9391eca46af7Smrg
9392eca46af7SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
9393eca46af7SmrgAC_REQUIRE([AC_CANONICAL_HOST])
9394eca46af7SmrgAC_REQUIRE([AC_PROG_SED])
9395eca46af7Smrg
9396eca46af7Smrgif test x$APP_MAN_SUFFIX = x    ; then
9397eca46af7Smrg    APP_MAN_SUFFIX=1
9398eca46af7Smrgfi
9399eca46af7Smrgif test x$APP_MAN_DIR = x    ; then
9400eca46af7Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9401eca46af7Smrgfi
9402eca46af7Smrg
9403eca46af7Smrgif test x$LIB_MAN_SUFFIX = x    ; then
9404eca46af7Smrg    LIB_MAN_SUFFIX=3
9405eca46af7Smrgfi
9406eca46af7Smrgif test x$LIB_MAN_DIR = x    ; then
9407eca46af7Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9408eca46af7Smrgfi
9409eca46af7Smrg
9410eca46af7Smrgif test x$FILE_MAN_SUFFIX = x    ; then
9411eca46af7Smrg    case $host_os in
9412eca46af7Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
9413eca46af7Smrg	*)		FILE_MAN_SUFFIX=5  ;;
9414eca46af7Smrg    esac
9415eca46af7Smrgfi
9416eca46af7Smrgif test x$FILE_MAN_DIR = x    ; then
9417eca46af7Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
9418eca46af7Smrgfi
9419eca46af7Smrg
9420eca46af7Smrgif test x$MISC_MAN_SUFFIX = x    ; then
9421eca46af7Smrg    case $host_os in
9422eca46af7Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
9423eca46af7Smrg	*)		MISC_MAN_SUFFIX=7  ;;
9424eca46af7Smrg    esac
9425eca46af7Smrgfi
9426eca46af7Smrgif test x$MISC_MAN_DIR = x    ; then
9427eca46af7Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
9428eca46af7Smrgfi
9429eca46af7Smrg
9430eca46af7Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
9431eca46af7Smrg    case $host_os in
9432eca46af7Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
9433eca46af7Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
9434eca46af7Smrg    esac
9435eca46af7Smrgfi
9436eca46af7Smrgif test x$DRIVER_MAN_DIR = x    ; then
9437eca46af7Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
9438eca46af7Smrgfi
9439eca46af7Smrg
9440eca46af7Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
9441eca46af7Smrg    case $host_os in
9442eca46af7Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
9443eca46af7Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
9444eca46af7Smrg    esac
9445eca46af7Smrgfi
9446eca46af7Smrgif test x$ADMIN_MAN_DIR = x    ; then
9447eca46af7Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
9448eca46af7Smrgfi
9449eca46af7Smrg
9450eca46af7Smrg
9451eca46af7SmrgAC_SUBST([APP_MAN_SUFFIX])
9452eca46af7SmrgAC_SUBST([LIB_MAN_SUFFIX])
9453eca46af7SmrgAC_SUBST([FILE_MAN_SUFFIX])
9454eca46af7SmrgAC_SUBST([MISC_MAN_SUFFIX])
9455eca46af7SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
9456eca46af7SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
9457eca46af7SmrgAC_SUBST([APP_MAN_DIR])
9458eca46af7SmrgAC_SUBST([LIB_MAN_DIR])
9459eca46af7SmrgAC_SUBST([FILE_MAN_DIR])
9460eca46af7SmrgAC_SUBST([MISC_MAN_DIR])
9461eca46af7SmrgAC_SUBST([DRIVER_MAN_DIR])
9462eca46af7SmrgAC_SUBST([ADMIN_MAN_DIR])
9463eca46af7Smrg
9464eca46af7SmrgXORG_MAN_PAGE="X Version 11"
9465eca46af7SmrgAC_SUBST([XORG_MAN_PAGE])
9466eca46af7SmrgMAN_SUBSTS="\
9467eca46af7Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9468eca46af7Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
9469eca46af7Smrg	-e 's|__xservername__|Xorg|g' \
9470eca46af7Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
9471eca46af7Smrg	-e 's|__projectroot__|\$(prefix)|g' \
9472eca46af7Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
9473eca46af7Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
9474eca46af7Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
9475eca46af7Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
9476eca46af7Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
9477eca46af7Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
9478eca46af7Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
9479eca46af7SmrgAC_SUBST([MAN_SUBSTS])
9480eca46af7Smrg
9481eca46af7Smrg]) # XORG_MANPAGE_SECTIONS
9482eca46af7Smrg
9483eca46af7Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
9484eca46af7Smrg# ------------------------
9485eca46af7Smrg# Minimum version: 1.7.0
9486eca46af7Smrg#
9487eca46af7Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
9488eca46af7Smrg# provided by xorg-sgml-doctools, if installed.
9489eca46af7SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
9490eca46af7SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
9491eca46af7SmrgXORG_SGML_PATH=
9492eca46af7SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
9493eca46af7Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
9494eca46af7Smrg    [m4_ifval([$1],[:],
9495eca46af7Smrg        [if test x"$cross_compiling" != x"yes" ; then
9496eca46af7Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
9497eca46af7Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
9498eca46af7Smrg         fi])
9499eca46af7Smrg    ])
950039713583Smrg
9501eca46af7Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
9502eca46af7Smrg# the path and the name of the doc stylesheet
9503eca46af7Smrgif test "x$XORG_SGML_PATH" != "x" ; then
9504eca46af7Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
9505eca46af7Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
9506eca46af7Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
9507eca46af7Smrgelse
9508eca46af7Smrg   AC_MSG_RESULT([no])
9509eca46af7Smrgfi
9510eca46af7Smrg
9511eca46af7SmrgAC_SUBST(XORG_SGML_PATH)
9512eca46af7SmrgAC_SUBST(STYLESHEET_SRCDIR)
9513eca46af7SmrgAC_SUBST(XSL_STYLESHEET)
9514eca46af7SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
9515eca46af7Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9516eca46af7Smrg
9517eca46af7Smrg# XORG_CHECK_LINUXDOC
9518eca46af7Smrg# -------------------
951914330f12Smrg# Minimum version: 1.0.0
952014330f12Smrg#
9521eca46af7Smrg# Defines the variable MAKE_TEXT if the necessary tools and
9522eca46af7Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
9523eca46af7Smrg# Whether or not the necessary tools and files are found can be checked
9524eca46af7Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
9525eca46af7SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
9526eca46af7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9527eca46af7SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
95282378475aSmrg
9529eca46af7SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9530eca46af7Smrg
9531eca46af7SmrgAC_MSG_CHECKING([whether to build documentation])
9532eca46af7Smrg
9533eca46af7Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
9534eca46af7Smrg   BUILDDOC=yes
953514330f12Smrgelse
9536eca46af7Smrg   BUILDDOC=no
953714330f12Smrgfi
95382378475aSmrg
9539eca46af7SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9540eca46af7Smrg
9541eca46af7SmrgAC_MSG_RESULT([$BUILDDOC])
9542eca46af7Smrg
9543eca46af7SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9544eca46af7Smrg
9545eca46af7Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
9546eca46af7Smrg   BUILDPDFDOC=yes
954714330f12Smrgelse
9548eca46af7Smrg   BUILDPDFDOC=no
954914330f12Smrgfi
95502378475aSmrg
9551eca46af7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9552eca46af7Smrg
9553eca46af7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9554eca46af7Smrg
9555eca46af7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
9556eca46af7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
9557eca46af7SmrgMAKE_PDF="$PS2PDF"
9558eca46af7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
9559eca46af7Smrg
9560eca46af7SmrgAC_SUBST(MAKE_TEXT)
9561eca46af7SmrgAC_SUBST(MAKE_PS)
9562eca46af7SmrgAC_SUBST(MAKE_PDF)
9563eca46af7SmrgAC_SUBST(MAKE_HTML)
9564eca46af7Smrg]) # XORG_CHECK_LINUXDOC
9565eca46af7Smrg
9566eca46af7Smrg# XORG_CHECK_DOCBOOK
9567eca46af7Smrg# -------------------
956814330f12Smrg# Minimum version: 1.0.0
956995b296d0Smrg#
9570eca46af7Smrg# Checks for the ability to build output formats from SGML DocBook source.
9571eca46af7Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
9572eca46af7Smrg# indicates whether the necessary tools and files are found and, if set,
9573eca46af7Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
9574eca46af7SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
9575eca46af7SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
957695b296d0Smrg
9577eca46af7SmrgBUILDTXTDOC=no
9578eca46af7SmrgBUILDPDFDOC=no
9579eca46af7SmrgBUILDPSDOC=no
9580eca46af7SmrgBUILDHTMLDOC=no
958195b296d0Smrg
9582eca46af7SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
9583eca46af7SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
9584eca46af7SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
9585eca46af7SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9586eca46af7Smrg
9587eca46af7SmrgAC_MSG_CHECKING([whether to build text documentation])
9588eca46af7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
9589eca46af7Smrg   test x$BUILD_TXTDOC != xno; then
9590eca46af7Smrg	BUILDTXTDOC=yes
959114330f12Smrgfi
9592eca46af7SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
9593eca46af7SmrgAC_MSG_RESULT([$BUILDTXTDOC])
959495b296d0Smrg
9595eca46af7SmrgAC_MSG_CHECKING([whether to build PDF documentation])
9596eca46af7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
9597eca46af7Smrg   test x$BUILD_PDFDOC != xno; then
9598eca46af7Smrg	BUILDPDFDOC=yes
959914330f12Smrgfi
9600eca46af7SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9601eca46af7SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9602eca46af7Smrg
9603eca46af7SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
9604eca46af7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
9605eca46af7Smrg   test x$BUILD_PSDOC != xno; then
9606eca46af7Smrg	BUILDPSDOC=yes
960714330f12Smrgfi
9608eca46af7SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
9609eca46af7SmrgAC_MSG_RESULT([$BUILDPSDOC])
961095b296d0Smrg
9611eca46af7SmrgAC_MSG_CHECKING([whether to build HTML documentation])
9612eca46af7Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
9613eca46af7Smrg   test x$BUILD_HTMLDOC != xno; then
9614eca46af7Smrg	BUILDHTMLDOC=yes
961514330f12Smrgfi
9616eca46af7SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
9617eca46af7SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9618eca46af7Smrg
9619eca46af7SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
9620eca46af7SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
9621eca46af7SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
9622eca46af7SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9623eca46af7Smrg
9624eca46af7SmrgAC_SUBST(MAKE_TEXT)
9625eca46af7SmrgAC_SUBST(MAKE_PS)
9626eca46af7SmrgAC_SUBST(MAKE_PDF)
9627eca46af7SmrgAC_SUBST(MAKE_HTML)
9628eca46af7Smrg]) # XORG_CHECK_DOCBOOK
9629eca46af7Smrg
9630eca46af7Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
9631eca46af7Smrg# ----------------
9632eca46af7Smrg# Minimum version: 1.5.0
9633eca46af7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9634eca46af7Smrg#
9635eca46af7Smrg# Documentation tools are not always available on all platforms and sometimes
9636eca46af7Smrg# not at the appropriate level. This macro enables a module to test for the
9637eca46af7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9638eca46af7Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
9639eca46af7Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
9640eca46af7Smrg# --with-xmlto assumes 'auto'.
9641eca46af7Smrg#
9642eca46af7Smrg# Interface to module:
9643eca46af7Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
9644eca46af7Smrg# XMLTO:	returns the path of the xmlto program found
9645eca46af7Smrg#		returns the path set by the user in the environment
9646eca46af7Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
9647eca46af7Smrg#		'no' user instructs the module not to use xmlto
9648eca46af7Smrg#
9649eca46af7Smrg# Added in version 1.10.0
9650eca46af7Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
9651eca46af7Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
9652eca46af7Smrg#
9653eca46af7Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
9654eca46af7Smrg#
9655eca46af7SmrgAC_DEFUN([XORG_WITH_XMLTO],[
9656eca46af7SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
9657eca46af7Smrgm4_define([_defopt], m4_default([$2], [auto]))
9658eca46af7SmrgAC_ARG_WITH(xmlto,
9659eca46af7Smrg	AS_HELP_STRING([--with-xmlto],
9660eca46af7Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
9661eca46af7Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
9662eca46af7Smrgm4_undefine([_defopt])
9663eca46af7Smrg
9664eca46af7Smrgif test "x$use_xmlto" = x"auto"; then
9665eca46af7Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9666eca46af7Smrg   if test "x$XMLTO" = "x"; then
9667eca46af7Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
9668eca46af7Smrg	have_xmlto=no
9669eca46af7Smrg   else
9670eca46af7Smrg        have_xmlto=yes
9671eca46af7Smrg   fi
9672eca46af7Smrgelif test "x$use_xmlto" = x"yes" ; then
9673eca46af7Smrg   AC_PATH_PROG([XMLTO], [xmlto])
9674eca46af7Smrg   if test "x$XMLTO" = "x"; then
9675eca46af7Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
9676eca46af7Smrg   fi
9677eca46af7Smrg   have_xmlto=yes
9678eca46af7Smrgelif test "x$use_xmlto" = x"no" ; then
9679eca46af7Smrg   if test "x$XMLTO" != "x"; then
9680eca46af7Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
9681eca46af7Smrg   fi
9682eca46af7Smrg   have_xmlto=no
9683eca46af7Smrgelse
9684eca46af7Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
968514330f12Smrgfi
968695b296d0Smrg
9687eca46af7Smrg# Test for a minimum version of xmlto, if provided.
9688eca46af7Smrgm4_ifval([$1],
9689eca46af7Smrg[if test "$have_xmlto" = yes; then
9690eca46af7Smrg    # scrape the xmlto version
9691eca46af7Smrg    AC_MSG_CHECKING([the xmlto version])
9692eca46af7Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
9693eca46af7Smrg    AC_MSG_RESULT([$xmlto_version])
9694eca46af7Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
9695eca46af7Smrg        [if test "x$use_xmlto" = xauto; then
9696eca46af7Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
9697eca46af7Smrg            have_xmlto=no
9698eca46af7Smrg        else
9699eca46af7Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
9700eca46af7Smrg        fi])
9701eca46af7Smrgfi])
970295b296d0Smrg
9703eca46af7Smrg# Test for the ability of xmlto to generate a text target
9704eca46af7Smrghave_xmlto_text=no
9705eca46af7Smrgcat > conftest.xml << "EOF"
9706eca46af7SmrgEOF
9707eca46af7SmrgAS_IF([test "$have_xmlto" = yes],
9708eca46af7Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
9709eca46af7Smrg             [have_xmlto_text=yes],
9710eca46af7Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
9711eca46af7Smrgrm -f conftest.xml
9712eca46af7SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
9713eca46af7SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
9714eca46af7Smrg]) # XORG_WITH_XMLTO
971595b296d0Smrg
9716eca46af7Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
9717eca46af7Smrg# --------------------------------------------
9718eca46af7Smrg# Minimum version: 1.12.0
9719eca46af7Smrg# Minimum version for optional DEFAULT argument: 1.12.0
9720eca46af7Smrg#
9721eca46af7Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
9722eca46af7Smrg# XML-based language used for the transformation of XML documents.
9723eca46af7Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
9724eca46af7Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
9725eca46af7Smrg# The XSLT processor is often used as a standalone tool for transformations.
9726eca46af7Smrg# It should not be assumed that this tool is used only to work with documnetation.
9727eca46af7Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
9728eca46af7Smrg#
9729eca46af7Smrg# Interface to module:
9730eca46af7Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
9731eca46af7Smrg# XSLTPROC:	 returns the path of the xsltproc program found
9732eca46af7Smrg#		 returns the path set by the user in the environment
9733eca46af7Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
9734eca46af7Smrg#		  'no' user instructs the module not to use xsltproc
9735eca46af7Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
9736eca46af7Smrg#
9737eca46af7Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
9738eca46af7Smrg#
9739eca46af7SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
9740eca46af7SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
9741eca46af7Smrg# Preserves the interface, should it be implemented later
9742eca46af7Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
9743eca46af7Smrgm4_define([_defopt], m4_default([$2], [auto]))
9744eca46af7SmrgAC_ARG_WITH(xsltproc,
9745eca46af7Smrg	AS_HELP_STRING([--with-xsltproc],
9746eca46af7Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
9747eca46af7Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
9748eca46af7Smrgm4_undefine([_defopt])
9749eca46af7Smrg
9750eca46af7Smrgif test "x$use_xsltproc" = x"auto"; then
9751eca46af7Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9752eca46af7Smrg   if test "x$XSLTPROC" = "x"; then
9753eca46af7Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
9754eca46af7Smrg	have_xsltproc=no
9755eca46af7Smrg   else
9756eca46af7Smrg        have_xsltproc=yes
9757eca46af7Smrg   fi
9758eca46af7Smrgelif test "x$use_xsltproc" = x"yes" ; then
9759eca46af7Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
9760eca46af7Smrg   if test "x$XSLTPROC" = "x"; then
9761eca46af7Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
9762eca46af7Smrg   fi
9763eca46af7Smrg   have_xsltproc=yes
9764eca46af7Smrgelif test "x$use_xsltproc" = x"no" ; then
9765eca46af7Smrg   if test "x$XSLTPROC" != "x"; then
9766eca46af7Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
9767eca46af7Smrg   fi
9768eca46af7Smrg   have_xsltproc=no
9769eca46af7Smrgelse
9770eca46af7Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
977195b296d0Smrgfi
977295b296d0Smrg
9773eca46af7SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
9774eca46af7Smrg]) # XORG_WITH_XSLTPROC
977595b296d0Smrg
9776eca46af7Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
9777eca46af7Smrg# ----------------------------------------
9778eca46af7Smrg# Minimum version: 1.15.0
9779eca46af7Smrg#
9780eca46af7Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
9781eca46af7Smrg# scanning arbitrary text files, extracting information from those text files,
9782eca46af7Smrg# and printing reports based on that information.
9783eca46af7Smrg#
9784eca46af7Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
9785eca46af7Smrg#
9786eca46af7Smrg# Interface to module:
9787eca46af7Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
9788eca46af7Smrg# PERL:	     returns the path of the perl program found
9789eca46af7Smrg#	     returns the path set by the user in the environment
9790eca46af7Smrg# --with-perl: 'yes' user instructs the module to use perl
9791eca46af7Smrg#	       'no' user instructs the module not to use perl
9792eca46af7Smrg# have_perl: returns yes if perl found in PATH or no
9793eca46af7Smrg#
9794eca46af7Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
9795eca46af7Smrg#
9796eca46af7SmrgAC_DEFUN([XORG_WITH_PERL],[
9797eca46af7SmrgAC_ARG_VAR([PERL], [Path to perl command])
9798eca46af7Smrg# Preserves the interface, should it be implemented later
9799eca46af7Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
9800eca46af7Smrgm4_define([_defopt], m4_default([$2], [auto]))
9801eca46af7SmrgAC_ARG_WITH(perl,
9802eca46af7Smrg	AS_HELP_STRING([--with-perl],
9803eca46af7Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
9804eca46af7Smrg	   [use_perl=$withval], [use_perl=]_defopt)
9805eca46af7Smrgm4_undefine([_defopt])
980695b296d0Smrg
9807eca46af7Smrgif test "x$use_perl" = x"auto"; then
9808eca46af7Smrg   AC_PATH_PROG([PERL], [perl])
9809eca46af7Smrg   if test "x$PERL" = "x"; then
9810eca46af7Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
9811eca46af7Smrg	have_perl=no
9812eca46af7Smrg   else
9813eca46af7Smrg        have_perl=yes
9814eca46af7Smrg   fi
9815eca46af7Smrgelif test "x$use_perl" = x"yes" ; then
9816eca46af7Smrg   AC_PATH_PROG([PERL], [perl])
9817eca46af7Smrg   if test "x$PERL" = "x"; then
9818eca46af7Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
9819eca46af7Smrg   fi
9820eca46af7Smrg   have_perl=yes
9821eca46af7Smrgelif test "x$use_perl" = x"no" ; then
9822eca46af7Smrg   if test "x$PERL" != "x"; then
9823eca46af7Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
9824eca46af7Smrg   fi
9825eca46af7Smrg   have_perl=no
9826eca46af7Smrgelse
9827eca46af7Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
9828eca46af7Smrgfi
982995b296d0Smrg
9830eca46af7SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
9831eca46af7Smrg]) # XORG_WITH_PERL
983295b296d0Smrg
9833eca46af7Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
9834eca46af7Smrg# ----------------
9835eca46af7Smrg# Minimum version: 1.5.0
9836eca46af7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
983795b296d0Smrg#
9838eca46af7Smrg# Documentation tools are not always available on all platforms and sometimes
9839eca46af7Smrg# not at the appropriate level. This macro enables a module to test for the
9840eca46af7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9841eca46af7Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
9842eca46af7Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
9843eca46af7Smrg# --with-asciidoc assumes 'auto'.
9844eca46af7Smrg#
9845eca46af7Smrg# Interface to module:
9846eca46af7Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
9847eca46af7Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
9848eca46af7Smrg#		 returns the path set by the user in the environment
9849eca46af7Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
9850eca46af7Smrg#		  'no' user instructs the module not to use asciidoc
9851eca46af7Smrg#
9852eca46af7Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
9853eca46af7Smrg#
9854eca46af7SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
9855eca46af7SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
9856eca46af7Smrgm4_define([_defopt], m4_default([$2], [auto]))
9857eca46af7SmrgAC_ARG_WITH(asciidoc,
9858eca46af7Smrg	AS_HELP_STRING([--with-asciidoc],
9859eca46af7Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
9860eca46af7Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
9861eca46af7Smrgm4_undefine([_defopt])
986295b296d0Smrg
9863eca46af7Smrgif test "x$use_asciidoc" = x"auto"; then
9864eca46af7Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9865eca46af7Smrg   if test "x$ASCIIDOC" = "x"; then
9866eca46af7Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
9867eca46af7Smrg	have_asciidoc=no
9868eca46af7Smrg   else
9869eca46af7Smrg        have_asciidoc=yes
9870eca46af7Smrg   fi
9871eca46af7Smrgelif test "x$use_asciidoc" = x"yes" ; then
9872eca46af7Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
9873eca46af7Smrg   if test "x$ASCIIDOC" = "x"; then
9874eca46af7Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
9875eca46af7Smrg   fi
9876eca46af7Smrg   have_asciidoc=yes
9877eca46af7Smrgelif test "x$use_asciidoc" = x"no" ; then
9878eca46af7Smrg   if test "x$ASCIIDOC" != "x"; then
9879eca46af7Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
9880eca46af7Smrg   fi
9881eca46af7Smrg   have_asciidoc=no
988214330f12Smrgelse
9883eca46af7Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
988414330f12Smrgfi
9885eca46af7Smrgm4_ifval([$1],
9886eca46af7Smrg[if test "$have_asciidoc" = yes; then
9887eca46af7Smrg    # scrape the asciidoc version
9888eca46af7Smrg    AC_MSG_CHECKING([the asciidoc version])
9889eca46af7Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
9890eca46af7Smrg    AC_MSG_RESULT([$asciidoc_version])
9891eca46af7Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
9892eca46af7Smrg        [if test "x$use_asciidoc" = xauto; then
9893eca46af7Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
9894eca46af7Smrg            have_asciidoc=no
9895eca46af7Smrg        else
9896eca46af7Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
9897eca46af7Smrg        fi])
9898eca46af7Smrgfi])
9899eca46af7SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
9900eca46af7Smrg]) # XORG_WITH_ASCIIDOC
9901e6f085baSmrg
9902eca46af7Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
9903eca46af7Smrg# -------------------------------------------
9904eca46af7Smrg# Minimum version: 1.5.0
9905eca46af7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
9906eca46af7Smrg# Minimum version for optional DOT checking: 1.18.0
990714330f12Smrg#
9908eca46af7Smrg# Documentation tools are not always available on all platforms and sometimes
9909eca46af7Smrg# not at the appropriate level. This macro enables a module to test for the
9910eca46af7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9911eca46af7Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
9912eca46af7Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
9913eca46af7Smrg# --with-doxygen assumes 'auto'.
9914eca46af7Smrg#
9915eca46af7Smrg# Interface to module:
9916eca46af7Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
9917eca46af7Smrg# DOXYGEN:	 returns the path of the doxygen program found
9918eca46af7Smrg#		 returns the path set by the user in the environment
9919eca46af7Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
9920eca46af7Smrg#		  'no' user instructs the module not to use doxygen
9921eca46af7Smrg#
9922eca46af7Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
9923eca46af7Smrg#
9924eca46af7SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
9925eca46af7SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
9926eca46af7SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
9927eca46af7Smrgm4_define([_defopt], m4_default([$2], [auto]))
9928eca46af7SmrgAC_ARG_WITH(doxygen,
9929eca46af7Smrg	AS_HELP_STRING([--with-doxygen],
9930eca46af7Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
9931eca46af7Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
9932eca46af7Smrgm4_undefine([_defopt])
993314330f12Smrg
9934eca46af7Smrgif test "x$use_doxygen" = x"auto"; then
9935eca46af7Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9936eca46af7Smrg   if test "x$DOXYGEN" = "x"; then
9937eca46af7Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
9938eca46af7Smrg	have_doxygen=no
9939eca46af7Smrg   else
9940eca46af7Smrg        have_doxygen=yes
9941eca46af7Smrg   fi
9942eca46af7Smrgelif test "x$use_doxygen" = x"yes" ; then
9943eca46af7Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
9944eca46af7Smrg   if test "x$DOXYGEN" = "x"; then
9945eca46af7Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
9946eca46af7Smrg   fi
9947eca46af7Smrg   have_doxygen=yes
9948eca46af7Smrgelif test "x$use_doxygen" = x"no" ; then
9949eca46af7Smrg   if test "x$DOXYGEN" != "x"; then
9950eca46af7Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
9951eca46af7Smrg   fi
9952eca46af7Smrg   have_doxygen=no
995395b296d0Smrgelse
9954eca46af7Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
995595b296d0Smrgfi
9956eca46af7Smrgm4_ifval([$1],
9957eca46af7Smrg[if test "$have_doxygen" = yes; then
9958eca46af7Smrg    # scrape the doxygen version
9959eca46af7Smrg    AC_MSG_CHECKING([the doxygen version])
9960eca46af7Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
9961eca46af7Smrg    AC_MSG_RESULT([$doxygen_version])
9962eca46af7Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
9963eca46af7Smrg        [if test "x$use_doxygen" = xauto; then
9964eca46af7Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
9965eca46af7Smrg            have_doxygen=no
9966eca46af7Smrg        else
9967eca46af7Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
9968eca46af7Smrg        fi])
9969eca46af7Smrgfi])
997095b296d0Smrg
9971eca46af7Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
9972eca46af7Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
9973eca46af7Smrgdnl 	HAVE_DOT = @HAVE_DOT@
9974eca46af7SmrgHAVE_DOT=no
9975eca46af7Smrgif test "x$have_doxygen" = "xyes"; then
9976eca46af7Smrg  AC_PATH_PROG([DOT], [dot])
9977eca46af7Smrg    if test "x$DOT" != "x"; then
9978eca46af7Smrg      HAVE_DOT=yes
9979eca46af7Smrg    fi
998095b296d0Smrgfi
998195b296d0Smrg
9982eca46af7SmrgAC_SUBST([HAVE_DOT])
9983eca46af7SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
9984eca46af7SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
9985eca46af7Smrg]) # XORG_WITH_DOXYGEN
998614330f12Smrg
9987eca46af7Smrg# XORG_WITH_GROFF([DEFAULT])
9988eca46af7Smrg# ----------------
9989eca46af7Smrg# Minimum version: 1.6.0
9990eca46af7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
999195b296d0Smrg#
9992eca46af7Smrg# Documentation tools are not always available on all platforms and sometimes
9993eca46af7Smrg# not at the appropriate level. This macro enables a module to test for the
9994eca46af7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
9995eca46af7Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
9996eca46af7Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
9997eca46af7Smrg# --with-groff assumes 'auto'.
9998eca46af7Smrg#
9999eca46af7Smrg# Interface to module:
10000eca46af7Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
10001eca46af7Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
10002eca46af7Smrg# HAVE_GROFF_MS: the -ms macros package
10003eca46af7Smrg# GROFF:	 returns the path of the groff program found
10004eca46af7Smrg#		 returns the path set by the user in the environment
10005eca46af7Smrg# --with-groff:	 'yes' user instructs the module to use groff
10006eca46af7Smrg#		 'no' user instructs the module not to use groff
10007eca46af7Smrg#
10008eca46af7Smrg# Added in version 1.9.0:
10009eca46af7Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
10010eca46af7Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
10011eca46af7Smrg#		   psselect from the psutils package.
10012eca46af7Smrg#		   the ghostcript package. Refer to the grohtml man pages
10013eca46af7Smrg#
10014eca46af7Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10015eca46af7Smrg#
10016eca46af7Smrg# OS and distros often splits groff in a basic and full package, the former
10017eca46af7Smrg# having the groff program and the later having devices, fonts and macros
10018eca46af7Smrg# Checking for the groff executable is not enough.
10019eca46af7Smrg#
10020eca46af7Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
10021eca46af7Smrg# unset HAVE_GROFF or GROFF env variables.
10022eca46af7Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10023eca46af7Smrg#
10024eca46af7SmrgAC_DEFUN([XORG_WITH_GROFF],[
10025eca46af7SmrgAC_ARG_VAR([GROFF], [Path to groff command])
10026eca46af7Smrgm4_define([_defopt], m4_default([$1], [auto]))
10027eca46af7SmrgAC_ARG_WITH(groff,
10028eca46af7Smrg	AS_HELP_STRING([--with-groff],
10029eca46af7Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
10030eca46af7Smrg	   [use_groff=$withval], [use_groff=]_defopt)
10031eca46af7Smrgm4_undefine([_defopt])
1003295b296d0Smrg
10033eca46af7Smrgif test "x$use_groff" = x"auto"; then
10034eca46af7Smrg   AC_PATH_PROG([GROFF], [groff])
10035eca46af7Smrg   if test "x$GROFF" = "x"; then
10036eca46af7Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
10037eca46af7Smrg	have_groff=no
10038eca46af7Smrg   else
10039eca46af7Smrg        have_groff=yes
10040eca46af7Smrg   fi
10041eca46af7Smrgelif test "x$use_groff" = x"yes" ; then
10042eca46af7Smrg   AC_PATH_PROG([GROFF], [groff])
10043eca46af7Smrg   if test "x$GROFF" = "x"; then
10044eca46af7Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
10045eca46af7Smrg   fi
10046eca46af7Smrg   have_groff=yes
10047eca46af7Smrgelif test "x$use_groff" = x"no" ; then
10048eca46af7Smrg   if test "x$GROFF" != "x"; then
10049eca46af7Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
10050eca46af7Smrg   fi
10051eca46af7Smrg   have_groff=no
10052eca46af7Smrgelse
10053eca46af7Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
10054eca46af7Smrgfi
1005514330f12Smrg
10056eca46af7Smrg# We have groff, test for the presence of the macro packages
10057eca46af7Smrgif test "x$have_groff" = x"yes"; then
10058eca46af7Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
10059eca46af7Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
10060eca46af7Smrg        groff_ms_works=yes
10061eca46af7Smrg    else
10062eca46af7Smrg        groff_ms_works=no
10063eca46af7Smrg    fi
10064eca46af7Smrg    AC_MSG_RESULT([$groff_ms_works])
10065eca46af7Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
10066eca46af7Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
10067eca46af7Smrg        groff_mm_works=yes
10068eca46af7Smrg    else
10069eca46af7Smrg        groff_mm_works=no
10070eca46af7Smrg    fi
10071eca46af7Smrg    AC_MSG_RESULT([$groff_mm_works])
1007214330f12Smrgfi
1007314330f12Smrg
10074eca46af7Smrg# We have groff, test for HTML dependencies, one command per package
10075eca46af7Smrgif test "x$have_groff" = x"yes"; then
10076eca46af7Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
10077eca46af7Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
10078eca46af7Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
10079eca46af7Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
10080eca46af7Smrg      have_groff_html=yes
10081eca46af7Smrg   else
10082eca46af7Smrg      have_groff_html=no
10083eca46af7Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
10084eca46af7Smrg   fi
1008514330f12Smrgfi
1008614330f12Smrg
10087eca46af7Smrg# Set Automake conditionals for Makefiles
10088eca46af7SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
10089eca46af7SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
10090eca46af7SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
10091eca46af7SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
10092eca46af7Smrg]) # XORG_WITH_GROFF
1009314330f12Smrg
10094eca46af7Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
10095eca46af7Smrg# ---------------------------------------
10096eca46af7Smrg# Minimum version: 1.6.0
10097eca46af7Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10098eca46af7Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
10099eca46af7Smrg#
10100eca46af7Smrg# Documentation tools are not always available on all platforms and sometimes
10101eca46af7Smrg# not at the appropriate level. This macro enables a module to test for the
10102eca46af7Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10103eca46af7Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
10104eca46af7Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
10105eca46af7Smrg# --with-fop assumes 'auto'.
10106eca46af7Smrg#
10107eca46af7Smrg# Interface to module:
10108eca46af7Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
10109eca46af7Smrg# FOP:	 	returns the path of the fop program found
10110eca46af7Smrg#		returns the path set by the user in the environment
10111eca46af7Smrg# --with-fop: 	'yes' user instructs the module to use fop
10112eca46af7Smrg#		'no' user instructs the module not to use fop
10113eca46af7Smrg#
10114eca46af7Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
10115eca46af7Smrg#
10116eca46af7SmrgAC_DEFUN([XORG_WITH_FOP],[
10117eca46af7SmrgAC_ARG_VAR([FOP], [Path to fop command])
10118eca46af7Smrgm4_define([_defopt], m4_default([$2], [auto]))
10119eca46af7SmrgAC_ARG_WITH(fop,
10120eca46af7Smrg	AS_HELP_STRING([--with-fop],
10121eca46af7Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
10122eca46af7Smrg	   [use_fop=$withval], [use_fop=]_defopt)
10123eca46af7Smrgm4_undefine([_defopt])
1012414330f12Smrg
10125eca46af7Smrgif test "x$use_fop" = x"auto"; then
10126eca46af7Smrg   AC_PATH_PROG([FOP], [fop])
10127eca46af7Smrg   if test "x$FOP" = "x"; then
10128eca46af7Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
10129eca46af7Smrg	have_fop=no
10130eca46af7Smrg   else
10131eca46af7Smrg        have_fop=yes
10132eca46af7Smrg   fi
10133eca46af7Smrgelif test "x$use_fop" = x"yes" ; then
10134eca46af7Smrg   AC_PATH_PROG([FOP], [fop])
10135eca46af7Smrg   if test "x$FOP" = "x"; then
10136eca46af7Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
10137eca46af7Smrg   fi
10138eca46af7Smrg   have_fop=yes
10139eca46af7Smrgelif test "x$use_fop" = x"no" ; then
10140eca46af7Smrg   if test "x$FOP" != "x"; then
10141eca46af7Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
10142eca46af7Smrg   fi
10143eca46af7Smrg   have_fop=no
10144eca46af7Smrgelse
10145eca46af7Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
10146eca46af7Smrgfi
1014714330f12Smrg
10148eca46af7Smrg# Test for a minimum version of fop, if provided.
10149eca46af7Smrgm4_ifval([$1],
10150eca46af7Smrg[if test "$have_fop" = yes; then
10151eca46af7Smrg    # scrape the fop version
10152eca46af7Smrg    AC_MSG_CHECKING([for fop minimum version])
10153eca46af7Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
10154eca46af7Smrg    AC_MSG_RESULT([$fop_version])
10155eca46af7Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
10156eca46af7Smrg        [if test "x$use_fop" = xauto; then
10157eca46af7Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
10158eca46af7Smrg            have_fop=no
10159eca46af7Smrg        else
10160eca46af7Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
10161eca46af7Smrg        fi])
10162eca46af7Smrgfi])
10163eca46af7SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
10164eca46af7Smrg]) # XORG_WITH_FOP
1016514330f12Smrg
1016689b0dc75Smrg# XORG_WITH_M4([MIN-VERSION])
1016789b0dc75Smrg# ---------------------------
1016889b0dc75Smrg# Minimum version: 1.19.0
1016989b0dc75Smrg#
1017089b0dc75Smrg# This macro attempts to locate an m4 macro processor which supports
1017189b0dc75Smrg# -I option and is only useful for modules relying on M4 in order to
1017289b0dc75Smrg# expand macros in source code files.
1017389b0dc75Smrg#
1017489b0dc75Smrg# Interface to module:
1017589b0dc75Smrg# M4:	 	returns the path of the m4 program found
1017689b0dc75Smrg#		returns the path set by the user in the environment
1017789b0dc75Smrg#
1017889b0dc75SmrgAC_DEFUN([XORG_WITH_M4], [
1017989b0dc75SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
1018089b0dc75Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
1018189b0dc75Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
1018289b0dc75Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
1018389b0dc75Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
1018489b0dc75Smrg   [$PATH:/usr/gnu/bin])])
1018589b0dc75Smrg
1018689b0dc75SmrgAC_SUBST([M4], [$ac_cv_path_M4])
1018789b0dc75Smrg]) # XORG_WITH_M4
1018889b0dc75Smrg
10189eca46af7Smrg# XORG_WITH_PS2PDF([DEFAULT])
1019014330f12Smrg# ----------------
10191eca46af7Smrg# Minimum version: 1.6.0
1019214330f12Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1019314330f12Smrg#
1019414330f12Smrg# Documentation tools are not always available on all platforms and sometimes
1019514330f12Smrg# not at the appropriate level. This macro enables a module to test for the
1019614330f12Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
10197eca46af7Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
10198eca46af7Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
10199eca46af7Smrg# --with-ps2pdf assumes 'auto'.
1020014330f12Smrg#
1020114330f12Smrg# Interface to module:
10202eca46af7Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
10203eca46af7Smrg# PS2PDF:	returns the path of the ps2pdf program found
1020414330f12Smrg#		returns the path set by the user in the environment
10205eca46af7Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
10206eca46af7Smrg#		 'no' user instructs the module not to use ps2pdf
10207eca46af7Smrg#
10208eca46af7Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
10209eca46af7Smrg#
10210eca46af7SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
10211eca46af7SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
10212eca46af7Smrgm4_define([_defopt], m4_default([$1], [auto]))
10213eca46af7SmrgAC_ARG_WITH(ps2pdf,
10214eca46af7Smrg	AS_HELP_STRING([--with-ps2pdf],
10215eca46af7Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
10216eca46af7Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
10217eca46af7Smrgm4_undefine([_defopt])
10218eca46af7Smrg
10219eca46af7Smrgif test "x$use_ps2pdf" = x"auto"; then
10220eca46af7Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10221eca46af7Smrg   if test "x$PS2PDF" = "x"; then
10222eca46af7Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
10223eca46af7Smrg	have_ps2pdf=no
10224eca46af7Smrg   else
10225eca46af7Smrg        have_ps2pdf=yes
10226eca46af7Smrg   fi
10227eca46af7Smrgelif test "x$use_ps2pdf" = x"yes" ; then
10228eca46af7Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
10229eca46af7Smrg   if test "x$PS2PDF" = "x"; then
10230eca46af7Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
10231eca46af7Smrg   fi
10232eca46af7Smrg   have_ps2pdf=yes
10233eca46af7Smrgelif test "x$use_ps2pdf" = x"no" ; then
10234eca46af7Smrg   if test "x$PS2PDF" != "x"; then
10235eca46af7Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
10236eca46af7Smrg   fi
10237eca46af7Smrg   have_ps2pdf=no
10238eca46af7Smrgelse
10239eca46af7Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10240eca46af7Smrgfi
10241eca46af7SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
10242eca46af7Smrg]) # XORG_WITH_PS2PDF
10243eca46af7Smrg
10244eca46af7Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
10245eca46af7Smrg# ----------------
10246eca46af7Smrg# Minimum version: 1.6.0
10247eca46af7Smrg#
10248eca46af7Smrg# Documentation tools are not always available on all platforms and sometimes
10249eca46af7Smrg# not at the appropriate level. This macro enables a builder to skip all
10250eca46af7Smrg# documentation targets except traditional man pages.
10251eca46af7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10252eca46af7Smrg# maximum flexibilty in controlling documentation building.
10253eca46af7Smrg# Refer to:
10254eca46af7Smrg# XORG_WITH_XMLTO         --with-xmlto
10255eca46af7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10256eca46af7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10257eca46af7Smrg# XORG_WITH_FOP           --with-fop
10258eca46af7Smrg# XORG_WITH_GROFF         --with-groff
10259eca46af7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10260eca46af7Smrg#
10261eca46af7Smrg# Interface to module:
10262eca46af7Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
10263eca46af7Smrg# --enable-docs: 'yes' user instructs the module to generate docs
10264eca46af7Smrg#		 'no' user instructs the module not to generate docs
10265eca46af7Smrg# parm1:	specify the default value, yes or no.
10266eca46af7Smrg#
10267eca46af7SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
10268eca46af7Smrgm4_define([docs_default], m4_default([$1], [yes]))
10269eca46af7SmrgAC_ARG_ENABLE(docs,
10270eca46af7Smrg	AS_HELP_STRING([--enable-docs],
10271eca46af7Smrg	   [Enable building the documentation (default: ]docs_default[)]),
10272eca46af7Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
10273eca46af7Smrgm4_undefine([docs_default])
10274eca46af7SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
10275eca46af7SmrgAC_MSG_CHECKING([whether to build documentation])
10276eca46af7SmrgAC_MSG_RESULT([$build_docs])
10277eca46af7Smrg]) # XORG_ENABLE_DOCS
10278eca46af7Smrg
10279eca46af7Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
10280eca46af7Smrg# ----------------
10281eca46af7Smrg# Minimum version: 1.6.0
10282eca46af7Smrg#
10283eca46af7Smrg# This macro enables a builder to skip all developer documentation.
10284eca46af7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10285eca46af7Smrg# maximum flexibilty in controlling documentation building.
10286eca46af7Smrg# Refer to:
10287eca46af7Smrg# XORG_WITH_XMLTO         --with-xmlto
10288eca46af7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10289eca46af7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10290eca46af7Smrg# XORG_WITH_FOP           --with-fop
10291eca46af7Smrg# XORG_WITH_GROFF         --with-groff
10292eca46af7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10293eca46af7Smrg#
10294eca46af7Smrg# Interface to module:
10295eca46af7Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
10296eca46af7Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
10297eca46af7Smrg#			'no' user instructs the module not to generate developer docs
10298eca46af7Smrg# parm1:		specify the default value, yes or no.
10299eca46af7Smrg#
10300eca46af7SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
10301eca46af7Smrgm4_define([devel_default], m4_default([$1], [yes]))
10302eca46af7SmrgAC_ARG_ENABLE(devel-docs,
10303eca46af7Smrg	AS_HELP_STRING([--enable-devel-docs],
10304eca46af7Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
10305eca46af7Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
10306eca46af7Smrgm4_undefine([devel_default])
10307eca46af7SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
10308eca46af7SmrgAC_MSG_CHECKING([whether to build developer documentation])
10309eca46af7SmrgAC_MSG_RESULT([$build_devel_docs])
10310eca46af7Smrg]) # XORG_ENABLE_DEVEL_DOCS
10311eca46af7Smrg
10312eca46af7Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
10313eca46af7Smrg# ----------------
10314eca46af7Smrg# Minimum version: 1.6.0
10315eca46af7Smrg#
10316eca46af7Smrg# This macro enables a builder to skip all functional specification targets.
10317eca46af7Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
10318eca46af7Smrg# maximum flexibilty in controlling documentation building.
10319eca46af7Smrg# Refer to:
10320eca46af7Smrg# XORG_WITH_XMLTO         --with-xmlto
10321eca46af7Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
10322eca46af7Smrg# XORG_WITH_DOXYGEN       --with-doxygen
10323eca46af7Smrg# XORG_WITH_FOP           --with-fop
10324eca46af7Smrg# XORG_WITH_GROFF         --with-groff
10325eca46af7Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
10326eca46af7Smrg#
10327eca46af7Smrg# Interface to module:
10328eca46af7Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
10329eca46af7Smrg# --enable-specs:	'yes' user instructs the module to generate specs
10330eca46af7Smrg#			'no' user instructs the module not to generate specs
10331eca46af7Smrg# parm1:		specify the default value, yes or no.
10332eca46af7Smrg#
10333eca46af7SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
10334eca46af7Smrgm4_define([spec_default], m4_default([$1], [yes]))
10335eca46af7SmrgAC_ARG_ENABLE(specs,
10336eca46af7Smrg	AS_HELP_STRING([--enable-specs],
10337eca46af7Smrg	   [Enable building the specs (default: ]spec_default[)]),
10338eca46af7Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
10339eca46af7Smrgm4_undefine([spec_default])
10340eca46af7SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
10341eca46af7SmrgAC_MSG_CHECKING([whether to build functional specifications])
10342eca46af7SmrgAC_MSG_RESULT([$build_specs])
10343eca46af7Smrg]) # XORG_ENABLE_SPECS
10344eca46af7Smrg
10345eca46af7Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
10346eca46af7Smrg# ----------------------------------------------
10347eca46af7Smrg# Minimum version: 1.13.0
1034814330f12Smrg#
10349eca46af7Smrg# This macro enables a builder to enable/disable unit testing
10350eca46af7Smrg# It makes no assumption about the test cases implementation
10351eca46af7Smrg# Test cases may or may not use Automake "Support for test suites"
10352eca46af7Smrg# They may or may not use the software utility library GLib
1035314330f12Smrg#
10354eca46af7Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
10355eca46af7Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
10356eca46af7Smrg# The variable enable_unit_tests is used by other macros in this file.
1035714330f12Smrg#
10358eca46af7Smrg# Interface to module:
10359eca46af7Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
10360eca46af7Smrg# enable_unit_tests:    used in configure.ac for additional configuration
10361eca46af7Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
10362eca46af7Smrg#			'no' user instructs the module not to build tests
10363eca46af7Smrg# parm1:		specify the default value, yes or no.
10364eca46af7Smrg#
10365eca46af7SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
10366eca46af7SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
10367eca46af7SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
10368eca46af7SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10369eca46af7Smrgm4_define([_defopt], m4_default([$1], [auto]))
10370eca46af7SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
10371eca46af7Smrg	[Enable building unit test cases (default: ]_defopt[)]),
10372eca46af7Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1037314330f12Smrgm4_undefine([_defopt])
10374eca46af7SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
10375eca46af7SmrgAC_MSG_CHECKING([whether to build unit test cases])
10376eca46af7SmrgAC_MSG_RESULT([$enable_unit_tests])
10377eca46af7Smrg]) # XORG_ENABLE_UNIT_TESTS
1037814330f12Smrg
10379eca46af7Smrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10380eca46af7Smrg# ------------------------------------------------------
10381eca46af7Smrg# Minimum version: 1.17.0
1038214330f12Smrg#
10383eca46af7Smrg# This macro enables a builder to enable/disable integration testing
10384eca46af7Smrg# It makes no assumption about the test cases' implementation
10385eca46af7Smrg# Test cases may or may not use Automake "Support for test suites"
1038614330f12Smrg#
10387eca46af7Smrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10388eca46af7Smrg# usually requires less dependencies and may be built and run under less
10389eca46af7Smrg# stringent environments than integration tests.
1039014330f12Smrg#
10391eca46af7Smrg# Interface to module:
10392eca46af7Smrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10393eca46af7Smrg# enable_integration_tests:   used in configure.ac for additional configuration
10394eca46af7Smrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10395eca46af7Smrg#                             'no' user instructs the module not to build tests
10396eca46af7Smrg# parm1:                      specify the default value, yes or no.
1039714330f12Smrg#
10398eca46af7SmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10399eca46af7SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10400eca46af7Smrgm4_define([_defopt], m4_default([$1], [auto]))
10401eca46af7SmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10402eca46af7Smrg	[Enable building integration test cases (default: ]_defopt[)]),
10403eca46af7Smrg	[enable_integration_tests=$enableval],
10404eca46af7Smrg	[enable_integration_tests=]_defopt)
1040514330f12Smrgm4_undefine([_defopt])
10406eca46af7SmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10407eca46af7Smrg	[test "x$enable_integration_tests" != xno])
10408eca46af7SmrgAC_MSG_CHECKING([whether to build unit test cases])
10409eca46af7SmrgAC_MSG_RESULT([$enable_integration_tests])
10410eca46af7Smrg]) # XORG_ENABLE_INTEGRATION_TESTS
1041114330f12Smrg
10412eca46af7Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1041314330f12Smrg# ----------------------------------------
10414eca46af7Smrg# Minimum version: 1.13.0
1041595b296d0Smrg#
10416eca46af7Smrg# GLib is a library which provides advanced data structures and functions.
10417eca46af7Smrg# This macro enables a module to test for the presence of Glib.
1041814330f12Smrg#
10419eca46af7Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
10420eca46af7Smrg# Otherwise the value of $enable_unit_tests is blank.
1042114330f12Smrg#
10422eca46af7Smrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10423eca46af7Smrg# test support usually requires less dependencies and may be built and run under
10424eca46af7Smrg# less stringent environments than integration tests.
1042514330f12Smrg#
10426eca46af7Smrg# Interface to module:
10427eca46af7Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
10428eca46af7Smrg# with_glib: used in configure.ac to know if GLib has been found
10429eca46af7Smrg# --with-glib:	'yes' user instructs the module to use glib
10430eca46af7Smrg#		'no' user instructs the module not to use glib
1043114330f12Smrg#
10432eca46af7SmrgAC_DEFUN([XORG_WITH_GLIB],[
10433eca46af7SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1043414330f12Smrgm4_define([_defopt], m4_default([$2], [auto]))
10435eca46af7SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
10436eca46af7Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
10437eca46af7Smrg	[with_glib=$withval], [with_glib=]_defopt)
1043814330f12Smrgm4_undefine([_defopt])
1043914330f12Smrg
10440eca46af7Smrghave_glib=no
10441eca46af7Smrg# Do not probe GLib if user explicitly disabled unit testing
10442eca46af7Smrgif test "x$enable_unit_tests" != x"no"; then
10443eca46af7Smrg  # Do not probe GLib if user explicitly disabled it
10444eca46af7Smrg  if test "x$with_glib" != x"no"; then
10445eca46af7Smrg    m4_ifval(
10446eca46af7Smrg      [$1],
10447eca46af7Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
10448eca46af7Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
10449eca46af7Smrg    )
10450eca46af7Smrg  fi
10451eca46af7Smrgfi
10452eca46af7Smrg
10453eca46af7Smrg# Not having GLib when unit testing has been explicitly requested is an error
10454eca46af7Smrgif test "x$enable_unit_tests" = x"yes"; then
10455eca46af7Smrg  if test "x$have_glib" = x"no"; then
10456eca46af7Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10457eca46af7Smrg  fi
10458eca46af7Smrgfi
10459eca46af7Smrg
10460eca46af7Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
10461eca46af7Smrgif test "x$enable_unit_tests" = x"no"; then
10462eca46af7Smrg  if test "x$with_glib" = x"yes"; then
10463eca46af7Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
10464eca46af7Smrg  fi
1046514330f12Smrgfi
1046695b296d0Smrg
10467eca46af7Smrg# Not having GLib when it has been explicitly requested is an error
10468eca46af7Smrgif test "x$with_glib" = x"yes"; then
10469eca46af7Smrg  if test "x$have_glib" = x"no"; then
10470eca46af7Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
10471eca46af7Smrg  fi
10472eca46af7Smrgfi
1047314330f12Smrg
10474eca46af7SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
10475eca46af7Smrg]) # XORG_WITH_GLIB
10476eca46af7Smrg
10477eca46af7Smrg# XORG_LD_WRAP([required|optional])
10478eca46af7Smrg# ---------------------------------
10479eca46af7Smrg# Minimum version: 1.13.0
1048095b296d0Smrg#
10481eca46af7Smrg# Check if linker supports -wrap, passed via compiler flags
1048214330f12Smrg#
10483eca46af7Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
10484eca46af7Smrg# Otherwise the value of $enable_unit_tests is blank.
1048514330f12Smrg#
10486eca46af7Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
10487eca46af7Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
10488eca46af7Smrg# available, an argument of "optional" allows use when some unit tests require
10489eca46af7Smrg# ld -wrap and others do not.
1049014330f12Smrg#
10491eca46af7SmrgAC_DEFUN([XORG_LD_WRAP],[
10492eca46af7SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
10493eca46af7Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
10494eca46af7Smrg                      void __wrap_exit(int status) { return; }],
10495eca46af7Smrg                     [exit(0);])])
10496eca46af7Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
10497eca46af7Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
10498eca46af7Smrg  if test "x$have_ld_wrap" = x"no"; then
10499eca46af7Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
10500eca46af7Smrg  fi
1050114330f12Smrgfi
10502eca46af7SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
10503eca46af7Smrg#
10504eca46af7Smrg]) # XORG_LD_WRAP
1050595b296d0Smrg
10506eca46af7Smrg# XORG_CHECK_LINKER_FLAGS
10507eca46af7Smrg# -----------------------
10508eca46af7Smrg# SYNOPSIS
1050914330f12Smrg#
10510eca46af7Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1051114330f12Smrg#
10512eca46af7Smrg# DESCRIPTION
1051314330f12Smrg#
10514eca46af7Smrg#   Check whether the given linker FLAGS work with the current language's
10515eca46af7Smrg#   linker, or whether they give an error.
1051614330f12Smrg#
10517eca46af7Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
10518eca46af7Smrg#   success/failure.
1051995b296d0Smrg#
10520eca46af7Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1052114330f12Smrg#
10522eca46af7Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1052314330f12Smrg#
10524eca46af7Smrg# LICENSE
10525eca46af7Smrg#
10526eca46af7Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
10527eca46af7Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
10528eca46af7Smrg#   Copyright (c) 2009 Matteo Frigo
10529eca46af7Smrg#
10530eca46af7Smrg#   This program is free software: you can redistribute it and/or modify it
10531eca46af7Smrg#   under the terms of the GNU General Public License as published by the
10532eca46af7Smrg#   Free Software Foundation, either version 3 of the License, or (at your
10533eca46af7Smrg#   option) any later version.
10534eca46af7Smrg#
10535eca46af7Smrg#   This program is distributed in the hope that it will be useful, but
10536eca46af7Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
10537eca46af7Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
10538eca46af7Smrg#   Public License for more details.
10539eca46af7Smrg#
10540eca46af7Smrg#   You should have received a copy of the GNU General Public License along
10541eca46af7Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
10542eca46af7Smrg#
10543eca46af7Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
10544eca46af7Smrg#   gives unlimited permission to copy, distribute and modify the configure
10545eca46af7Smrg#   scripts that are the output of Autoconf when processing the Macro. You
10546eca46af7Smrg#   need not follow the terms of the GNU General Public License when using
10547eca46af7Smrg#   or distributing such scripts, even though portions of the text of the
10548eca46af7Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
10549eca46af7Smrg#   all other use of the material that constitutes the Autoconf Macro.
10550eca46af7Smrg#
10551eca46af7Smrg#   This special exception to the GPL applies to versions of the Autoconf
10552eca46af7Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
10553eca46af7Smrg#   modified version of the Autoconf Macro, you may extend this special
10554eca46af7Smrg#   exception to the GPL to apply to your modified version as well.#
10555eca46af7SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
10556eca46af7Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
10557eca46af7Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
10558eca46af7SmrgAS_LITERAL_IF([$1],
10559eca46af7Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
10560eca46af7Smrg      ax_save_FLAGS=$LDFLAGS
10561eca46af7Smrg      LDFLAGS="$1"
10562eca46af7Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
10563eca46af7Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10564eca46af7Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10565eca46af7Smrg      LDFLAGS=$ax_save_FLAGS])],
10566eca46af7Smrg  [ax_save_FLAGS=$LDFLAGS
10567eca46af7Smrg   LDFLAGS="$1"
10568eca46af7Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
10569eca46af7Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
10570eca46af7Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
10571eca46af7Smrg   LDFLAGS=$ax_save_FLAGS])
10572eca46af7Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
10573eca46af7SmrgAC_MSG_RESULT($xorg_check_linker_flags)
10574eca46af7Smrgif test "x$xorg_check_linker_flags" = xyes; then
10575eca46af7Smrg	m4_default([$2], :)
10576eca46af7Smrgelse
10577eca46af7Smrg	m4_default([$3], :)
10578eca46af7Smrgfi
10579eca46af7Smrg]) # XORG_CHECK_LINKER_FLAGS
10580eca46af7Smrg
10581eca46af7Smrg# XORG_MEMORY_CHECK_FLAGS
10582eca46af7Smrg# -----------------------
10583eca46af7Smrg# Minimum version: 1.16.0
1058414330f12Smrg#
10585eca46af7Smrg# This macro attempts to find appropriate memory checking functionality
10586eca46af7Smrg# for various platforms which unit testing code may use to catch various
10587eca46af7Smrg# forms of memory allocation and access errors in testing.
1058814330f12Smrg#
10589eca46af7Smrg# Interface to module:
10590eca46af7Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
10591eca46af7Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1059214330f12Smrg#
10593eca46af7Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1059414330f12Smrg#
10595eca46af7SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
1059695b296d0Smrg
10597eca46af7SmrgAC_REQUIRE([AC_CANONICAL_HOST])
10598eca46af7SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
10599eca46af7Smrg           [Environment variables to enable memory checking in tests])
1060095b296d0Smrg
10601eca46af7Smrg# Check for different types of support on different platforms
10602eca46af7Smrgcase $host_os in
10603eca46af7Smrg    solaris*)
10604eca46af7Smrg        AC_CHECK_LIB([umem], [umem_alloc],
10605eca46af7Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
10606eca46af7Smrg        ;;
10607eca46af7Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
10608eca46af7Smrg        # both directly and inverted, so should not be 0 or 255.
10609eca46af7Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
10610eca46af7Smrg        ;;
10611eca46af7Smrg    darwin*)
10612eca46af7Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
10613eca46af7Smrg        ;;
10614eca46af7Smrg    *bsd*)
10615eca46af7Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
10616eca46af7Smrg        ;;
10617eca46af7Smrgesac
1061895b296d0Smrg
10619eca46af7Smrg# User supplied flags override default flags
10620eca46af7Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
10621eca46af7Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1062295b296d0Smrgfi
1062395b296d0Smrg
10624eca46af7SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10625eca46af7Smrg]) # XORG_WITH_LINT
1062695b296d0Smrg
10627eca46af7Smrg# XORG_CHECK_MALLOC_ZERO
10628eca46af7Smrg# ----------------------
10629eca46af7Smrg# Minimum version: 1.0.0
1063014330f12Smrg#
10631eca46af7Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10632eca46af7Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10633eca46af7Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10634eca46af7SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10635eca46af7SmrgAC_ARG_ENABLE(malloc0returnsnull,
10636eca46af7Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10637eca46af7Smrg		       [malloc(0) returns NULL (default: auto)]),
10638eca46af7Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10639eca46af7Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
1064095b296d0Smrg
10641eca46af7SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10642eca46af7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10643eca46af7SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10644eca46af7Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10645eca46af7Smrg#include <stdlib.h>
10646eca46af7Smrg],[
10647eca46af7Smrg    char *m0, *r0, *c0, *p;
10648eca46af7Smrg    m0 = malloc(0);
10649eca46af7Smrg    p = malloc(10);
10650eca46af7Smrg    r0 = realloc(p,0);
10651eca46af7Smrg    c0 = calloc(0,10);
10652eca46af7Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10653eca46af7Smrg])],
10654eca46af7Smrg		[xorg_cv_malloc0_returns_null=yes],
10655eca46af7Smrg		[xorg_cv_malloc0_returns_null=no])])
10656eca46af7SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10657eca46af7Smrgfi
10658eca46af7SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10659eca46af7Smrg
10660eca46af7Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10661eca46af7Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10662eca46af7Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10663eca46af7Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
1066414330f12Smrgelse
10665eca46af7Smrg	MALLOC_ZERO_CFLAGS=""
10666eca46af7Smrg	XMALLOC_ZERO_CFLAGS=""
10667eca46af7Smrg	XTMALLOC_ZERO_CFLAGS=""
1066814330f12Smrgfi
1066995b296d0Smrg
10670eca46af7SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10671eca46af7SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10672eca46af7SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10673eca46af7Smrg]) # XORG_CHECK_MALLOC_ZERO
1067495b296d0Smrg
10675eca46af7Smrg# XORG_WITH_LINT()
1067614330f12Smrg# ----------------
10677eca46af7Smrg# Minimum version: 1.1.0
1067814330f12Smrg#
10679eca46af7Smrg# This macro enables the use of a tool that flags some suspicious and
10680eca46af7Smrg# non-portable constructs (likely to be bugs) in C language source code.
10681eca46af7Smrg# It will attempt to locate the tool and use appropriate options.
10682eca46af7Smrg# There are various lint type tools on different platforms.
1068314330f12Smrg#
1068414330f12Smrg# Interface to module:
10685eca46af7Smrg# LINT:		returns the path to the tool found on the platform
10686eca46af7Smrg#		or the value set to LINT on the configure cmd line
10687eca46af7Smrg#		also an Automake conditional
10688eca46af7Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
1068914330f12Smrg#
10690eca46af7Smrg# --with-lint:	'yes' user instructs the module to use lint
10691eca46af7Smrg#		'no' user instructs the module not to use lint (default)
1069214330f12Smrg#
10693eca46af7Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10694eca46af7Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10695eca46af7Smrg#
10696eca46af7SmrgAC_DEFUN([XORG_WITH_LINT],[
10697eca46af7Smrg
10698eca46af7SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10699eca46af7SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10700eca46af7SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10701eca46af7Smrg		[Use a lint-style source code checker (default: disabled)])],
10702eca46af7Smrg		[use_lint=$withval], [use_lint=no])
10703e6f085baSmrg
10704eca46af7Smrg# Obtain platform specific info like program name and options
10705eca46af7Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10706eca46af7Smrgcase $host_os in
10707eca46af7Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10708eca46af7Smrg	lint_name=splint
10709eca46af7Smrg	lint_options="-badflag"
10710eca46af7Smrg	;;
10711eca46af7Smrg  *freebsd* | *netbsd*)
10712eca46af7Smrg	lint_name=lint
10713eca46af7Smrg	lint_options="-u -b"
10714eca46af7Smrg	;;
10715eca46af7Smrg  *solaris*)
10716eca46af7Smrg	lint_name=lint
10717eca46af7Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10718eca46af7Smrg	;;
10719eca46af7Smrgesac
10720eca46af7Smrg
10721eca46af7Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10722eca46af7Smrgif test "x$use_lint" = x"yes" ; then
10723eca46af7Smrg   AC_PATH_PROG([LINT], [$lint_name])
10724eca46af7Smrg   if test "x$LINT" = "x"; then
10725eca46af7Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
1072614330f12Smrg   fi
10727eca46af7Smrgelif test "x$use_lint" = x"no" ; then
10728eca46af7Smrg   if test "x$LINT" != "x"; then
10729eca46af7Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
1073014330f12Smrg   fi
1073114330f12Smrgelse
10732eca46af7Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
1073314330f12Smrgfi
1073495b296d0Smrg
10735eca46af7Smrg# User supplied flags override default flags
10736eca46af7Smrgif test "x$LINT_FLAGS" != "x"; then
10737eca46af7Smrg   lint_options=$LINT_FLAGS
10738eca46af7Smrgfi
10739eca46af7Smrg
10740eca46af7SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10741eca46af7SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10742eca46af7Smrg
10743eca46af7Smrg]) # XORG_WITH_LINT
10744eca46af7Smrg
10745eca46af7Smrg# XORG_LINT_LIBRARY(LIBNAME)
10746eca46af7Smrg# --------------------------
10747eca46af7Smrg# Minimum version: 1.1.0
1074814330f12Smrg#
10749eca46af7Smrg# Sets up flags for building lint libraries for checking programs that call
10750eca46af7Smrg# functions in the library.
1075114330f12Smrg#
1075214330f12Smrg# Interface to module:
10753eca46af7Smrg# LINTLIB		- Automake variable with the name of lint library file to make
10754eca46af7Smrg# MAKE_LINT_LIB		- Automake conditional
1075514330f12Smrg#
10756eca46af7Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10757eca46af7Smrg#			  - 'no' user instructs the module not to create a lint library (default)
1075895b296d0Smrg
10759eca46af7SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10760eca46af7SmrgAC_REQUIRE([XORG_WITH_LINT])
10761eca46af7SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10762eca46af7Smrg	[Create lint library (default: disabled)])],
10763eca46af7Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10764eca46af7Smrg
10765eca46af7Smrgif test "x$make_lint_lib" = x"yes" ; then
10766eca46af7Smrg   LINTLIB=llib-l$1.ln
10767eca46af7Smrg   if test "x$LINT" = "x"; then
10768eca46af7Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10769eca46af7Smrg   fi
10770eca46af7Smrgelif test "x$make_lint_lib" != x"no" ; then
10771eca46af7Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10772eca46af7Smrgfi
10773eca46af7Smrg
10774eca46af7SmrgAC_SUBST(LINTLIB)
10775eca46af7SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10776eca46af7Smrg
10777eca46af7Smrg]) # XORG_LINT_LIBRARY
10778eca46af7Smrg
10779eca46af7Smrg# XORG_COMPILER_BRAND
10780eca46af7Smrg# -------------------
10781eca46af7Smrg# Minimum version: 1.14.0
1078214330f12Smrg#
10783eca46af7Smrg# Checks for various brands of compilers and sets flags as appropriate:
10784eca46af7Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10785eca46af7Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10786eca46af7Smrg#   clang compiler - sets CLANGCC to "yes"
10787eca46af7Smrg#   Intel compiler - sets INTELCC to "yes"
10788eca46af7Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
1078914330f12Smrg#
10790eca46af7SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10791eca46af7SmrgAC_LANG_CASE(
10792eca46af7Smrg	[C], [
10793eca46af7Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10794eca46af7Smrg	],
10795eca46af7Smrg	[C++], [
10796eca46af7Smrg		AC_REQUIRE([AC_PROG_CXX])
10797eca46af7Smrg	]
10798eca46af7Smrg)
10799eca46af7SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10800eca46af7SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10801eca46af7SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10802eca46af7Smrg]) # XORG_COMPILER_BRAND
1080395b296d0Smrg
10804eca46af7Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10805eca46af7Smrg# ---------------
10806eca46af7Smrg# Minimum version: 1.16.0
1080714330f12Smrg#
10808eca46af7Smrg# Test if the compiler works when passed the given flag as a command line argument.
10809eca46af7Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10810eca46af7Smrg# next flag in the list until there are no more options.
1081195b296d0Smrg#
10812eca46af7Smrg# Note that this does not guarantee that the compiler supports the flag as some
10813eca46af7Smrg# compilers will simply ignore arguments that they do not understand, but we do
10814eca46af7Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10815eca46af7Smrg# -Werror=unused-command-line-argument
1081614330f12Smrg#
10817eca46af7SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10818eca46af7Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10819eca46af7Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10820eca46af7Smrg
10821eca46af7SmrgAC_LANG_COMPILER_REQUIRE
10822eca46af7Smrg
10823eca46af7SmrgAC_LANG_CASE(
10824eca46af7Smrg	[C], [
10825eca46af7Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10826eca46af7Smrg		define([PREFIX], [C])
10827eca46af7Smrg		define([CACHE_PREFIX], [cc])
10828eca46af7Smrg		define([COMPILER], [$CC])
10829eca46af7Smrg	],
10830eca46af7Smrg	[C++], [
10831eca46af7Smrg		define([PREFIX], [CXX])
10832eca46af7Smrg		define([CACHE_PREFIX], [cxx])
10833eca46af7Smrg		define([COMPILER], [$CXX])
10834eca46af7Smrg	]
10835eca46af7Smrg)
10836eca46af7Smrg
10837eca46af7Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10838eca46af7Smrg
10839eca46af7Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10840eca46af7Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10841eca46af7Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10842eca46af7Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10843eca46af7Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10844eca46af7Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10845eca46af7Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10846eca46af7Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10847eca46af7Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10848eca46af7Smrgfi
10849eca46af7Smrg
10850eca46af7Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10851eca46af7Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10852eca46af7Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10853eca46af7Smrg	fi
10854eca46af7Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10855eca46af7Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10856eca46af7Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10857eca46af7Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10858eca46af7Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10859eca46af7Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10860eca46af7Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10861eca46af7Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10862eca46af7Smrgfi
10863eca46af7Smrg
10864eca46af7Smrgfound="no"
10865eca46af7Smrgm4_foreach([flag], m4_cdr($@), [
10866eca46af7Smrg	if test $found = "no" ; then
10867eca46af7Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10868eca46af7Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10869eca46af7Smrg		fi
1087095b296d0Smrg
10871eca46af7Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10872eca46af7Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10873eca46af7Smrg		fi
1087414330f12Smrg
10875eca46af7Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10876eca46af7Smrg
10877eca46af7Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10878eca46af7Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10879eca46af7Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10880eca46af7Smrg		AC_CACHE_VAL($cacheid,
10881eca46af7Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
10882eca46af7Smrg					     [eval $cacheid=yes],
10883eca46af7Smrg					     [eval $cacheid=no])])
10884eca46af7Smrg
10885eca46af7Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10886eca46af7Smrg
10887eca46af7Smrg		eval supported=\$$cacheid
10888eca46af7Smrg		AC_MSG_RESULT([$supported])
10889eca46af7Smrg		if test "$supported" = "yes" ; then
10890eca46af7Smrg			$1="$$1 ]flag["
10891eca46af7Smrg			found="yes"
10892eca46af7Smrg		fi
10893eca46af7Smrg	fi
10894eca46af7Smrg])
10895eca46af7Smrg]) # XORG_TESTSET_CFLAG
10896eca46af7Smrg
10897eca46af7Smrg# XORG_COMPILER_FLAGS
10898eca46af7Smrg# ---------------
10899eca46af7Smrg# Minimum version: 1.16.0
1090014330f12Smrg#
10901eca46af7Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
10902eca46af7Smrg# arguments supported by the selected compiler which do NOT alter the generated
10903eca46af7Smrg# code.  These arguments will cause the compiler to print various warnings
10904eca46af7Smrg# during compilation AND turn a conservative set of warnings into errors.
1090514330f12Smrg#
10906eca46af7Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
10907eca46af7Smrg# future versions of util-macros as options are added to new compilers.
1090814330f12Smrg#
10909eca46af7SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
10910eca46af7SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
1091114330f12Smrg
10912eca46af7SmrgAC_ARG_ENABLE(selective-werror,
10913eca46af7Smrg              AS_HELP_STRING([--disable-selective-werror],
10914eca46af7Smrg                             [Turn off selective compiler errors. (default: enabled)]),
10915eca46af7Smrg              [SELECTIVE_WERROR=$enableval],
10916eca46af7Smrg              [SELECTIVE_WERROR=yes])
10917eca46af7Smrg
10918eca46af7SmrgAC_LANG_CASE(
10919eca46af7Smrg        [C], [
10920eca46af7Smrg                define([PREFIX], [C])
10921eca46af7Smrg        ],
10922eca46af7Smrg        [C++], [
10923eca46af7Smrg                define([PREFIX], [CXX])
10924eca46af7Smrg        ]
10925eca46af7Smrg)
10926eca46af7Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
10927eca46af7Smrgif test "x$SUNCC" = "xyes"; then
10928eca46af7Smrg    [BASE_]PREFIX[FLAGS]="-v"
10929eca46af7Smrgelse
10930eca46af7Smrg    [BASE_]PREFIX[FLAGS]=""
10931eca46af7Smrgfi
10932eca46af7Smrg
10933eca46af7Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
10934eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
10935eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
10936eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
10937eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
10938eca46af7Smrg
10939eca46af7SmrgAC_LANG_CASE(
10940eca46af7Smrg	[C], [
10941eca46af7Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
10942eca46af7Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
10943eca46af7Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
10944eca46af7Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
10945eca46af7Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
10946eca46af7Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
10947eca46af7Smrg	]
10948eca46af7Smrg)
10949eca46af7Smrg
10950eca46af7Smrg# This chunk adds additional warnings that could catch undesired effects.
10951eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
10952eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
10953eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
10954eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
10955eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
10956eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
10957eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
10958eca46af7Smrg
10959eca46af7Smrg# These are currently disabled because they are noisy.  They will be enabled
10960eca46af7Smrg# in the future once the codebase is sufficiently modernized to silence
10961eca46af7Smrg# them.  For now, I don't want them to drown out the other warnings.
10962eca46af7Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
10963eca46af7Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
10964eca46af7Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
10965eca46af7Smrg
10966eca46af7Smrg# Turn some warnings into errors, so we don't accidently get successful builds
10967eca46af7Smrg# when there are problems that should be fixed.
10968eca46af7Smrg
10969eca46af7Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
10970eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
10971eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
10972eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
10973eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
10974eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
10975eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
10976eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
10977eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
10978eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
10979eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
10980eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
10981eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
10982eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
10983eca46af7Smrgelse
10984eca46af7SmrgAC_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])
10985eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
10986eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
10987eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
10988eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
10989eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
10990eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
10991eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
10992eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
10993eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
10994eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
10995eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
10996eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
10997eca46af7SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
10998eca46af7Smrgfi
10999eca46af7Smrg
11000eca46af7SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11001eca46af7Smrg]) # XORG_COMPILER_FLAGS
11002eca46af7Smrg
11003eca46af7Smrg# XORG_CWARNFLAGS
11004eca46af7Smrg# ---------------
11005eca46af7Smrg# Minimum version: 1.2.0
11006eca46af7Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
1100714330f12Smrg#
11008eca46af7Smrg# Defines CWARNFLAGS to enable C compiler warnings.
1100914330f12Smrg#
11010eca46af7Smrg# This function is deprecated because it defines -fno-strict-aliasing
11011eca46af7Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11012eca46af7Smrg# is needed, then it should be added explicitly in the module when
11013eca46af7Smrg# it is updated to use BASE_CFLAGS.
1101414330f12Smrg#
11015eca46af7SmrgAC_DEFUN([XORG_CWARNFLAGS], [
11016eca46af7SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11017eca46af7SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11018eca46af7SmrgAC_LANG_CASE(
11019eca46af7Smrg	[C], [
11020eca46af7Smrg		CWARNFLAGS="$BASE_CFLAGS"
11021eca46af7Smrg		if  test "x$GCC" = xyes ; then
11022eca46af7Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11023eca46af7Smrg		fi
11024eca46af7Smrg		AC_SUBST(CWARNFLAGS)
11025eca46af7Smrg	]
11026eca46af7Smrg)
11027eca46af7Smrg]) # XORG_CWARNFLAGS
11028eca46af7Smrg
11029eca46af7Smrg# XORG_STRICT_OPTION
11030eca46af7Smrg# -----------------------
11031eca46af7Smrg# Minimum version: 1.3.0
1103214330f12Smrg#
11033eca46af7Smrg# Add configure option to enable strict compilation flags, such as treating
11034eca46af7Smrg# warnings as fatal errors.
11035eca46af7Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11036eca46af7Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
1103714330f12Smrg#
11038eca46af7Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11039eca46af7Smrg# when strict compilation is unconditionally desired.
11040eca46af7SmrgAC_DEFUN([XORG_STRICT_OPTION], [
11041eca46af7SmrgAC_REQUIRE([XORG_CWARNFLAGS])
11042eca46af7SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1104395b296d0Smrg
11044eca46af7SmrgAC_ARG_ENABLE(strict-compilation,
11045eca46af7Smrg			  AS_HELP_STRING([--enable-strict-compilation],
11046eca46af7Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11047eca46af7Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1104895b296d0Smrg
11049eca46af7SmrgAC_LANG_CASE(
11050eca46af7Smrg        [C], [
11051eca46af7Smrg                define([PREFIX], [C])
11052eca46af7Smrg        ],
11053eca46af7Smrg        [C++], [
11054eca46af7Smrg                define([PREFIX], [CXX])
11055eca46af7Smrg        ]
11056eca46af7Smrg)
1105795b296d0Smrg
11058eca46af7Smrg[STRICT_]PREFIX[FLAGS]=""
11059eca46af7SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11060eca46af7SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
1106195b296d0Smrg
11062eca46af7Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11063eca46af7Smrg# activate it with -Werror, so we add it here explicitly.
11064eca46af7SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
1106595b296d0Smrg
11066eca46af7Smrgif test "x$STRICT_COMPILE" = "xyes"; then
11067eca46af7Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11068eca46af7Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
1106914330f12Smrgfi
11070eca46af7SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11071eca46af7SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11072eca46af7SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11073eca46af7Smrg]) # XORG_STRICT_OPTION
11074eca46af7Smrg
11075eca46af7Smrg# XORG_DEFAULT_OPTIONS
11076eca46af7Smrg# --------------------
11077eca46af7Smrg# Minimum version: 1.3.0
1107895b296d0Smrg#
11079eca46af7Smrg# Defines default options for X.Org modules.
11080eca46af7Smrg#
11081eca46af7SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11082eca46af7SmrgAC_REQUIRE([AC_PROG_INSTALL])
11083eca46af7SmrgXORG_COMPILER_FLAGS
11084eca46af7SmrgXORG_CWARNFLAGS
11085eca46af7SmrgXORG_STRICT_OPTION
11086eca46af7SmrgXORG_RELEASE_VERSION
11087eca46af7SmrgXORG_CHANGELOG
11088eca46af7SmrgXORG_INSTALL
11089eca46af7SmrgXORG_MANPAGE_SECTIONS
11090eca46af7Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11091eca46af7Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11092eca46af7Smrg]) # XORG_DEFAULT_OPTIONS
1109395b296d0Smrg
11094eca46af7Smrg# XORG_INSTALL()
11095eca46af7Smrg# ----------------
11096eca46af7Smrg# Minimum version: 1.4.0
1109714330f12Smrg#
11098eca46af7Smrg# Defines the variable INSTALL_CMD as the command to copy
11099eca46af7Smrg# INSTALL from $prefix/share/util-macros.
1110014330f12Smrg#
11101eca46af7SmrgAC_DEFUN([XORG_INSTALL], [
11102eca46af7SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11103eca46af7Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11104eca46af7SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11105eca46af7Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11106eca46af7Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11107eca46af7Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11108eca46af7SmrgAC_SUBST([INSTALL_CMD])
11109eca46af7Smrg]) # XORG_INSTALL
11110eca46af7Smrgdnl Copyright 2005 Red Hat, Inc
11111eca46af7Smrgdnl
11112eca46af7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11113eca46af7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11114eca46af7Smrgdnl the above copyright notice appear in all copies and that both that
11115eca46af7Smrgdnl copyright notice and this permission notice appear in supporting
11116eca46af7Smrgdnl documentation.
11117eca46af7Smrgdnl
11118eca46af7Smrgdnl The above copyright notice and this permission notice shall be included
11119eca46af7Smrgdnl in all copies or substantial portions of the Software.
11120eca46af7Smrgdnl
11121eca46af7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11122eca46af7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11123eca46af7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11124eca46af7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11125eca46af7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11126eca46af7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11127eca46af7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
11128eca46af7Smrgdnl
11129eca46af7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
11130eca46af7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
11131eca46af7Smrgdnl other dealings in this Software without prior written authorization
11132eca46af7Smrgdnl from the copyright holders.
11133eca46af7Smrgdnl
11134eca46af7Smrg
11135eca46af7Smrg# XORG_RELEASE_VERSION
11136eca46af7Smrg# --------------------
11137eca46af7Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11138eca46af7Smrg
11139eca46af7SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11140eca46af7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11141eca46af7Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11142eca46af7Smrg		[Major version of this package])
11143eca46af7Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11144eca46af7Smrg	if test "x$PVM" = "x"; then
11145eca46af7Smrg		PVM="0"
11146eca46af7Smrg	fi
11147eca46af7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11148eca46af7Smrg		[$PVM],
11149eca46af7Smrg		[Minor version of this package])
11150eca46af7Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11151eca46af7Smrg	if test "x$PVP" = "x"; then
11152eca46af7Smrg		PVP="0"
11153eca46af7Smrg	fi
11154eca46af7Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11155eca46af7Smrg		[$PVP],
11156eca46af7Smrg		[Patch version of this package])
11157eca46af7Smrg])
11158eca46af7Smrg
11159eca46af7Smrg# XORG_CHANGELOG()
11160eca46af7Smrg# ----------------
11161eca46af7Smrg# Minimum version: 1.2.0
1116214330f12Smrg#
11163eca46af7Smrg# Defines the variable CHANGELOG_CMD as the command to generate
11164eca46af7Smrg# ChangeLog from git.
1116514330f12Smrg#
1116614330f12Smrg#
11167eca46af7SmrgAC_DEFUN([XORG_CHANGELOG], [
11168eca46af7SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11169eca46af7Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11170eca46af7Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11171eca46af7Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11172eca46af7SmrgAC_SUBST([CHANGELOG_CMD])
11173eca46af7Smrg]) # XORG_CHANGELOG
11174eca46af7Smrg
11175eca46af7Smrgdnl Copyright 2005 Red Hat, Inc
11176eca46af7Smrgdnl 
11177eca46af7Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11178eca46af7Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11179eca46af7Smrgdnl the above copyright notice appear in all copies and that both that
11180eca46af7Smrgdnl copyright notice and this permission notice appear in supporting
11181eca46af7Smrgdnl documentation.
11182eca46af7Smrgdnl 
11183eca46af7Smrgdnl The above copyright notice and this permission notice shall be included
11184eca46af7Smrgdnl in all copies or substantial portions of the Software.
11185eca46af7Smrgdnl 
11186eca46af7Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11187eca46af7Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11188eca46af7Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11189eca46af7Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11190eca46af7Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11191eca46af7Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11192eca46af7Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
11193eca46af7Smrgdnl 
11194eca46af7Smrgdnl Except as contained in this notice, the name of the copyright holders shall
11195eca46af7Smrgdnl not be used in advertising or otherwise to promote the sale, use or
11196eca46af7Smrgdnl other dealings in this Software without prior written authorization
11197eca46af7Smrgdnl from the copyright holders.
11198eca46af7Smrgdnl 
11199eca46af7Smrg
11200eca46af7Smrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
11201eca46af7Smrg# --------------------------
11202eca46af7Smrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
11203eca46af7Smrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
11204eca46af7Smrg
11205eca46af7SmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
11206eca46af7Smrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
11207eca46af7Smrg	SAVE_CFLAGS="$CFLAGS"
11208eca46af7Smrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
11209eca46af7Smrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
11210eca46af7Smrg#include "xorg-server.h"
11211eca46af7Smrg#if !defined $1
11212eca46af7Smrg#error $1 not defined
11213eca46af7Smrg#endif
11214eca46af7Smrg		]])],
11215eca46af7Smrg		[_EXT_CHECK=yes],
11216eca46af7Smrg		[_EXT_CHECK=no])
11217eca46af7Smrg	CFLAGS="$SAVE_CFLAGS"
11218eca46af7Smrg	AC_MSG_CHECKING([if $1 is defined])
11219eca46af7Smrg	AC_MSG_RESULT([$_EXT_CHECK])
11220eca46af7Smrg	if test "$_EXT_CHECK" != no; then
11221eca46af7Smrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
11222eca46af7Smrg	fi
11223eca46af7Smrg])
11224eca46af7Smrg
1122589b0dc75Smrg# Copyright (C) 2002-2014 Free Software Foundation, Inc.
1122614330f12Smrg#
11227eca46af7Smrg# This file is free software; the Free Software Foundation
11228eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11229eca46af7Smrg# with or without modifications, as long as this notice is preserved.
11230eca46af7Smrg
11231eca46af7Smrg# AM_AUTOMAKE_VERSION(VERSION)
11232eca46af7Smrg# ----------------------------
11233eca46af7Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11234eca46af7Smrg# generated from the m4 files accompanying Automake X.Y.
11235eca46af7Smrg# (This private macro should not be called outside this file.)
11236eca46af7SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
1123789b0dc75Smrg[am__api_version='1.15'
11238eca46af7Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11239eca46af7Smrgdnl require some minimum version.  Point them to the right macro.
1124089b0dc75Smrgm4_if([$1], [1.15], [],
11241eca46af7Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11242eca46af7Smrg])
11243eca46af7Smrg
11244eca46af7Smrg# _AM_AUTOCONF_VERSION(VERSION)
11245eca46af7Smrg# -----------------------------
11246eca46af7Smrg# aclocal traces this macro to find the Autoconf version.
11247eca46af7Smrg# This is a private macro too.  Using m4_define simplifies
11248eca46af7Smrg# the logic in aclocal, which can simply ignore this definition.
11249eca46af7Smrgm4_define([_AM_AUTOCONF_VERSION], [])
11250eca46af7Smrg
11251eca46af7Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11252eca46af7Smrg# -------------------------------
11253eca46af7Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11254eca46af7Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11255eca46af7SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
1125689b0dc75Smrg[AM_AUTOMAKE_VERSION([1.15])dnl
11257eca46af7Smrgm4_ifndef([AC_AUTOCONF_VERSION],
11258eca46af7Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11259eca46af7Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11260eca46af7Smrg
11261eca46af7Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11262eca46af7Smrg
1126389b0dc75Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
1126414330f12Smrg#
11265eca46af7Smrg# This file is free software; the Free Software Foundation
11266eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11267eca46af7Smrg# with or without modifications, as long as this notice is preserved.
11268eca46af7Smrg
11269eca46af7Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11270eca46af7Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11271eca46af7Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
1127214330f12Smrg#
11273eca46af7Smrg# Of course, Automake must honor this variable whenever it calls a
11274eca46af7Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11275eca46af7Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11276eca46af7Smrg# depending on how configure is run.  This is pretty annoying, since
11277eca46af7Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11278eca46af7Smrg# source directory, any form will work fine, but in subdirectories a
11279eca46af7Smrg# relative path needs to be adjusted first.
1128014330f12Smrg#
11281eca46af7Smrg# $ac_aux_dir/missing
11282eca46af7Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11283eca46af7Smrg# $top_srcdir/$ac_aux_dir/missing
11284eca46af7Smrg#    fails if $ac_aux_dir is absolute,
11285eca46af7Smrg#    fails when called from a subdirectory in a VPATH build with
11286eca46af7Smrg#          a relative $ac_aux_dir
1128714330f12Smrg#
11288eca46af7Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11289eca46af7Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
11290eca46af7Smrg# harmless because $srcdir is '.', but things will broke when you
11291eca46af7Smrg# start a VPATH build or use an absolute $srcdir.
1129214330f12Smrg#
11293eca46af7Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11294eca46af7Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11295eca46af7Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11296eca46af7Smrg# and then we would define $MISSING as
11297eca46af7Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11298eca46af7Smrg# This will work as long as MISSING is not called from configure, because
11299eca46af7Smrg# unfortunately $(top_srcdir) has no meaning in configure.
11300eca46af7Smrg# However there are other variables, like CC, which are often used in
11301eca46af7Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
1130214330f12Smrg#
11303eca46af7Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
11304eca46af7Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
11305eca46af7Smrg# configured tree to be moved without reconfiguration.
11306eca46af7Smrg
11307eca46af7SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
1130889b0dc75Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
1130989b0dc75Smrg# Expand $ac_aux_dir to an absolute path.
1131089b0dc75Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11311eca46af7Smrg])
11312eca46af7Smrg
11313eca46af7Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11314eca46af7Smrg
1131589b0dc75Smrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
1131614330f12Smrg#
11317eca46af7Smrg# This file is free software; the Free Software Foundation
11318eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11319eca46af7Smrg# with or without modifications, as long as this notice is preserved.
11320eca46af7Smrg
11321eca46af7Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11322eca46af7Smrg# -------------------------------------
11323eca46af7Smrg# Define a conditional.
11324eca46af7SmrgAC_DEFUN([AM_CONDITIONAL],
11325eca46af7Smrg[AC_PREREQ([2.52])dnl
11326eca46af7Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11327eca46af7Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11328eca46af7SmrgAC_SUBST([$1_TRUE])dnl
11329eca46af7SmrgAC_SUBST([$1_FALSE])dnl
11330eca46af7Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11331eca46af7Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11332eca46af7Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11333eca46af7Smrgif $2; then
11334eca46af7Smrg  $1_TRUE=
11335eca46af7Smrg  $1_FALSE='#'
1133614330f12Smrgelse
11337eca46af7Smrg  $1_TRUE='#'
11338eca46af7Smrg  $1_FALSE=
1133914330f12Smrgfi
11340eca46af7SmrgAC_CONFIG_COMMANDS_PRE(
11341eca46af7Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11342eca46af7Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11343eca46af7SmrgUsually this means the macro was only invoked conditionally.]])
11344eca46af7Smrgfi])])
1134595b296d0Smrg
1134689b0dc75Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1134714330f12Smrg#
11348eca46af7Smrg# This file is free software; the Free Software Foundation
11349eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11350eca46af7Smrg# with or without modifications, as long as this notice is preserved.
11351eca46af7Smrg
11352eca46af7Smrg
11353eca46af7Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11354eca46af7Smrg# written in clear, in which case automake, when reading aclocal.m4,
11355eca46af7Smrg# will think it sees a *use*, and therefore will trigger all it's
11356eca46af7Smrg# C support machinery.  Also note that it means that autoscan, seeing
11357eca46af7Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11358eca46af7Smrg
11359eca46af7Smrg
11360eca46af7Smrg# _AM_DEPENDENCIES(NAME)
11361eca46af7Smrg# ----------------------
11362eca46af7Smrg# See how the compiler implements dependency checking.
11363eca46af7Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11364eca46af7Smrg# We try a few techniques and use that to set a single cache variable.
1136514330f12Smrg#
11366eca46af7Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11367eca46af7Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11368eca46af7Smrg# dependency, and given that the user is not expected to run this macro,
11369eca46af7Smrg# just rely on AC_PROG_CC.
11370eca46af7SmrgAC_DEFUN([_AM_DEPENDENCIES],
11371eca46af7Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11372eca46af7SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11373eca46af7SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11374eca46af7SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11375eca46af7Smrg
11376eca46af7Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11377eca46af7Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11378eca46af7Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11379eca46af7Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11380eca46af7Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11381eca46af7Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11382eca46af7Smrg                    [depcc="$$1"   am_compiler_list=])
11383eca46af7Smrg
11384eca46af7SmrgAC_CACHE_CHECK([dependency style of $depcc],
11385eca46af7Smrg               [am_cv_$1_dependencies_compiler_type],
11386eca46af7Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11387eca46af7Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
11388eca46af7Smrg  # making bogus files that we don't know about and never remove.  For
11389eca46af7Smrg  # instance it was reported that on HP-UX the gcc test will end up
11390eca46af7Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11391eca46af7Smrg  # in D".
11392eca46af7Smrg  rm -rf conftest.dir
11393eca46af7Smrg  mkdir conftest.dir
11394eca46af7Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11395eca46af7Smrg  # using a relative directory.
11396eca46af7Smrg  cp "$am_depcomp" conftest.dir
11397eca46af7Smrg  cd conftest.dir
11398eca46af7Smrg  # We will build objects and dependencies in a subdirectory because
11399eca46af7Smrg  # it helps to detect inapplicable dependency modes.  For instance
11400eca46af7Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11401eca46af7Smrg  # side effect of compilation, but ICC will put the dependencies in
11402eca46af7Smrg  # the current directory while Tru64 will put them in the object
11403eca46af7Smrg  # directory.
11404eca46af7Smrg  mkdir sub
11405eca46af7Smrg
11406eca46af7Smrg  am_cv_$1_dependencies_compiler_type=none
11407eca46af7Smrg  if test "$am_compiler_list" = ""; then
11408eca46af7Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11409eca46af7Smrg  fi
11410eca46af7Smrg  am__universal=false
11411eca46af7Smrg  m4_case([$1], [CC],
11412eca46af7Smrg    [case " $depcc " in #(
11413eca46af7Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11414eca46af7Smrg     esac],
11415eca46af7Smrg    [CXX],
11416eca46af7Smrg    [case " $depcc " in #(
11417eca46af7Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11418eca46af7Smrg     esac])
11419eca46af7Smrg
11420eca46af7Smrg  for depmode in $am_compiler_list; do
11421eca46af7Smrg    # Setup a source with many dependencies, because some compilers
11422eca46af7Smrg    # like to wrap large dependency lists on column 80 (with \), and
11423eca46af7Smrg    # we should not choose a depcomp mode which is confused by this.
11424eca46af7Smrg    #
11425eca46af7Smrg    # We need to recreate these files for each test, as the compiler may
11426eca46af7Smrg    # overwrite some of them when testing with obscure command lines.
11427eca46af7Smrg    # This happens at least with the AIX C compiler.
11428eca46af7Smrg    : > sub/conftest.c
11429eca46af7Smrg    for i in 1 2 3 4 5 6; do
11430eca46af7Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11431eca46af7Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11432eca46af7Smrg      # Solaris 10 /bin/sh.
11433eca46af7Smrg      echo '/* dummy */' > sub/conftst$i.h
11434eca46af7Smrg    done
11435eca46af7Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11436eca46af7Smrg
11437eca46af7Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11438eca46af7Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11439eca46af7Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11440eca46af7Smrg    # versions had trouble with output in subdirs.
11441eca46af7Smrg    am__obj=sub/conftest.${OBJEXT-o}
11442eca46af7Smrg    am__minus_obj="-o $am__obj"
11443eca46af7Smrg    case $depmode in
11444eca46af7Smrg    gcc)
11445eca46af7Smrg      # This depmode causes a compiler race in universal mode.
11446eca46af7Smrg      test "$am__universal" = false || continue
11447eca46af7Smrg      ;;
11448eca46af7Smrg    nosideeffect)
11449eca46af7Smrg      # After this tag, mechanisms are not by side-effect, so they'll
11450eca46af7Smrg      # only be used when explicitly requested.
11451eca46af7Smrg      if test "x$enable_dependency_tracking" = xyes; then
11452eca46af7Smrg	continue
11453eca46af7Smrg      else
11454eca46af7Smrg	break
11455eca46af7Smrg      fi
11456eca46af7Smrg      ;;
11457eca46af7Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11458eca46af7Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
11459eca46af7Smrg      # not run yet.  These depmodes are late enough in the game, and
11460eca46af7Smrg      # so weak that their functioning should not be impacted.
11461eca46af7Smrg      am__obj=conftest.${OBJEXT-o}
11462eca46af7Smrg      am__minus_obj=
11463eca46af7Smrg      ;;
11464eca46af7Smrg    none) break ;;
11465eca46af7Smrg    esac
11466eca46af7Smrg    if depmode=$depmode \
11467eca46af7Smrg       source=sub/conftest.c object=$am__obj \
11468eca46af7Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11469eca46af7Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11470eca46af7Smrg         >/dev/null 2>conftest.err &&
11471eca46af7Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11472eca46af7Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11473eca46af7Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11474eca46af7Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11475eca46af7Smrg      # icc doesn't choke on unknown options, it will just issue warnings
11476eca46af7Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
11477eca46af7Smrg      # that says an option was ignored or not supported.
11478eca46af7Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11479eca46af7Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11480eca46af7Smrg      # The diagnosis changed in icc 8.0:
11481eca46af7Smrg      #   icc: Command line remark: option '-MP' not supported
11482eca46af7Smrg      if (grep 'ignoring option' conftest.err ||
11483eca46af7Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11484eca46af7Smrg        am_cv_$1_dependencies_compiler_type=$depmode
11485eca46af7Smrg        break
11486eca46af7Smrg      fi
11487eca46af7Smrg    fi
11488eca46af7Smrg  done
11489eca46af7Smrg
11490eca46af7Smrg  cd ..
11491eca46af7Smrg  rm -rf conftest.dir
11492eca46af7Smrgelse
11493eca46af7Smrg  am_cv_$1_dependencies_compiler_type=none
11494eca46af7Smrgfi
11495eca46af7Smrg])
11496eca46af7SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11497eca46af7SmrgAM_CONDITIONAL([am__fastdep$1], [
11498eca46af7Smrg  test "x$enable_dependency_tracking" != xno \
11499eca46af7Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11500eca46af7Smrg])
1150195b296d0Smrg
1150295b296d0Smrg
11503eca46af7Smrg# AM_SET_DEPDIR
11504eca46af7Smrg# -------------
11505eca46af7Smrg# Choose a directory name for dependency files.
11506eca46af7Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11507eca46af7SmrgAC_DEFUN([AM_SET_DEPDIR],
11508eca46af7Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11509eca46af7SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11510eca46af7Smrg])
1151114330f12Smrg
11512eca46af7Smrg
11513eca46af7Smrg# AM_DEP_TRACK
11514eca46af7Smrg# ------------
11515eca46af7SmrgAC_DEFUN([AM_DEP_TRACK],
11516eca46af7Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11517eca46af7SmrgAS_HELP_STRING(
11518eca46af7Smrg  [--enable-dependency-tracking],
11519eca46af7Smrg  [do not reject slow dependency extractors])
11520eca46af7SmrgAS_HELP_STRING(
11521eca46af7Smrg  [--disable-dependency-tracking],
11522eca46af7Smrg  [speeds up one-time build])])
11523eca46af7Smrgif test "x$enable_dependency_tracking" != xno; then
11524eca46af7Smrg  am_depcomp="$ac_aux_dir/depcomp"
11525eca46af7Smrg  AMDEPBACKSLASH='\'
11526eca46af7Smrg  am__nodep='_no'
1152795b296d0Smrgfi
11528eca46af7SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11529eca46af7SmrgAC_SUBST([AMDEPBACKSLASH])dnl
11530eca46af7Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11531eca46af7SmrgAC_SUBST([am__nodep])dnl
11532eca46af7Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11533eca46af7Smrg])
1153495b296d0Smrg
11535eca46af7Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
1153695b296d0Smrg
1153789b0dc75Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
1153895b296d0Smrg#
11539eca46af7Smrg# This file is free software; the Free Software Foundation
11540eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11541eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1154295b296d0Smrg
1154314330f12Smrg
11544eca46af7Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11545eca46af7Smrg# ------------------------------
11546eca46af7SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11547eca46af7Smrg[{
11548eca46af7Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
11549eca46af7Smrg  # are listed without --file.  Let's play safe and only enable the eval
11550eca46af7Smrg  # if we detect the quoting.
11551eca46af7Smrg  case $CONFIG_FILES in
11552eca46af7Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
11553eca46af7Smrg  *)   set x $CONFIG_FILES ;;
11554eca46af7Smrg  esac
11555eca46af7Smrg  shift
11556eca46af7Smrg  for mf
11557eca46af7Smrg  do
11558eca46af7Smrg    # Strip MF so we end up with the name of the file.
11559eca46af7Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11560eca46af7Smrg    # Check whether this is an Automake generated Makefile or not.
11561eca46af7Smrg    # We used to match only the files named 'Makefile.in', but
11562eca46af7Smrg    # some people rename them; so instead we look at the file content.
11563eca46af7Smrg    # Grep'ing the first line is not enough: some people post-process
11564eca46af7Smrg    # each Makefile.in and add a new line on top of each file to say so.
11565eca46af7Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
11566eca46af7Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
11567eca46af7Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11568eca46af7Smrg      dirpart=`AS_DIRNAME("$mf")`
11569eca46af7Smrg    else
11570eca46af7Smrg      continue
11571eca46af7Smrg    fi
11572eca46af7Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
11573eca46af7Smrg    # from the Makefile without running 'make'.
11574eca46af7Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11575eca46af7Smrg    test -z "$DEPDIR" && continue
11576eca46af7Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11577eca46af7Smrg    test -z "$am__include" && continue
11578eca46af7Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11579eca46af7Smrg    # Find all dependency output files, they are included files with
11580eca46af7Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11581eca46af7Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11582eca46af7Smrg    # expansion.
11583eca46af7Smrg    for file in `sed -n "
11584eca46af7Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11585eca46af7Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11586eca46af7Smrg      # Make sure the directory exists.
11587eca46af7Smrg      test -f "$dirpart/$file" && continue
11588eca46af7Smrg      fdir=`AS_DIRNAME(["$file"])`
11589eca46af7Smrg      AS_MKDIR_P([$dirpart/$fdir])
11590eca46af7Smrg      # echo "creating $dirpart/$file"
11591eca46af7Smrg      echo '# dummy' > "$dirpart/$file"
11592eca46af7Smrg    done
11593eca46af7Smrg  done
11594eca46af7Smrg}
11595eca46af7Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
1159695b296d0Smrg
1159714330f12Smrg
11598eca46af7Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11599eca46af7Smrg# -----------------------------
11600eca46af7Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
1160114330f12Smrg#
11602eca46af7Smrg# This code is only required when automatic dependency tracking
11603eca46af7Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
11604eca46af7Smrg# need in order to bootstrap the dependency handling code.
11605eca46af7SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11606eca46af7Smrg[AC_CONFIG_COMMANDS([depfiles],
11607eca46af7Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11608eca46af7Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11609eca46af7Smrg])
11610eca46af7Smrg
11611eca46af7Smrg# Do all the work for Automake.                             -*- Autoconf -*-
11612eca46af7Smrg
1161389b0dc75Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
1161414330f12Smrg#
11615eca46af7Smrg# This file is free software; the Free Software Foundation
11616eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11617eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1161895b296d0Smrg
11619eca46af7Smrg# This macro actually does too much.  Some checks are only needed if
11620eca46af7Smrg# your package does certain things.  But this isn't really a big deal.
1162114330f12Smrg
11622eca46af7Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11623eca46af7Smrgm4_define([AC_PROG_CC],
11624eca46af7Smrgm4_defn([AC_PROG_CC])
11625eca46af7Smrg[_AM_PROG_CC_C_O
11626eca46af7Smrg])
1162795b296d0Smrg
11628eca46af7Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11629eca46af7Smrg# AM_INIT_AUTOMAKE([OPTIONS])
11630eca46af7Smrg# -----------------------------------------------
11631eca46af7Smrg# The call with PACKAGE and VERSION arguments is the old style
11632eca46af7Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11633eca46af7Smrg# and VERSION should now be passed to AC_INIT and removed from
11634eca46af7Smrg# the call to AM_INIT_AUTOMAKE.
11635eca46af7Smrg# We support both call styles for the transition.  After
11636eca46af7Smrg# the next Automake release, Autoconf can make the AC_INIT
11637eca46af7Smrg# arguments mandatory, and then we can depend on a new Autoconf
11638eca46af7Smrg# release and drop the old call support.
11639eca46af7SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11640eca46af7Smrg[AC_PREREQ([2.65])dnl
11641eca46af7Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11642eca46af7Smrgdnl the ones we care about.
11643eca46af7Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11644eca46af7SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11645eca46af7SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11646eca46af7Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11647eca46af7Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11648eca46af7Smrg  # is not polluted with repeated "-I."
11649eca46af7Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11650eca46af7Smrg  # test to see if srcdir already configured
11651eca46af7Smrg  if test -f $srcdir/config.status; then
11652eca46af7Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11653eca46af7Smrg  fi
1165414330f12Smrgfi
1165595b296d0Smrg
11656eca46af7Smrg# test whether we have cygpath
11657eca46af7Smrgif test -z "$CYGPATH_W"; then
11658eca46af7Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11659eca46af7Smrg    CYGPATH_W='cygpath -w'
11660eca46af7Smrg  else
11661eca46af7Smrg    CYGPATH_W=echo
11662eca46af7Smrg  fi
1166314330f12Smrgfi
11664eca46af7SmrgAC_SUBST([CYGPATH_W])
1166595b296d0Smrg
11666eca46af7Smrg# Define the identity of the package.
11667eca46af7Smrgdnl Distinguish between old-style and new-style calls.
11668eca46af7Smrgm4_ifval([$2],
11669eca46af7Smrg[AC_DIAGNOSE([obsolete],
11670eca46af7Smrg             [$0: two- and three-arguments forms are deprecated.])
11671eca46af7Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11672eca46af7Smrg AC_SUBST([PACKAGE], [$1])dnl
11673eca46af7Smrg AC_SUBST([VERSION], [$2])],
11674eca46af7Smrg[_AM_SET_OPTIONS([$1])dnl
11675eca46af7Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11676eca46af7Smrgm4_if(
11677eca46af7Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11678eca46af7Smrg  [ok:ok],,
11679eca46af7Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11680eca46af7Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11681eca46af7Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
1168295b296d0Smrg
11683eca46af7Smrg_AM_IF_OPTION([no-define],,
11684eca46af7Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11685eca46af7Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
1168695b296d0Smrg
11687eca46af7Smrg# Some tools Automake needs.
11688eca46af7SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11689eca46af7SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11690eca46af7SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11691eca46af7SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11692eca46af7SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11693eca46af7SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11694eca46af7SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11695eca46af7SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11696eca46af7SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11697eca46af7SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11698eca46af7Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
11699eca46af7Smrg# dies out for good.  For more background, see:
11700eca46af7Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11701eca46af7Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11702eca46af7SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
1170389b0dc75Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
1170489b0dc75Smrg# system "awk" is bad on some platforms.
11705eca46af7SmrgAC_REQUIRE([AC_PROG_AWK])dnl
11706eca46af7SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11707eca46af7SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11708eca46af7Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11709eca46af7Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11710eca46af7Smrg			     [_AM_PROG_TAR([v7])])])
11711eca46af7Smrg_AM_IF_OPTION([no-dependencies],,
11712eca46af7Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11713eca46af7Smrg		  [_AM_DEPENDENCIES([CC])],
11714eca46af7Smrg		  [m4_define([AC_PROG_CC],
11715eca46af7Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11716eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11717eca46af7Smrg		  [_AM_DEPENDENCIES([CXX])],
11718eca46af7Smrg		  [m4_define([AC_PROG_CXX],
11719eca46af7Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11720eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11721eca46af7Smrg		  [_AM_DEPENDENCIES([OBJC])],
11722eca46af7Smrg		  [m4_define([AC_PROG_OBJC],
11723eca46af7Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11724eca46af7SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11725eca46af7Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
11726eca46af7Smrg		  [m4_define([AC_PROG_OBJCXX],
11727eca46af7Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11728eca46af7Smrg])
11729eca46af7SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11730eca46af7Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
11731eca46af7Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11732eca46af7Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11733eca46af7SmrgAC_CONFIG_COMMANDS_PRE(dnl
11734eca46af7Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11735eca46af7Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
1173695b296d0Smrg
11737eca46af7Smrg# POSIX will say in a future version that running "rm -f" with no argument
11738eca46af7Smrg# is OK; and we want to be able to make that assumption in our Makefile
11739eca46af7Smrg# recipes.  So use an aggressive probe to check that the usage we want is
11740eca46af7Smrg# actually supported "in the wild" to an acceptable degree.
11741eca46af7Smrg# See automake bug#10828.
11742eca46af7Smrg# To make any issue more visible, cause the running configure to be aborted
11743eca46af7Smrg# by default if the 'rm' program in use doesn't match our expectations; the
11744eca46af7Smrg# user can still override this though.
11745eca46af7Smrgif rm -f && rm -fr && rm -rf; then : OK; else
11746eca46af7Smrg  cat >&2 <<'END'
11747eca46af7SmrgOops!
11748eca46af7Smrg
11749eca46af7SmrgYour 'rm' program seems unable to run without file operands specified
11750eca46af7Smrgon the command line, even when the '-f' option is present.  This is contrary
11751eca46af7Smrgto the behaviour of most rm programs out there, and not conforming with
11752eca46af7Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11753eca46af7Smrg
11754eca46af7SmrgPlease tell bug-automake@gnu.org about your system, including the value
11755eca46af7Smrgof your $PATH and any error possibly output before this message.  This
11756eca46af7Smrgcan help us improve future automake versions.
1175795b296d0Smrg
11758eca46af7SmrgEND
11759eca46af7Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11760eca46af7Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11761eca46af7Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11762eca46af7Smrg    echo >&2
11763eca46af7Smrg  else
11764eca46af7Smrg    cat >&2 <<'END'
11765eca46af7SmrgAborting the configuration process, to ensure you take notice of the issue.
1176695b296d0Smrg
11767eca46af7SmrgYou can download and install GNU coreutils to get an 'rm' implementation
11768eca46af7Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
1176995b296d0Smrg
11770eca46af7SmrgIf you want to complete the configuration process using your problematic
11771eca46af7Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11772eca46af7Smrgto "yes", and re-run configure.
1177395b296d0Smrg
11774eca46af7SmrgEND
11775eca46af7Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11776eca46af7Smrg  fi
1177789b0dc75Smrgfi
1177889b0dc75Smrgdnl The trailing newline in this macro's definition is deliberate, for
1177989b0dc75Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
1178089b0dc75Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
1178189b0dc75Smrg])
1178295b296d0Smrg
11783eca46af7Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11784eca46af7Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11785eca46af7Smrgdnl mangled by Autoconf and run in a shell conditional statement.
11786eca46af7Smrgm4_define([_AC_COMPILER_EXEEXT],
11787eca46af7Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
1178814330f12Smrg
11789eca46af7Smrg# When config.status generates a header, we must update the stamp-h file.
11790eca46af7Smrg# This file resides in the same directory as the config header
11791eca46af7Smrg# that is generated.  The stamp files are numbered to have different names.
1179214330f12Smrg
11793eca46af7Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11794eca46af7Smrg# loop where config.status creates the headers, so we can generate
11795eca46af7Smrg# our stamp files there.
11796eca46af7SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11797eca46af7Smrg[# Compute $1's index in $config_headers.
11798eca46af7Smrg_am_arg=$1
11799eca46af7Smrg_am_stamp_count=1
11800eca46af7Smrgfor _am_header in $config_headers :; do
11801eca46af7Smrg  case $_am_header in
11802eca46af7Smrg    $_am_arg | $_am_arg:* )
11803eca46af7Smrg      break ;;
11804eca46af7Smrg    * )
11805eca46af7Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11806eca46af7Smrg  esac
11807eca46af7Smrgdone
11808eca46af7Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11809e6f085baSmrg
1181089b0dc75Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11811eca46af7Smrg#
11812eca46af7Smrg# This file is free software; the Free Software Foundation
11813eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11814eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1181514330f12Smrg
11816eca46af7Smrg# AM_PROG_INSTALL_SH
11817eca46af7Smrg# ------------------
11818eca46af7Smrg# Define $install_sh.
11819eca46af7SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11820eca46af7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
1182189b0dc75Smrgif test x"${install_sh+set}" != xset; then
11822eca46af7Smrg  case $am_aux_dir in
11823eca46af7Smrg  *\ * | *\	*)
11824eca46af7Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11825eca46af7Smrg  *)
11826eca46af7Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11827eca46af7Smrg  esac
1182814330f12Smrgfi
11829eca46af7SmrgAC_SUBST([install_sh])])
1183095b296d0Smrg
1183189b0dc75Smrg# Copyright (C) 2003-2014 Free Software Foundation, Inc.
11832eca46af7Smrg#
11833eca46af7Smrg# This file is free software; the Free Software Foundation
11834eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11835eca46af7Smrg# with or without modifications, as long as this notice is preserved.
11836eca46af7Smrg
11837eca46af7Smrg# Check whether the underlying file-system supports filenames
11838eca46af7Smrg# with a leading dot.  For instance MS-DOS doesn't.
11839eca46af7SmrgAC_DEFUN([AM_SET_LEADING_DOT],
11840eca46af7Smrg[rm -rf .tst 2>/dev/null
11841eca46af7Smrgmkdir .tst 2>/dev/null
11842eca46af7Smrgif test -d .tst; then
11843eca46af7Smrg  am__leading_dot=.
11844eca46af7Smrgelse
11845eca46af7Smrg  am__leading_dot=_
1184614330f12Smrgfi
11847eca46af7Smrgrmdir .tst 2>/dev/null
11848eca46af7SmrgAC_SUBST([am__leading_dot])])
1184995b296d0Smrg
11850eca46af7Smrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
11851eca46af7Smrg# From Jim Meyering
1185214330f12Smrg
1185389b0dc75Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
11854eca46af7Smrg#
11855eca46af7Smrg# This file is free software; the Free Software Foundation
11856eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11857eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1185814330f12Smrg
11859eca46af7Smrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
11860eca46af7Smrg# ----------------------------------
11861eca46af7Smrg# Control maintainer-specific portions of Makefiles.
11862eca46af7Smrg# Default is to disable them, unless 'enable' is passed literally.
11863eca46af7Smrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
11864eca46af7Smrg# can override the default with the --enable/--disable switch.
11865eca46af7SmrgAC_DEFUN([AM_MAINTAINER_MODE],
11866eca46af7Smrg[m4_case(m4_default([$1], [disable]),
11867eca46af7Smrg       [enable], [m4_define([am_maintainer_other], [disable])],
11868eca46af7Smrg       [disable], [m4_define([am_maintainer_other], [enable])],
11869eca46af7Smrg       [m4_define([am_maintainer_other], [enable])
11870eca46af7Smrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
11871eca46af7SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
11872eca46af7Smrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
11873eca46af7Smrg  AC_ARG_ENABLE([maintainer-mode],
11874eca46af7Smrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
11875eca46af7Smrg      am_maintainer_other[ make rules and dependencies not useful
11876eca46af7Smrg      (and sometimes confusing) to the casual installer])],
11877eca46af7Smrg    [USE_MAINTAINER_MODE=$enableval],
11878eca46af7Smrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
11879eca46af7Smrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
11880eca46af7Smrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
11881eca46af7Smrg  MAINT=$MAINTAINER_MODE_TRUE
11882eca46af7Smrg  AC_SUBST([MAINT])dnl
11883eca46af7Smrg]
11884eca46af7Smrg)
1188514330f12Smrg
11886eca46af7Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1188714330f12Smrg
1188889b0dc75Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11889eca46af7Smrg#
11890eca46af7Smrg# This file is free software; the Free Software Foundation
11891eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11892eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1189314330f12Smrg
11894eca46af7Smrg# AM_MAKE_INCLUDE()
11895eca46af7Smrg# -----------------
11896eca46af7Smrg# Check to see how make treats includes.
11897eca46af7SmrgAC_DEFUN([AM_MAKE_INCLUDE],
11898eca46af7Smrg[am_make=${MAKE-make}
11899eca46af7Smrgcat > confinc << 'END'
11900eca46af7Smrgam__doit:
11901eca46af7Smrg	@echo this is the am__doit target
11902eca46af7Smrg.PHONY: am__doit
11903eca46af7SmrgEND
11904eca46af7Smrg# If we don't find an include directive, just comment out the code.
11905eca46af7SmrgAC_MSG_CHECKING([for style of include used by $am_make])
11906eca46af7Smrgam__include="#"
11907eca46af7Smrgam__quote=
11908eca46af7Smrg_am_result=none
11909eca46af7Smrg# First try GNU make style include.
11910eca46af7Smrgecho "include confinc" > confmf
11911eca46af7Smrg# Ignore all kinds of additional output from 'make'.
11912eca46af7Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11913eca46af7Smrg*the\ am__doit\ target*)
11914eca46af7Smrg  am__include=include
11915eca46af7Smrg  am__quote=
11916eca46af7Smrg  _am_result=GNU
11917eca46af7Smrg  ;;
11918eca46af7Smrgesac
11919eca46af7Smrg# Now try BSD make style include.
11920eca46af7Smrgif test "$am__include" = "#"; then
11921eca46af7Smrg   echo '.include "confinc"' > confmf
11922eca46af7Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11923eca46af7Smrg   *the\ am__doit\ target*)
11924eca46af7Smrg     am__include=.include
11925eca46af7Smrg     am__quote="\""
11926eca46af7Smrg     _am_result=BSD
11927eca46af7Smrg     ;;
11928eca46af7Smrg   esac
11929eca46af7Smrgfi
11930eca46af7SmrgAC_SUBST([am__include])
11931eca46af7SmrgAC_SUBST([am__quote])
11932eca46af7SmrgAC_MSG_RESULT([$_am_result])
11933eca46af7Smrgrm -f confinc confmf
1193414330f12Smrg])
1193514330f12Smrg
11936eca46af7Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
11937eca46af7Smrg
1193889b0dc75Smrg# Copyright (C) 1997-2014 Free Software Foundation, Inc.
1193914330f12Smrg#
11940eca46af7Smrg# This file is free software; the Free Software Foundation
11941eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11942eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1194314330f12Smrg
11944eca46af7Smrg# AM_MISSING_PROG(NAME, PROGRAM)
11945eca46af7Smrg# ------------------------------
11946eca46af7SmrgAC_DEFUN([AM_MISSING_PROG],
11947eca46af7Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11948eca46af7Smrg$1=${$1-"${am_missing_run}$2"}
11949eca46af7SmrgAC_SUBST($1)])
1195014330f12Smrg
11951eca46af7Smrg# AM_MISSING_HAS_RUN
11952eca46af7Smrg# ------------------
11953eca46af7Smrg# Define MISSING if not defined so far and test if it is modern enough.
11954eca46af7Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
11955eca46af7SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11956eca46af7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11957eca46af7SmrgAC_REQUIRE_AUX_FILE([missing])dnl
11958eca46af7Smrgif test x"${MISSING+set}" != xset; then
11959eca46af7Smrg  case $am_aux_dir in
11960eca46af7Smrg  *\ * | *\	*)
11961eca46af7Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11962eca46af7Smrg  *)
11963eca46af7Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11964eca46af7Smrg  esac
11965eca46af7Smrgfi
11966eca46af7Smrg# Use eval to expand $SHELL
11967eca46af7Smrgif eval "$MISSING --is-lightweight"; then
11968eca46af7Smrg  am_missing_run="$MISSING "
1196995b296d0Smrgelse
11970eca46af7Smrg  am_missing_run=
11971eca46af7Smrg  AC_MSG_WARN(['missing' script is too old or missing])
1197295b296d0Smrgfi
11973eca46af7Smrg])
1197495b296d0Smrg
11975eca46af7Smrg# Helper functions for option handling.                     -*- Autoconf -*-
1197614330f12Smrg
1197789b0dc75Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
11978eca46af7Smrg#
11979eca46af7Smrg# This file is free software; the Free Software Foundation
11980eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
11981eca46af7Smrg# with or without modifications, as long as this notice is preserved.
119822378475aSmrg
11983eca46af7Smrg# _AM_MANGLE_OPTION(NAME)
11984eca46af7Smrg# -----------------------
11985eca46af7SmrgAC_DEFUN([_AM_MANGLE_OPTION],
11986eca46af7Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1198714330f12Smrg
11988eca46af7Smrg# _AM_SET_OPTION(NAME)
11989eca46af7Smrg# --------------------
11990eca46af7Smrg# Set option NAME.  Presently that only means defining a flag for this option.
11991eca46af7SmrgAC_DEFUN([_AM_SET_OPTION],
11992eca46af7Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1199314330f12Smrg
11994eca46af7Smrg# _AM_SET_OPTIONS(OPTIONS)
11995eca46af7Smrg# ------------------------
11996eca46af7Smrg# OPTIONS is a space-separated list of Automake options.
11997eca46af7SmrgAC_DEFUN([_AM_SET_OPTIONS],
11998eca46af7Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1199914330f12Smrg
12000eca46af7Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
12001eca46af7Smrg# -------------------------------------------
12002eca46af7Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
12003eca46af7SmrgAC_DEFUN([_AM_IF_OPTION],
12004eca46af7Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
120052378475aSmrg
1200689b0dc75Smrg# Copyright (C) 1999-2014 Free Software Foundation, Inc.
12007eca46af7Smrg#
12008eca46af7Smrg# This file is free software; the Free Software Foundation
12009eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12010eca46af7Smrg# with or without modifications, as long as this notice is preserved.
120112378475aSmrg
12012eca46af7Smrg# _AM_PROG_CC_C_O
1201314330f12Smrg# ---------------
12014eca46af7Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
12015eca46af7Smrg# to automatically call this.
12016eca46af7SmrgAC_DEFUN([_AM_PROG_CC_C_O],
12017eca46af7Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12018eca46af7SmrgAC_REQUIRE_AUX_FILE([compile])dnl
12019eca46af7SmrgAC_LANG_PUSH([C])dnl
12020eca46af7SmrgAC_CACHE_CHECK(
12021eca46af7Smrg  [whether $CC understands -c and -o together],
12022eca46af7Smrg  [am_cv_prog_cc_c_o],
12023eca46af7Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
12024eca46af7Smrg  # Make sure it works both with $CC and with simple cc.
12025eca46af7Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
12026eca46af7Smrg  # compilers refuse to overwrite an existing .o file with -o,
12027eca46af7Smrg  # though they will create one.
12028eca46af7Smrg  am_cv_prog_cc_c_o=yes
12029eca46af7Smrg  for am_i in 1 2; do
12030eca46af7Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
12031eca46af7Smrg         && test -f conftest2.$ac_objext; then
12032eca46af7Smrg      : OK
12033eca46af7Smrg    else
12034eca46af7Smrg      am_cv_prog_cc_c_o=no
12035eca46af7Smrg      break
12036eca46af7Smrg    fi
12037eca46af7Smrg  done
12038eca46af7Smrg  rm -f core conftest*
12039eca46af7Smrg  unset am_i])
12040eca46af7Smrgif test "$am_cv_prog_cc_c_o" != yes; then
12041eca46af7Smrg   # Losing compiler, so override with the script.
12042eca46af7Smrg   # FIXME: It is wrong to rewrite CC.
12043eca46af7Smrg   # But if we don't then we get into trouble of one sort or another.
12044eca46af7Smrg   # A longer-term fix would be to have automake use am__CC in this case,
12045eca46af7Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12046eca46af7Smrg   CC="$am_aux_dir/compile $CC"
12047eca46af7Smrgfi
12048eca46af7SmrgAC_LANG_POP([C])])
1204995b296d0Smrg
12050eca46af7Smrg# For backward compatibility.
12051eca46af7SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12052eca46af7Smrg
1205389b0dc75Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12054ff89ac2bSmrg#
12055eca46af7Smrg# This file is free software; the Free Software Foundation
12056eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12057eca46af7Smrg# with or without modifications, as long as this notice is preserved.
12058eca46af7Smrg
12059eca46af7Smrg# AM_RUN_LOG(COMMAND)
12060eca46af7Smrg# -------------------
12061eca46af7Smrg# Run COMMAND, save the exit status in ac_status, and log it.
12062eca46af7Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12063eca46af7SmrgAC_DEFUN([AM_RUN_LOG],
12064eca46af7Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12065eca46af7Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12066eca46af7Smrg   ac_status=$?
12067eca46af7Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12068eca46af7Smrg   (exit $ac_status); }])
12069eca46af7Smrg
12070eca46af7Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12071eca46af7Smrg
1207289b0dc75Smrg# Copyright (C) 1996-2014 Free Software Foundation, Inc.
1207314330f12Smrg#
12074eca46af7Smrg# This file is free software; the Free Software Foundation
12075eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12076eca46af7Smrg# with or without modifications, as long as this notice is preserved.
12077ff89ac2bSmrg
12078eca46af7Smrg# AM_SANITY_CHECK
12079eca46af7Smrg# ---------------
12080eca46af7SmrgAC_DEFUN([AM_SANITY_CHECK],
12081eca46af7Smrg[AC_MSG_CHECKING([whether build environment is sane])
12082eca46af7Smrg# Reject unsafe characters in $srcdir or the absolute working directory
12083eca46af7Smrg# name.  Accept space and tab only in the latter.
12084eca46af7Smrgam_lf='
12085eca46af7Smrg'
12086eca46af7Smrgcase `pwd` in
12087eca46af7Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12088eca46af7Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12089eca46af7Smrgesac
12090eca46af7Smrgcase $srcdir in
12091eca46af7Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12092eca46af7Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12093eca46af7Smrgesac
12094eca46af7Smrg
12095eca46af7Smrg# Do 'set' in a subshell so we don't clobber the current shell's
12096eca46af7Smrg# arguments.  Must try -L first in case configure is actually a
12097eca46af7Smrg# symlink; some systems play weird games with the mod time of symlinks
12098eca46af7Smrg# (eg FreeBSD returns the mod time of the symlink's containing
12099eca46af7Smrg# directory).
12100eca46af7Smrgif (
12101eca46af7Smrg   am_has_slept=no
12102eca46af7Smrg   for am_try in 1 2; do
12103eca46af7Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12104eca46af7Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12105eca46af7Smrg     if test "$[*]" = "X"; then
12106eca46af7Smrg	# -L didn't work.
12107eca46af7Smrg	set X `ls -t "$srcdir/configure" conftest.file`
12108eca46af7Smrg     fi
12109eca46af7Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12110eca46af7Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
12111eca46af7Smrg
12112eca46af7Smrg	# If neither matched, then we have a broken ls.  This can happen
12113eca46af7Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12114eca46af7Smrg	# broken ls alias from the environment.  This has actually
12115eca46af7Smrg	# happened.  Such a system could not be considered "sane".
12116eca46af7Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12117eca46af7Smrg  alias in your environment])
12118eca46af7Smrg     fi
12119eca46af7Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12120eca46af7Smrg       break
12121eca46af7Smrg     fi
12122eca46af7Smrg     # Just in case.
12123eca46af7Smrg     sleep 1
12124eca46af7Smrg     am_has_slept=yes
12125eca46af7Smrg   done
12126eca46af7Smrg   test "$[2]" = conftest.file
12127eca46af7Smrg   )
12128eca46af7Smrgthen
12129eca46af7Smrg   # Ok.
12130eca46af7Smrg   :
12131eca46af7Smrgelse
12132eca46af7Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
12133eca46af7SmrgCheck your system clock])
12134eca46af7Smrgfi
12135eca46af7SmrgAC_MSG_RESULT([yes])
12136eca46af7Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12137eca46af7Smrg# generated files are strictly newer.
12138eca46af7Smrgam_sleep_pid=
12139eca46af7Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12140eca46af7Smrg  ( sleep 1 ) &
12141eca46af7Smrg  am_sleep_pid=$!
12142eca46af7Smrgfi
12143eca46af7SmrgAC_CONFIG_COMMANDS_PRE(
12144eca46af7Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12145eca46af7Smrg   if test -n "$am_sleep_pid"; then
12146eca46af7Smrg     # Hide warnings about reused PIDs.
12147eca46af7Smrg     wait $am_sleep_pid 2>/dev/null
12148eca46af7Smrg   fi
12149eca46af7Smrg   AC_MSG_RESULT([done])])
12150eca46af7Smrgrm -f conftest.file
12151eca46af7Smrg])
12152e6f085baSmrg
1215389b0dc75Smrg# Copyright (C) 2009-2014 Free Software Foundation, Inc.
12154eca46af7Smrg#
12155eca46af7Smrg# This file is free software; the Free Software Foundation
12156eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12157eca46af7Smrg# with or without modifications, as long as this notice is preserved.
12158ff89ac2bSmrg
12159eca46af7Smrg# AM_SILENT_RULES([DEFAULT])
12160eca46af7Smrg# --------------------------
12161eca46af7Smrg# Enable less verbose build rules; with the default set to DEFAULT
12162eca46af7Smrg# ("yes" being less verbose, "no" or empty being verbose).
12163eca46af7SmrgAC_DEFUN([AM_SILENT_RULES],
12164eca46af7Smrg[AC_ARG_ENABLE([silent-rules], [dnl
12165eca46af7SmrgAS_HELP_STRING(
12166eca46af7Smrg  [--enable-silent-rules],
12167eca46af7Smrg  [less verbose build output (undo: "make V=1")])
12168eca46af7SmrgAS_HELP_STRING(
12169eca46af7Smrg  [--disable-silent-rules],
12170eca46af7Smrg  [verbose build output (undo: "make V=0")])dnl
12171eca46af7Smrg])
12172eca46af7Smrgcase $enable_silent_rules in @%:@ (((
12173eca46af7Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
12174eca46af7Smrg   no) AM_DEFAULT_VERBOSITY=1;;
12175eca46af7Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12176eca46af7Smrgesac
12177eca46af7Smrgdnl
12178eca46af7Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12179eca46af7Smrgdnl do not support nested variable expansions.
12180eca46af7Smrgdnl See automake bug#9928 and bug#10237.
12181eca46af7Smrgam_make=${MAKE-make}
12182eca46af7SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12183eca46af7Smrg   [am_cv_make_support_nested_variables],
12184eca46af7Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12185eca46af7SmrgBAR0=false
12186eca46af7SmrgBAR1=true
12187eca46af7SmrgV=1
12188eca46af7Smrgam__doit:
12189eca46af7Smrg	@$(TRUE)
12190eca46af7Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12191eca46af7Smrg  am_cv_make_support_nested_variables=yes
12192eca46af7Smrgelse
12193eca46af7Smrg  am_cv_make_support_nested_variables=no
12194eca46af7Smrgfi])
12195eca46af7Smrgif test $am_cv_make_support_nested_variables = yes; then
12196eca46af7Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12197eca46af7Smrg  AM_V='$(V)'
12198eca46af7Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12199eca46af7Smrgelse
12200eca46af7Smrg  AM_V=$AM_DEFAULT_VERBOSITY
12201eca46af7Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12202eca46af7Smrgfi
12203eca46af7SmrgAC_SUBST([AM_V])dnl
12204eca46af7SmrgAM_SUBST_NOTMAKE([AM_V])dnl
12205eca46af7SmrgAC_SUBST([AM_DEFAULT_V])dnl
12206eca46af7SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12207eca46af7SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12208eca46af7SmrgAM_BACKSLASH='\'
12209eca46af7SmrgAC_SUBST([AM_BACKSLASH])dnl
12210eca46af7Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12211eca46af7Smrg])
12212e6f085baSmrg
1221389b0dc75Smrg# Copyright (C) 2001-2014 Free Software Foundation, Inc.
12214eca46af7Smrg#
12215eca46af7Smrg# This file is free software; the Free Software Foundation
12216eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12217eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1221895b296d0Smrg
12219eca46af7Smrg# AM_PROG_INSTALL_STRIP
12220eca46af7Smrg# ---------------------
12221eca46af7Smrg# One issue with vendor 'install' (even GNU) is that you can't
12222eca46af7Smrg# specify the program used to strip binaries.  This is especially
12223eca46af7Smrg# annoying in cross-compiling environments, where the build's strip
12224eca46af7Smrg# is unlikely to handle the host's binaries.
12225eca46af7Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12226eca46af7Smrg# always use install-sh in "make install-strip", and initialize
12227eca46af7Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
12228eca46af7SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12229eca46af7Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12230eca46af7Smrg# Installed binaries are usually stripped using 'strip' when the user
12231eca46af7Smrg# run "make install-strip".  However 'strip' might not be the right
12232eca46af7Smrg# tool to use in cross-compilation environments, therefore Automake
12233eca46af7Smrg# will honor the 'STRIP' environment variable to overrule this program.
12234eca46af7Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12235eca46af7Smrgif test "$cross_compiling" != no; then
12236eca46af7Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
1223714330f12Smrgfi
12238eca46af7SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12239eca46af7SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
1224014330f12Smrg
1224189b0dc75Smrg# Copyright (C) 2006-2014 Free Software Foundation, Inc.
1224214330f12Smrg#
12243eca46af7Smrg# This file is free software; the Free Software Foundation
12244eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12245eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1224695b296d0Smrg
12247eca46af7Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
12248eca46af7Smrg# ---------------------------
12249eca46af7Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12250eca46af7Smrg# This macro is traced by Automake.
12251eca46af7SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
12252eca46af7Smrg
12253eca46af7Smrg# AM_SUBST_NOTMAKE(VARIABLE)
12254eca46af7Smrg# --------------------------
12255eca46af7Smrg# Public sister of _AM_SUBST_NOTMAKE.
12256eca46af7SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
12257eca46af7Smrg
12258eca46af7Smrg# Check how to create a tarball.                            -*- Autoconf -*-
12259eca46af7Smrg
1226089b0dc75Smrg# Copyright (C) 2004-2014 Free Software Foundation, Inc.
1226114330f12Smrg#
12262eca46af7Smrg# This file is free software; the Free Software Foundation
12263eca46af7Smrg# gives unlimited permission to copy and/or distribute it,
12264eca46af7Smrg# with or without modifications, as long as this notice is preserved.
1226595b296d0Smrg
12266eca46af7Smrg# _AM_PROG_TAR(FORMAT)
1226795b296d0Smrg# --------------------
12268eca46af7Smrg# Check how to create a tarball in format FORMAT.
12269eca46af7Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
1227095b296d0Smrg#
12271eca46af7Smrg# Substitute a variable $(am__tar) that is a command
12272eca46af7Smrg# writing to stdout a FORMAT-tarball containing the directory
12273eca46af7Smrg# $tardir.
12274eca46af7Smrg#     tardir=directory && $(am__tar) > result.tar
1227595b296d0Smrg#
12276eca46af7Smrg# Substitute a variable $(am__untar) that extract such
12277eca46af7Smrg# a tarball read from stdin.
12278eca46af7Smrg#     $(am__untar) < result.tar
1227914330f12Smrg#
12280eca46af7SmrgAC_DEFUN([_AM_PROG_TAR],
12281eca46af7Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12282eca46af7Smrg# in the wild :-(  We should find a proper way to deprecate it ...
12283eca46af7SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1228495b296d0Smrg
12285eca46af7Smrg# We'll loop over all known methods to create a tar archive until one works.
12286eca46af7Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1228795b296d0Smrg
12288eca46af7Smrgm4_if([$1], [v7],
12289eca46af7Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12290eca46af7Smrg
12291eca46af7Smrg  [m4_case([$1],
12292eca46af7Smrg    [ustar],
12293eca46af7Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12294eca46af7Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12295eca46af7Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12296eca46af7Smrg      # and bug#13588).
12297eca46af7Smrg      am_max_uid=2097151 # 2^21 - 1
12298eca46af7Smrg      am_max_gid=$am_max_uid
12299eca46af7Smrg      # The $UID and $GID variables are not portable, so we need to resort
12300eca46af7Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12301eca46af7Smrg      # below are definitely unexpected, so allow the users to see them
12302eca46af7Smrg      # (that is, avoid stderr redirection).
12303eca46af7Smrg      am_uid=`id -u || echo unknown`
12304eca46af7Smrg      am_gid=`id -g || echo unknown`
12305eca46af7Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12306eca46af7Smrg      if test $am_uid -le $am_max_uid; then
12307eca46af7Smrg         AC_MSG_RESULT([yes])
12308eca46af7Smrg      else
12309eca46af7Smrg         AC_MSG_RESULT([no])
12310eca46af7Smrg         _am_tools=none
12311eca46af7Smrg      fi
12312eca46af7Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12313eca46af7Smrg      if test $am_gid -le $am_max_gid; then
12314eca46af7Smrg         AC_MSG_RESULT([yes])
12315eca46af7Smrg      else
12316eca46af7Smrg        AC_MSG_RESULT([no])
12317eca46af7Smrg        _am_tools=none
12318eca46af7Smrg      fi],
1231995b296d0Smrg
12320eca46af7Smrg  [pax],
12321eca46af7Smrg    [],
12322eca46af7Smrg
12323eca46af7Smrg  [m4_fatal([Unknown tar format])])
12324eca46af7Smrg
12325eca46af7Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12326eca46af7Smrg
12327eca46af7Smrg  # Go ahead even if we have the value already cached.  We do so because we
12328eca46af7Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12329eca46af7Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12330eca46af7Smrg
12331eca46af7Smrg  for _am_tool in $_am_tools; do
12332eca46af7Smrg    case $_am_tool in
12333eca46af7Smrg    gnutar)
12334eca46af7Smrg      for _am_tar in tar gnutar gtar; do
12335eca46af7Smrg        AM_RUN_LOG([$_am_tar --version]) && break
12336eca46af7Smrg      done
12337eca46af7Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12338eca46af7Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12339eca46af7Smrg      am__untar="$_am_tar -xf -"
12340eca46af7Smrg      ;;
12341eca46af7Smrg    plaintar)
12342eca46af7Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12343eca46af7Smrg      # ustar tarball either.
12344eca46af7Smrg      (tar --version) >/dev/null 2>&1 && continue
12345eca46af7Smrg      am__tar='tar chf - "$$tardir"'
12346eca46af7Smrg      am__tar_='tar chf - "$tardir"'
12347eca46af7Smrg      am__untar='tar xf -'
12348eca46af7Smrg      ;;
12349eca46af7Smrg    pax)
12350eca46af7Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
12351eca46af7Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
12352eca46af7Smrg      am__untar='pax -r'
12353eca46af7Smrg      ;;
12354eca46af7Smrg    cpio)
12355eca46af7Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12356eca46af7Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12357eca46af7Smrg      am__untar='cpio -i -H $1 -d'
12358eca46af7Smrg      ;;
12359eca46af7Smrg    none)
12360eca46af7Smrg      am__tar=false
12361eca46af7Smrg      am__tar_=false
12362eca46af7Smrg      am__untar=false
12363eca46af7Smrg      ;;
12364eca46af7Smrg    esac
12365eca46af7Smrg
12366eca46af7Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
12367eca46af7Smrg    # and am__untar set.
12368eca46af7Smrg    test -n "${am_cv_prog_tar_$1}" && break
12369eca46af7Smrg
12370eca46af7Smrg    # tar/untar a dummy directory, and stop if the command works.
12371eca46af7Smrg    rm -rf conftest.dir
12372eca46af7Smrg    mkdir conftest.dir
12373eca46af7Smrg    echo GrepMe > conftest.dir/file
12374eca46af7Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12375eca46af7Smrg    rm -rf conftest.dir
12376eca46af7Smrg    if test -s conftest.tar; then
12377eca46af7Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
12378eca46af7Smrg      AM_RUN_LOG([cat conftest.dir/file])
12379eca46af7Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12380eca46af7Smrg    fi
12381eca46af7Smrg  done
12382eca46af7Smrg  rm -rf conftest.dir
12383eca46af7Smrg
12384eca46af7Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12385eca46af7Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12386eca46af7Smrg
12387eca46af7SmrgAC_SUBST([am__tar])
12388eca46af7SmrgAC_SUBST([am__untar])
12389eca46af7Smrg]) # _AM_PROG_TAR
1239095b296d0Smrg
12391