aclocal.m4 revision b3a827e2
1b3a827e2Smrg# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
2e494fffdSmrg
3b3a827e2Smrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
4e0963edeSmrg
5e0963edeSmrg# This file is free software; the Free Software Foundation
6e0963edeSmrg# gives unlimited permission to copy and/or distribute it,
7e0963edeSmrg# with or without modifications, as long as this notice is preserved.
8e0963edeSmrg
9e0963edeSmrg# This program is distributed in the hope that it will be useful,
10e0963edeSmrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11e0963edeSmrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12e0963edeSmrg# PARTICULAR PURPOSE.
13e0963edeSmrg
14e494fffdSmrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15e0963edeSmrgm4_ifndef([AC_AUTOCONF_VERSION],
16e0963edeSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17b3a827e2Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18b3a827e2Smrg[m4_warning([this file was generated for autoconf 2.69.
19e0963edeSmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20e0963edeSmrgIf you have problems, you may need to regenerate the build system entirely.
21e494fffdSmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22e0963edeSmrg
23b3a827e2Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24f05b35a2Smrg#
25b3a827e2Smrg#   Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
26b3a827e2Smrg#   Written by Gordon Matzigkeit, 1996
27b3a827e2Smrg#
28b3a827e2Smrg# This file is free software; the Free Software Foundation gives
29b3a827e2Smrg# unlimited permission to copy and/or distribute it, with or without
30b3a827e2Smrg# modifications, as long as this notice is preserved.
3149e108a1Smrg
32b3a827e2Smrgm4_define([_LT_COPYING], [dnl
33b3a827e2Smrg# Copyright (C) 2014 Free Software Foundation, Inc.
34b3a827e2Smrg# This is free software; see the source for copying conditions.  There is NO
35b3a827e2Smrg# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3649e108a1Smrg
37b3a827e2Smrg# GNU Libtool is free software; you can redistribute it and/or modify
38b3a827e2Smrg# it under the terms of the GNU General Public License as published by
39b3a827e2Smrg# the Free Software Foundation; either version 2 of of the License, or
40b3a827e2Smrg# (at your option) any later version.
41b3a827e2Smrg#
42b3a827e2Smrg# As a special exception to the GNU General Public License, if you
43b3a827e2Smrg# distribute this file as part of a program or library that is built
44b3a827e2Smrg# using GNU Libtool, you may include this file under the  same
45b3a827e2Smrg# distribution terms that you use for the rest of that program.
46b3a827e2Smrg#
47b3a827e2Smrg# GNU Libtool is distributed in the hope that it will be useful, but
48b3a827e2Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
49b3a827e2Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50b3a827e2Smrg# GNU General Public License for more details.
51b3a827e2Smrg#
52b3a827e2Smrg# You should have received a copy of the GNU General Public License
53b3a827e2Smrg# along with this program.  If not, see <http://www.gnu.org/licenses/>.
54b3a827e2Smrg])
5549e108a1Smrg
56b3a827e2Smrg# serial 58 LT_INIT
5749e108a1Smrg
5849e108a1Smrg
59b3a827e2Smrg# LT_PREREQ(VERSION)
60b3a827e2Smrg# ------------------
61b3a827e2Smrg# Complain and exit if this libtool version is less that VERSION.
62b3a827e2Smrgm4_defun([LT_PREREQ],
63b3a827e2Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
64b3a827e2Smrg       [m4_default([$3],
65b3a827e2Smrg		   [m4_fatal([Libtool version $1 or higher is required],
66b3a827e2Smrg		             63)])],
67b3a827e2Smrg       [$2])])
68f05b35a2Smrg
69e0963edeSmrg
70b3a827e2Smrg# _LT_CHECK_BUILDDIR
71b3a827e2Smrg# ------------------
72b3a827e2Smrg# Complain if the absolute build directory name contains unusual characters
73b3a827e2Smrgm4_defun([_LT_CHECK_BUILDDIR],
74b3a827e2Smrg[case `pwd` in
75b3a827e2Smrg  *\ * | *\	*)
76b3a827e2Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
77b3a827e2Smrgesac
78f05b35a2Smrg])
79f05b35a2Smrg
80f05b35a2Smrg
81b3a827e2Smrg# LT_INIT([OPTIONS])
82b3a827e2Smrg# ------------------
83b3a827e2SmrgAC_DEFUN([LT_INIT],
84b3a827e2Smrg[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
85b3a827e2SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
86b3a827e2SmrgAC_BEFORE([$0], [LT_LANG])dnl
87b3a827e2SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
88b3a827e2SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
89b3a827e2Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
90e0963edeSmrg
91b3a827e2Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
92b3a827e2Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
93b3a827e2Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
94b3a827e2Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
95b3a827e2Smrgdnl unless we require an AC_DEFUNed macro:
96b3a827e2SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
97b3a827e2SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
98b3a827e2SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
99b3a827e2SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
100b3a827e2Smrgm4_require([_LT_PROG_LTMAIN])dnl
101e0963edeSmrg
102b3a827e2Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
103f05b35a2Smrg
104b3a827e2Smrgdnl Parse OPTIONS
105b3a827e2Smrg_LT_SET_OPTIONS([$0], [$1])
106f05b35a2Smrg
107b3a827e2Smrg# This can be used to rebuild libtool when needed
108b3a827e2SmrgLIBTOOL_DEPS=$ltmain
109f05b35a2Smrg
110b3a827e2Smrg# Always use our own libtool.
111b3a827e2SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
112b3a827e2SmrgAC_SUBST(LIBTOOL)dnl
113f05b35a2Smrg
114b3a827e2Smrg_LT_SETUP
115f05b35a2Smrg
116b3a827e2Smrg# Only expand once:
117b3a827e2Smrgm4_define([LT_INIT])
118b3a827e2Smrg])# LT_INIT
119f05b35a2Smrg
120b3a827e2Smrg# Old names:
121b3a827e2SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
122b3a827e2SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
123b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
124b3a827e2Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
125b3a827e2Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
126e0963edeSmrg
127e0963edeSmrg
128b3a827e2Smrg# _LT_PREPARE_CC_BASENAME
129b3a827e2Smrg# -----------------------
130b3a827e2Smrgm4_defun([_LT_PREPARE_CC_BASENAME], [
131b3a827e2Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
132b3a827e2Smrgfunc_cc_basename ()
133b3a827e2Smrg{
134b3a827e2Smrg    for cc_temp in @S|@*""; do
135b3a827e2Smrg      case $cc_temp in
136b3a827e2Smrg        compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
137b3a827e2Smrg        distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
138b3a827e2Smrg        \-*) ;;
139b3a827e2Smrg        *) break;;
140b3a827e2Smrg      esac
14149e108a1Smrg    done
142b3a827e2Smrg    func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
143b3a827e2Smrg}
144b3a827e2Smrg])# _LT_PREPARE_CC_BASENAME
145e0963edeSmrg
146e0963edeSmrg
147b3a827e2Smrg# _LT_CC_BASENAME(CC)
148b3a827e2Smrg# -------------------
149b3a827e2Smrg# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
150b3a827e2Smrg# but that macro is also expanded into generated libtool script, which
151b3a827e2Smrg# arranges for $SED and $ECHO to be set by different means.
152b3a827e2Smrgm4_defun([_LT_CC_BASENAME],
153b3a827e2Smrg[m4_require([_LT_PREPARE_CC_BASENAME])dnl
154b3a827e2SmrgAC_REQUIRE([_LT_DECL_SED])dnl
155b3a827e2SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
156b3a827e2Smrgfunc_cc_basename $1
157b3a827e2Smrgcc_basename=$func_cc_basename_result
15849e108a1Smrg])
159e0963edeSmrg
160e0963edeSmrg
161b3a827e2Smrg# _LT_FILEUTILS_DEFAULTS
162b3a827e2Smrg# ----------------------
163b3a827e2Smrg# It is okay to use these file commands and assume they have been set
164b3a827e2Smrg# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
165b3a827e2Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
166b3a827e2Smrg[: ${CP="cp -f"}
167b3a827e2Smrg: ${MV="mv -f"}
168b3a827e2Smrg: ${RM="rm -f"}
169b3a827e2Smrg])# _LT_FILEUTILS_DEFAULTS
170e0963edeSmrg
171e0963edeSmrg
172b3a827e2Smrg# _LT_SETUP
173b3a827e2Smrg# ---------
174b3a827e2Smrgm4_defun([_LT_SETUP],
175b3a827e2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
176b3a827e2SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
177b3a827e2SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
178b3a827e2SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
179b3a827e2Smrg
180b3a827e2Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
181b3a827e2Smrgdnl
182b3a827e2Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
183b3a827e2Smrg_LT_DECL([], [host], [0])dnl
184b3a827e2Smrg_LT_DECL([], [host_os], [0])dnl
185b3a827e2Smrgdnl
186b3a827e2Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
187b3a827e2Smrg_LT_DECL([], [build], [0])dnl
188b3a827e2Smrg_LT_DECL([], [build_os], [0])dnl
189b3a827e2Smrgdnl
190b3a827e2SmrgAC_REQUIRE([AC_PROG_CC])dnl
191b3a827e2SmrgAC_REQUIRE([LT_PATH_LD])dnl
192b3a827e2SmrgAC_REQUIRE([LT_PATH_NM])dnl
193b3a827e2Smrgdnl
194b3a827e2SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
195b3a827e2Smrgtest -z "$LN_S" && LN_S="ln -s"
196b3a827e2Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
197b3a827e2Smrgdnl
198b3a827e2SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
199b3a827e2Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
200b3a827e2Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
201b3a827e2Smrgdnl
202b3a827e2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
203b3a827e2Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
204b3a827e2Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
205b3a827e2Smrgm4_require([_LT_CMD_RELOAD])dnl
206b3a827e2Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
207b3a827e2Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
208b3a827e2Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
209b3a827e2Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
210b3a827e2Smrgm4_require([_LT_WITH_SYSROOT])dnl
211b3a827e2Smrgm4_require([_LT_CMD_TRUNCATE])dnl
212b3a827e2Smrg
213b3a827e2Smrg_LT_CONFIG_LIBTOOL_INIT([
214b3a827e2Smrg# See if we are running on zsh, and set the options that allow our
215b3a827e2Smrg# commands through without removal of \ escapes INIT.
216b3a827e2Smrgif test -n "\${ZSH_VERSION+set}"; then
217b3a827e2Smrg   setopt NO_GLOB_SUBST
21849e108a1Smrgfi
21949e108a1Smrg])
220b3a827e2Smrgif test -n "${ZSH_VERSION+set}"; then
221b3a827e2Smrg   setopt NO_GLOB_SUBST
222b3a827e2Smrgfi
223e0963edeSmrg
224b3a827e2Smrg_LT_CHECK_OBJDIR
225e0963edeSmrg
226b3a827e2Smrgm4_require([_LT_TAG_COMPILER])dnl
227f05b35a2Smrg
228b3a827e2Smrgcase $host_os in
229b3a827e2Smrgaix3*)
230b3a827e2Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
231b3a827e2Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
232b3a827e2Smrg  # vanish in a puff of smoke.
233b3a827e2Smrg  if test set != "${COLLECT_NAMES+set}"; then
234b3a827e2Smrg    COLLECT_NAMES=
235b3a827e2Smrg    export COLLECT_NAMES
236b3a827e2Smrg  fi
237b3a827e2Smrg  ;;
238b3a827e2Smrgesac
239f05b35a2Smrg
240b3a827e2Smrg# Global variables:
241b3a827e2Smrgofile=libtool
242b3a827e2Smrgcan_build_shared=yes
243f05b35a2Smrg
244b3a827e2Smrg# All known linkers require a '.a' archive for static linking (except MSVC,
245b3a827e2Smrg# which needs '.lib').
246b3a827e2Smrglibext=a
247f05b35a2Smrg
248b3a827e2Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
249f05b35a2Smrg
250b3a827e2Smrgold_CC=$CC
251b3a827e2Smrgold_CFLAGS=$CFLAGS
252f05b35a2Smrg
253b3a827e2Smrg# Set sane defaults for various variables
254b3a827e2Smrgtest -z "$CC" && CC=cc
255b3a827e2Smrgtest -z "$LTCC" && LTCC=$CC
256b3a827e2Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
257b3a827e2Smrgtest -z "$LD" && LD=ld
258b3a827e2Smrgtest -z "$ac_objext" && ac_objext=o
259f05b35a2Smrg
260b3a827e2Smrg_LT_CC_BASENAME([$compiler])
261f05b35a2Smrg
262b3a827e2Smrg# Only perform the check for file, if the check method requires it
263b3a827e2Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
264b3a827e2Smrgcase $deplibs_check_method in
265b3a827e2Smrgfile_magic*)
266b3a827e2Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
267b3a827e2Smrg    _LT_PATH_MAGIC
26849e108a1Smrg  fi
269b3a827e2Smrg  ;;
270b3a827e2Smrgesac
271f05b35a2Smrg
272b3a827e2Smrg# Use C for the default configuration in the libtool script
273b3a827e2SmrgLT_SUPPORTED_TAG([CC])
274b3a827e2Smrg_LT_LANG_C_CONFIG
275b3a827e2Smrg_LT_LANG_DEFAULT_CONFIG
276b3a827e2Smrg_LT_CONFIG_COMMANDS
277b3a827e2Smrg])# _LT_SETUP
278f05b35a2Smrg
279f05b35a2Smrg
280b3a827e2Smrg# _LT_PREPARE_SED_QUOTE_VARS
281b3a827e2Smrg# --------------------------
282b3a827e2Smrg# Define a few sed substitution that help us do robust quoting.
283b3a827e2Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
284b3a827e2Smrg[# Backslashify metacharacters that are still active within
285b3a827e2Smrg# double-quoted strings.
286b3a827e2Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
287f05b35a2Smrg
288b3a827e2Smrg# Same as above, but do not quote variable references.
289b3a827e2Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
290f05b35a2Smrg
291b3a827e2Smrg# Sed substitution to delay expansion of an escaped shell variable in a
292b3a827e2Smrg# double_quote_subst'ed string.
293b3a827e2Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
294f05b35a2Smrg
295b3a827e2Smrg# Sed substitution to delay expansion of an escaped single quote.
296b3a827e2Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
297f05b35a2Smrg
298b3a827e2Smrg# Sed substitution to avoid accidental globbing in evaled expressions
299b3a827e2Smrgno_glob_subst='s/\*/\\\*/g'
300b3a827e2Smrg])
301f05b35a2Smrg
302b3a827e2Smrg# _LT_PROG_LTMAIN
303b3a827e2Smrg# ---------------
304b3a827e2Smrg# Note that this code is called both from 'configure', and 'config.status'
305b3a827e2Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
306b3a827e2Smrg# 'config.status' has no value for ac_aux_dir unless we are using Automake,
307b3a827e2Smrg# so we pass a copy along to make sure it has a sensible value anyway.
308b3a827e2Smrgm4_defun([_LT_PROG_LTMAIN],
309b3a827e2Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
310b3a827e2Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
311b3a827e2Smrgltmain=$ac_aux_dir/ltmain.sh
312b3a827e2Smrg])# _LT_PROG_LTMAIN
313f05b35a2Smrg
314f05b35a2Smrg
315f05b35a2Smrg
316b3a827e2Smrg# So that we can recreate a full libtool script including additional
317b3a827e2Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
318b3a827e2Smrg# in macros and then make a single call at the end using the 'libtool'
319b3a827e2Smrg# label.
32049e108a1Smrg
321f05b35a2Smrg
322b3a827e2Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
323b3a827e2Smrg# ----------------------------------------
324b3a827e2Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
325b3a827e2Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
326b3a827e2Smrg[m4_ifval([$1],
327b3a827e2Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
328b3a827e2Smrg                     [$1
329b3a827e2Smrg])])])
330f05b35a2Smrg
331b3a827e2Smrg# Initialize.
332b3a827e2Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
333f05b35a2Smrg
334f05b35a2Smrg
335b3a827e2Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
336f05b35a2Smrg# ------------------------------
337b3a827e2Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
338b3a827e2Smrgm4_define([_LT_CONFIG_LIBTOOL],
339b3a827e2Smrg[m4_ifval([$1],
340b3a827e2Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
341b3a827e2Smrg                     [$1
342b3a827e2Smrg])])])
343f05b35a2Smrg
344b3a827e2Smrg# Initialize.
345b3a827e2Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
346b3a827e2Smrg
347b3a827e2Smrg
348b3a827e2Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
349b3a827e2Smrg# -----------------------------------------------------
350b3a827e2Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
351b3a827e2Smrg[_LT_CONFIG_LIBTOOL([$1])
352b3a827e2Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
35349e108a1Smrg])
354f05b35a2Smrg
355f05b35a2Smrg
356b3a827e2Smrg# _LT_FORMAT_COMMENT([COMMENT])
357b3a827e2Smrg# -----------------------------
358b3a827e2Smrg# Add leading comment marks to the start of each line, and a trailing
359b3a827e2Smrg# full-stop to the whole comment if one is not present already.
360b3a827e2Smrgm4_define([_LT_FORMAT_COMMENT],
361b3a827e2Smrg[m4_ifval([$1], [
362b3a827e2Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
363b3a827e2Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
364b3a827e2Smrg)])
365f05b35a2Smrg
366f05b35a2Smrg
367f05b35a2Smrg
368f05b35a2Smrg
369f05b35a2Smrg
370b3a827e2Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
371b3a827e2Smrg# -------------------------------------------------------------------
372b3a827e2Smrg# CONFIGNAME is the name given to the value in the libtool script.
373b3a827e2Smrg# VARNAME is the (base) name used in the configure script.
374b3a827e2Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
375b3a827e2Smrg# VARNAME.  Any other value will be used directly.
376b3a827e2Smrgm4_define([_LT_DECL],
377b3a827e2Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
378b3a827e2Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
379b3a827e2Smrg	[m4_ifval([$1], [$1], [$2])])
380b3a827e2Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
381b3a827e2Smrg    m4_ifval([$4],
382b3a827e2Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
383b3a827e2Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
384b3a827e2Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
385b3a827e2Smrg])
386f05b35a2Smrg
387f05b35a2Smrg
388b3a827e2Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
389b3a827e2Smrg# --------------------------------------------------------
390b3a827e2Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
391f05b35a2Smrg
392e494fffdSmrg
393b3a827e2Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
394b3a827e2Smrg# ------------------------------------------------
395b3a827e2Smrgm4_define([lt_decl_tag_varnames],
396b3a827e2Smrg[_lt_decl_filter([tagged?], [yes], $@)])
397f05b35a2Smrg
398f05b35a2Smrg
399b3a827e2Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
400b3a827e2Smrg# ---------------------------------------------------------
401b3a827e2Smrgm4_define([_lt_decl_filter],
402b3a827e2Smrg[m4_case([$#],
403b3a827e2Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
404b3a827e2Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
405b3a827e2Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
406b3a827e2Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
407b3a827e2Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
40849e108a1Smrg])
409f05b35a2Smrg
410f05b35a2Smrg
411b3a827e2Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
412b3a827e2Smrg# --------------------------------------------------
413b3a827e2Smrgm4_define([lt_decl_quote_varnames],
414b3a827e2Smrg[_lt_decl_filter([value], [1], $@)])
415f05b35a2Smrg
416f05b35a2Smrg
417b3a827e2Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
418b3a827e2Smrg# ---------------------------------------------------
419b3a827e2Smrgm4_define([lt_decl_dquote_varnames],
420b3a827e2Smrg[_lt_decl_filter([value], [2], $@)])
421f05b35a2Smrg
422e0963edeSmrg
423b3a827e2Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
424b3a827e2Smrg# ---------------------------------------------------
425b3a827e2Smrgm4_define([lt_decl_varnames_tagged],
426b3a827e2Smrg[m4_assert([$# <= 2])dnl
427b3a827e2Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
428b3a827e2Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
429b3a827e2Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
430b3a827e2Smrgm4_define([_lt_decl_varnames_tagged],
431b3a827e2Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
432f05b35a2Smrg
433e494fffdSmrg
434b3a827e2Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
435b3a827e2Smrg# ------------------------------------------------
436b3a827e2Smrgm4_define([lt_decl_all_varnames],
437b3a827e2Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
438b3a827e2Smrg     m4_if([$2], [],
439b3a827e2Smrg	   m4_quote(lt_decl_varnames),
440b3a827e2Smrg	m4_quote(m4_shift($@))))[]dnl
441b3a827e2Smrg])
442b3a827e2Smrgm4_define([_lt_decl_all_varnames],
443b3a827e2Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
444b3a827e2Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
445b3a827e2Smrg])
446e0963edeSmrg
447e0963edeSmrg
448b3a827e2Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
449b3a827e2Smrg# ------------------------------------
450b3a827e2Smrg# Quote a variable value, and forward it to 'config.status' so that its
451b3a827e2Smrg# declaration there will have the same value as in 'configure'.  VARNAME
452b3a827e2Smrg# must have a single quote delimited value for this to work.
453b3a827e2Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
454b3a827e2Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
455e0963edeSmrg
456e0963edeSmrg
457b3a827e2Smrg# _LT_CONFIG_STATUS_DECLARATIONS
458b3a827e2Smrg# ------------------------------
459b3a827e2Smrg# We delimit libtool config variables with single quotes, so when
460b3a827e2Smrg# we write them to config.status, we have to be sure to quote all
461b3a827e2Smrg# embedded single quotes properly.  In configure, this macro expands
462b3a827e2Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
463b3a827e2Smrg#
464b3a827e2Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
465b3a827e2Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
466b3a827e2Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
467b3a827e2Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
46849e108a1Smrg
469e0963edeSmrg
470b3a827e2Smrg# _LT_LIBTOOL_TAGS
471b3a827e2Smrg# ----------------
472b3a827e2Smrg# Output comment and list of tags supported by the script
473b3a827e2Smrgm4_defun([_LT_LIBTOOL_TAGS],
474b3a827e2Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
475b3a827e2Smrgavailable_tags='_LT_TAGS'dnl
476b3a827e2Smrg])
477e494fffdSmrg
47867ab2ff2Smrg
479b3a827e2Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
480b3a827e2Smrg# -----------------------------------
481b3a827e2Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
482b3a827e2Smrg# expand to a commented shell variable setting:
483b3a827e2Smrg#
484b3a827e2Smrg#    # Some comment about what VAR is for.
485b3a827e2Smrg#    visible_name=$lt_internal_name
486b3a827e2Smrgm4_define([_LT_LIBTOOL_DECLARE],
487b3a827e2Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
488b3a827e2Smrg					   [description])))[]dnl
489b3a827e2Smrgm4_pushdef([_libtool_name],
490b3a827e2Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
491b3a827e2Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
492b3a827e2Smrg    [0], [_libtool_name=[$]$1],
493b3a827e2Smrg    [1], [_libtool_name=$lt_[]$1],
494b3a827e2Smrg    [2], [_libtool_name=$lt_[]$1],
495b3a827e2Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
496b3a827e2Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
497b3a827e2Smrg])
49867ab2ff2Smrg
499e0963edeSmrg
500b3a827e2Smrg# _LT_LIBTOOL_CONFIG_VARS
501b3a827e2Smrg# -----------------------
502b3a827e2Smrg# Produce commented declarations of non-tagged libtool config variables
503b3a827e2Smrg# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
504b3a827e2Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
505b3a827e2Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
506b3a827e2Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
507b3a827e2Smrg[m4_foreach([_lt_var],
508b3a827e2Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
509b3a827e2Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
510e0963edeSmrg
511f05b35a2Smrg
512b3a827e2Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
513b3a827e2Smrg# -------------------------
514b3a827e2Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
515b3a827e2Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
516b3a827e2Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
517f05b35a2Smrg
518e0963edeSmrg
519b3a827e2Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
520b3a827e2Smrg# ------------------------------
521b3a827e2Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
522e0963edeSmrg
523e0963edeSmrg
524b3a827e2Smrg# _LT_CONFIG_COMMANDS
525b3a827e2Smrg# -------------------
526b3a827e2Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
527b3a827e2Smrg# variables for single and double quote escaping we saved from calls
528b3a827e2Smrg# to _LT_DECL, we can put quote escaped variables declarations
529b3a827e2Smrg# into 'config.status', and then the shell code to quote escape them in
530b3a827e2Smrg# for loops in 'config.status'.  Finally, any additional code accumulated
531b3a827e2Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
532b3a827e2Smrgm4_defun([_LT_CONFIG_COMMANDS],
533b3a827e2Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
534b3a827e2Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
535b3a827e2Smrg	dnl instead of duplicating it all over again into config.status,
536b3a827e2Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
537b3a827e2Smrg	dnl needs to know what name is stored there:
538b3a827e2Smrg        [AC_CONFIG_COMMANDS([libtool],
539b3a827e2Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
540b3a827e2Smrg    dnl If the libtool generation code is destined for config.status,
541b3a827e2Smrg    dnl expand the accumulated commands and init code now:
542b3a827e2Smrg    [AC_CONFIG_COMMANDS([libtool],
543b3a827e2Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
544b3a827e2Smrg])#_LT_CONFIG_COMMANDS
545e0963edeSmrg
546e0963edeSmrg
547b3a827e2Smrg# Initialize.
548b3a827e2Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
549b3a827e2Smrg[
550e0963edeSmrg
551b3a827e2Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
552b3a827e2Smrg# if CDPATH is set.
553b3a827e2Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
554e0963edeSmrg
555b3a827e2Smrgsed_quote_subst='$sed_quote_subst'
556b3a827e2Smrgdouble_quote_subst='$double_quote_subst'
557b3a827e2Smrgdelay_variable_subst='$delay_variable_subst'
558b3a827e2Smrg_LT_CONFIG_STATUS_DECLARATIONS
559b3a827e2SmrgLTCC='$LTCC'
560b3a827e2SmrgLTCFLAGS='$LTCFLAGS'
561b3a827e2Smrgcompiler='$compiler_DEFAULT'
562e0963edeSmrg
563b3a827e2Smrg# A function that is used when there is no print builtin or printf.
564b3a827e2Smrgfunc_fallback_echo ()
565b3a827e2Smrg{
566b3a827e2Smrg  eval 'cat <<_LTECHO_EOF
567b3a827e2Smrg\$[]1
568b3a827e2Smrg_LTECHO_EOF'
569b3a827e2Smrg}
570e0963edeSmrg
571b3a827e2Smrg# Quote evaled strings.
572b3a827e2Smrgfor var in lt_decl_all_varnames([[ \
573b3a827e2Smrg]], lt_decl_quote_varnames); do
574b3a827e2Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
575b3a827e2Smrg    *[[\\\\\\\`\\"\\\$]]*)
576b3a827e2Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
577b3a827e2Smrg      ;;
578b3a827e2Smrg    *)
579b3a827e2Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
580b3a827e2Smrg      ;;
581b3a827e2Smrg    esac
58267ab2ff2Smrgdone
583e0963edeSmrg
584b3a827e2Smrg# Double-quote double-evaled strings.
585b3a827e2Smrgfor var in lt_decl_all_varnames([[ \
586b3a827e2Smrg]], lt_decl_dquote_varnames); do
587b3a827e2Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
588b3a827e2Smrg    *[[\\\\\\\`\\"\\\$]]*)
589b3a827e2Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
590b3a827e2Smrg      ;;
591b3a827e2Smrg    *)
592b3a827e2Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
593b3a827e2Smrg      ;;
594b3a827e2Smrg    esac
595b3a827e2Smrgdone
596e0963edeSmrg
597b3a827e2Smrg_LT_OUTPUT_LIBTOOL_INIT
598b3a827e2Smrg])
599e0963edeSmrg
600b3a827e2Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
601b3a827e2Smrg# ------------------------------------
602b3a827e2Smrg# Generate a child script FILE with all initialization necessary to
603b3a827e2Smrg# reuse the environment learned by the parent script, and make the
604b3a827e2Smrg# file executable.  If COMMENT is supplied, it is inserted after the
605b3a827e2Smrg# '#!' sequence but before initialization text begins.  After this
606b3a827e2Smrg# macro, additional text can be appended to FILE to form the body of
607b3a827e2Smrg# the child script.  The macro ends with non-zero status if the
608b3a827e2Smrg# file could not be fully written (such as if the disk is full).
609b3a827e2Smrgm4_ifdef([AS_INIT_GENERATED],
610b3a827e2Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
611b3a827e2Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
612b3a827e2Smrg[m4_require([AS_PREPARE])]dnl
613b3a827e2Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
614b3a827e2Smrg[lt_write_fail=0
615b3a827e2Smrgcat >$1 <<_ASEOF || lt_write_fail=1
616b3a827e2Smrg#! $SHELL
617b3a827e2Smrg# Generated by $as_me.
618b3a827e2Smrg$2
619b3a827e2SmrgSHELL=\${CONFIG_SHELL-$SHELL}
620b3a827e2Smrgexport SHELL
621b3a827e2Smrg_ASEOF
622b3a827e2Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
623b3a827e2SmrgAS_SHELL_SANITIZE
624b3a827e2Smrg_AS_PREPARE
625b3a827e2Smrgexec AS_MESSAGE_FD>&1
626b3a827e2Smrg_ASEOF
627b3a827e2Smrgtest 0 = "$lt_write_fail" && chmod +x $1[]dnl
628b3a827e2Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
629e0963edeSmrg
630b3a827e2Smrg# LT_OUTPUT
63167ab2ff2Smrg# ---------
632b3a827e2Smrg# This macro allows early generation of the libtool script (before
633b3a827e2Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
634b3a827e2Smrg# tests.
635b3a827e2SmrgAC_DEFUN([LT_OUTPUT],
636b3a827e2Smrg[: ${CONFIG_LT=./config.lt}
637b3a827e2SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
638b3a827e2Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
639b3a827e2Smrg[# Run this file to recreate a libtool stub with the current configuration.])
64049e108a1Smrg
641b3a827e2Smrgcat >>"$CONFIG_LT" <<\_LTEOF
642b3a827e2Smrglt_cl_silent=false
643b3a827e2Smrgexec AS_MESSAGE_LOG_FD>>config.log
644b3a827e2Smrg{
645b3a827e2Smrg  echo
646b3a827e2Smrg  AS_BOX([Running $as_me.])
647b3a827e2Smrg} >&AS_MESSAGE_LOG_FD
64867ab2ff2Smrg
649b3a827e2Smrglt_cl_help="\
650b3a827e2Smrg'$as_me' creates a local libtool stub from the current configuration,
651b3a827e2Smrgfor use in further configure time tests before the real libtool is
652b3a827e2Smrggenerated.
653f05b35a2Smrg
654b3a827e2SmrgUsage: $[0] [[OPTIONS]]
655f05b35a2Smrg
656b3a827e2Smrg  -h, --help      print this help, then exit
657b3a827e2Smrg  -V, --version   print version number, then exit
658b3a827e2Smrg  -q, --quiet     do not print progress messages
659b3a827e2Smrg  -d, --debug     don't remove temporary files
66049e108a1Smrg
661b3a827e2SmrgReport bugs to <bug-libtool@gnu.org>."
66249e108a1Smrg
663b3a827e2Smrglt_cl_version="\
664b3a827e2Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
665b3a827e2Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
666b3a827e2Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
667f05b35a2Smrg
668b3a827e2SmrgCopyright (C) 2011 Free Software Foundation, Inc.
669b3a827e2SmrgThis config.lt script is free software; the Free Software Foundation
670b3a827e2Smrggives unlimited permision to copy, distribute and modify it."
67149e108a1Smrg
672b3a827e2Smrgwhile test 0 != $[#]
673b3a827e2Smrgdo
674b3a827e2Smrg  case $[1] in
675b3a827e2Smrg    --version | --v* | -V )
676b3a827e2Smrg      echo "$lt_cl_version"; exit 0 ;;
677b3a827e2Smrg    --help | --h* | -h )
678b3a827e2Smrg      echo "$lt_cl_help"; exit 0 ;;
679b3a827e2Smrg    --debug | --d* | -d )
680b3a827e2Smrg      debug=: ;;
681b3a827e2Smrg    --quiet | --q* | --silent | --s* | -q )
682b3a827e2Smrg      lt_cl_silent=: ;;
68349e108a1Smrg
684b3a827e2Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
685b3a827e2SmrgTry '$[0] --help' for more information.]) ;;
68649e108a1Smrg
687b3a827e2Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
688b3a827e2SmrgTry '$[0] --help' for more information.]) ;;
689b3a827e2Smrg  esac
690b3a827e2Smrg  shift
691b3a827e2Smrgdone
692f05b35a2Smrg
693b3a827e2Smrgif $lt_cl_silent; then
694b3a827e2Smrg  exec AS_MESSAGE_FD>/dev/null
695b3a827e2Smrgfi
696b3a827e2Smrg_LTEOF
69749e108a1Smrg
698b3a827e2Smrgcat >>"$CONFIG_LT" <<_LTEOF
699b3a827e2Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
700b3a827e2Smrg_LTEOF
701e0963edeSmrg
702b3a827e2Smrgcat >>"$CONFIG_LT" <<\_LTEOF
703b3a827e2SmrgAC_MSG_NOTICE([creating $ofile])
704b3a827e2Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
705b3a827e2SmrgAS_EXIT(0)
706b3a827e2Smrg_LTEOF
707b3a827e2Smrgchmod +x "$CONFIG_LT"
70849e108a1Smrg
709b3a827e2Smrg# configure is writing to config.log, but config.lt does its own redirection,
710b3a827e2Smrg# appending to config.log, which fails on DOS, as config.log is still kept
711b3a827e2Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
712b3a827e2Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
713b3a827e2Smrglt_cl_success=:
714b3a827e2Smrgtest yes = "$silent" &&
715b3a827e2Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
716b3a827e2Smrgexec AS_MESSAGE_LOG_FD>/dev/null
717b3a827e2Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
718b3a827e2Smrgexec AS_MESSAGE_LOG_FD>>config.log
719b3a827e2Smrg$lt_cl_success || AS_EXIT(1)
720b3a827e2Smrg])# LT_OUTPUT
72149e108a1Smrg
722f05b35a2Smrg
723b3a827e2Smrg# _LT_CONFIG(TAG)
72467ab2ff2Smrg# ---------------
725b3a827e2Smrg# If TAG is the built-in tag, create an initial libtool script with a
726b3a827e2Smrg# default configuration from the untagged config vars.  Otherwise add code
727b3a827e2Smrg# to config.status for appending the configuration named by TAG from the
728b3a827e2Smrg# matching tagged config vars.
729b3a827e2Smrgm4_defun([_LT_CONFIG],
730b3a827e2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
731b3a827e2Smrg_LT_CONFIG_SAVE_COMMANDS([
732b3a827e2Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
733b3a827e2Smrg  m4_if(_LT_TAG, [C], [
734b3a827e2Smrg    # See if we are running on zsh, and set the options that allow our
735b3a827e2Smrg    # commands through without removal of \ escapes.
736b3a827e2Smrg    if test -n "${ZSH_VERSION+set}"; then
737b3a827e2Smrg      setopt NO_GLOB_SUBST
738b3a827e2Smrg    fi
739e0963edeSmrg
740b3a827e2Smrg    cfgfile=${ofile}T
741b3a827e2Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
742b3a827e2Smrg    $RM "$cfgfile"
743e0963edeSmrg
744b3a827e2Smrg    cat <<_LT_EOF >> "$cfgfile"
745b3a827e2Smrg#! $SHELL
746b3a827e2Smrg# Generated automatically by $as_me ($PACKAGE) $VERSION
747b3a827e2Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
748b3a827e2Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
749e0963edeSmrg
750b3a827e2Smrg# Provide generalized library-building support services.
751b3a827e2Smrg# Written by Gordon Matzigkeit, 1996
752e0963edeSmrg
753b3a827e2Smrg_LT_COPYING
754b3a827e2Smrg_LT_LIBTOOL_TAGS
755e0963edeSmrg
756b3a827e2Smrg# Configured defaults for sys_lib_dlsearch_path munging.
757b3a827e2Smrg: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
758e0963edeSmrg
759b3a827e2Smrg# ### BEGIN LIBTOOL CONFIG
760b3a827e2Smrg_LT_LIBTOOL_CONFIG_VARS
761b3a827e2Smrg_LT_LIBTOOL_TAG_VARS
762b3a827e2Smrg# ### END LIBTOOL CONFIG
763e0963edeSmrg
764b3a827e2Smrg_LT_EOF
765f05b35a2Smrg
766b3a827e2Smrg    cat <<'_LT_EOF' >> "$cfgfile"
767e0963edeSmrg
768b3a827e2Smrg# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
769e0963edeSmrg
770b3a827e2Smrg_LT_PREPARE_MUNGE_PATH_LIST
771b3a827e2Smrg_LT_PREPARE_CC_BASENAME
772e0963edeSmrg
773b3a827e2Smrg# ### END FUNCTIONS SHARED WITH CONFIGURE
774e0963edeSmrg
775b3a827e2Smrg_LT_EOF
776e0963edeSmrg
777b3a827e2Smrg  case $host_os in
778b3a827e2Smrg  aix3*)
779b3a827e2Smrg    cat <<\_LT_EOF >> "$cfgfile"
780b3a827e2Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
781b3a827e2Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
782b3a827e2Smrg# vanish in a puff of smoke.
783b3a827e2Smrgif test set != "${COLLECT_NAMES+set}"; then
784b3a827e2Smrg  COLLECT_NAMES=
785b3a827e2Smrg  export COLLECT_NAMES
786b3a827e2Smrgfi
787b3a827e2Smrg_LT_EOF
788b3a827e2Smrg    ;;
789b3a827e2Smrg  esac
790e0963edeSmrg
791b3a827e2Smrg  _LT_PROG_LTMAIN
792e0963edeSmrg
793b3a827e2Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
794b3a827e2Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
795b3a827e2Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
796b3a827e2Smrg  # is reportedly fixed, but why not run on old versions too?
797b3a827e2Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
798b3a827e2Smrg     || (rm -f "$cfgfile"; exit 1)
799e0963edeSmrg
800b3a827e2Smrg   mv -f "$cfgfile" "$ofile" ||
801b3a827e2Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
802b3a827e2Smrg  chmod +x "$ofile"
803b3a827e2Smrg],
804b3a827e2Smrg[cat <<_LT_EOF >> "$ofile"
805e0963edeSmrg
806b3a827e2Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
807b3a827e2Smrgdnl in a comment (ie after a #).
808b3a827e2Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
809b3a827e2Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
810b3a827e2Smrg# ### END LIBTOOL TAG CONFIG: $1
811b3a827e2Smrg_LT_EOF
812b3a827e2Smrg])dnl /m4_if
813b3a827e2Smrg],
814b3a827e2Smrg[m4_if([$1], [], [
815b3a827e2Smrg    PACKAGE='$PACKAGE'
816b3a827e2Smrg    VERSION='$VERSION'
817b3a827e2Smrg    RM='$RM'
818b3a827e2Smrg    ofile='$ofile'], [])
819b3a827e2Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
820b3a827e2Smrg])# _LT_CONFIG
821e0963edeSmrg
822e0963edeSmrg
823b3a827e2Smrg# LT_SUPPORTED_TAG(TAG)
824b3a827e2Smrg# ---------------------
825b3a827e2Smrg# Trace this macro to discover what tags are supported by the libtool
826b3a827e2Smrg# --tag option, using:
827b3a827e2Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
828b3a827e2SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
829e0963edeSmrg
830e0963edeSmrg
831b3a827e2Smrg# C support is built-in for now
832b3a827e2Smrgm4_define([_LT_LANG_C_enabled], [])
833b3a827e2Smrgm4_define([_LT_TAGS], [])
834e0963edeSmrg
835e0963edeSmrg
836b3a827e2Smrg# LT_LANG(LANG)
837b3a827e2Smrg# -------------
838b3a827e2Smrg# Enable libtool support for the given language if not already enabled.
839b3a827e2SmrgAC_DEFUN([LT_LANG],
840b3a827e2Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
841b3a827e2Smrgm4_case([$1],
842b3a827e2Smrg  [C],			[_LT_LANG(C)],
843b3a827e2Smrg  [C++],		[_LT_LANG(CXX)],
844b3a827e2Smrg  [Go],			[_LT_LANG(GO)],
845b3a827e2Smrg  [Java],		[_LT_LANG(GCJ)],
846b3a827e2Smrg  [Fortran 77],		[_LT_LANG(F77)],
847b3a827e2Smrg  [Fortran],		[_LT_LANG(FC)],
848b3a827e2Smrg  [Windows Resource],	[_LT_LANG(RC)],
849b3a827e2Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
850b3a827e2Smrg    [_LT_LANG($1)],
851b3a827e2Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
852b3a827e2Smrg])# LT_LANG
853e0963edeSmrg
854e0963edeSmrg
855b3a827e2Smrg# _LT_LANG(LANGNAME)
856b3a827e2Smrg# ------------------
857b3a827e2Smrgm4_defun([_LT_LANG],
858b3a827e2Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
859b3a827e2Smrg  [LT_SUPPORTED_TAG([$1])dnl
860b3a827e2Smrg  m4_append([_LT_TAGS], [$1 ])dnl
861b3a827e2Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
862b3a827e2Smrg  _LT_LANG_$1_CONFIG($1)])dnl
863b3a827e2Smrg])# _LT_LANG
864e0963edeSmrg
865e0963edeSmrg
866b3a827e2Smrgm4_ifndef([AC_PROG_GO], [
867b3a827e2Smrg# NOTE: This macro has been submitted for inclusion into   #
868b3a827e2Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
869b3a827e2Smrg#  a released version of Autoconf we should remove this    #
870b3a827e2Smrg#  macro and use it instead.                               #
871b3a827e2Smrgm4_defun([AC_PROG_GO],
872b3a827e2Smrg[AC_LANG_PUSH(Go)dnl
873b3a827e2SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
874b3a827e2SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
875b3a827e2Smrg_AC_ARG_VAR_LDFLAGS()dnl
876b3a827e2SmrgAC_CHECK_TOOL(GOC, gccgo)
877b3a827e2Smrgif test -z "$GOC"; then
878b3a827e2Smrg  if test -n "$ac_tool_prefix"; then
879b3a827e2Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
880b3a827e2Smrg  fi
881b3a827e2Smrgfi
882b3a827e2Smrgif test -z "$GOC"; then
883b3a827e2Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
884b3a827e2Smrgfi
885b3a827e2Smrg])#m4_defun
886b3a827e2Smrg])#m4_ifndef
887e0963edeSmrg
888e0963edeSmrg
889b3a827e2Smrg# _LT_LANG_DEFAULT_CONFIG
890b3a827e2Smrg# -----------------------
891b3a827e2Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
892b3a827e2Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
893b3a827e2Smrg  [LT_LANG(CXX)],
894b3a827e2Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
895e0963edeSmrg
896b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
897b3a827e2Smrg  [LT_LANG(F77)],
898b3a827e2Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
899e0963edeSmrg
900b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
901b3a827e2Smrg  [LT_LANG(FC)],
902b3a827e2Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
903f05b35a2Smrg
904b3a827e2Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
905b3a827e2Smrgdnl pulling things in needlessly.
906b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
907b3a827e2Smrg  [LT_LANG(GCJ)],
908b3a827e2Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
909b3a827e2Smrg    [LT_LANG(GCJ)],
910b3a827e2Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
911b3a827e2Smrg      [LT_LANG(GCJ)],
912b3a827e2Smrg      [m4_ifdef([AC_PROG_GCJ],
913b3a827e2Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
914b3a827e2Smrg       m4_ifdef([A][M_PROG_GCJ],
915b3a827e2Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
916b3a827e2Smrg       m4_ifdef([LT_PROG_GCJ],
917b3a827e2Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
918e0963edeSmrg
919b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
920b3a827e2Smrg  [LT_LANG(GO)],
921b3a827e2Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
922e0963edeSmrg
923b3a827e2SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
924b3a827e2Smrg  [LT_LANG(RC)],
925b3a827e2Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
926b3a827e2Smrg])# _LT_LANG_DEFAULT_CONFIG
927e0963edeSmrg
928b3a827e2Smrg# Obsolete macros:
929b3a827e2SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
930b3a827e2SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
931b3a827e2SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
932b3a827e2SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
933b3a827e2SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
934b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
935b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
936b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
937b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
938b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
939b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
940e0963edeSmrg
94149e108a1Smrg
942b3a827e2Smrg# _LT_TAG_COMPILER
94367ab2ff2Smrg# ----------------
944b3a827e2Smrgm4_defun([_LT_TAG_COMPILER],
945b3a827e2Smrg[AC_REQUIRE([AC_PROG_CC])dnl
946e0963edeSmrg
947b3a827e2Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
948b3a827e2Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
949b3a827e2Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
950b3a827e2Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
951e0963edeSmrg
952b3a827e2Smrg# If no C compiler was specified, use CC.
953b3a827e2SmrgLTCC=${LTCC-"$CC"}
954e0963edeSmrg
955b3a827e2Smrg# If no C compiler flags were specified, use CFLAGS.
956b3a827e2SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
957e0963edeSmrg
958b3a827e2Smrg# Allow CC to be a program name with arguments.
959b3a827e2Smrgcompiler=$CC
960b3a827e2Smrg])# _LT_TAG_COMPILER
961e0963edeSmrg
962e0963edeSmrg
963b3a827e2Smrg# _LT_COMPILER_BOILERPLATE
964b3a827e2Smrg# ------------------------
965b3a827e2Smrg# Check for compiler boilerplate output or warnings with
966b3a827e2Smrg# the simple compiler test code.
967b3a827e2Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
968b3a827e2Smrg[m4_require([_LT_DECL_SED])dnl
969b3a827e2Smrgac_outfile=conftest.$ac_objext
970b3a827e2Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
971b3a827e2Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
972b3a827e2Smrg_lt_compiler_boilerplate=`cat conftest.err`
973b3a827e2Smrg$RM conftest*
974b3a827e2Smrg])# _LT_COMPILER_BOILERPLATE
975e0963edeSmrg
976e0963edeSmrg
977b3a827e2Smrg# _LT_LINKER_BOILERPLATE
978b3a827e2Smrg# ----------------------
979b3a827e2Smrg# Check for linker boilerplate output or warnings with
980b3a827e2Smrg# the simple link test code.
981b3a827e2Smrgm4_defun([_LT_LINKER_BOILERPLATE],
982b3a827e2Smrg[m4_require([_LT_DECL_SED])dnl
983b3a827e2Smrgac_outfile=conftest.$ac_objext
984b3a827e2Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
985b3a827e2Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
986b3a827e2Smrg_lt_linker_boilerplate=`cat conftest.err`
987b3a827e2Smrg$RM -r conftest*
988b3a827e2Smrg])# _LT_LINKER_BOILERPLATE
989e0963edeSmrg
990b3a827e2Smrg# _LT_REQUIRED_DARWIN_CHECKS
991b3a827e2Smrg# -------------------------
992b3a827e2Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
993b3a827e2Smrg  case $host_os in
994b3a827e2Smrg    rhapsody* | darwin*)
995b3a827e2Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
996b3a827e2Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
997b3a827e2Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
998b3a827e2Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
999b3a827e2Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
1000b3a827e2Smrg    _LT_DECL([], [DSYMUTIL], [1],
1001b3a827e2Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
1002b3a827e2Smrg    _LT_DECL([], [NMEDIT], [1],
1003b3a827e2Smrg      [Tool to change global to local symbols on Mac OS X])
1004b3a827e2Smrg    _LT_DECL([], [LIPO], [1],
1005b3a827e2Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
1006b3a827e2Smrg    _LT_DECL([], [OTOOL], [1],
1007b3a827e2Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
1008b3a827e2Smrg    _LT_DECL([], [OTOOL64], [1],
1009b3a827e2Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
1010e0963edeSmrg
1011b3a827e2Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
1012b3a827e2Smrg      [lt_cv_apple_cc_single_mod=no
1013b3a827e2Smrg      if test -z "$LT_MULTI_MODULE"; then
1014b3a827e2Smrg	# By default we will add the -single_module flag. You can override
1015b3a827e2Smrg	# by either setting the environment variable LT_MULTI_MODULE
1016b3a827e2Smrg	# non-empty at configure time, or by adding -multi_module to the
1017b3a827e2Smrg	# link flags.
1018b3a827e2Smrg	rm -rf libconftest.dylib*
1019b3a827e2Smrg	echo "int foo(void){return 1;}" > conftest.c
1020b3a827e2Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1021b3a827e2Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1022b3a827e2Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1023b3a827e2Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1024b3a827e2Smrg        _lt_result=$?
1025b3a827e2Smrg	# If there is a non-empty error log, and "single_module"
1026b3a827e2Smrg	# appears in it, assume the flag caused a linker warning
1027b3a827e2Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1028b3a827e2Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1029b3a827e2Smrg	# Otherwise, if the output was created with a 0 exit code from
1030b3a827e2Smrg	# the compiler, it worked.
1031b3a827e2Smrg	elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
1032b3a827e2Smrg	  lt_cv_apple_cc_single_mod=yes
1033b3a827e2Smrg	else
1034b3a827e2Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1035b3a827e2Smrg	fi
1036b3a827e2Smrg	rm -rf libconftest.dylib*
1037b3a827e2Smrg	rm -f conftest.*
1038b3a827e2Smrg      fi])
1039e0963edeSmrg
1040b3a827e2Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1041b3a827e2Smrg      [lt_cv_ld_exported_symbols_list],
1042b3a827e2Smrg      [lt_cv_ld_exported_symbols_list=no
1043b3a827e2Smrg      save_LDFLAGS=$LDFLAGS
1044b3a827e2Smrg      echo "_main" > conftest.sym
1045b3a827e2Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1046b3a827e2Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1047b3a827e2Smrg	[lt_cv_ld_exported_symbols_list=yes],
1048b3a827e2Smrg	[lt_cv_ld_exported_symbols_list=no])
1049b3a827e2Smrg	LDFLAGS=$save_LDFLAGS
1050b3a827e2Smrg    ])
105149e108a1Smrg
1052b3a827e2Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1053b3a827e2Smrg      [lt_cv_ld_force_load=no
1054b3a827e2Smrg      cat > conftest.c << _LT_EOF
1055b3a827e2Smrgint forced_loaded() { return 2;}
1056b3a827e2Smrg_LT_EOF
1057b3a827e2Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1058b3a827e2Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1059b3a827e2Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1060b3a827e2Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1061b3a827e2Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1062b3a827e2Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1063b3a827e2Smrg      cat > conftest.c << _LT_EOF
1064b3a827e2Smrgint main() { return 0;}
1065b3a827e2Smrg_LT_EOF
1066b3a827e2Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1067b3a827e2Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1068b3a827e2Smrg      _lt_result=$?
1069b3a827e2Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1070b3a827e2Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1071b3a827e2Smrg      elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
1072b3a827e2Smrg	lt_cv_ld_force_load=yes
1073b3a827e2Smrg      else
1074b3a827e2Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1075b3a827e2Smrg      fi
1076b3a827e2Smrg        rm -f conftest.err libconftest.a conftest conftest.c
1077b3a827e2Smrg        rm -rf conftest.dSYM
1078b3a827e2Smrg    ])
1079b3a827e2Smrg    case $host_os in
1080b3a827e2Smrg    rhapsody* | darwin1.[[012]])
1081b3a827e2Smrg      _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
1082b3a827e2Smrg    darwin1.*)
1083b3a827e2Smrg      _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1084b3a827e2Smrg    darwin*) # darwin 5.x on
1085b3a827e2Smrg      # if running on 10.5 or later, the deployment target defaults
1086b3a827e2Smrg      # to the OS version, if on x86, and 10.4, the deployment
1087b3a827e2Smrg      # target defaults to 10.4. Don't you love it?
1088b3a827e2Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1089b3a827e2Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1090b3a827e2Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1091b3a827e2Smrg	10.[[012]][[,.]]*)
1092b3a827e2Smrg	  _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
1093b3a827e2Smrg	10.*)
1094b3a827e2Smrg	  _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
1095b3a827e2Smrg      esac
1096b3a827e2Smrg    ;;
1097b3a827e2Smrg  esac
1098b3a827e2Smrg    if test yes = "$lt_cv_apple_cc_single_mod"; then
1099b3a827e2Smrg      _lt_dar_single_mod='$single_module'
1100b3a827e2Smrg    fi
1101b3a827e2Smrg    if test yes = "$lt_cv_ld_exported_symbols_list"; then
1102b3a827e2Smrg      _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
1103b3a827e2Smrg    else
1104b3a827e2Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
1105b3a827e2Smrg    fi
1106b3a827e2Smrg    if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
1107b3a827e2Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1108b3a827e2Smrg    else
1109b3a827e2Smrg      _lt_dsymutil=
1110b3a827e2Smrg    fi
1111b3a827e2Smrg    ;;
1112b3a827e2Smrg  esac
1113b3a827e2Smrg])
1114e0963edeSmrg
1115e0963edeSmrg
1116b3a827e2Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1117b3a827e2Smrg# ---------------------------------
1118b3a827e2Smrg# Checks for linker and compiler features on darwin
1119b3a827e2Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1120b3a827e2Smrg[
1121b3a827e2Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1122b3a827e2Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1123b3a827e2Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1124b3a827e2Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1125b3a827e2Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1126b3a827e2Smrg  if test yes = "$lt_cv_ld_force_load"; then
1127b3a827e2Smrg    _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\"`'
1128b3a827e2Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1129b3a827e2Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1130b3a827e2Smrg  else
1131b3a827e2Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1132b3a827e2Smrg  fi
1133b3a827e2Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1134b3a827e2Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
1135b3a827e2Smrg  case $cc_basename in
1136b3a827e2Smrg     ifort*|nagfor*) _lt_dar_can_shared=yes ;;
1137b3a827e2Smrg     *) _lt_dar_can_shared=$GCC ;;
1138b3a827e2Smrg  esac
1139b3a827e2Smrg  if test yes = "$_lt_dar_can_shared"; then
1140b3a827e2Smrg    output_verbose_link_cmd=func_echo_all
1141b3a827e2Smrg    _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"
1142b3a827e2Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
1143b3a827e2Smrg    _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"
1144b3a827e2Smrg    _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"
1145b3a827e2Smrg    m4_if([$1], [CXX],
1146b3a827e2Smrg[   if test yes != "$lt_cv_apple_cc_single_mod"; then
1147b3a827e2Smrg      _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"
1148b3a827e2Smrg      _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"
1149b3a827e2Smrg    fi
1150b3a827e2Smrg],[])
1151b3a827e2Smrg  else
1152b3a827e2Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1153b3a827e2Smrg  fi
115467ab2ff2Smrg])
1155e0963edeSmrg
1156b3a827e2Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1157b3a827e2Smrg# ----------------------------------
1158b3a827e2Smrg# Links a minimal program and checks the executable
1159b3a827e2Smrg# for the system default hardcoded library path. In most cases,
1160b3a827e2Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1161b3a827e2Smrg# the location of the communication and MPI libs are included too.
1162b3a827e2Smrg# If we don't find anything, use the default library path according
1163b3a827e2Smrg# to the aix ld manual.
1164b3a827e2Smrg# Store the results from the different compilers for each TAGNAME.
1165b3a827e2Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1166b3a827e2Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1167b3a827e2Smrg[m4_require([_LT_DECL_SED])dnl
1168b3a827e2Smrgif test set = "${lt_cv_aix_libpath+set}"; then
1169b3a827e2Smrg  aix_libpath=$lt_cv_aix_libpath
1170b3a827e2Smrgelse
1171b3a827e2Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1172b3a827e2Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1173b3a827e2Smrg  lt_aix_libpath_sed='[
1174b3a827e2Smrg      /Import File Strings/,/^$/ {
1175b3a827e2Smrg	  /^0/ {
1176b3a827e2Smrg	      s/^0  *\([^ ]*\) *$/\1/
1177b3a827e2Smrg	      p
1178b3a827e2Smrg	  }
1179b3a827e2Smrg      }]'
1180b3a827e2Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1181b3a827e2Smrg  # Check for a 64-bit object if we didn't find anything.
1182b3a827e2Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1183b3a827e2Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1184b3a827e2Smrg  fi],[])
1185b3a827e2Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1186b3a827e2Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
1187b3a827e2Smrg  fi
1188b3a827e2Smrg  ])
1189b3a827e2Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1190b3a827e2Smrgfi
1191b3a827e2Smrg])# _LT_SYS_MODULE_PATH_AIX
1192e0963edeSmrg
1193e0963edeSmrg
1194b3a827e2Smrg# _LT_SHELL_INIT(ARG)
1195b3a827e2Smrg# -------------------
1196b3a827e2Smrgm4_define([_LT_SHELL_INIT],
1197b3a827e2Smrg[m4_divert_text([M4SH-INIT], [$1
1198b3a827e2Smrg])])# _LT_SHELL_INIT
1199e0963edeSmrg
1200e0963edeSmrg
1201e0963edeSmrg
1202b3a827e2Smrg# _LT_PROG_ECHO_BACKSLASH
1203b3a827e2Smrg# -----------------------
1204b3a827e2Smrg# Find how we can fake an echo command that does not interpret backslash.
1205b3a827e2Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1206b3a827e2Smrg# of the generated configure script that will find a shell with a builtin
1207b3a827e2Smrg# printf (that we can use as an echo command).
1208b3a827e2Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1209b3a827e2Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1210b3a827e2SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1211b3a827e2SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1212e0963edeSmrg
1213b3a827e2SmrgAC_MSG_CHECKING([how to print strings])
1214b3a827e2Smrg# Test print first, because it will be a builtin if present.
1215b3a827e2Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1216b3a827e2Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1217b3a827e2Smrg  ECHO='print -r --'
1218b3a827e2Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1219b3a827e2Smrg  ECHO='printf %s\n'
1220b3a827e2Smrgelse
1221b3a827e2Smrg  # Use this function as a fallback that always works.
1222b3a827e2Smrg  func_fallback_echo ()
1223b3a827e2Smrg  {
1224b3a827e2Smrg    eval 'cat <<_LTECHO_EOF
1225b3a827e2Smrg$[]1
1226b3a827e2Smrg_LTECHO_EOF'
1227b3a827e2Smrg  }
1228b3a827e2Smrg  ECHO='func_fallback_echo'
1229b3a827e2Smrgfi
1230e0963edeSmrg
1231b3a827e2Smrg# func_echo_all arg...
1232b3a827e2Smrg# Invoke $ECHO with all args, space-separated.
1233b3a827e2Smrgfunc_echo_all ()
1234b3a827e2Smrg{
1235b3a827e2Smrg    $ECHO "$*"
1236b3a827e2Smrg}
1237e0963edeSmrg
1238b3a827e2Smrgcase $ECHO in
1239b3a827e2Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1240b3a827e2Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1241b3a827e2Smrg  *) AC_MSG_RESULT([cat]) ;;
1242b3a827e2Smrgesac
1243e0963edeSmrg
1244b3a827e2Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1245b3a827e2Smrg[_AS_DETECT_SUGGESTED([
1246b3a827e2Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1247b3a827e2Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1248b3a827e2Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1249b3a827e2Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1250b3a827e2Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1251b3a827e2Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1252b3a827e2Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
125349e108a1Smrg
1254b3a827e2Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1255b3a827e2Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1256b3a827e2Smrg])# _LT_PROG_ECHO_BACKSLASH
1257e0963edeSmrg
1258f05b35a2Smrg
1259b3a827e2Smrg# _LT_WITH_SYSROOT
1260b3a827e2Smrg# ----------------
1261b3a827e2SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1262b3a827e2Smrg[AC_MSG_CHECKING([for sysroot])
1263b3a827e2SmrgAC_ARG_WITH([sysroot],
1264b3a827e2Smrg[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
1265b3a827e2Smrg  [Search for dependent libraries within DIR (or the compiler's sysroot
1266b3a827e2Smrg   if not specified).])],
1267b3a827e2Smrg[], [with_sysroot=no])
1268f05b35a2Smrg
1269b3a827e2Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1270b3a827e2Smrgdnl in case the user passed a directory name.
1271b3a827e2Smrglt_sysroot=
1272b3a827e2Smrgcase $with_sysroot in #(
1273b3a827e2Smrg yes)
1274b3a827e2Smrg   if test yes = "$GCC"; then
1275b3a827e2Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1276b3a827e2Smrg   fi
1277b3a827e2Smrg   ;; #(
1278b3a827e2Smrg /*)
1279b3a827e2Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1280b3a827e2Smrg   ;; #(
1281b3a827e2Smrg no|'')
1282b3a827e2Smrg   ;; #(
1283b3a827e2Smrg *)
1284b3a827e2Smrg   AC_MSG_RESULT([$with_sysroot])
1285b3a827e2Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1286b3a827e2Smrg   ;;
1287b3a827e2Smrgesac
1288e0963edeSmrg
1289b3a827e2Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1290b3a827e2Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1291b3a827e2Smrg[dependent libraries, and where our libraries should be installed.])])
1292e0963edeSmrg
1293b3a827e2Smrg# _LT_ENABLE_LOCK
129449e108a1Smrg# ---------------
1295b3a827e2Smrgm4_defun([_LT_ENABLE_LOCK],
1296b3a827e2Smrg[AC_ARG_ENABLE([libtool-lock],
1297b3a827e2Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1298b3a827e2Smrg    [avoid locking (might break parallel builds)])])
1299b3a827e2Smrgtest no = "$enable_libtool_lock" || enable_libtool_lock=yes
1300e0963edeSmrg
1301b3a827e2Smrg# Some flags need to be propagated to the compiler or linker for good
1302b3a827e2Smrg# libtool support.
1303b3a827e2Smrgcase $host in
1304b3a827e2Smrgia64-*-hpux*)
1305b3a827e2Smrg  # Find out what ABI is being produced by ac_compile, and set mode
1306b3a827e2Smrg  # options accordingly.
1307b3a827e2Smrg  echo 'int i;' > conftest.$ac_ext
1308b3a827e2Smrg  if AC_TRY_EVAL(ac_compile); then
1309b3a827e2Smrg    case `/usr/bin/file conftest.$ac_objext` in
1310b3a827e2Smrg      *ELF-32*)
1311b3a827e2Smrg	HPUX_IA64_MODE=32
1312b3a827e2Smrg	;;
1313b3a827e2Smrg      *ELF-64*)
1314b3a827e2Smrg	HPUX_IA64_MODE=64
1315b3a827e2Smrg	;;
1316b3a827e2Smrg    esac
1317b3a827e2Smrg  fi
1318b3a827e2Smrg  rm -rf conftest*
1319b3a827e2Smrg  ;;
1320b3a827e2Smrg*-*-irix6*)
1321b3a827e2Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1322b3a827e2Smrg  # options accordingly.
1323b3a827e2Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1324b3a827e2Smrg  if AC_TRY_EVAL(ac_compile); then
1325b3a827e2Smrg    if test yes = "$lt_cv_prog_gnu_ld"; then
1326b3a827e2Smrg      case `/usr/bin/file conftest.$ac_objext` in
1327b3a827e2Smrg	*32-bit*)
1328b3a827e2Smrg	  LD="${LD-ld} -melf32bsmip"
1329b3a827e2Smrg	  ;;
1330b3a827e2Smrg	*N32*)
1331b3a827e2Smrg	  LD="${LD-ld} -melf32bmipn32"
1332b3a827e2Smrg	  ;;
1333b3a827e2Smrg	*64-bit*)
1334b3a827e2Smrg	  LD="${LD-ld} -melf64bmip"
1335b3a827e2Smrg	;;
1336b3a827e2Smrg      esac
1337b3a827e2Smrg    else
1338b3a827e2Smrg      case `/usr/bin/file conftest.$ac_objext` in
1339b3a827e2Smrg	*32-bit*)
1340b3a827e2Smrg	  LD="${LD-ld} -32"
1341b3a827e2Smrg	  ;;
1342b3a827e2Smrg	*N32*)
1343b3a827e2Smrg	  LD="${LD-ld} -n32"
1344b3a827e2Smrg	  ;;
1345b3a827e2Smrg	*64-bit*)
1346b3a827e2Smrg	  LD="${LD-ld} -64"
1347b3a827e2Smrg	  ;;
1348b3a827e2Smrg      esac
1349b3a827e2Smrg    fi
1350b3a827e2Smrg  fi
1351b3a827e2Smrg  rm -rf conftest*
1352b3a827e2Smrg  ;;
1353f05b35a2Smrg
1354b3a827e2Smrgmips64*-*linux*)
1355b3a827e2Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1356b3a827e2Smrg  # options accordingly.
1357b3a827e2Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1358b3a827e2Smrg  if AC_TRY_EVAL(ac_compile); then
1359b3a827e2Smrg    emul=elf
1360b3a827e2Smrg    case `/usr/bin/file conftest.$ac_objext` in
1361b3a827e2Smrg      *32-bit*)
1362b3a827e2Smrg	emul="${emul}32"
1363b3a827e2Smrg	;;
1364b3a827e2Smrg      *64-bit*)
1365b3a827e2Smrg	emul="${emul}64"
1366b3a827e2Smrg	;;
1367b3a827e2Smrg    esac
1368b3a827e2Smrg    case `/usr/bin/file conftest.$ac_objext` in
1369b3a827e2Smrg      *MSB*)
1370b3a827e2Smrg	emul="${emul}btsmip"
1371b3a827e2Smrg	;;
1372b3a827e2Smrg      *LSB*)
1373b3a827e2Smrg	emul="${emul}ltsmip"
1374b3a827e2Smrg	;;
1375b3a827e2Smrg    esac
1376b3a827e2Smrg    case `/usr/bin/file conftest.$ac_objext` in
1377b3a827e2Smrg      *N32*)
1378b3a827e2Smrg	emul="${emul}n32"
1379b3a827e2Smrg	;;
1380b3a827e2Smrg    esac
1381b3a827e2Smrg    LD="${LD-ld} -m $emul"
1382b3a827e2Smrg  fi
1383b3a827e2Smrg  rm -rf conftest*
1384b3a827e2Smrg  ;;
1385e0963edeSmrg
1386b3a827e2Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
1387b3a827e2Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
1388b3a827e2Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1389b3a827e2Smrg  # options accordingly.  Note that the listed cases only cover the
1390b3a827e2Smrg  # situations where additional linker options are needed (such as when
1391b3a827e2Smrg  # doing 32-bit compilation for a host where ld defaults to 64-bit, or
1392b3a827e2Smrg  # vice versa); the common cases where no linker options are needed do
1393b3a827e2Smrg  # not appear in the list.
1394b3a827e2Smrg  echo 'int i;' > conftest.$ac_ext
1395b3a827e2Smrg  if AC_TRY_EVAL(ac_compile); then
1396b3a827e2Smrg    case `/usr/bin/file conftest.o` in
1397b3a827e2Smrg      *32-bit*)
1398b3a827e2Smrg	case $host in
1399b3a827e2Smrg	  x86_64-*kfreebsd*-gnu)
1400b3a827e2Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1401b3a827e2Smrg	    ;;
1402b3a827e2Smrg	  x86_64-*linux*)
1403b3a827e2Smrg	    case `/usr/bin/file conftest.o` in
1404b3a827e2Smrg	      *x86-64*)
1405b3a827e2Smrg		LD="${LD-ld} -m elf32_x86_64"
1406b3a827e2Smrg		;;
1407b3a827e2Smrg	      *)
1408b3a827e2Smrg		LD="${LD-ld} -m elf_i386"
1409b3a827e2Smrg		;;
1410b3a827e2Smrg	    esac
1411b3a827e2Smrg	    ;;
1412b3a827e2Smrg	  powerpc64le-*linux*)
1413b3a827e2Smrg	    LD="${LD-ld} -m elf32lppclinux"
1414b3a827e2Smrg	    ;;
1415b3a827e2Smrg	  powerpc64-*linux*)
1416b3a827e2Smrg	    LD="${LD-ld} -m elf32ppclinux"
1417b3a827e2Smrg	    ;;
1418b3a827e2Smrg	  s390x-*linux*)
1419b3a827e2Smrg	    LD="${LD-ld} -m elf_s390"
1420b3a827e2Smrg	    ;;
1421b3a827e2Smrg	  sparc64-*linux*)
1422b3a827e2Smrg	    LD="${LD-ld} -m elf32_sparc"
1423b3a827e2Smrg	    ;;
1424b3a827e2Smrg	esac
1425b3a827e2Smrg	;;
1426b3a827e2Smrg      *64-bit*)
1427b3a827e2Smrg	case $host in
1428b3a827e2Smrg	  x86_64-*kfreebsd*-gnu)
1429b3a827e2Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1430b3a827e2Smrg	    ;;
1431b3a827e2Smrg	  x86_64-*linux*)
1432b3a827e2Smrg	    LD="${LD-ld} -m elf_x86_64"
1433b3a827e2Smrg	    ;;
1434b3a827e2Smrg	  powerpcle-*linux*)
1435b3a827e2Smrg	    LD="${LD-ld} -m elf64lppc"
1436b3a827e2Smrg	    ;;
1437b3a827e2Smrg	  powerpc-*linux*)
1438b3a827e2Smrg	    LD="${LD-ld} -m elf64ppc"
1439b3a827e2Smrg	    ;;
1440b3a827e2Smrg	  s390*-*linux*|s390*-*tpf*)
1441b3a827e2Smrg	    LD="${LD-ld} -m elf64_s390"
1442b3a827e2Smrg	    ;;
1443b3a827e2Smrg	  sparc*-*linux*)
1444b3a827e2Smrg	    LD="${LD-ld} -m elf64_sparc"
1445b3a827e2Smrg	    ;;
1446b3a827e2Smrg	esac
1447b3a827e2Smrg	;;
1448b3a827e2Smrg    esac
1449b3a827e2Smrg  fi
1450b3a827e2Smrg  rm -rf conftest*
1451b3a827e2Smrg  ;;
1452e0963edeSmrg
1453b3a827e2Smrg*-*-sco3.2v5*)
1454b3a827e2Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
1455b3a827e2Smrg  SAVE_CFLAGS=$CFLAGS
1456b3a827e2Smrg  CFLAGS="$CFLAGS -belf"
1457b3a827e2Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
1458b3a827e2Smrg    [AC_LANG_PUSH(C)
1459b3a827e2Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
1460b3a827e2Smrg     AC_LANG_POP])
1461b3a827e2Smrg  if test yes != "$lt_cv_cc_needs_belf"; then
1462b3a827e2Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
1463b3a827e2Smrg    CFLAGS=$SAVE_CFLAGS
1464b3a827e2Smrg  fi
1465b3a827e2Smrg  ;;
1466b3a827e2Smrg*-*solaris*)
1467b3a827e2Smrg  # Find out what ABI is being produced by ac_compile, and set linker
1468b3a827e2Smrg  # options accordingly.
1469b3a827e2Smrg  echo 'int i;' > conftest.$ac_ext
1470b3a827e2Smrg  if AC_TRY_EVAL(ac_compile); then
1471b3a827e2Smrg    case `/usr/bin/file conftest.o` in
1472b3a827e2Smrg    *64-bit*)
1473b3a827e2Smrg      case $lt_cv_prog_gnu_ld in
1474b3a827e2Smrg      yes*)
1475b3a827e2Smrg        case $host in
1476b3a827e2Smrg        i?86-*-solaris*|x86_64-*-solaris*)
1477b3a827e2Smrg          LD="${LD-ld} -m elf_x86_64"
1478b3a827e2Smrg          ;;
1479b3a827e2Smrg        sparc*-*-solaris*)
1480b3a827e2Smrg          LD="${LD-ld} -m elf64_sparc"
1481b3a827e2Smrg          ;;
1482b3a827e2Smrg        esac
1483b3a827e2Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1484b3a827e2Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1485b3a827e2Smrg          LD=${LD-ld}_sol2
1486b3a827e2Smrg        fi
1487b3a827e2Smrg        ;;
1488b3a827e2Smrg      *)
1489b3a827e2Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1490b3a827e2Smrg	  LD="${LD-ld} -64"
1491b3a827e2Smrg	fi
1492b3a827e2Smrg	;;
1493b3a827e2Smrg      esac
1494b3a827e2Smrg      ;;
1495b3a827e2Smrg    esac
1496b3a827e2Smrg  fi
1497b3a827e2Smrg  rm -rf conftest*
1498b3a827e2Smrg  ;;
1499b3a827e2Smrgesac
1500e0963edeSmrg
1501b3a827e2Smrgneed_locks=$enable_libtool_lock
1502b3a827e2Smrg])# _LT_ENABLE_LOCK
1503e0963edeSmrg
1504f05b35a2Smrg
1505b3a827e2Smrg# _LT_PROG_AR
1506b3a827e2Smrg# -----------
1507b3a827e2Smrgm4_defun([_LT_PROG_AR],
1508b3a827e2Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1509b3a827e2Smrg: ${AR=ar}
1510b3a827e2Smrg: ${AR_FLAGS=cru}
1511b3a827e2Smrg_LT_DECL([], [AR], [1], [The archiver])
1512b3a827e2Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1513b3a827e2Smrg
1514b3a827e2SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1515b3a827e2Smrg  [lt_cv_ar_at_file=no
1516b3a827e2Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1517b3a827e2Smrg     [echo conftest.$ac_objext > conftest.lst
1518b3a827e2Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1519b3a827e2Smrg      AC_TRY_EVAL([lt_ar_try])
1520b3a827e2Smrg      if test 0 -eq "$ac_status"; then
1521b3a827e2Smrg	# Ensure the archiver fails upon bogus file names.
1522b3a827e2Smrg	rm -f conftest.$ac_objext libconftest.a
1523b3a827e2Smrg	AC_TRY_EVAL([lt_ar_try])
1524b3a827e2Smrg	if test 0 -ne "$ac_status"; then
1525b3a827e2Smrg          lt_cv_ar_at_file=@
1526b3a827e2Smrg        fi
1527b3a827e2Smrg      fi
1528b3a827e2Smrg      rm -f conftest.* libconftest.a
1529b3a827e2Smrg     ])
1530b3a827e2Smrg  ])
1531f05b35a2Smrg
1532b3a827e2Smrgif test no = "$lt_cv_ar_at_file"; then
1533b3a827e2Smrg  archiver_list_spec=
1534b3a827e2Smrgelse
1535b3a827e2Smrg  archiver_list_spec=$lt_cv_ar_at_file
1536b3a827e2Smrgfi
1537b3a827e2Smrg_LT_DECL([], [archiver_list_spec], [1],
1538b3a827e2Smrg  [How to feed a file listing to the archiver])
1539b3a827e2Smrg])# _LT_PROG_AR
1540e0963edeSmrg
1541e0963edeSmrg
1542b3a827e2Smrg# _LT_CMD_OLD_ARCHIVE
1543b3a827e2Smrg# -------------------
1544b3a827e2Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1545b3a827e2Smrg[_LT_PROG_AR
1546e0963edeSmrg
1547b3a827e2SmrgAC_CHECK_TOOL(STRIP, strip, :)
1548b3a827e2Smrgtest -z "$STRIP" && STRIP=:
1549b3a827e2Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1550f05b35a2Smrg
1551b3a827e2SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1552b3a827e2Smrgtest -z "$RANLIB" && RANLIB=:
1553b3a827e2Smrg_LT_DECL([], [RANLIB], [1],
1554b3a827e2Smrg    [Commands used to install an old-style archive])
1555e0963edeSmrg
1556b3a827e2Smrg# Determine commands to create old-style static archives.
1557b3a827e2Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1558b3a827e2Smrgold_postinstall_cmds='chmod 644 $oldlib'
1559b3a827e2Smrgold_postuninstall_cmds=
1560e0963edeSmrg
1561b3a827e2Smrgif test -n "$RANLIB"; then
1562b3a827e2Smrg  case $host_os in
1563b3a827e2Smrg  bitrig* | openbsd*)
1564b3a827e2Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1565b3a827e2Smrg    ;;
1566b3a827e2Smrg  *)
1567b3a827e2Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1568b3a827e2Smrg    ;;
1569b3a827e2Smrg  esac
1570b3a827e2Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1571e494fffdSmrgfi
1572e494fffdSmrg
1573b3a827e2Smrgcase $host_os in
1574b3a827e2Smrg  darwin*)
1575b3a827e2Smrg    lock_old_archive_extraction=yes ;;
1576b3a827e2Smrg  *)
1577b3a827e2Smrg    lock_old_archive_extraction=no ;;
1578b3a827e2Smrgesac
1579b3a827e2Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1580b3a827e2Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1581b3a827e2Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1582b3a827e2Smrg    [Commands used to build an old-style archive])
1583b3a827e2Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1584b3a827e2Smrg    [Whether to use a lock for old archive extraction])
1585b3a827e2Smrg])# _LT_CMD_OLD_ARCHIVE
1586e494fffdSmrg
1587f05b35a2Smrg
1588b3a827e2Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1589b3a827e2Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
1590b3a827e2Smrg# ----------------------------------------------------------------
1591b3a827e2Smrg# Check whether the given compiler option works
1592b3a827e2SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1593b3a827e2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1594b3a827e2Smrgm4_require([_LT_DECL_SED])dnl
1595b3a827e2SmrgAC_CACHE_CHECK([$1], [$2],
1596b3a827e2Smrg  [$2=no
1597b3a827e2Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1598b3a827e2Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
1599b3a827e2Smrg   lt_compiler_flag="$3"  ## exclude from sc_useless_quotes_in_assignment
1600b3a827e2Smrg   # Insert the option either (1) after the last *FLAGS variable, or
1601b3a827e2Smrg   # (2) before a word containing "conftest.", or (3) at the end.
1602b3a827e2Smrg   # Note that $ac_compile itself does not contain backslashes and begins
1603b3a827e2Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
1604b3a827e2Smrg   # The option is referenced via a variable to avoid confusing sed.
1605b3a827e2Smrg   lt_compile=`echo "$ac_compile" | $SED \
1606b3a827e2Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1607b3a827e2Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
1608b3a827e2Smrg   -e 's:$: $lt_compiler_flag:'`
1609b3a827e2Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
1610b3a827e2Smrg   (eval "$lt_compile" 2>conftest.err)
1611b3a827e2Smrg   ac_status=$?
1612b3a827e2Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1613b3a827e2Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
1614b3a827e2Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
1615b3a827e2Smrg     # The compiler can only warn and ignore the option if not recognized
1616b3a827e2Smrg     # So say no if there are warnings other than the usual output.
1617b3a827e2Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
1618b3a827e2Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1619b3a827e2Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
1620b3a827e2Smrg       $2=yes
1621b3a827e2Smrg     fi
1622b3a827e2Smrg   fi
1623b3a827e2Smrg   $RM conftest*
1624b3a827e2Smrg])
1625f05b35a2Smrg
1626b3a827e2Smrgif test yes = "[$]$2"; then
1627b3a827e2Smrg    m4_if([$5], , :, [$5])
1628b3a827e2Smrgelse
1629b3a827e2Smrg    m4_if([$6], , :, [$6])
1630b3a827e2Smrgfi
1631b3a827e2Smrg])# _LT_COMPILER_OPTION
1632e0963edeSmrg
1633b3a827e2Smrg# Old name:
1634b3a827e2SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1635b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
1636b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
1637e0963edeSmrg
1638e494fffdSmrg
1639b3a827e2Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1640b3a827e2Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1641b3a827e2Smrg# ----------------------------------------------------
1642b3a827e2Smrg# Check whether the given linker option works
1643b3a827e2SmrgAC_DEFUN([_LT_LINKER_OPTION],
1644b3a827e2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1645b3a827e2Smrgm4_require([_LT_DECL_SED])dnl
1646b3a827e2SmrgAC_CACHE_CHECK([$1], [$2],
1647b3a827e2Smrg  [$2=no
1648b3a827e2Smrg   save_LDFLAGS=$LDFLAGS
1649b3a827e2Smrg   LDFLAGS="$LDFLAGS $3"
1650b3a827e2Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
1651b3a827e2Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
1652b3a827e2Smrg     # The linker can only warn and ignore the option if not recognized
1653b3a827e2Smrg     # So say no if there are warnings
1654b3a827e2Smrg     if test -s conftest.err; then
1655b3a827e2Smrg       # Append any errors to the config.log.
1656b3a827e2Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1657b3a827e2Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
1658b3a827e2Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
1659b3a827e2Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
1660b3a827e2Smrg         $2=yes
1661b3a827e2Smrg       fi
1662b3a827e2Smrg     else
1663b3a827e2Smrg       $2=yes
1664b3a827e2Smrg     fi
1665b3a827e2Smrg   fi
1666b3a827e2Smrg   $RM -r conftest*
1667b3a827e2Smrg   LDFLAGS=$save_LDFLAGS
1668b3a827e2Smrg])
1669f05b35a2Smrg
1670b3a827e2Smrgif test yes = "[$]$2"; then
1671b3a827e2Smrg    m4_if([$4], , :, [$4])
1672b3a827e2Smrgelse
1673b3a827e2Smrg    m4_if([$5], , :, [$5])
1674b3a827e2Smrgfi
1675b3a827e2Smrg])# _LT_LINKER_OPTION
1676e0963edeSmrg
1677b3a827e2Smrg# Old name:
1678b3a827e2SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1679b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
1680b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1681e0963edeSmrg
1682e0963edeSmrg
1683b3a827e2Smrg# LT_CMD_MAX_LEN
1684b3a827e2Smrg#---------------
1685b3a827e2SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1686b3a827e2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1687b3a827e2Smrg# find the maximum length of command line arguments
1688b3a827e2SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
1689b3a827e2SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
1690b3a827e2Smrg  i=0
1691b3a827e2Smrg  teststring=ABCD
1692e0963edeSmrg
1693b3a827e2Smrg  case $build_os in
1694b3a827e2Smrg  msdosdjgpp*)
1695b3a827e2Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
1696b3a827e2Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
1697b3a827e2Smrg    # during glob expansion).  Even if it were fixed, the result of this
1698b3a827e2Smrg    # check would be larger than it should be.
1699b3a827e2Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
1700b3a827e2Smrg    ;;
1701e0963edeSmrg
1702b3a827e2Smrg  gnu*)
1703b3a827e2Smrg    # Under GNU Hurd, this test is not required because there is
1704b3a827e2Smrg    # no limit to the length of command line arguments.
1705b3a827e2Smrg    # Libtool will interpret -1 as no limit whatsoever
1706b3a827e2Smrg    lt_cv_sys_max_cmd_len=-1;
1707b3a827e2Smrg    ;;
1708e0963edeSmrg
1709b3a827e2Smrg  cygwin* | mingw* | cegcc*)
1710b3a827e2Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
1711b3a827e2Smrg    # about 5 minutes as the teststring grows exponentially.
1712b3a827e2Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
1713b3a827e2Smrg    # you end up with a "frozen" computer, even though with patience
1714b3a827e2Smrg    # the test eventually succeeds (with a max line length of 256k).
1715b3a827e2Smrg    # Instead, let's just punt: use the minimum linelength reported by
1716b3a827e2Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
1717b3a827e2Smrg    lt_cv_sys_max_cmd_len=8192;
1718b3a827e2Smrg    ;;
1719e494fffdSmrg
1720b3a827e2Smrg  mint*)
1721b3a827e2Smrg    # On MiNT this can take a long time and run out of memory.
1722b3a827e2Smrg    lt_cv_sys_max_cmd_len=8192;
1723b3a827e2Smrg    ;;
1724e494fffdSmrg
1725b3a827e2Smrg  amigaos*)
1726b3a827e2Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
1727b3a827e2Smrg    # So we just punt and use a minimum line length of 8192.
1728b3a827e2Smrg    lt_cv_sys_max_cmd_len=8192;
172967ab2ff2Smrg    ;;
1730b3a827e2Smrg
1731b3a827e2Smrg  bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
1732b3a827e2Smrg    # This has been around since 386BSD, at least.  Likely further.
1733b3a827e2Smrg    if test -x /sbin/sysctl; then
1734b3a827e2Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
1735b3a827e2Smrg    elif test -x /usr/sbin/sysctl; then
1736b3a827e2Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
173767ab2ff2Smrg    else
1738b3a827e2Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
173967ab2ff2Smrg    fi
1740b3a827e2Smrg    # And add a safety zone
1741b3a827e2Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1742b3a827e2Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
174367ab2ff2Smrg    ;;
1744e0963edeSmrg
1745b3a827e2Smrg  interix*)
1746b3a827e2Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
1747b3a827e2Smrg    lt_cv_sys_max_cmd_len=196608
1748b3a827e2Smrg    ;;
1749e0963edeSmrg
1750b3a827e2Smrg  os2*)
1751b3a827e2Smrg    # The test takes a long time on OS/2.
1752b3a827e2Smrg    lt_cv_sys_max_cmd_len=8192
1753b3a827e2Smrg    ;;
1754b3a827e2Smrg
1755b3a827e2Smrg  osf*)
1756b3a827e2Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
1757b3a827e2Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
1758b3a827e2Smrg    # nice to cause kernel panics so lets avoid the loop below.
1759b3a827e2Smrg    # First set a reasonable default.
1760b3a827e2Smrg    lt_cv_sys_max_cmd_len=16384
1761b3a827e2Smrg    #
1762b3a827e2Smrg    if test -x /sbin/sysconfig; then
1763b3a827e2Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
1764b3a827e2Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
1765b3a827e2Smrg      esac
176667ab2ff2Smrg    fi
1767b3a827e2Smrg    ;;
1768b3a827e2Smrg  sco3.2v5*)
1769b3a827e2Smrg    lt_cv_sys_max_cmd_len=102400
1770b3a827e2Smrg    ;;
1771b3a827e2Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
1772b3a827e2Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
1773b3a827e2Smrg    if test -n "$kargmax"; then
1774b3a827e2Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
1775b3a827e2Smrg    else
1776b3a827e2Smrg      lt_cv_sys_max_cmd_len=32768
1777b3a827e2Smrg    fi
1778b3a827e2Smrg    ;;
1779b3a827e2Smrg  *)
1780b3a827e2Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1781b3a827e2Smrg    if test -n "$lt_cv_sys_max_cmd_len" && \
1782b3a827e2Smrg       test undefined != "$lt_cv_sys_max_cmd_len"; then
1783b3a827e2Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1784b3a827e2Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1785b3a827e2Smrg    else
1786b3a827e2Smrg      # Make teststring a little bigger before we do anything with it.
1787b3a827e2Smrg      # a 1K string should be a reasonable start.
1788b3a827e2Smrg      for i in 1 2 3 4 5 6 7 8; do
1789b3a827e2Smrg        teststring=$teststring$teststring
1790b3a827e2Smrg      done
1791b3a827e2Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1792b3a827e2Smrg      # If test is not a shell built-in, we'll probably end up computing a
1793b3a827e2Smrg      # maximum length that is only half of the actual maximum length, but
1794b3a827e2Smrg      # we can't tell.
1795b3a827e2Smrg      while { test X`env echo "$teststring$teststring" 2>/dev/null` \
1796b3a827e2Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1797b3a827e2Smrg	      test 17 != "$i" # 1/2 MB should be enough
1798b3a827e2Smrg      do
1799b3a827e2Smrg        i=`expr $i + 1`
1800b3a827e2Smrg        teststring=$teststring$teststring
1801b3a827e2Smrg      done
1802b3a827e2Smrg      # Only check the string length outside the loop.
1803b3a827e2Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1804b3a827e2Smrg      teststring=
1805b3a827e2Smrg      # Add a significant safety factor because C++ compilers can tack on
1806b3a827e2Smrg      # massive amounts of additional arguments before passing them to the
1807b3a827e2Smrg      # linker.  It appears as though 1/2 is a usable value.
1808b3a827e2Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1809b3a827e2Smrg    fi
1810b3a827e2Smrg    ;;
1811b3a827e2Smrg  esac
181267ab2ff2Smrg])
1813b3a827e2Smrgif test -n "$lt_cv_sys_max_cmd_len"; then
1814b3a827e2Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
181567ab2ff2Smrgelse
1816b3a827e2Smrg  AC_MSG_RESULT(none)
181767ab2ff2Smrgfi
1818b3a827e2Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1819b3a827e2Smrg_LT_DECL([], [max_cmd_len], [0],
1820b3a827e2Smrg    [What is the maximum length of a command?])
1821b3a827e2Smrg])# LT_CMD_MAX_LEN
1822f05b35a2Smrg
1823b3a827e2Smrg# Old name:
1824b3a827e2SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1825b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
1826b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1827e0963edeSmrg
1828e0963edeSmrg
1829b3a827e2Smrg# _LT_HEADER_DLFCN
1830b3a827e2Smrg# ----------------
1831b3a827e2Smrgm4_defun([_LT_HEADER_DLFCN],
1832b3a827e2Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1833b3a827e2Smrg])# _LT_HEADER_DLFCN
1834e0963edeSmrg
1835f05b35a2Smrg
1836b3a827e2Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1837b3a827e2Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1838b3a827e2Smrg# ----------------------------------------------------------------
1839b3a827e2Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1840b3a827e2Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1841b3a827e2Smrgif test yes = "$cross_compiling"; then :
1842b3a827e2Smrg  [$4]
184367ab2ff2Smrgelse
1844b3a827e2Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1845b3a827e2Smrg  lt_status=$lt_dlunknown
1846b3a827e2Smrg  cat > conftest.$ac_ext <<_LT_EOF
1847b3a827e2Smrg[#line $LINENO "configure"
1848b3a827e2Smrg#include "confdefs.h"
1849f05b35a2Smrg
1850b3a827e2Smrg#if HAVE_DLFCN_H
1851b3a827e2Smrg#include <dlfcn.h>
1852b3a827e2Smrg#endif
1853e0963edeSmrg
1854b3a827e2Smrg#include <stdio.h>
1855e0963edeSmrg
1856b3a827e2Smrg#ifdef RTLD_GLOBAL
1857b3a827e2Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
1858b3a827e2Smrg#else
1859b3a827e2Smrg#  ifdef DL_GLOBAL
1860b3a827e2Smrg#    define LT_DLGLOBAL		DL_GLOBAL
1861b3a827e2Smrg#  else
1862b3a827e2Smrg#    define LT_DLGLOBAL		0
1863b3a827e2Smrg#  endif
1864b3a827e2Smrg#endif
1865e0963edeSmrg
1866b3a827e2Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
1867b3a827e2Smrg   find out it does not work in some platform. */
1868b3a827e2Smrg#ifndef LT_DLLAZY_OR_NOW
1869b3a827e2Smrg#  ifdef RTLD_LAZY
1870b3a827e2Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
1871b3a827e2Smrg#  else
1872b3a827e2Smrg#    ifdef DL_LAZY
1873b3a827e2Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
1874b3a827e2Smrg#    else
1875b3a827e2Smrg#      ifdef RTLD_NOW
1876b3a827e2Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
1877b3a827e2Smrg#      else
1878b3a827e2Smrg#        ifdef DL_NOW
1879b3a827e2Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
1880b3a827e2Smrg#        else
1881b3a827e2Smrg#          define LT_DLLAZY_OR_NOW	0
1882b3a827e2Smrg#        endif
1883b3a827e2Smrg#      endif
1884b3a827e2Smrg#    endif
1885b3a827e2Smrg#  endif
1886b3a827e2Smrg#endif
188767ab2ff2Smrg
1888b3a827e2Smrg/* When -fvisibility=hidden is used, assume the code has been annotated
1889b3a827e2Smrg   correspondingly for the symbols needed.  */
1890b3a827e2Smrg#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1891b3a827e2Smrgint fnord () __attribute__((visibility("default")));
1892b3a827e2Smrg#endif
1893e0963edeSmrg
1894b3a827e2Smrgint fnord () { return 42; }
1895b3a827e2Smrgint main ()
1896b3a827e2Smrg{
1897b3a827e2Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
1898b3a827e2Smrg  int status = $lt_dlunknown;
1899e0963edeSmrg
1900b3a827e2Smrg  if (self)
1901b3a827e2Smrg    {
1902b3a827e2Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1903b3a827e2Smrg      else
1904b3a827e2Smrg        {
1905b3a827e2Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1906b3a827e2Smrg          else puts (dlerror ());
1907b3a827e2Smrg	}
1908b3a827e2Smrg      /* dlclose (self); */
1909b3a827e2Smrg    }
1910b3a827e2Smrg  else
1911b3a827e2Smrg    puts (dlerror ());
1912e0963edeSmrg
1913b3a827e2Smrg  return status;
1914b3a827e2Smrg}]
1915b3a827e2Smrg_LT_EOF
1916b3a827e2Smrg  if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
1917b3a827e2Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
1918b3a827e2Smrg    lt_status=$?
1919b3a827e2Smrg    case x$lt_status in
1920b3a827e2Smrg      x$lt_dlno_uscore) $1 ;;
1921b3a827e2Smrg      x$lt_dlneed_uscore) $2 ;;
1922b3a827e2Smrg      x$lt_dlunknown|x*) $3 ;;
192367ab2ff2Smrg    esac
1924b3a827e2Smrg  else :
1925b3a827e2Smrg    # compilation failed
1926b3a827e2Smrg    $3
192767ab2ff2Smrg  fi
1928b3a827e2Smrgfi
1929b3a827e2Smrgrm -fr conftest*
1930b3a827e2Smrg])# _LT_TRY_DLOPEN_SELF
193167ab2ff2Smrg
1932e0963edeSmrg
1933b3a827e2Smrg# LT_SYS_DLOPEN_SELF
1934b3a827e2Smrg# ------------------
1935b3a827e2SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1936b3a827e2Smrg[m4_require([_LT_HEADER_DLFCN])dnl
1937b3a827e2Smrgif test yes != "$enable_dlopen"; then
1938b3a827e2Smrg  enable_dlopen=unknown
1939b3a827e2Smrg  enable_dlopen_self=unknown
1940b3a827e2Smrg  enable_dlopen_self_static=unknown
194167ab2ff2Smrgelse
1942b3a827e2Smrg  lt_cv_dlopen=no
1943b3a827e2Smrg  lt_cv_dlopen_libs=
1944e0963edeSmrg
1945b3a827e2Smrg  case $host_os in
1946b3a827e2Smrg  beos*)
1947b3a827e2Smrg    lt_cv_dlopen=load_add_on
1948b3a827e2Smrg    lt_cv_dlopen_libs=
1949b3a827e2Smrg    lt_cv_dlopen_self=yes
1950b3a827e2Smrg    ;;
1951e0963edeSmrg
1952b3a827e2Smrg  mingw* | pw32* | cegcc*)
1953b3a827e2Smrg    lt_cv_dlopen=LoadLibrary
1954b3a827e2Smrg    lt_cv_dlopen_libs=
1955b3a827e2Smrg    ;;
1956e0963edeSmrg
1957b3a827e2Smrg  cygwin*)
1958b3a827e2Smrg    lt_cv_dlopen=dlopen
1959b3a827e2Smrg    lt_cv_dlopen_libs=
1960b3a827e2Smrg    ;;
1961e0963edeSmrg
1962b3a827e2Smrg  darwin*)
1963b3a827e2Smrg    # if libdl is installed we need to link against it
1964b3a827e2Smrg    AC_CHECK_LIB([dl], [dlopen],
1965b3a827e2Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
1966b3a827e2Smrg    lt_cv_dlopen=dyld
1967b3a827e2Smrg    lt_cv_dlopen_libs=
1968b3a827e2Smrg    lt_cv_dlopen_self=yes
1969b3a827e2Smrg    ])
1970b3a827e2Smrg    ;;
1971e0963edeSmrg
1972b3a827e2Smrg  tpf*)
1973b3a827e2Smrg    # Don't try to run any link tests for TPF.  We know it's impossible
1974b3a827e2Smrg    # because TPF is a cross-compiler, and we know how we open DSOs.
1975b3a827e2Smrg    lt_cv_dlopen=dlopen
1976b3a827e2Smrg    lt_cv_dlopen_libs=
1977b3a827e2Smrg    lt_cv_dlopen_self=no
197867ab2ff2Smrg    ;;
1979b3a827e2Smrg
198067ab2ff2Smrg  *)
1981b3a827e2Smrg    AC_CHECK_FUNC([shl_load],
1982b3a827e2Smrg	  [lt_cv_dlopen=shl_load],
1983b3a827e2Smrg      [AC_CHECK_LIB([dld], [shl_load],
1984b3a827e2Smrg	    [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
1985b3a827e2Smrg	[AC_CHECK_FUNC([dlopen],
1986b3a827e2Smrg	      [lt_cv_dlopen=dlopen],
1987b3a827e2Smrg	  [AC_CHECK_LIB([dl], [dlopen],
1988b3a827e2Smrg		[lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
1989b3a827e2Smrg	    [AC_CHECK_LIB([svld], [dlopen],
1990b3a827e2Smrg		  [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
1991b3a827e2Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1992b3a827e2Smrg		    [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
1993b3a827e2Smrg	      ])
1994b3a827e2Smrg	    ])
1995b3a827e2Smrg	  ])
1996b3a827e2Smrg	])
1997b3a827e2Smrg      ])
199849e108a1Smrg    ;;
199949e108a1Smrg  esac
2000e0963edeSmrg
2001b3a827e2Smrg  if test no = "$lt_cv_dlopen"; then
2002b3a827e2Smrg    enable_dlopen=no
2003b3a827e2Smrg  else
2004b3a827e2Smrg    enable_dlopen=yes
2005b3a827e2Smrg  fi
2006e0963edeSmrg
2007b3a827e2Smrg  case $lt_cv_dlopen in
2008b3a827e2Smrg  dlopen)
2009b3a827e2Smrg    save_CPPFLAGS=$CPPFLAGS
2010b3a827e2Smrg    test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
2011e0963edeSmrg
2012b3a827e2Smrg    save_LDFLAGS=$LDFLAGS
2013b3a827e2Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
2014b3a827e2Smrg
2015b3a827e2Smrg    save_LIBS=$LIBS
2016b3a827e2Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
2017b3a827e2Smrg
2018b3a827e2Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
2019b3a827e2Smrg	  lt_cv_dlopen_self, [dnl
2020b3a827e2Smrg	  _LT_TRY_DLOPEN_SELF(
2021b3a827e2Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
2022b3a827e2Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
2023b3a827e2Smrg    ])
2024b3a827e2Smrg
2025b3a827e2Smrg    if test yes = "$lt_cv_dlopen_self"; then
2026b3a827e2Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
2027b3a827e2Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
2028b3a827e2Smrg	  lt_cv_dlopen_self_static, [dnl
2029b3a827e2Smrg	  _LT_TRY_DLOPEN_SELF(
2030b3a827e2Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
2031b3a827e2Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
2032b3a827e2Smrg      ])
2033b3a827e2Smrg    fi
2034b3a827e2Smrg
2035b3a827e2Smrg    CPPFLAGS=$save_CPPFLAGS
2036b3a827e2Smrg    LDFLAGS=$save_LDFLAGS
2037b3a827e2Smrg    LIBS=$save_LIBS
2038b3a827e2Smrg    ;;
2039b3a827e2Smrg  esac
2040b3a827e2Smrg
2041b3a827e2Smrg  case $lt_cv_dlopen_self in
2042b3a827e2Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
2043b3a827e2Smrg  *) enable_dlopen_self=unknown ;;
2044b3a827e2Smrg  esac
2045b3a827e2Smrg
2046b3a827e2Smrg  case $lt_cv_dlopen_self_static in
2047b3a827e2Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
2048b3a827e2Smrg  *) enable_dlopen_self_static=unknown ;;
2049b3a827e2Smrg  esac
2050b3a827e2Smrgfi
2051b3a827e2Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
2052b3a827e2Smrg	 [Whether dlopen is supported])
2053b3a827e2Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
2054b3a827e2Smrg	 [Whether dlopen of programs is supported])
2055b3a827e2Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
2056b3a827e2Smrg	 [Whether dlopen of statically linked programs is supported])
2057b3a827e2Smrg])# LT_SYS_DLOPEN_SELF
2058b3a827e2Smrg
2059b3a827e2Smrg# Old name:
2060b3a827e2SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
2061b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
2062b3a827e2Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
2063b3a827e2Smrg
2064b3a827e2Smrg
2065b3a827e2Smrg# _LT_COMPILER_C_O([TAGNAME])
2066b3a827e2Smrg# ---------------------------
2067b3a827e2Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
2068b3a827e2Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
2069b3a827e2Smrgm4_defun([_LT_COMPILER_C_O],
2070b3a827e2Smrg[m4_require([_LT_DECL_SED])dnl
2071b3a827e2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2072b3a827e2Smrgm4_require([_LT_TAG_COMPILER])dnl
2073b3a827e2SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
2074b3a827e2Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
2075b3a827e2Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
2076b3a827e2Smrg   $RM -r conftest 2>/dev/null
2077b3a827e2Smrg   mkdir conftest
2078b3a827e2Smrg   cd conftest
2079b3a827e2Smrg   mkdir out
208067ab2ff2Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
2081b3a827e2Smrg
2082b3a827e2Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
208367ab2ff2Smrg   # Insert the option either (1) after the last *FLAGS variable, or
208467ab2ff2Smrg   # (2) before a word containing "conftest.", or (3) at the end.
208567ab2ff2Smrg   # Note that $ac_compile itself does not contain backslashes and begins
208667ab2ff2Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
208767ab2ff2Smrg   lt_compile=`echo "$ac_compile" | $SED \
208867ab2ff2Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
208967ab2ff2Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
209067ab2ff2Smrg   -e 's:$: $lt_compiler_flag:'`
209167ab2ff2Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
2092b3a827e2Smrg   (eval "$lt_compile" 2>out/conftest.err)
209367ab2ff2Smrg   ac_status=$?
2094b3a827e2Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
209567ab2ff2Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
2096b3a827e2Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
2097b3a827e2Smrg   then
209867ab2ff2Smrg     # The compiler can only warn and ignore the option if not recognized
2099b3a827e2Smrg     # So say no if there are warnings
2100b3a827e2Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
2101b3a827e2Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
2102b3a827e2Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2103b3a827e2Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
210467ab2ff2Smrg     fi
210567ab2ff2Smrg   fi
2106b3a827e2Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2107b3a827e2Smrg   $RM conftest*
2108b3a827e2Smrg   # SGI C++ compiler will create directory out/ii_files/ for
2109b3a827e2Smrg   # template instantiation
2110b3a827e2Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2111b3a827e2Smrg   $RM out/* && rmdir out
2112b3a827e2Smrg   cd ..
2113b3a827e2Smrg   $RM -r conftest
211467ab2ff2Smrg   $RM conftest*
211567ab2ff2Smrg])
2116b3a827e2Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2117b3a827e2Smrg	[Does compiler simultaneously support -c and -o options?])
2118b3a827e2Smrg])# _LT_COMPILER_C_O
2119e0963edeSmrg
2120e0963edeSmrg
2121b3a827e2Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2122b3a827e2Smrg# ----------------------------------
2123b3a827e2Smrg# Check to see if we can do hard links to lock some files if needed
2124b3a827e2Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2125b3a827e2Smrg[m4_require([_LT_ENABLE_LOCK])dnl
2126b3a827e2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2127b3a827e2Smrg_LT_COMPILER_C_O([$1])
2128e0963edeSmrg
2129b3a827e2Smrghard_links=nottested
2130b3a827e2Smrgif test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
2131b3a827e2Smrg  # do not overwrite the value of need_locks provided by the user
2132b3a827e2Smrg  AC_MSG_CHECKING([if we can lock with hard links])
2133b3a827e2Smrg  hard_links=yes
2134b3a827e2Smrg  $RM conftest*
2135b3a827e2Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2136b3a827e2Smrg  touch conftest.a
2137b3a827e2Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
2138b3a827e2Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
2139b3a827e2Smrg  AC_MSG_RESULT([$hard_links])
2140b3a827e2Smrg  if test no = "$hard_links"; then
2141b3a827e2Smrg    AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
2142b3a827e2Smrg    need_locks=warn
2143b3a827e2Smrg  fi
2144b3a827e2Smrgelse
2145b3a827e2Smrg  need_locks=no
2146b3a827e2Smrgfi
2147b3a827e2Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2148b3a827e2Smrg])# _LT_COMPILER_FILE_LOCKS
2149f05b35a2Smrg
215049e108a1Smrg
2151b3a827e2Smrg# _LT_CHECK_OBJDIR
2152b3a827e2Smrg# ----------------
2153b3a827e2Smrgm4_defun([_LT_CHECK_OBJDIR],
2154b3a827e2Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
2155b3a827e2Smrg[rm -f .libs 2>/dev/null
2156b3a827e2Smrgmkdir .libs 2>/dev/null
2157b3a827e2Smrgif test -d .libs; then
2158b3a827e2Smrg  lt_cv_objdir=.libs
215967ab2ff2Smrgelse
2160b3a827e2Smrg  # MS-DOS does not allow filenames that begin with a dot.
2161b3a827e2Smrg  lt_cv_objdir=_libs
216267ab2ff2Smrgfi
2163b3a827e2Smrgrmdir .libs 2>/dev/null])
2164b3a827e2Smrgobjdir=$lt_cv_objdir
2165b3a827e2Smrg_LT_DECL([], [objdir], [0],
2166b3a827e2Smrg         [The name of the directory that contains temporary libtool files])dnl
2167b3a827e2Smrgm4_pattern_allow([LT_OBJDIR])dnl
2168b3a827e2SmrgAC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
2169b3a827e2Smrg  [Define to the sub-directory where libtool stores uninstalled libraries.])
2170b3a827e2Smrg])# _LT_CHECK_OBJDIR
217149e108a1Smrg
217249e108a1Smrg
2173b3a827e2Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2174b3a827e2Smrg# --------------------------------------
2175b3a827e2Smrg# Check hardcoding attributes.
2176b3a827e2Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
2177b3a827e2Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2178b3a827e2Smrg_LT_TAGVAR(hardcode_action, $1)=
2179b3a827e2Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2180b3a827e2Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2181b3a827e2Smrg   test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
218249e108a1Smrg
2183b3a827e2Smrg  # We can hardcode non-existent directories.
2184b3a827e2Smrg  if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
2185b3a827e2Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
2186b3a827e2Smrg     # have to relink, otherwise we might link with an installed library
2187b3a827e2Smrg     # when we should be linking with a yet-to-be-installed one
2188b3a827e2Smrg     ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
2189b3a827e2Smrg     test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
2190b3a827e2Smrg    # Linking always hardcodes the temporary library directory.
2191b3a827e2Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
2192b3a827e2Smrg  else
2193b3a827e2Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2194b3a827e2Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
2195b3a827e2Smrg  fi
2196b3a827e2Smrgelse
2197b3a827e2Smrg  # We cannot hardcode anything, or else we can only hardcode existing
2198b3a827e2Smrg  # directories.
2199b3a827e2Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
2200b3a827e2Smrgfi
2201b3a827e2SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
220249e108a1Smrg
2203b3a827e2Smrgif test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
2204b3a827e2Smrg   test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
2205b3a827e2Smrg  # Fast installation is not supported
2206b3a827e2Smrg  enable_fast_install=no
2207b3a827e2Smrgelif test yes = "$shlibpath_overrides_runpath" ||
2208b3a827e2Smrg     test no = "$enable_shared"; then
2209b3a827e2Smrg  # Fast installation is not necessary
2210b3a827e2Smrg  enable_fast_install=needless
2211b3a827e2Smrgfi
2212b3a827e2Smrg_LT_TAGDECL([], [hardcode_action], [0],
2213b3a827e2Smrg    [How to hardcode a shared library path into an executable])
2214b3a827e2Smrg])# _LT_LINKER_HARDCODE_LIBPATH
221549e108a1Smrg
221649e108a1Smrg
2217b3a827e2Smrg# _LT_CMD_STRIPLIB
2218b3a827e2Smrg# ----------------
2219b3a827e2Smrgm4_defun([_LT_CMD_STRIPLIB],
2220b3a827e2Smrg[m4_require([_LT_DECL_EGREP])
2221b3a827e2Smrgstriplib=
2222b3a827e2Smrgold_striplib=
2223b3a827e2SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2224b3a827e2Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
2225b3a827e2Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
2226b3a827e2Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
2227b3a827e2Smrg  AC_MSG_RESULT([yes])
2228b3a827e2Smrgelse
2229b3a827e2Smrg# FIXME - insert some real tests, host_os isn't really good enough
2230b3a827e2Smrg  case $host_os in
2231b3a827e2Smrg  darwin*)
2232b3a827e2Smrg    if test -n "$STRIP"; then
2233b3a827e2Smrg      striplib="$STRIP -x"
2234b3a827e2Smrg      old_striplib="$STRIP -S"
2235b3a827e2Smrg      AC_MSG_RESULT([yes])
223667ab2ff2Smrg    else
2237b3a827e2Smrg      AC_MSG_RESULT([no])
223867ab2ff2Smrg    fi
223967ab2ff2Smrg    ;;
2240b3a827e2Smrg  *)
2241b3a827e2Smrg    AC_MSG_RESULT([no])
224267ab2ff2Smrg    ;;
2243b3a827e2Smrg  esac
2244b3a827e2Smrgfi
2245b3a827e2Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2246b3a827e2Smrg_LT_DECL([], [striplib], [1])
2247b3a827e2Smrg])# _LT_CMD_STRIPLIB
224849e108a1Smrg
2249e494fffdSmrg
2250b3a827e2Smrg# _LT_PREPARE_MUNGE_PATH_LIST
2251b3a827e2Smrg# ---------------------------
2252b3a827e2Smrg# Make sure func_munge_path_list() is defined correctly.
2253b3a827e2Smrgm4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
2254b3a827e2Smrg[[# func_munge_path_list VARIABLE PATH
2255b3a827e2Smrg# -----------------------------------
2256b3a827e2Smrg# VARIABLE is name of variable containing _space_ separated list of
2257b3a827e2Smrg# directories to be munged by the contents of PATH, which is string
2258b3a827e2Smrg# having a format:
2259b3a827e2Smrg# "DIR[:DIR]:"
2260b3a827e2Smrg#       string "DIR[ DIR]" will be prepended to VARIABLE
2261b3a827e2Smrg# ":DIR[:DIR]"
2262b3a827e2Smrg#       string "DIR[ DIR]" will be appended to VARIABLE
2263b3a827e2Smrg# "DIRP[:DIRP]::[DIRA:]DIRA"
2264b3a827e2Smrg#       string "DIRP[ DIRP]" will be prepended to VARIABLE and string
2265b3a827e2Smrg#       "DIRA[ DIRA]" will be appended to VARIABLE
2266b3a827e2Smrg# "DIR[:DIR]"
2267b3a827e2Smrg#       VARIABLE will be replaced by "DIR[ DIR]"
2268b3a827e2Smrgfunc_munge_path_list ()
2269b3a827e2Smrg{
2270b3a827e2Smrg    case x@S|@2 in
2271b3a827e2Smrg    x)
2272b3a827e2Smrg        ;;
2273b3a827e2Smrg    *:)
2274b3a827e2Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
2275b3a827e2Smrg        ;;
2276b3a827e2Smrg    x:*)
2277b3a827e2Smrg        eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
2278b3a827e2Smrg        ;;
2279b3a827e2Smrg    *::*)
2280b3a827e2Smrg        eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
2281b3a827e2Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
2282b3a827e2Smrg        ;;
2283b3a827e2Smrg    *)
2284b3a827e2Smrg        eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
2285b3a827e2Smrg        ;;
2286b3a827e2Smrg    esac
2287b3a827e2Smrg}
2288b3a827e2Smrg]])# _LT_PREPARE_PATH_LIST
2289b3a827e2Smrg
2290b3a827e2Smrg
2291b3a827e2Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
2292b3a827e2Smrg# -----------------------------
2293b3a827e2Smrg# PORTME Fill in your ld.so characteristics
2294b3a827e2Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2295b3a827e2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2296b3a827e2Smrgm4_require([_LT_DECL_EGREP])dnl
2297b3a827e2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2298b3a827e2Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2299b3a827e2Smrgm4_require([_LT_DECL_SED])dnl
2300b3a827e2Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2301b3a827e2Smrgm4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
2302b3a827e2SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2303b3a827e2Smrgm4_if([$1],
2304b3a827e2Smrg	[], [
2305b3a827e2Smrgif test yes = "$GCC"; then
2306b3a827e2Smrg  case $host_os in
2307b3a827e2Smrg    darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
2308b3a827e2Smrg    *) lt_awk_arg='/^libraries:/' ;;
2309b3a827e2Smrg  esac
2310b3a827e2Smrg  case $host_os in
2311b3a827e2Smrg    mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
2312b3a827e2Smrg    *) lt_sed_strip_eq='s|=/|/|g' ;;
2313b3a827e2Smrg  esac
2314b3a827e2Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2315b3a827e2Smrg  case $lt_search_path_spec in
2316b3a827e2Smrg  *\;*)
2317b3a827e2Smrg    # if the path contains ";" then we assume it to be the separator
2318b3a827e2Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
2319b3a827e2Smrg    # assumed that no part of a normal pathname contains ";" but that should
2320b3a827e2Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2321b3a827e2Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
232267ab2ff2Smrg    ;;
2323b3a827e2Smrg  *)
2324b3a827e2Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
232567ab2ff2Smrg    ;;
2326b3a827e2Smrg  esac
2327b3a827e2Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2328b3a827e2Smrg  # and add multilib dir if necessary...
2329b3a827e2Smrg  lt_tmp_lt_search_path_spec=
2330b3a827e2Smrg  lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2331b3a827e2Smrg  # ...but if some path component already ends with the multilib dir we assume
2332b3a827e2Smrg  # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
2333b3a827e2Smrg  case "$lt_multi_os_dir; $lt_search_path_spec " in
2334b3a827e2Smrg  "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
2335b3a827e2Smrg    lt_multi_os_dir=
233667ab2ff2Smrg    ;;
2337b3a827e2Smrg  esac
2338b3a827e2Smrg  for lt_sys_path in $lt_search_path_spec; do
2339b3a827e2Smrg    if test -d "$lt_sys_path$lt_multi_os_dir"; then
2340b3a827e2Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
2341b3a827e2Smrg    elif test -n "$lt_multi_os_dir"; then
2342b3a827e2Smrg      test -d "$lt_sys_path" && \
2343b3a827e2Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
234449e108a1Smrg    fi
2345b3a827e2Smrg  done
2346b3a827e2Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2347b3a827e2SmrgBEGIN {RS = " "; FS = "/|\n";} {
2348b3a827e2Smrg  lt_foo = "";
2349b3a827e2Smrg  lt_count = 0;
2350b3a827e2Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2351b3a827e2Smrg    if ($lt_i != "" && $lt_i != ".") {
2352b3a827e2Smrg      if ($lt_i == "..") {
2353b3a827e2Smrg        lt_count++;
2354b3a827e2Smrg      } else {
2355b3a827e2Smrg        if (lt_count == 0) {
2356b3a827e2Smrg          lt_foo = "/" $lt_i lt_foo;
2357b3a827e2Smrg        } else {
2358b3a827e2Smrg          lt_count--;
2359b3a827e2Smrg        }
2360b3a827e2Smrg      }
2361b3a827e2Smrg    }
2362b3a827e2Smrg  }
2363b3a827e2Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2364b3a827e2Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2365b3a827e2Smrg}'`
2366b3a827e2Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2367b3a827e2Smrg  # for these hosts.
2368b3a827e2Smrg  case $host_os in
2369b3a827e2Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2370b3a827e2Smrg      $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
237149e108a1Smrg  esac
2372b3a827e2Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
237367ab2ff2Smrgelse
2374b3a827e2Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2375b3a827e2Smrgfi])
2376b3a827e2Smrglibrary_names_spec=
2377b3a827e2Smrglibname_spec='lib$name'
2378b3a827e2Smrgsoname_spec=
2379b3a827e2Smrgshrext_cmds=.so
2380b3a827e2Smrgpostinstall_cmds=
2381b3a827e2Smrgpostuninstall_cmds=
2382b3a827e2Smrgfinish_cmds=
2383b3a827e2Smrgfinish_eval=
2384b3a827e2Smrgshlibpath_var=
2385b3a827e2Smrgshlibpath_overrides_runpath=unknown
2386b3a827e2Smrgversion_type=none
2387b3a827e2Smrgdynamic_linker="$host_os ld.so"
2388b3a827e2Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
2389b3a827e2Smrgneed_lib_prefix=unknown
2390b3a827e2Smrghardcode_into_libs=no
239149e108a1Smrg
2392b3a827e2Smrg# when you set need_version to no, make sure it does not cause -set_version
2393b3a827e2Smrg# flags to be left without arguments
2394b3a827e2Smrgneed_version=unknown
239549e108a1Smrg
2396b3a827e2SmrgAC_ARG_VAR([LT_SYS_LIBRARY_PATH],
2397b3a827e2Smrg[User-defined run-time library search path.])
239849e108a1Smrg
2399b3a827e2Smrgcase $host_os in
2400b3a827e2Smrgaix3*)
2401b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2402b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
2403b3a827e2Smrg  shlibpath_var=LIBPATH
240449e108a1Smrg
2405b3a827e2Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
2406b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2407b3a827e2Smrg  ;;
240849e108a1Smrg
2409b3a827e2Smrgaix[[4-9]]*)
2410b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2411b3a827e2Smrg  need_lib_prefix=no
2412b3a827e2Smrg  need_version=no
2413b3a827e2Smrg  hardcode_into_libs=yes
2414b3a827e2Smrg  if test ia64 = "$host_cpu"; then
2415b3a827e2Smrg    # AIX 5 supports IA64
2416b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
2417b3a827e2Smrg    shlibpath_var=LD_LIBRARY_PATH
241867ab2ff2Smrg  else
2419b3a827e2Smrg    # With GCC up to 2.95.x, collect2 would create an import file
2420b3a827e2Smrg    # for dependence libraries.  The import file would start with
2421b3a827e2Smrg    # the line '#! .'.  This would cause the generated library to
2422b3a827e2Smrg    # depend on '.', always an invalid library.  This was fixed in
2423b3a827e2Smrg    # development snapshots of GCC prior to 3.0.
2424b3a827e2Smrg    case $host_os in
2425b3a827e2Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
2426b3a827e2Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
2427b3a827e2Smrg	   echo ' yes '
2428b3a827e2Smrg	   echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
2429b3a827e2Smrg	:
2430b3a827e2Smrg      else
2431b3a827e2Smrg	can_build_shared=no
2432b3a827e2Smrg      fi
2433b3a827e2Smrg      ;;
243467ab2ff2Smrg    esac
2435b3a827e2Smrg    # Using Import Files as archive members, it is possible to support
2436b3a827e2Smrg    # filename-based versioning of shared library archives on AIX. While
2437b3a827e2Smrg    # this would work for both with and without runtime linking, it will
2438b3a827e2Smrg    # prevent static linking of such archives. So we do filename-based
2439b3a827e2Smrg    # shared library versioning with .so extension only, which is used
2440b3a827e2Smrg    # when both runtime linking and shared linking is enabled.
2441b3a827e2Smrg    # Unfortunately, runtime linking may impact performance, so we do
2442b3a827e2Smrg    # not want this to be the default eventually. Also, we use the
2443b3a827e2Smrg    # versioned .so libs for executables only if there is the -brtl
2444b3a827e2Smrg    # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
2445b3a827e2Smrg    # To allow for filename-based versioning support, we need to create
2446b3a827e2Smrg    # libNAME.so.V as an archive file, containing:
2447b3a827e2Smrg    # *) an Import File, referring to the versioned filename of the
2448b3a827e2Smrg    #    archive as well as the shared archive member, telling the
2449b3a827e2Smrg    #    bitwidth (32 or 64) of that shared object, and providing the
2450b3a827e2Smrg    #    list of exported symbols of that shared object, eventually
2451b3a827e2Smrg    #    decorated with the 'weak' keyword
2452b3a827e2Smrg    # *) the shared object with the F_LOADONLY flag set, to really avoid
2453b3a827e2Smrg    #    it being seen by the linker.
2454b3a827e2Smrg    # At run time we better use the real file rather than another symlink,
2455b3a827e2Smrg    # but for link time we create the symlink libNAME.so -> libNAME.so.V
2456b3a827e2Smrg
2457b3a827e2Smrg    case $with_aix_soname,$aix_use_runtimelinking in
2458b3a827e2Smrg    # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
2459b3a827e2Smrg    # soname into executable. Probably we can add versioning support to
2460b3a827e2Smrg    # collect2, so additional links can be useful in future.
2461b3a827e2Smrg    aix,yes) # traditional libtool
2462b3a827e2Smrg      dynamic_linker='AIX unversionable lib.so'
2463b3a827e2Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
2464b3a827e2Smrg      # instead of lib<name>.a to let people know that these are not
2465b3a827e2Smrg      # typical AIX shared libraries.
2466b3a827e2Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2467b3a827e2Smrg      ;;
2468b3a827e2Smrg    aix,no) # traditional AIX only
2469b3a827e2Smrg      dynamic_linker='AIX lib.a[(]lib.so.V[)]'
2470b3a827e2Smrg      # We preserve .a as extension for shared libraries through AIX4.2
2471b3a827e2Smrg      # and later when we are not doing run time linking.
2472b3a827e2Smrg      library_names_spec='$libname$release.a $libname.a'
2473b3a827e2Smrg      soname_spec='$libname$release$shared_ext$major'
2474b3a827e2Smrg      ;;
2475b3a827e2Smrg    svr4,*) # full svr4 only
2476b3a827e2Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
2477b3a827e2Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2478b3a827e2Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2479b3a827e2Smrg      shlibpath_overrides_runpath=yes
2480b3a827e2Smrg      ;;
2481b3a827e2Smrg    *,yes) # both, prefer svr4
2482b3a827e2Smrg      dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
2483b3a827e2Smrg      library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
2484b3a827e2Smrg      # unpreferred sharedlib libNAME.a needs extra handling
2485b3a827e2Smrg      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"'
2486b3a827e2Smrg      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"'
2487b3a827e2Smrg      # We do not specify a path in Import Files, so LIBPATH fires.
2488b3a827e2Smrg      shlibpath_overrides_runpath=yes
2489b3a827e2Smrg      ;;
2490b3a827e2Smrg    *,no) # both, prefer aix
2491b3a827e2Smrg      dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
2492b3a827e2Smrg      library_names_spec='$libname$release.a $libname.a'
2493b3a827e2Smrg      soname_spec='$libname$release$shared_ext$major'
2494b3a827e2Smrg      # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
2495b3a827e2Smrg      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)'
2496b3a827e2Smrg      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"'
2497b3a827e2Smrg      ;;
2498b3a827e2Smrg    esac
2499b3a827e2Smrg    shlibpath_var=LIBPATH
250067ab2ff2Smrg  fi
2501b3a827e2Smrg  ;;
250249e108a1Smrg
2503b3a827e2Smrgamigaos*)
2504b3a827e2Smrg  case $host_cpu in
2505b3a827e2Smrg  powerpc)
2506b3a827e2Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2507b3a827e2Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2508b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2509b3a827e2Smrg    ;;
2510b3a827e2Smrg  m68k)
2511b3a827e2Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2512b3a827e2Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2513b3a827e2Smrg    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'
2514b3a827e2Smrg    ;;
2515b3a827e2Smrg  esac
2516b3a827e2Smrg  ;;
251749e108a1Smrg
2518b3a827e2Smrgbeos*)
2519b3a827e2Smrg  library_names_spec='$libname$shared_ext'
2520b3a827e2Smrg  dynamic_linker="$host_os ld.so"
2521b3a827e2Smrg  shlibpath_var=LIBRARY_PATH
2522b3a827e2Smrg  ;;
252349e108a1Smrg
2524b3a827e2Smrgbsdi[[45]]*)
2525b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2526b3a827e2Smrg  need_version=no
2527b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2528b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2529b3a827e2Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
2530b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2531b3a827e2Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
2532b3a827e2Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
2533b3a827e2Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
2534b3a827e2Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
2535b3a827e2Smrg  # libtool to hard-code these into programs
2536b3a827e2Smrg  ;;
253749e108a1Smrg
2538b3a827e2Smrgcygwin* | mingw* | pw32* | cegcc*)
2539b3a827e2Smrg  version_type=windows
2540b3a827e2Smrg  shrext_cmds=.dll
2541b3a827e2Smrg  need_version=no
2542b3a827e2Smrg  need_lib_prefix=no
254367ab2ff2Smrg
2544b3a827e2Smrg  case $GCC,$cc_basename in
2545b3a827e2Smrg  yes,*)
2546b3a827e2Smrg    # gcc
2547b3a827e2Smrg    library_names_spec='$libname.dll.a'
2548b3a827e2Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2549b3a827e2Smrg    postinstall_cmds='base_file=`basename \$file`~
2550b3a827e2Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2551b3a827e2Smrg      dldir=$destdir/`dirname \$dlpath`~
2552b3a827e2Smrg      test -d \$dldir || mkdir -p \$dldir~
2553b3a827e2Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2554b3a827e2Smrg      chmod a+x \$dldir/$dlname~
2555b3a827e2Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2556b3a827e2Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2557b3a827e2Smrg      fi'
2558b3a827e2Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2559b3a827e2Smrg      dlpath=$dir/\$dldll~
2560b3a827e2Smrg       $RM \$dlpath'
2561b3a827e2Smrg    shlibpath_overrides_runpath=yes
2562b3a827e2Smrg
2563b3a827e2Smrg    case $host_os in
2564b3a827e2Smrg    cygwin*)
2565b3a827e2Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
2566b3a827e2Smrg      soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2567b3a827e2Smrgm4_if([$1], [],[
2568b3a827e2Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
2569b3a827e2Smrg      ;;
2570b3a827e2Smrg    mingw* | cegcc*)
2571b3a827e2Smrg      # MinGW DLLs use traditional 'lib' prefix
2572b3a827e2Smrg      soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2573b3a827e2Smrg      ;;
2574b3a827e2Smrg    pw32*)
2575b3a827e2Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
2576b3a827e2Smrg      library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2577b3a827e2Smrg      ;;
2578b3a827e2Smrg    esac
2579b3a827e2Smrg    dynamic_linker='Win32 ld.exe'
258067ab2ff2Smrg    ;;
258167ab2ff2Smrg
2582b3a827e2Smrg  *,cl*)
2583b3a827e2Smrg    # Native MSVC
2584b3a827e2Smrg    libname_spec='$name'
2585b3a827e2Smrg    soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
2586b3a827e2Smrg    library_names_spec='$libname.dll.lib'
2587b3a827e2Smrg
2588b3a827e2Smrg    case $build_os in
2589b3a827e2Smrg    mingw*)
2590b3a827e2Smrg      sys_lib_search_path_spec=
2591b3a827e2Smrg      lt_save_ifs=$IFS
2592b3a827e2Smrg      IFS=';'
2593b3a827e2Smrg      for lt_path in $LIB
2594b3a827e2Smrg      do
2595b3a827e2Smrg        IFS=$lt_save_ifs
2596b3a827e2Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2597b3a827e2Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2598b3a827e2Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2599b3a827e2Smrg      done
2600b3a827e2Smrg      IFS=$lt_save_ifs
2601b3a827e2Smrg      # Convert to MSYS style.
2602b3a827e2Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2603b3a827e2Smrg      ;;
2604b3a827e2Smrg    cygwin*)
2605b3a827e2Smrg      # Convert to unix form, then to dos form, then back to unix form
2606b3a827e2Smrg      # but this time dos style (no spaces!) so that the unix form looks
2607b3a827e2Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2608b3a827e2Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2609b3a827e2Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2610b3a827e2Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2611b3a827e2Smrg      ;;
2612b3a827e2Smrg    *)
2613b3a827e2Smrg      sys_lib_search_path_spec=$LIB
2614b3a827e2Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2615b3a827e2Smrg        # It is most probably a Windows format PATH.
2616b3a827e2Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2617b3a827e2Smrg      else
2618b3a827e2Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2619b3a827e2Smrg      fi
2620b3a827e2Smrg      # FIXME: find the short name or the path components, as spaces are
2621b3a827e2Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2622b3a827e2Smrg      ;;
2623b3a827e2Smrg    esac
2624b3a827e2Smrg
2625b3a827e2Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2626b3a827e2Smrg    postinstall_cmds='base_file=`basename \$file`~
2627b3a827e2Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
2628b3a827e2Smrg      dldir=$destdir/`dirname \$dlpath`~
2629b3a827e2Smrg      test -d \$dldir || mkdir -p \$dldir~
2630b3a827e2Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2631b3a827e2Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2632b3a827e2Smrg      dlpath=$dir/\$dldll~
2633b3a827e2Smrg       $RM \$dlpath'
2634b3a827e2Smrg    shlibpath_overrides_runpath=yes
2635b3a827e2Smrg    dynamic_linker='Win32 link.exe'
263667ab2ff2Smrg    ;;
263767ab2ff2Smrg
263867ab2ff2Smrg  *)
2639b3a827e2Smrg    # Assume MSVC wrapper
2640b3a827e2Smrg    library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
2641b3a827e2Smrg    dynamic_linker='Win32 ld.exe'
264267ab2ff2Smrg    ;;
264367ab2ff2Smrg  esac
2644b3a827e2Smrg  # FIXME: first we should search . and the directory the executable is in
2645b3a827e2Smrg  shlibpath_var=PATH
2646b3a827e2Smrg  ;;
264767ab2ff2Smrg
2648b3a827e2Smrgdarwin* | rhapsody*)
2649b3a827e2Smrg  dynamic_linker="$host_os dyld"
2650b3a827e2Smrg  version_type=darwin
2651b3a827e2Smrg  need_lib_prefix=no
2652b3a827e2Smrg  need_version=no
2653b3a827e2Smrg  library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
2654b3a827e2Smrg  soname_spec='$libname$release$major$shared_ext'
2655b3a827e2Smrg  shlibpath_overrides_runpath=yes
2656b3a827e2Smrg  shlibpath_var=DYLD_LIBRARY_PATH
2657b3a827e2Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2658b3a827e2Smrgm4_if([$1], [],[
2659b3a827e2Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
2660b3a827e2Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
2661b3a827e2Smrg  ;;
266249e108a1Smrg
2663b3a827e2Smrgdgux*)
2664b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2665b3a827e2Smrg  need_lib_prefix=no
2666b3a827e2Smrg  need_version=no
2667b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2668b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2669b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2670b3a827e2Smrg  ;;
267149e108a1Smrg
2672b3a827e2Smrgfreebsd* | dragonfly*)
2673b3a827e2Smrg  # DragonFly does not have aout.  When/if they implement a new
2674b3a827e2Smrg  # versioning mechanism, adjust this.
2675b3a827e2Smrg  if test -x /usr/bin/objformat; then
2676b3a827e2Smrg    objformat=`/usr/bin/objformat`
2677b3a827e2Smrg  else
2678b3a827e2Smrg    case $host_os in
2679b3a827e2Smrg    freebsd[[23]].*) objformat=aout ;;
2680b3a827e2Smrg    *) objformat=elf ;;
2681b3a827e2Smrg    esac
2682b3a827e2Smrg  fi
2683b3a827e2Smrg  version_type=freebsd-$objformat
2684b3a827e2Smrg  case $version_type in
2685b3a827e2Smrg    freebsd-elf*)
2686b3a827e2Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2687b3a827e2Smrg      soname_spec='$libname$release$shared_ext$major'
2688b3a827e2Smrg      need_version=no
2689b3a827e2Smrg      need_lib_prefix=no
2690b3a827e2Smrg      ;;
2691b3a827e2Smrg    freebsd-*)
2692b3a827e2Smrg      library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2693b3a827e2Smrg      need_version=yes
2694b3a827e2Smrg      ;;
2695b3a827e2Smrg  esac
2696b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2697b3a827e2Smrg  case $host_os in
2698b3a827e2Smrg  freebsd2.*)
2699b3a827e2Smrg    shlibpath_overrides_runpath=yes
2700b3a827e2Smrg    ;;
2701b3a827e2Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
2702b3a827e2Smrg    shlibpath_overrides_runpath=yes
2703b3a827e2Smrg    hardcode_into_libs=yes
2704b3a827e2Smrg    ;;
2705b3a827e2Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
2706b3a827e2Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
2707b3a827e2Smrg    shlibpath_overrides_runpath=no
2708b3a827e2Smrg    hardcode_into_libs=yes
2709b3a827e2Smrg    ;;
2710b3a827e2Smrg  *) # from 4.6 on, and DragonFly
2711b3a827e2Smrg    shlibpath_overrides_runpath=yes
2712b3a827e2Smrg    hardcode_into_libs=yes
271367ab2ff2Smrg    ;;
271467ab2ff2Smrg  esac
2715b3a827e2Smrg  ;;
271649e108a1Smrg
2717b3a827e2Smrghaiku*)
2718b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2719b3a827e2Smrg  need_lib_prefix=no
2720b3a827e2Smrg  need_version=no
2721b3a827e2Smrg  dynamic_linker="$host_os runtime_loader"
2722b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2723b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2724b3a827e2Smrg  shlibpath_var=LIBRARY_PATH
2725b3a827e2Smrg  shlibpath_overrides_runpath=no
2726b3a827e2Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
2727b3a827e2Smrg  hardcode_into_libs=yes
2728b3a827e2Smrg  ;;
272949e108a1Smrg
2730b3a827e2Smrghpux9* | hpux10* | hpux11*)
2731b3a827e2Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
2732b3a827e2Smrg  # link against other versions.
2733b3a827e2Smrg  version_type=sunos
2734b3a827e2Smrg  need_lib_prefix=no
2735b3a827e2Smrg  need_version=no
2736b3a827e2Smrg  case $host_cpu in
2737b3a827e2Smrg  ia64*)
2738b3a827e2Smrg    shrext_cmds='.so'
2739b3a827e2Smrg    hardcode_into_libs=yes
2740b3a827e2Smrg    dynamic_linker="$host_os dld.so"
2741b3a827e2Smrg    shlibpath_var=LD_LIBRARY_PATH
2742b3a827e2Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2743b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2744b3a827e2Smrg    soname_spec='$libname$release$shared_ext$major'
2745b3a827e2Smrg    if test 32 = "$HPUX_IA64_MODE"; then
2746b3a827e2Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
2747b3a827e2Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux32
2748b3a827e2Smrg    else
2749b3a827e2Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
2750b3a827e2Smrg      sys_lib_dlsearch_path_spec=/usr/lib/hpux64
2751b3a827e2Smrg    fi
2752b3a827e2Smrg    ;;
2753b3a827e2Smrg  hppa*64*)
2754b3a827e2Smrg    shrext_cmds='.sl'
2755b3a827e2Smrg    hardcode_into_libs=yes
2756b3a827e2Smrg    dynamic_linker="$host_os dld.sl"
2757b3a827e2Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2758b3a827e2Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2759b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2760b3a827e2Smrg    soname_spec='$libname$release$shared_ext$major'
2761b3a827e2Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2762b3a827e2Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2763b3a827e2Smrg    ;;
2764b3a827e2Smrg  *)
2765b3a827e2Smrg    shrext_cmds='.sl'
2766b3a827e2Smrg    dynamic_linker="$host_os dld.sl"
2767b3a827e2Smrg    shlibpath_var=SHLIB_PATH
2768b3a827e2Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
2769b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2770b3a827e2Smrg    soname_spec='$libname$release$shared_ext$major'
2771b3a827e2Smrg    ;;
277249e108a1Smrg  esac
2773b3a827e2Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
2774b3a827e2Smrg  postinstall_cmds='chmod 555 $lib'
2775b3a827e2Smrg  # or fails outright, so override atomically:
2776b3a827e2Smrg  install_override_mode=555
2777b3a827e2Smrg  ;;
277849e108a1Smrg
2779b3a827e2Smrginterix[[3-9]]*)
2780b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2781b3a827e2Smrg  need_lib_prefix=no
2782b3a827e2Smrg  need_version=no
2783b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2784b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2785b3a827e2Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
2786b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2787b3a827e2Smrg  shlibpath_overrides_runpath=no
2788b3a827e2Smrg  hardcode_into_libs=yes
2789b3a827e2Smrg  ;;
279049e108a1Smrg
2791b3a827e2Smrgirix5* | irix6* | nonstopux*)
2792b3a827e2Smrg  case $host_os in
2793b3a827e2Smrg    nonstopux*) version_type=nonstopux ;;
2794b3a827e2Smrg    *)
2795b3a827e2Smrg	if test yes = "$lt_cv_prog_gnu_ld"; then
2796b3a827e2Smrg		version_type=linux # correct to gnu/linux during the next big refactor
2797b3a827e2Smrg	else
2798b3a827e2Smrg		version_type=irix
2799b3a827e2Smrg	fi ;;
2800b3a827e2Smrg  esac
2801b3a827e2Smrg  need_lib_prefix=no
2802b3a827e2Smrg  need_version=no
2803b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2804b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
2805b3a827e2Smrg  case $host_os in
2806b3a827e2Smrg  irix5* | nonstopux*)
2807b3a827e2Smrg    libsuff= shlibsuff=
2808b3a827e2Smrg    ;;
2809b3a827e2Smrg  *)
2810b3a827e2Smrg    case $LD in # libtool.m4 will add one of these switches to LD
2811b3a827e2Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
2812b3a827e2Smrg      libsuff= shlibsuff= libmagic=32-bit;;
2813b3a827e2Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
2814b3a827e2Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
2815b3a827e2Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
2816b3a827e2Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
2817b3a827e2Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
2818b3a827e2Smrg    esac
2819b3a827e2Smrg    ;;
2820b3a827e2Smrg  esac
2821b3a827e2Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
2822b3a827e2Smrg  shlibpath_overrides_runpath=no
2823b3a827e2Smrg  sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
2824b3a827e2Smrg  sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
2825b3a827e2Smrg  hardcode_into_libs=yes
2826b3a827e2Smrg  ;;
282749e108a1Smrg
2828b3a827e2Smrg# No shared lib support for Linux oldld, aout, or coff.
2829b3a827e2Smrglinux*oldld* | linux*aout* | linux*coff*)
2830b3a827e2Smrg  dynamic_linker=no
2831b3a827e2Smrg  ;;
283267ab2ff2Smrg
2833b3a827e2Smrglinux*android*)
2834b3a827e2Smrg  version_type=none # Android doesn't support versioned libraries.
2835b3a827e2Smrg  need_lib_prefix=no
2836b3a827e2Smrg  need_version=no
2837b3a827e2Smrg  library_names_spec='$libname$release$shared_ext'
2838b3a827e2Smrg  soname_spec='$libname$release$shared_ext'
2839b3a827e2Smrg  finish_cmds=
2840b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2841b3a827e2Smrg  shlibpath_overrides_runpath=yes
284249e108a1Smrg
2843b3a827e2Smrg  # This implies no fast_install, which is unacceptable.
2844b3a827e2Smrg  # Some rework will be needed to allow for fast_install
2845b3a827e2Smrg  # before this can be enabled.
2846b3a827e2Smrg  hardcode_into_libs=yes
284767ab2ff2Smrg
2848b3a827e2Smrg  dynamic_linker='Android linker'
2849b3a827e2Smrg  # Don't embed -rpath directories since the linker doesn't support them.
2850b3a827e2Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
2851b3a827e2Smrg  ;;
285267ab2ff2Smrg
2853b3a827e2Smrg# This must be glibc/ELF.
2854b3a827e2Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
2855b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2856b3a827e2Smrg  need_lib_prefix=no
2857b3a827e2Smrg  need_version=no
2858b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2859b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2860b3a827e2Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
2861b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2862b3a827e2Smrg  shlibpath_overrides_runpath=no
286349e108a1Smrg
2864b3a827e2Smrg  # Some binutils ld are patched to set DT_RUNPATH
2865b3a827e2Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2866b3a827e2Smrg    [lt_cv_shlibpath_overrides_runpath=no
2867b3a827e2Smrg    save_LDFLAGS=$LDFLAGS
2868b3a827e2Smrg    save_libdir=$libdir
2869b3a827e2Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2870b3a827e2Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2871b3a827e2Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2872b3a827e2Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2873b3a827e2Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2874b3a827e2Smrg    LDFLAGS=$save_LDFLAGS
2875b3a827e2Smrg    libdir=$save_libdir
2876b3a827e2Smrg    ])
2877b3a827e2Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
287849e108a1Smrg
2879b3a827e2Smrg  # This implies no fast_install, which is unacceptable.
2880b3a827e2Smrg  # Some rework will be needed to allow for fast_install
2881b3a827e2Smrg  # before this can be enabled.
2882b3a827e2Smrg  hardcode_into_libs=yes
288349e108a1Smrg
2884b3a827e2Smrg  # Add ABI-specific directories to the system library path.
2885b3a827e2Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
288649e108a1Smrg
2887b3a827e2Smrg  # Ideally, we could use ldconfig to report *all* directores which are
2888b3a827e2Smrg  # searched for libraries, however this is still not possible.  Aside from not
2889b3a827e2Smrg  # being certain /sbin/ldconfig is available, command
2890b3a827e2Smrg  # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
2891b3a827e2Smrg  # even though it is searched at run-time.  Try to do the best guess by
2892b3a827e2Smrg  # appending ld.so.conf contents (and includes) to the search path.
2893b3a827e2Smrg  if test -f /etc/ld.so.conf; then
2894b3a827e2Smrg    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' ' '`
2895b3a827e2Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2896b3a827e2Smrg  fi
289749e108a1Smrg
2898b3a827e2Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
2899b3a827e2Smrg  # powerpc, because MkLinux only supported shared libraries with the
2900b3a827e2Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
2901b3a827e2Smrg  # most powerpc-linux boxes support dynamic linking these days and
2902b3a827e2Smrg  # people can always --disable-shared, the test was removed, and we
2903b3a827e2Smrg  # assume the GNU/Linux dynamic linker is in use.
2904b3a827e2Smrg  dynamic_linker='GNU/Linux ld.so'
2905b3a827e2Smrg  ;;
2906b3a827e2Smrg
2907b3a827e2Smrgnetbsd*)
2908b3a827e2Smrg  version_type=sunos
2909b3a827e2Smrg  need_lib_prefix=no
2910b3a827e2Smrg  need_version=no
2911b3a827e2Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
2912b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2913b3a827e2Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2914b3a827e2Smrg    dynamic_linker='NetBSD (a.out) ld.so'
291567ab2ff2Smrg  else
2916b3a827e2Smrg    library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2917b3a827e2Smrg    soname_spec='$libname$release$shared_ext$major'
2918b3a827e2Smrg    dynamic_linker='NetBSD ld.elf_so'
291967ab2ff2Smrg  fi
2920b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2921b3a827e2Smrg  shlibpath_overrides_runpath=yes
2922b3a827e2Smrg  hardcode_into_libs=yes
2923b3a827e2Smrg  ;;
292449e108a1Smrg
2925b3a827e2Smrgnewsos6)
2926b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2927b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2928b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2929b3a827e2Smrg  shlibpath_overrides_runpath=yes
2930b3a827e2Smrg  ;;
293149e108a1Smrg
2932b3a827e2Smrg*nto* | *qnx*)
2933b3a827e2Smrg  version_type=qnx
2934b3a827e2Smrg  need_lib_prefix=no
2935b3a827e2Smrg  need_version=no
2936b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2937b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2938b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2939b3a827e2Smrg  shlibpath_overrides_runpath=no
2940b3a827e2Smrg  hardcode_into_libs=yes
2941b3a827e2Smrg  dynamic_linker='ldqnx.so'
2942b3a827e2Smrg  ;;
294349e108a1Smrg
2944b3a827e2Smrgopenbsd* | bitrig*)
2945b3a827e2Smrg  version_type=sunos
2946b3a827e2Smrg  sys_lib_dlsearch_path_spec=/usr/lib
2947b3a827e2Smrg  need_lib_prefix=no
2948b3a827e2Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
2949b3a827e2Smrg    need_version=no
2950b3a827e2Smrg  else
2951b3a827e2Smrg    need_version=yes
2952b3a827e2Smrg  fi
2953b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
2954b3a827e2Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
2955b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2956b3a827e2Smrg  shlibpath_overrides_runpath=yes
2957b3a827e2Smrg  ;;
295849e108a1Smrg
2959b3a827e2Smrgos2*)
2960b3a827e2Smrg  libname_spec='$name'
2961b3a827e2Smrg  version_type=windows
2962b3a827e2Smrg  shrext_cmds=.dll
2963b3a827e2Smrg  need_version=no
2964b3a827e2Smrg  need_lib_prefix=no
2965b3a827e2Smrg  # OS/2 can only load a DLL with a base name of 8 characters or less.
2966b3a827e2Smrg  soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
2967b3a827e2Smrg    v=$($ECHO $release$versuffix | tr -d .-);
2968b3a827e2Smrg    n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
2969b3a827e2Smrg    $ECHO $n$v`$shared_ext'
2970b3a827e2Smrg  library_names_spec='${libname}_dll.$libext'
2971b3a827e2Smrg  dynamic_linker='OS/2 ld.exe'
2972b3a827e2Smrg  shlibpath_var=BEGINLIBPATH
297367ab2ff2Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2974b3a827e2Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2975b3a827e2Smrg  postinstall_cmds='base_file=`basename \$file`~
2976b3a827e2Smrg    dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
2977b3a827e2Smrg    dldir=$destdir/`dirname \$dlpath`~
2978b3a827e2Smrg    test -d \$dldir || mkdir -p \$dldir~
2979b3a827e2Smrg    $install_prog $dir/$dlname \$dldir/$dlname~
2980b3a827e2Smrg    chmod a+x \$dldir/$dlname~
2981b3a827e2Smrg    if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2982b3a827e2Smrg      eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2983b3a827e2Smrg    fi'
2984b3a827e2Smrg  postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
2985b3a827e2Smrg    dlpath=$dir/\$dldll~
2986b3a827e2Smrg    $RM \$dlpath'
298767ab2ff2Smrg  ;;
298849e108a1Smrg
2989b3a827e2Smrgosf3* | osf4* | osf5*)
2990b3a827e2Smrg  version_type=osf
299167ab2ff2Smrg  need_lib_prefix=no
299267ab2ff2Smrg  need_version=no
2993b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
2994b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
2995b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
2996b3a827e2Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
2997b3a827e2Smrg  sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
299867ab2ff2Smrg  ;;
2999f05b35a2Smrg
3000b3a827e2Smrgrdos*)
3001b3a827e2Smrg  dynamic_linker=no
300267ab2ff2Smrg  ;;
3003f05b35a2Smrg
3004b3a827e2Smrgsolaris*)
3005e494fffdSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3006b3a827e2Smrg  need_lib_prefix=no
300767ab2ff2Smrg  need_version=no
3008b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3009b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
301067ab2ff2Smrg  shlibpath_var=LD_LIBRARY_PATH
3011b3a827e2Smrg  shlibpath_overrides_runpath=yes
3012b3a827e2Smrg  hardcode_into_libs=yes
3013b3a827e2Smrg  # ldd complains unless libraries are executable
3014b3a827e2Smrg  postinstall_cmds='chmod +x $lib'
301567ab2ff2Smrg  ;;
3016f05b35a2Smrg
3017b3a827e2Smrgsunos4*)
3018b3a827e2Smrg  version_type=sunos
3019b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
3020b3a827e2Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
3021b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
3022b3a827e2Smrg  shlibpath_overrides_runpath=yes
3023b3a827e2Smrg  if test yes = "$with_gnu_ld"; then
3024b3a827e2Smrg    need_lib_prefix=no
3025b3a827e2Smrg  fi
3026b3a827e2Smrg  need_version=yes
3027b3a827e2Smrg  ;;
302867ab2ff2Smrg
3029b3a827e2Smrgsysv4 | sysv4.3*)
3030b3a827e2Smrg  version_type=linux # correct to gnu/linux during the next big refactor
3031b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3032b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
3033b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
3034b3a827e2Smrg  case $host_vendor in
3035b3a827e2Smrg    sni)
3036b3a827e2Smrg      shlibpath_overrides_runpath=no
3037b3a827e2Smrg      need_lib_prefix=no
3038b3a827e2Smrg      runpath_var=LD_RUN_PATH
303967ab2ff2Smrg      ;;
3040b3a827e2Smrg    siemens)
3041b3a827e2Smrg      need_lib_prefix=no
304267ab2ff2Smrg      ;;
3043b3a827e2Smrg    motorola)
3044b3a827e2Smrg      need_lib_prefix=no
3045b3a827e2Smrg      need_version=no
3046b3a827e2Smrg      shlibpath_overrides_runpath=no
3047b3a827e2Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
304867ab2ff2Smrg      ;;
304949e108a1Smrg  esac
305067ab2ff2Smrg  ;;
3051e0963edeSmrg
3052b3a827e2Smrgsysv4*MP*)
3053b3a827e2Smrg  if test -d /usr/nec; then
3054b3a827e2Smrg    version_type=linux # correct to gnu/linux during the next big refactor
3055b3a827e2Smrg    library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
3056b3a827e2Smrg    soname_spec='$libname$shared_ext.$major'
3057b3a827e2Smrg    shlibpath_var=LD_LIBRARY_PATH
3058b3a827e2Smrg  fi
305967ab2ff2Smrg  ;;
3060e0963edeSmrg
3061b3a827e2Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3062b3a827e2Smrg  version_type=sco
306367ab2ff2Smrg  need_lib_prefix=no
306467ab2ff2Smrg  need_version=no
3065b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
3066b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
3067e494fffdSmrg  shlibpath_var=LD_LIBRARY_PATH
3068b3a827e2Smrg  shlibpath_overrides_runpath=yes
3069b3a827e2Smrg  hardcode_into_libs=yes
3070b3a827e2Smrg  if test yes = "$with_gnu_ld"; then
3071b3a827e2Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
307267ab2ff2Smrg  else
3073b3a827e2Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
307467ab2ff2Smrg    case $host_os in
3075b3a827e2Smrg      sco3.2v5*)
3076b3a827e2Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
3077b3a827e2Smrg	;;
307867ab2ff2Smrg    esac
307967ab2ff2Smrg  fi
3080b3a827e2Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
308167ab2ff2Smrg  ;;
3082e0963edeSmrg
3083b3a827e2Smrgtpf*)
3084b3a827e2Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
3085e494fffdSmrg  version_type=linux # correct to gnu/linux during the next big refactor
308667ab2ff2Smrg  need_lib_prefix=no
308767ab2ff2Smrg  need_version=no
3088b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
308967ab2ff2Smrg  shlibpath_var=LD_LIBRARY_PATH
3090e494fffdSmrg  shlibpath_overrides_runpath=no
309167ab2ff2Smrg  hardcode_into_libs=yes
309267ab2ff2Smrg  ;;
3093e0963edeSmrg
3094b3a827e2Smrguts4*)
3095e494fffdSmrg  version_type=linux # correct to gnu/linux during the next big refactor
3096b3a827e2Smrg  library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
3097b3a827e2Smrg  soname_spec='$libname$release$shared_ext$major'
3098b3a827e2Smrg  shlibpath_var=LD_LIBRARY_PATH
309967ab2ff2Smrg  ;;
3100e0963edeSmrg
3101b3a827e2Smrg*)
3102b3a827e2Smrg  dynamic_linker=no
310367ab2ff2Smrg  ;;
3104b3a827e2Smrgesac
3105b3a827e2SmrgAC_MSG_RESULT([$dynamic_linker])
3106b3a827e2Smrgtest no = "$dynamic_linker" && can_build_shared=no
3107e0963edeSmrg
3108b3a827e2Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
3109b3a827e2Smrgif test yes = "$GCC"; then
3110b3a827e2Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
3111b3a827e2Smrgfi
3112e0963edeSmrg
3113b3a827e2Smrgif test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
3114b3a827e2Smrg  sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
3115b3a827e2Smrgfi
311649e108a1Smrg
3117b3a827e2Smrgif test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
3118b3a827e2Smrg  sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
3119b3a827e2Smrgfi
312049e108a1Smrg
3121b3a827e2Smrg# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
3122b3a827e2Smrgconfigure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
312367ab2ff2Smrg
3124b3a827e2Smrg# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
3125b3a827e2Smrgfunc_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
312667ab2ff2Smrg
3127b3a827e2Smrg# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
3128b3a827e2Smrgconfigure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
312967ab2ff2Smrg
3130b3a827e2Smrg_LT_DECL([], [variables_saved_for_relink], [1],
3131b3a827e2Smrg    [Variables whose values should be saved in libtool wrapper scripts and
3132b3a827e2Smrg    restored at link time])
3133b3a827e2Smrg_LT_DECL([], [need_lib_prefix], [0],
3134b3a827e2Smrg    [Do we need the "lib" prefix for modules?])
3135b3a827e2Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
3136b3a827e2Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
3137b3a827e2Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
3138b3a827e2Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
3139b3a827e2Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
3140b3a827e2Smrg    [Is shlibpath searched before the hard-coded library search path?])
3141b3a827e2Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
3142b3a827e2Smrg_LT_DECL([], [library_names_spec], [1],
3143b3a827e2Smrg    [[List of archive names.  First name is the real one, the rest are links.
3144b3a827e2Smrg    The last name is the one that the linker finds with -lNAME]])
3145b3a827e2Smrg_LT_DECL([], [soname_spec], [1],
3146b3a827e2Smrg    [[The coded name of the library, if different from the real name]])
3147b3a827e2Smrg_LT_DECL([], [install_override_mode], [1],
3148b3a827e2Smrg    [Permission mode override for installation of shared libraries])
3149b3a827e2Smrg_LT_DECL([], [postinstall_cmds], [2],
3150b3a827e2Smrg    [Command to use after installation of a shared archive])
3151b3a827e2Smrg_LT_DECL([], [postuninstall_cmds], [2],
3152b3a827e2Smrg    [Command to use after uninstallation of a shared archive])
3153b3a827e2Smrg_LT_DECL([], [finish_cmds], [2],
3154b3a827e2Smrg    [Commands used to finish a libtool library installation in a directory])
3155b3a827e2Smrg_LT_DECL([], [finish_eval], [1],
3156b3a827e2Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
3157b3a827e2Smrg    not shown]])
3158b3a827e2Smrg_LT_DECL([], [hardcode_into_libs], [0],
3159b3a827e2Smrg    [Whether we should hardcode library paths into libraries])
3160b3a827e2Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
3161b3a827e2Smrg    [Compile-time system search path for libraries])
3162b3a827e2Smrg_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
3163b3a827e2Smrg    [Detected run-time system search path for libraries])
3164b3a827e2Smrg_LT_DECL([], [configure_time_lt_sys_library_path], [2],
3165b3a827e2Smrg    [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
3166b3a827e2Smrg])# _LT_SYS_DYNAMIC_LINKER
3167e0963edeSmrg
3168e0963edeSmrg
3169b3a827e2Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
3170b3a827e2Smrg# --------------------------
3171b3a827e2Smrg# find a file program that can recognize shared library
3172b3a827e2SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
3173b3a827e2Smrg[m4_require([_LT_DECL_EGREP])dnl
3174b3a827e2SmrgAC_MSG_CHECKING([for $1])
3175b3a827e2SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
3176b3a827e2Smrg[case $MAGIC_CMD in
3177b3a827e2Smrg[[\\/*] |  ?:[\\/]*])
3178b3a827e2Smrg  lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
317949e108a1Smrg  ;;
3180b3a827e2Smrg*)
3181b3a827e2Smrg  lt_save_MAGIC_CMD=$MAGIC_CMD
3182b3a827e2Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
3183b3a827e2Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
3184b3a827e2Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
3185b3a827e2Smrgdnl not every word.  This closes a longstanding sh security hole.
3186b3a827e2Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
3187b3a827e2Smrg  for ac_dir in $ac_dummy; do
3188b3a827e2Smrg    IFS=$lt_save_ifs
3189b3a827e2Smrg    test -z "$ac_dir" && ac_dir=.
3190b3a827e2Smrg    if test -f "$ac_dir/$1"; then
3191b3a827e2Smrg      lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
3192b3a827e2Smrg      if test -n "$file_magic_test_file"; then
3193b3a827e2Smrg	case $deplibs_check_method in
3194b3a827e2Smrg	"file_magic "*)
3195b3a827e2Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
3196b3a827e2Smrg	  MAGIC_CMD=$lt_cv_path_MAGIC_CMD
3197b3a827e2Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
3198b3a827e2Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
3199b3a827e2Smrg	    :
3200b3a827e2Smrg	  else
3201b3a827e2Smrg	    cat <<_LT_EOF 1>&2
3202e0963edeSmrg
3203b3a827e2Smrg*** Warning: the command libtool uses to detect shared libraries,
3204b3a827e2Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
3205b3a827e2Smrg*** The result is that libtool may fail to recognize shared libraries
3206b3a827e2Smrg*** as such.  This will affect the creation of libtool libraries that
3207b3a827e2Smrg*** depend on shared libraries, but programs linked with such libtool
3208b3a827e2Smrg*** libraries will work regardless of this problem.  Nevertheless, you
3209b3a827e2Smrg*** may want to report the problem to your system manager and/or to
3210b3a827e2Smrg*** bug-libtool@gnu.org
321167ab2ff2Smrg
3212b3a827e2Smrg_LT_EOF
3213b3a827e2Smrg	  fi ;;
3214b3a827e2Smrg	esac
3215b3a827e2Smrg      fi
3216b3a827e2Smrg      break
3217b3a827e2Smrg    fi
3218b3a827e2Smrg  done
3219b3a827e2Smrg  IFS=$lt_save_ifs
3220b3a827e2Smrg  MAGIC_CMD=$lt_save_MAGIC_CMD
322149e108a1Smrg  ;;
3222b3a827e2Smrgesac])
3223b3a827e2SmrgMAGIC_CMD=$lt_cv_path_MAGIC_CMD
3224b3a827e2Smrgif test -n "$MAGIC_CMD"; then
3225b3a827e2Smrg  AC_MSG_RESULT($MAGIC_CMD)
3226b3a827e2Smrgelse
3227b3a827e2Smrg  AC_MSG_RESULT(no)
3228b3a827e2Smrgfi
3229b3a827e2Smrg_LT_DECL([], [MAGIC_CMD], [0],
3230b3a827e2Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3231b3a827e2Smrg])# _LT_PATH_TOOL_PREFIX
323249e108a1Smrg
3233b3a827e2Smrg# Old name:
3234b3a827e2SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3235b3a827e2Smrgdnl aclocal-1.4 backwards compatibility:
3236b3a827e2Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
3237e0963edeSmrg
3238e0963edeSmrg
323949e108a1Smrg# _LT_PATH_MAGIC
324049e108a1Smrg# --------------
3241b3a827e2Smrg# find a file program that can recognize a shared library
324249e108a1Smrgm4_defun([_LT_PATH_MAGIC],
324349e108a1Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
324449e108a1Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
324549e108a1Smrg  if test -n "$ac_tool_prefix"; then
324649e108a1Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
324749e108a1Smrg  else
324849e108a1Smrg    MAGIC_CMD=:
324949e108a1Smrg  fi
325049e108a1Smrgfi
325149e108a1Smrg])# _LT_PATH_MAGIC
3252e0963edeSmrg
3253e0963edeSmrg
325449e108a1Smrg# LT_PATH_LD
325549e108a1Smrg# ----------
325649e108a1Smrg# find the pathname to the GNU or non-GNU linker
325749e108a1SmrgAC_DEFUN([LT_PATH_LD],
325849e108a1Smrg[AC_REQUIRE([AC_PROG_CC])dnl
325949e108a1SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
326049e108a1SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
326149e108a1Smrgm4_require([_LT_DECL_SED])dnl
326249e108a1Smrgm4_require([_LT_DECL_EGREP])dnl
326349e108a1Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3264e0963edeSmrg
326549e108a1SmrgAC_ARG_WITH([gnu-ld],
326649e108a1Smrg    [AS_HELP_STRING([--with-gnu-ld],
326749e108a1Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3268b3a827e2Smrg    [test no = "$withval" || with_gnu_ld=yes],
326949e108a1Smrg    [with_gnu_ld=no])dnl
3270e0963edeSmrg
327149e108a1Smrgac_prog=ld
3272b3a827e2Smrgif test yes = "$GCC"; then
327349e108a1Smrg  # Check if gcc -print-prog-name=ld gives a path.
327449e108a1Smrg  AC_MSG_CHECKING([for ld used by $CC])
327549e108a1Smrg  case $host in
327649e108a1Smrg  *-*-mingw*)
3277b3a827e2Smrg    # gcc leaves a trailing carriage return, which upsets mingw
327849e108a1Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
327949e108a1Smrg  *)
328049e108a1Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
328149e108a1Smrg  esac
328249e108a1Smrg  case $ac_prog in
328349e108a1Smrg    # Accept absolute paths.
328449e108a1Smrg    [[\\/]]* | ?:[[\\/]]*)
328549e108a1Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
328649e108a1Smrg      # Canonicalize the pathname of ld
328749e108a1Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
328849e108a1Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
328949e108a1Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
329049e108a1Smrg      done
3291b3a827e2Smrg      test -z "$LD" && LD=$ac_prog
3292f05b35a2Smrg      ;;
329349e108a1Smrg  "")
329449e108a1Smrg    # If it fails, then pretend we aren't using GCC.
329549e108a1Smrg    ac_prog=ld
329649e108a1Smrg    ;;
329749e108a1Smrg  *)
329849e108a1Smrg    # If it is relative, then search for the first ld in PATH.
329949e108a1Smrg    with_gnu_ld=unknown
330049e108a1Smrg    ;;
330149e108a1Smrg  esac
3302b3a827e2Smrgelif test yes = "$with_gnu_ld"; then
330349e108a1Smrg  AC_MSG_CHECKING([for GNU ld])
330449e108a1Smrgelse
330549e108a1Smrg  AC_MSG_CHECKING([for non-GNU ld])
330649e108a1Smrgfi
330749e108a1SmrgAC_CACHE_VAL(lt_cv_path_LD,
330849e108a1Smrg[if test -z "$LD"; then
3309b3a827e2Smrg  lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
331049e108a1Smrg  for ac_dir in $PATH; do
3311b3a827e2Smrg    IFS=$lt_save_ifs
331249e108a1Smrg    test -z "$ac_dir" && ac_dir=.
331349e108a1Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3314b3a827e2Smrg      lt_cv_path_LD=$ac_dir/$ac_prog
331549e108a1Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
331649e108a1Smrg      # but apparently some variants of GNU ld only accept -v.
331749e108a1Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
331849e108a1Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
331949e108a1Smrg      *GNU* | *'with BFD'*)
3320b3a827e2Smrg	test no != "$with_gnu_ld" && break
3321f05b35a2Smrg	;;
332249e108a1Smrg      *)
3323b3a827e2Smrg	test yes != "$with_gnu_ld" && break
3324f05b35a2Smrg	;;
3325f05b35a2Smrg      esac
332649e108a1Smrg    fi
332749e108a1Smrg  done
3328b3a827e2Smrg  IFS=$lt_save_ifs
332949e108a1Smrgelse
3330b3a827e2Smrg  lt_cv_path_LD=$LD # Let the user override the test with a path.
333149e108a1Smrgfi])
3332b3a827e2SmrgLD=$lt_cv_path_LD
333349e108a1Smrgif test -n "$LD"; then
333449e108a1Smrg  AC_MSG_RESULT($LD)
333549e108a1Smrgelse
333649e108a1Smrg  AC_MSG_RESULT(no)
333749e108a1Smrgfi
333849e108a1Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
333949e108a1Smrg_LT_PATH_LD_GNU
334049e108a1SmrgAC_SUBST([LD])
3341e0963edeSmrg
334249e108a1Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
334349e108a1Smrg])# LT_PATH_LD
3344e0963edeSmrg
334549e108a1Smrg# Old names:
334649e108a1SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
334749e108a1SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
334849e108a1Smrgdnl aclocal-1.4 backwards compatibility:
334949e108a1Smrgdnl AC_DEFUN([AM_PROG_LD], [])
335049e108a1Smrgdnl AC_DEFUN([AC_PROG_LD], [])
335149e108a1Smrg
335249e108a1Smrg
335349e108a1Smrg# _LT_PATH_LD_GNU
335449e108a1Smrg#- --------------
335549e108a1Smrgm4_defun([_LT_PATH_LD_GNU],
335649e108a1Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
335749e108a1Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
335849e108a1Smrgcase `$LD -v 2>&1 </dev/null` in
335949e108a1Smrg*GNU* | *'with BFD'*)
336049e108a1Smrg  lt_cv_prog_gnu_ld=yes
336149e108a1Smrg  ;;
336249e108a1Smrg*)
336349e108a1Smrg  lt_cv_prog_gnu_ld=no
336449e108a1Smrg  ;;
336549e108a1Smrgesac])
336649e108a1Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
336749e108a1Smrg])# _LT_PATH_LD_GNU
336849e108a1Smrg
336949e108a1Smrg
337049e108a1Smrg# _LT_CMD_RELOAD
337149e108a1Smrg# --------------
337249e108a1Smrg# find reload flag for linker
337349e108a1Smrg#   -- PORTME Some linkers may need a different reload flag.
337449e108a1Smrgm4_defun([_LT_CMD_RELOAD],
337549e108a1Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
337649e108a1Smrg  lt_cv_ld_reload_flag,
337749e108a1Smrg  [lt_cv_ld_reload_flag='-r'])
337849e108a1Smrgreload_flag=$lt_cv_ld_reload_flag
337949e108a1Smrgcase $reload_flag in
338049e108a1Smrg"" | " "*) ;;
338149e108a1Smrg*) reload_flag=" $reload_flag" ;;
338249e108a1Smrgesac
338349e108a1Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
338449e108a1Smrgcase $host_os in
338567ab2ff2Smrg  cygwin* | mingw* | pw32* | cegcc*)
3386b3a827e2Smrg    if test yes != "$GCC"; then
338767ab2ff2Smrg      reload_cmds=false
338867ab2ff2Smrg    fi
338967ab2ff2Smrg    ;;
339049e108a1Smrg  darwin*)
3391b3a827e2Smrg    if test yes = "$GCC"; then
3392b3a827e2Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
339349e108a1Smrg    else
339449e108a1Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
339549e108a1Smrg    fi
339649e108a1Smrg    ;;
339749e108a1Smrgesac
339849e108a1Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
339949e108a1Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
340049e108a1Smrg])# _LT_CMD_RELOAD
3401e0963edeSmrg
3402e0963edeSmrg
3403b3a827e2Smrg# _LT_PATH_DD
3404b3a827e2Smrg# -----------
3405b3a827e2Smrg# find a working dd
3406b3a827e2Smrgm4_defun([_LT_PATH_DD],
3407b3a827e2Smrg[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
3408b3a827e2Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3409b3a827e2Smrgcat conftest.i conftest.i >conftest2.i
3410b3a827e2Smrg: ${lt_DD:=$DD}
3411b3a827e2SmrgAC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
3412b3a827e2Smrg[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3413b3a827e2Smrg  cmp -s conftest.i conftest.out \
3414b3a827e2Smrg  && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
3415b3a827e2Smrgfi])
3416b3a827e2Smrgrm -f conftest.i conftest2.i conftest.out])
3417b3a827e2Smrg])# _LT_PATH_DD
3418b3a827e2Smrg
3419b3a827e2Smrg
3420b3a827e2Smrg# _LT_CMD_TRUNCATE
3421b3a827e2Smrg# ----------------
3422b3a827e2Smrg# find command to truncate a binary pipe
3423b3a827e2Smrgm4_defun([_LT_CMD_TRUNCATE],
3424b3a827e2Smrg[m4_require([_LT_PATH_DD])
3425b3a827e2SmrgAC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
3426b3a827e2Smrg[printf 0123456789abcdef0123456789abcdef >conftest.i
3427b3a827e2Smrgcat conftest.i conftest.i >conftest2.i
3428b3a827e2Smrglt_cv_truncate_bin=
3429b3a827e2Smrgif "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
3430b3a827e2Smrg  cmp -s conftest.i conftest.out \
3431b3a827e2Smrg  && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
3432b3a827e2Smrgfi
3433b3a827e2Smrgrm -f conftest.i conftest2.i conftest.out
3434b3a827e2Smrgtest -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
3435b3a827e2Smrg_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
3436b3a827e2Smrg  [Command to truncate a binary pipe])
3437b3a827e2Smrg])# _LT_CMD_TRUNCATE
3438b3a827e2Smrg
3439b3a827e2Smrg
344049e108a1Smrg# _LT_CHECK_MAGIC_METHOD
344149e108a1Smrg# ----------------------
344249e108a1Smrg# how to check for library dependencies
344349e108a1Smrg#  -- PORTME fill in with the dynamic library characteristics
344449e108a1Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
344549e108a1Smrg[m4_require([_LT_DECL_EGREP])
344649e108a1Smrgm4_require([_LT_DECL_OBJDUMP])
344749e108a1SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
344849e108a1Smrglt_cv_deplibs_check_method,
344949e108a1Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
345049e108a1Smrglt_cv_file_magic_test_file=
345149e108a1Smrglt_cv_deplibs_check_method='unknown'
345249e108a1Smrg# Need to set the preceding variable on all platforms that support
345349e108a1Smrg# interlibrary dependencies.
345449e108a1Smrg# 'none' -- dependencies not supported.
3455b3a827e2Smrg# 'unknown' -- same as none, but documents that we really don't know.
345649e108a1Smrg# 'pass_all' -- all dependencies passed with no checks.
345749e108a1Smrg# 'test_compile' -- check by making test program.
345849e108a1Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
3459b3a827e2Smrg# that responds to the $file_magic_cmd with a given extended regex.
3460b3a827e2Smrg# If you have 'file' or equivalent on your system and you're not sure
3461b3a827e2Smrg# whether 'pass_all' will *always* work, you probably want this one.
3462e0963edeSmrg
346349e108a1Smrgcase $host_os in
346449e108a1Smrgaix[[4-9]]*)
346549e108a1Smrg  lt_cv_deplibs_check_method=pass_all
346649e108a1Smrg  ;;
3467e0963edeSmrg
346849e108a1Smrgbeos*)
346949e108a1Smrg  lt_cv_deplibs_check_method=pass_all
347049e108a1Smrg  ;;
3471e0963edeSmrg
347249e108a1Smrgbsdi[[45]]*)
347349e108a1Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
347449e108a1Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
347549e108a1Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
347649e108a1Smrg  ;;
3477e0963edeSmrg
347849e108a1Smrgcygwin*)
347949e108a1Smrg  # func_win32_libid is a shell function defined in ltmain.sh
348049e108a1Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
348149e108a1Smrg  lt_cv_file_magic_cmd='func_win32_libid'
348249e108a1Smrg  ;;
3483e0963edeSmrg
348449e108a1Smrgmingw* | pw32*)
348549e108a1Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
348649e108a1Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
348749e108a1Smrg  # unless we find 'file', for example because we are cross-compiling.
3488b3a827e2Smrg  if ( file / ) >/dev/null 2>&1; then
348949e108a1Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
349049e108a1Smrg    lt_cv_file_magic_cmd='func_win32_libid'
349149e108a1Smrg  else
349249e108a1Smrg    # Keep this pattern in sync with the one in func_win32_libid.
349349e108a1Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
349449e108a1Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3495f05b35a2Smrg  fi
349649e108a1Smrg  ;;
3497e0963edeSmrg
349849e108a1Smrgcegcc*)
349949e108a1Smrg  # use the weaker test based on 'objdump'. See mingw*.
350049e108a1Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
350149e108a1Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
350249e108a1Smrg  ;;
3503e0963edeSmrg
350449e108a1Smrgdarwin* | rhapsody*)
350549e108a1Smrg  lt_cv_deplibs_check_method=pass_all
350649e108a1Smrg  ;;
3507e0963edeSmrg
350849e108a1Smrgfreebsd* | dragonfly*)
350949e108a1Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
351049e108a1Smrg    case $host_cpu in
351149e108a1Smrg    i*86 )
351249e108a1Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
351349e108a1Smrg      # Let's accept both of them until this is cleared up.
351449e108a1Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
351549e108a1Smrg      lt_cv_file_magic_cmd=/usr/bin/file
351649e108a1Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
3517f05b35a2Smrg      ;;
3518f05b35a2Smrg    esac
351949e108a1Smrg  else
352049e108a1Smrg    lt_cv_deplibs_check_method=pass_all
3521f05b35a2Smrg  fi
3522f05b35a2Smrg  ;;
3523e0963edeSmrg
352449e108a1Smrghaiku*)
352549e108a1Smrg  lt_cv_deplibs_check_method=pass_all
352649e108a1Smrg  ;;
3527f05b35a2Smrg
352849e108a1Smrghpux10.20* | hpux11*)
352949e108a1Smrg  lt_cv_file_magic_cmd=/usr/bin/file
353049e108a1Smrg  case $host_cpu in
353149e108a1Smrg  ia64*)
353249e108a1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
353349e108a1Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
353449e108a1Smrg    ;;
353549e108a1Smrg  hppa*64*)
353649e108a1Smrg    [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]']
353749e108a1Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
353849e108a1Smrg    ;;
353949e108a1Smrg  *)
354049e108a1Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
354149e108a1Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
354249e108a1Smrg    ;;
354349e108a1Smrg  esac
354449e108a1Smrg  ;;
3545e0963edeSmrg
354649e108a1Smrginterix[[3-9]]*)
354749e108a1Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
354849e108a1Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
354949e108a1Smrg  ;;
3550e0963edeSmrg
355149e108a1Smrgirix5* | irix6* | nonstopux*)
355249e108a1Smrg  case $LD in
355349e108a1Smrg  *-32|*"-32 ") libmagic=32-bit;;
355449e108a1Smrg  *-n32|*"-n32 ") libmagic=N32;;
355549e108a1Smrg  *-64|*"-64 ") libmagic=64-bit;;
355649e108a1Smrg  *) libmagic=never-match;;
355749e108a1Smrg  esac
355849e108a1Smrg  lt_cv_deplibs_check_method=pass_all
355949e108a1Smrg  ;;
3560e0963edeSmrg
3561e494fffdSmrg# This must be glibc/ELF.
3562b3a827e2Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
356349e108a1Smrg  lt_cv_deplibs_check_method=pass_all
356449e108a1Smrg  ;;
3565e0963edeSmrg
356649e108a1Smrgnetbsd*)
356749e108a1Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
356849e108a1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
356949e108a1Smrg  else
357049e108a1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
357149e108a1Smrg  fi
357249e108a1Smrg  ;;
3573e0963edeSmrg
357449e108a1Smrgnewos6*)
357549e108a1Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
357649e108a1Smrg  lt_cv_file_magic_cmd=/usr/bin/file
357749e108a1Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
357849e108a1Smrg  ;;
3579e0963edeSmrg
358049e108a1Smrg*nto* | *qnx*)
358149e108a1Smrg  lt_cv_deplibs_check_method=pass_all
358249e108a1Smrg  ;;
3583e0963edeSmrg
3584b3a827e2Smrgopenbsd* | bitrig*)
3585b3a827e2Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
358649e108a1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
358749e108a1Smrg  else
358849e108a1Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
358949e108a1Smrg  fi
359049e108a1Smrg  ;;
3591f05b35a2Smrg
359249e108a1Smrgosf3* | osf4* | osf5*)
359349e108a1Smrg  lt_cv_deplibs_check_method=pass_all
359449e108a1Smrg  ;;
3595f05b35a2Smrg
359649e108a1Smrgrdos*)
359749e108a1Smrg  lt_cv_deplibs_check_method=pass_all
359849e108a1Smrg  ;;
3599f05b35a2Smrg
360049e108a1Smrgsolaris*)
360149e108a1Smrg  lt_cv_deplibs_check_method=pass_all
360249e108a1Smrg  ;;
3603e0963edeSmrg
360449e108a1Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
360549e108a1Smrg  lt_cv_deplibs_check_method=pass_all
360649e108a1Smrg  ;;
360749e108a1Smrg
360849e108a1Smrgsysv4 | sysv4.3*)
360949e108a1Smrg  case $host_vendor in
361049e108a1Smrg  motorola)
361149e108a1Smrg    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]]'
361249e108a1Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
361349e108a1Smrg    ;;
361449e108a1Smrg  ncr)
361549e108a1Smrg    lt_cv_deplibs_check_method=pass_all
361649e108a1Smrg    ;;
361749e108a1Smrg  sequent)
361849e108a1Smrg    lt_cv_file_magic_cmd='/bin/file'
361949e108a1Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
362049e108a1Smrg    ;;
362149e108a1Smrg  sni)
362249e108a1Smrg    lt_cv_file_magic_cmd='/bin/file'
362349e108a1Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
362449e108a1Smrg    lt_cv_file_magic_test_file=/lib/libc.so
362549e108a1Smrg    ;;
362649e108a1Smrg  siemens)
362749e108a1Smrg    lt_cv_deplibs_check_method=pass_all
362849e108a1Smrg    ;;
362949e108a1Smrg  pc)
363049e108a1Smrg    lt_cv_deplibs_check_method=pass_all
3631f05b35a2Smrg    ;;
3632f05b35a2Smrg  esac
363349e108a1Smrg  ;;
3634e0963edeSmrg
363549e108a1Smrgtpf*)
363649e108a1Smrg  lt_cv_deplibs_check_method=pass_all
363749e108a1Smrg  ;;
3638b3a827e2Smrgos2*)
3639b3a827e2Smrg  lt_cv_deplibs_check_method=pass_all
3640b3a827e2Smrg  ;;
364149e108a1Smrgesac
364249e108a1Smrg])
364367ab2ff2Smrg
364467ab2ff2Smrgfile_magic_glob=
364567ab2ff2Smrgwant_nocaseglob=no
364667ab2ff2Smrgif test "$build" = "$host"; then
364767ab2ff2Smrg  case $host_os in
364867ab2ff2Smrg  mingw* | pw32*)
364967ab2ff2Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
365067ab2ff2Smrg      want_nocaseglob=yes
365167ab2ff2Smrg    else
365267ab2ff2Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
365367ab2ff2Smrg    fi
365467ab2ff2Smrg    ;;
365567ab2ff2Smrg  esac
365667ab2ff2Smrgfi
365767ab2ff2Smrg
365849e108a1Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
365949e108a1Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
366049e108a1Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
3661e0963edeSmrg
366249e108a1Smrg_LT_DECL([], [deplibs_check_method], [1],
366349e108a1Smrg    [Method to check whether dependent libraries are shared objects])
366449e108a1Smrg_LT_DECL([], [file_magic_cmd], [1],
366567ab2ff2Smrg    [Command to use when deplibs_check_method = "file_magic"])
366667ab2ff2Smrg_LT_DECL([], [file_magic_glob], [1],
366767ab2ff2Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
366867ab2ff2Smrg_LT_DECL([], [want_nocaseglob], [1],
366967ab2ff2Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
367049e108a1Smrg])# _LT_CHECK_MAGIC_METHOD
3671e0963edeSmrg
3672e0963edeSmrg
367349e108a1Smrg# LT_PATH_NM
367449e108a1Smrg# ----------
367549e108a1Smrg# find the pathname to a BSD- or MS-compatible name lister
367649e108a1SmrgAC_DEFUN([LT_PATH_NM],
367749e108a1Smrg[AC_REQUIRE([AC_PROG_CC])dnl
367849e108a1SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
367949e108a1Smrg[if test -n "$NM"; then
368049e108a1Smrg  # Let the user override the test.
3681b3a827e2Smrg  lt_cv_path_NM=$NM
3682f05b35a2Smrgelse
3683b3a827e2Smrg  lt_nm_to_check=${ac_tool_prefix}nm
368449e108a1Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
368549e108a1Smrg    lt_nm_to_check="$lt_nm_to_check nm"
368649e108a1Smrg  fi
368749e108a1Smrg  for lt_tmp_nm in $lt_nm_to_check; do
3688b3a827e2Smrg    lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
368949e108a1Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
3690b3a827e2Smrg      IFS=$lt_save_ifs
369149e108a1Smrg      test -z "$ac_dir" && ac_dir=.
3692b3a827e2Smrg      tmp_nm=$ac_dir/$lt_tmp_nm
3693b3a827e2Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
369449e108a1Smrg	# Check to see if the nm accepts a BSD-compat flag.
3695b3a827e2Smrg	# Adding the 'sed 1q' prevents false positives on HP-UX, which says:
369649e108a1Smrg	#   nm: unknown option "B" ignored
369749e108a1Smrg	# Tru64's nm complains that /dev/null is an invalid object file
3698b3a827e2Smrg	# MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
3699b3a827e2Smrg	case $build_os in
3700b3a827e2Smrg	mingw*) lt_bad_file=conftest.nm/nofile ;;
3701b3a827e2Smrg	*) lt_bad_file=/dev/null ;;
3702b3a827e2Smrg	esac
3703b3a827e2Smrg	case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
3704b3a827e2Smrg	*$lt_bad_file* | *'Invalid file or object type'*)
370549e108a1Smrg	  lt_cv_path_NM="$tmp_nm -B"
3706b3a827e2Smrg	  break 2
370749e108a1Smrg	  ;;
370849e108a1Smrg	*)
370949e108a1Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
371049e108a1Smrg	  */dev/null*)
371149e108a1Smrg	    lt_cv_path_NM="$tmp_nm -p"
3712b3a827e2Smrg	    break 2
371349e108a1Smrg	    ;;
371449e108a1Smrg	  *)
371549e108a1Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
371649e108a1Smrg	    continue # so that we can try to find one that supports BSD flags
371749e108a1Smrg	    ;;
371849e108a1Smrg	  esac
371949e108a1Smrg	  ;;
372049e108a1Smrg	esac
372149e108a1Smrg      fi
372249e108a1Smrg    done
3723b3a827e2Smrg    IFS=$lt_save_ifs
372449e108a1Smrg  done
372549e108a1Smrg  : ${lt_cv_path_NM=no}
372649e108a1Smrgfi])
3727b3a827e2Smrgif test no != "$lt_cv_path_NM"; then
3728b3a827e2Smrg  NM=$lt_cv_path_NM
372949e108a1Smrgelse
373049e108a1Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
373149e108a1Smrg  if test -n "$DUMPBIN"; then :
373249e108a1Smrg    # Let the user override the test.
373349e108a1Smrg  else
373449e108a1Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3735b3a827e2Smrg    case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
373649e108a1Smrg    *COFF*)
3737b3a827e2Smrg      DUMPBIN="$DUMPBIN -symbols -headers"
373849e108a1Smrg      ;;
373949e108a1Smrg    *)
374049e108a1Smrg      DUMPBIN=:
374149e108a1Smrg      ;;
374249e108a1Smrg    esac
374349e108a1Smrg  fi
374449e108a1Smrg  AC_SUBST([DUMPBIN])
3745b3a827e2Smrg  if test : != "$DUMPBIN"; then
3746b3a827e2Smrg    NM=$DUMPBIN
374749e108a1Smrg  fi
3748f05b35a2Smrgfi
374949e108a1Smrgtest -z "$NM" && NM=nm
375049e108a1SmrgAC_SUBST([NM])
375149e108a1Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
375249e108a1Smrg
375349e108a1SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
375449e108a1Smrg  [lt_cv_nm_interface="BSD nm"
375549e108a1Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
375649e108a1Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
375749e108a1Smrg  (eval "$ac_compile" 2>conftest.err)
375849e108a1Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
375949e108a1Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
376049e108a1Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
376149e108a1Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
376249e108a1Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
376349e108a1Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
376449e108a1Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
376549e108a1Smrg    lt_cv_nm_interface="MS dumpbin"
376649e108a1Smrg  fi
376749e108a1Smrg  rm -f conftest*])
376849e108a1Smrg])# LT_PATH_NM
3769e0963edeSmrg
377049e108a1Smrg# Old names:
377149e108a1SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
377249e108a1SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3773f05b35a2Smrgdnl aclocal-1.4 backwards compatibility:
377449e108a1Smrgdnl AC_DEFUN([AM_PROG_NM], [])
377549e108a1Smrgdnl AC_DEFUN([AC_PROG_NM], [])
3776e0963edeSmrg
377767ab2ff2Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
377867ab2ff2Smrg# --------------------------------
377967ab2ff2Smrg# how to determine the name of the shared library
378067ab2ff2Smrg# associated with a specific link library.
378167ab2ff2Smrg#  -- PORTME fill in with the dynamic library characteristics
378267ab2ff2Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
378367ab2ff2Smrg[m4_require([_LT_DECL_EGREP])
378467ab2ff2Smrgm4_require([_LT_DECL_OBJDUMP])
378567ab2ff2Smrgm4_require([_LT_DECL_DLLTOOL])
378667ab2ff2SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
378767ab2ff2Smrglt_cv_sharedlib_from_linklib_cmd,
378867ab2ff2Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
378967ab2ff2Smrg
379067ab2ff2Smrgcase $host_os in
379167ab2ff2Smrgcygwin* | mingw* | pw32* | cegcc*)
3792b3a827e2Smrg  # two different shell functions defined in ltmain.sh;
3793b3a827e2Smrg  # decide which one to use based on capabilities of $DLLTOOL
379467ab2ff2Smrg  case `$DLLTOOL --help 2>&1` in
379567ab2ff2Smrg  *--identify-strict*)
379667ab2ff2Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
379767ab2ff2Smrg    ;;
379867ab2ff2Smrg  *)
379967ab2ff2Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
380067ab2ff2Smrg    ;;
380167ab2ff2Smrg  esac
380267ab2ff2Smrg  ;;
380367ab2ff2Smrg*)
380467ab2ff2Smrg  # fallback: assume linklib IS sharedlib
3805b3a827e2Smrg  lt_cv_sharedlib_from_linklib_cmd=$ECHO
380667ab2ff2Smrg  ;;
380767ab2ff2Smrgesac
380867ab2ff2Smrg])
380967ab2ff2Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
381067ab2ff2Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
381167ab2ff2Smrg
381267ab2ff2Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
381367ab2ff2Smrg    [Command to associate shared and link libraries])
381467ab2ff2Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
381567ab2ff2Smrg
381667ab2ff2Smrg
381767ab2ff2Smrg# _LT_PATH_MANIFEST_TOOL
381867ab2ff2Smrg# ----------------------
381967ab2ff2Smrg# locate the manifest tool
382067ab2ff2Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
382167ab2ff2Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
382267ab2ff2Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
382367ab2ff2SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
382467ab2ff2Smrg  [lt_cv_path_mainfest_tool=no
382567ab2ff2Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
382667ab2ff2Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
382767ab2ff2Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
382867ab2ff2Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
382967ab2ff2Smrg    lt_cv_path_mainfest_tool=yes
383067ab2ff2Smrg  fi
383167ab2ff2Smrg  rm -f conftest*])
3832b3a827e2Smrgif test yes != "$lt_cv_path_mainfest_tool"; then
383367ab2ff2Smrg  MANIFEST_TOOL=:
383467ab2ff2Smrgfi
383567ab2ff2Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
383667ab2ff2Smrg])# _LT_PATH_MANIFEST_TOOL
383767ab2ff2Smrg
3838e0963edeSmrg
3839b3a827e2Smrg# _LT_DLL_DEF_P([FILE])
3840b3a827e2Smrg# ---------------------
3841b3a827e2Smrg# True iff FILE is a Windows DLL '.def' file.
3842b3a827e2Smrg# Keep in sync with func_dll_def_p in the libtool script
3843b3a827e2SmrgAC_DEFUN([_LT_DLL_DEF_P],
3844b3a827e2Smrg[dnl
3845b3a827e2Smrg  test DEF = "`$SED -n dnl
3846b3a827e2Smrg    -e '\''s/^[[	 ]]*//'\'' dnl Strip leading whitespace
3847b3a827e2Smrg    -e '\''/^\(;.*\)*$/d'\'' dnl      Delete empty lines and comments
3848b3a827e2Smrg    -e '\''s/^\(EXPORTS\|LIBRARY\)\([[	 ]].*\)*$/DEF/p'\'' dnl
3849b3a827e2Smrg    -e q dnl                          Only consider the first "real" line
3850b3a827e2Smrg    $1`" dnl
3851b3a827e2Smrg])# _LT_DLL_DEF_P
3852b3a827e2Smrg
3853b3a827e2Smrg
385449e108a1Smrg# LT_LIB_M
385549e108a1Smrg# --------
385649e108a1Smrg# check for math library
385749e108a1SmrgAC_DEFUN([LT_LIB_M],
385849e108a1Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
385949e108a1SmrgLIBM=
386049e108a1Smrgcase $host in
386149e108a1Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
386249e108a1Smrg  # These system don't have libm, or don't need it
386349e108a1Smrg  ;;
386449e108a1Smrg*-ncr-sysv4.3*)
3865b3a827e2Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
386649e108a1Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
386749e108a1Smrg  ;;
386849e108a1Smrg*)
3869b3a827e2Smrg  AC_CHECK_LIB(m, cos, LIBM=-lm)
387049e108a1Smrg  ;;
387149e108a1Smrgesac
387249e108a1SmrgAC_SUBST([LIBM])
387349e108a1Smrg])# LT_LIB_M
387449e108a1Smrg
387549e108a1Smrg# Old name:
387649e108a1SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
387749e108a1Smrgdnl aclocal-1.4 backwards compatibility:
387849e108a1Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
3879f05b35a2Smrg
3880e0963edeSmrg
388149e108a1Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
388249e108a1Smrg# -------------------------------
388349e108a1Smrgm4_defun([_LT_COMPILER_NO_RTTI],
388449e108a1Smrg[m4_require([_LT_TAG_COMPILER])dnl
3885e0963edeSmrg
388649e108a1Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
3887f05b35a2Smrg
3888b3a827e2Smrgif test yes = "$GCC"; then
388949e108a1Smrg  case $cc_basename in
389049e108a1Smrg  nvcc*)
389149e108a1Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
389249e108a1Smrg  *)
389349e108a1Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
389449e108a1Smrg  esac
3895f05b35a2Smrg
389649e108a1Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
389749e108a1Smrg    lt_cv_prog_compiler_rtti_exceptions,
389849e108a1Smrg    [-fno-rtti -fno-exceptions], [],
389949e108a1Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
390049e108a1Smrgfi
390149e108a1Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
390249e108a1Smrg	[Compiler flag to turn off builtin functions])
390349e108a1Smrg])# _LT_COMPILER_NO_RTTI
3904f05b35a2Smrg
3905f05b35a2Smrg
390649e108a1Smrg# _LT_CMD_GLOBAL_SYMBOLS
390749e108a1Smrg# ----------------------
390849e108a1Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
390949e108a1Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
391049e108a1SmrgAC_REQUIRE([AC_PROG_CC])dnl
391149e108a1SmrgAC_REQUIRE([AC_PROG_AWK])dnl
391249e108a1SmrgAC_REQUIRE([LT_PATH_NM])dnl
391349e108a1SmrgAC_REQUIRE([LT_PATH_LD])dnl
391449e108a1Smrgm4_require([_LT_DECL_SED])dnl
391549e108a1Smrgm4_require([_LT_DECL_EGREP])dnl
391649e108a1Smrgm4_require([_LT_TAG_COMPILER])dnl
3917f05b35a2Smrg
391849e108a1Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
391949e108a1SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
392049e108a1SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
392149e108a1Smrg[
392249e108a1Smrg# These are sane defaults that work on at least a few old systems.
392349e108a1Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
3924e0963edeSmrg
392549e108a1Smrg# Character class describing NM global symbol codes.
392649e108a1Smrgsymcode='[[BCDEGRST]]'
3927e0963edeSmrg
392849e108a1Smrg# Regexp to match symbols that can be accessed directly from C.
392949e108a1Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3930e0963edeSmrg
393149e108a1Smrg# Define system-specific variables.
393249e108a1Smrgcase $host_os in
393349e108a1Smrgaix*)
393449e108a1Smrg  symcode='[[BCDT]]'
393549e108a1Smrg  ;;
393649e108a1Smrgcygwin* | mingw* | pw32* | cegcc*)
393749e108a1Smrg  symcode='[[ABCDGISTW]]'
393849e108a1Smrg  ;;
393949e108a1Smrghpux*)
3940b3a827e2Smrg  if test ia64 = "$host_cpu"; then
394149e108a1Smrg    symcode='[[ABCDEGRST]]'
394249e108a1Smrg  fi
394349e108a1Smrg  ;;
394449e108a1Smrgirix* | nonstopux*)
394549e108a1Smrg  symcode='[[BCDEGRST]]'
394649e108a1Smrg  ;;
394749e108a1Smrgosf*)
394849e108a1Smrg  symcode='[[BCDEGQRST]]'
394949e108a1Smrg  ;;
395049e108a1Smrgsolaris*)
395149e108a1Smrg  symcode='[[BDRT]]'
395249e108a1Smrg  ;;
395349e108a1Smrgsco3.2v5*)
395449e108a1Smrg  symcode='[[DT]]'
395549e108a1Smrg  ;;
395649e108a1Smrgsysv4.2uw2*)
395749e108a1Smrg  symcode='[[DT]]'
395849e108a1Smrg  ;;
395949e108a1Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
396049e108a1Smrg  symcode='[[ABDT]]'
396149e108a1Smrg  ;;
396249e108a1Smrgsysv4)
396349e108a1Smrg  symcode='[[DFNSTU]]'
396449e108a1Smrg  ;;
396549e108a1Smrgesac
3966e0963edeSmrg
396749e108a1Smrg# If we're using GNU nm, then use its standard symbol codes.
396849e108a1Smrgcase `$NM -V 2>&1` in
396949e108a1Smrg*GNU* | *'with BFD'*)
397049e108a1Smrg  symcode='[[ABCDGIRSTW]]' ;;
397149e108a1Smrgesac
3972e0963edeSmrg
3973b3a827e2Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3974b3a827e2Smrg  # Gets list of data symbols to import.
3975b3a827e2Smrg  lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
3976b3a827e2Smrg  # Adjust the below global symbol transforms to fixup imported variables.
3977b3a827e2Smrg  lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
3978b3a827e2Smrg  lt_c_name_hook=" -e 's/^I .* \(.*\)$/  {\"\1\", (void *) 0},/p'"
3979b3a827e2Smrg  lt_c_name_lib_hook="\
3980b3a827e2Smrg  -e 's/^I .* \(lib.*\)$/  {\"\1\", (void *) 0},/p'\
3981b3a827e2Smrg  -e 's/^I .* \(.*\)$/  {\"lib\1\", (void *) 0},/p'"
3982b3a827e2Smrgelse
3983b3a827e2Smrg  # Disable hooks by default.
3984b3a827e2Smrg  lt_cv_sys_global_symbol_to_import=
3985b3a827e2Smrg  lt_cdecl_hook=
3986b3a827e2Smrg  lt_c_name_hook=
3987b3a827e2Smrg  lt_c_name_lib_hook=
3988b3a827e2Smrgfi
3989b3a827e2Smrg
399049e108a1Smrg# Transform an extracted symbol line into a proper C declaration.
399149e108a1Smrg# Some systems (esp. on ia64) link data and code symbols differently,
399249e108a1Smrg# so use this general approach.
3993b3a827e2Smrglt_cv_sys_global_symbol_to_cdecl="sed -n"\
3994b3a827e2Smrg$lt_cdecl_hook\
3995b3a827e2Smrg" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
3996b3a827e2Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
3997e0963edeSmrg
399849e108a1Smrg# Transform an extracted symbol line into symbol name and symbol address
3999b3a827e2Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n"\
4000b3a827e2Smrg$lt_c_name_hook\
4001b3a827e2Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4002b3a827e2Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/p'"
4003b3a827e2Smrg
4004b3a827e2Smrg# Transform an extracted symbol line into symbol name with lib prefix and
4005b3a827e2Smrg# symbol address.
4006b3a827e2Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
4007b3a827e2Smrg$lt_c_name_lib_hook\
4008b3a827e2Smrg" -e 's/^: \(.*\) .*$/  {\"\1\", (void *) 0},/p'"\
4009b3a827e2Smrg" -e 's/^$symcode$symcode* .* \(lib.*\)$/  {\"\1\", (void *) \&\1},/p'"\
4010b3a827e2Smrg" -e 's/^$symcode$symcode* .* \(.*\)$/  {\"lib\1\", (void *) \&\1},/p'"
4011e0963edeSmrg
401249e108a1Smrg# Handle CRLF in mingw tool chain
401349e108a1Smrgopt_cr=
401449e108a1Smrgcase $build_os in
401549e108a1Smrgmingw*)
401649e108a1Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
401749e108a1Smrg  ;;
401849e108a1Smrgesac
4019f05b35a2Smrg
402049e108a1Smrg# Try without a prefix underscore, then with it.
402149e108a1Smrgfor ac_symprfx in "" "_"; do
4022e0963edeSmrg
402349e108a1Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
402449e108a1Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
4025e0963edeSmrg
402649e108a1Smrg  # Write the raw and C identifiers.
402749e108a1Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
4028b3a827e2Smrg    # Fake it for dumpbin and say T for any non-static function,
4029b3a827e2Smrg    # D for any global variable and I for any imported variable.
403049e108a1Smrg    # Also find C++ and __fastcall symbols from MSVC++,
403149e108a1Smrg    # which start with @ or ?.
403249e108a1Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
403349e108a1Smrg"     {last_section=section; section=\$ 3};"\
4034e494fffdSmrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
403549e108a1Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
4036b3a827e2Smrg"     /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
4037b3a827e2Smrg"     /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
4038b3a827e2Smrg"     /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
403949e108a1Smrg"     \$ 0!~/External *\|/{next};"\
404049e108a1Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
404149e108a1Smrg"     {if(hide[section]) next};"\
4042b3a827e2Smrg"     {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
4043b3a827e2Smrg"     {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
4044b3a827e2Smrg"     s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
4045b3a827e2Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
404649e108a1Smrg"     ' prfx=^$ac_symprfx]"
404749e108a1Smrg  else
404849e108a1Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
404949e108a1Smrg  fi
405067ab2ff2Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
4051e0963edeSmrg
405249e108a1Smrg  # Check to see that the pipe works correctly.
405349e108a1Smrg  pipe_works=no
4054f05b35a2Smrg
405549e108a1Smrg  rm -f conftest*
405649e108a1Smrg  cat > conftest.$ac_ext <<_LT_EOF
405749e108a1Smrg#ifdef __cplusplus
405849e108a1Smrgextern "C" {
405949e108a1Smrg#endif
406049e108a1Smrgchar nm_test_var;
406149e108a1Smrgvoid nm_test_func(void);
406249e108a1Smrgvoid nm_test_func(void){}
406349e108a1Smrg#ifdef __cplusplus
406449e108a1Smrg}
406549e108a1Smrg#endif
406649e108a1Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
406749e108a1Smrg_LT_EOF
4068e0963edeSmrg
406949e108a1Smrg  if AC_TRY_EVAL(ac_compile); then
407049e108a1Smrg    # Now try to grab the symbols.
407149e108a1Smrg    nlist=conftest.nm
407249e108a1Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
407349e108a1Smrg      # Try sorting and uniquifying the output.
407449e108a1Smrg      if sort "$nlist" | uniq > "$nlist"T; then
407549e108a1Smrg	mv -f "$nlist"T "$nlist"
407649e108a1Smrg      else
407749e108a1Smrg	rm -f "$nlist"T
407849e108a1Smrg      fi
4079e0963edeSmrg
408049e108a1Smrg      # Make sure that we snagged all the symbols we need.
408149e108a1Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
408249e108a1Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
408349e108a1Smrg	  cat <<_LT_EOF > conftest.$ac_ext
408467ab2ff2Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
4085b3a827e2Smrg#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
4086b3a827e2Smrg/* DATA imports from DLLs on WIN32 can't be const, because runtime
408767ab2ff2Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
408867ab2ff2Smrg# define LT@&t@_DLSYM_CONST
4089b3a827e2Smrg#elif defined __osf__
409067ab2ff2Smrg/* This system does not cope well with relocations in const data.  */
409167ab2ff2Smrg# define LT@&t@_DLSYM_CONST
409267ab2ff2Smrg#else
409367ab2ff2Smrg# define LT@&t@_DLSYM_CONST const
409467ab2ff2Smrg#endif
409567ab2ff2Smrg
409649e108a1Smrg#ifdef __cplusplus
409749e108a1Smrgextern "C" {
409849e108a1Smrg#endif
4099f05b35a2Smrg
410049e108a1Smrg_LT_EOF
410149e108a1Smrg	  # Now generate the symbol file.
410249e108a1Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
4103f05b35a2Smrg
410449e108a1Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
4105e0963edeSmrg
410649e108a1Smrg/* The mapping between symbol names and symbols.  */
410767ab2ff2SmrgLT@&t@_DLSYM_CONST struct {
410849e108a1Smrg  const char *name;
410949e108a1Smrg  void       *address;
411049e108a1Smrg}
411149e108a1Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
411249e108a1Smrg{
411349e108a1Smrg  { "@PROGRAM@", (void *) 0 },
411449e108a1Smrg_LT_EOF
4115b3a827e2Smrg	  $SED "s/^$symcode$symcode* .* \(.*\)$/  {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
411649e108a1Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
411749e108a1Smrg  {0, (void *) 0}
411849e108a1Smrg};
4119f05b35a2Smrg
412049e108a1Smrg/* This works around a problem in FreeBSD linker */
412149e108a1Smrg#ifdef FREEBSD_WORKAROUND
412249e108a1Smrgstatic const void *lt_preloaded_setup() {
412349e108a1Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
412449e108a1Smrg}
412549e108a1Smrg#endif
4126e0963edeSmrg
412749e108a1Smrg#ifdef __cplusplus
412849e108a1Smrg}
412949e108a1Smrg#endif
413049e108a1Smrg_LT_EOF
413149e108a1Smrg	  # Now try linking the two files.
413249e108a1Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
413367ab2ff2Smrg	  lt_globsym_save_LIBS=$LIBS
413467ab2ff2Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
4135b3a827e2Smrg	  LIBS=conftstm.$ac_objext
413649e108a1Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
4137b3a827e2Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
413849e108a1Smrg	    pipe_works=yes
413949e108a1Smrg	  fi
414067ab2ff2Smrg	  LIBS=$lt_globsym_save_LIBS
414167ab2ff2Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
4142f05b35a2Smrg	else
414349e108a1Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
4144f05b35a2Smrg	fi
414549e108a1Smrg      else
414649e108a1Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
414749e108a1Smrg      fi
414849e108a1Smrg    else
414949e108a1Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
415049e108a1Smrg    fi
415149e108a1Smrg  else
415249e108a1Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
415349e108a1Smrg    cat conftest.$ac_ext >&5
415449e108a1Smrg  fi
415549e108a1Smrg  rm -rf conftest* conftst*
4156e0963edeSmrg
415749e108a1Smrg  # Do not use the global_symbol_pipe unless it works.
4158b3a827e2Smrg  if test yes = "$pipe_works"; then
415949e108a1Smrg    break
416049e108a1Smrg  else
416149e108a1Smrg    lt_cv_sys_global_symbol_pipe=
416249e108a1Smrg  fi
416349e108a1Smrgdone
416449e108a1Smrg])
416549e108a1Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
416649e108a1Smrg  lt_cv_sys_global_symbol_to_cdecl=
416749e108a1Smrgfi
416849e108a1Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
416949e108a1Smrg  AC_MSG_RESULT(failed)
417049e108a1Smrgelse
417149e108a1Smrg  AC_MSG_RESULT(ok)
417249e108a1Smrgfi
4173e0963edeSmrg
417467ab2ff2Smrg# Response file support.
417567ab2ff2Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
417667ab2ff2Smrg  nm_file_list_spec='@'
417767ab2ff2Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
417867ab2ff2Smrg  nm_file_list_spec='@'
417967ab2ff2Smrgfi
418067ab2ff2Smrg
418149e108a1Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
418249e108a1Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
418349e108a1Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
418449e108a1Smrg    [Transform the output of nm in a proper C declaration])
4185b3a827e2Smrg_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
4186b3a827e2Smrg    [Transform the output of nm into a list of symbols to manually relocate])
418749e108a1Smrg_LT_DECL([global_symbol_to_c_name_address],
418849e108a1Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
418949e108a1Smrg    [Transform the output of nm in a C name address pair])
419049e108a1Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
419149e108a1Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
419249e108a1Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
4193b3a827e2Smrg_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
4194b3a827e2Smrg    [The name lister interface])
419567ab2ff2Smrg_LT_DECL([], [nm_file_list_spec], [1],
419667ab2ff2Smrg    [Specify filename containing input files for $NM])
419749e108a1Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
4198e0963edeSmrg
4199e0963edeSmrg
420049e108a1Smrg# _LT_COMPILER_PIC([TAGNAME])
420149e108a1Smrg# ---------------------------
420249e108a1Smrgm4_defun([_LT_COMPILER_PIC],
420349e108a1Smrg[m4_require([_LT_TAG_COMPILER])dnl
420449e108a1Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
420549e108a1Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
420649e108a1Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
4207e0963edeSmrg
420849e108a1Smrgm4_if([$1], [CXX], [
420949e108a1Smrg  # C++ specific cases for pic, static, wl, etc.
4210b3a827e2Smrg  if test yes = "$GXX"; then
421149e108a1Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
421249e108a1Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4213e0963edeSmrg
421449e108a1Smrg    case $host_os in
421549e108a1Smrg    aix*)
421649e108a1Smrg      # All AIX code is PIC.
4217b3a827e2Smrg      if test ia64 = "$host_cpu"; then
421849e108a1Smrg	# AIX 5 now supports IA64 processor
421949e108a1Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
422049e108a1Smrg      fi
4221b3a827e2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
422249e108a1Smrg      ;;
4223f05b35a2Smrg
422449e108a1Smrg    amigaos*)
422549e108a1Smrg      case $host_cpu in
422649e108a1Smrg      powerpc)
422749e108a1Smrg            # see comment about AmigaOS4 .so support
422849e108a1Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4229f05b35a2Smrg        ;;
423049e108a1Smrg      m68k)
423149e108a1Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4232b3a827e2Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4233b3a827e2Smrg            # like '-m68040'.
423449e108a1Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4235f05b35a2Smrg        ;;
423649e108a1Smrg      esac
423749e108a1Smrg      ;;
4238e0963edeSmrg
423949e108a1Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
424049e108a1Smrg      # PIC is the default for these OSes.
424149e108a1Smrg      ;;
424249e108a1Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
424349e108a1Smrg      # This hack is so that the source file can tell whether it is being
424449e108a1Smrg      # built for inclusion in a dll (and should export symbols for example).
424549e108a1Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
424649e108a1Smrg      # (--disable-auto-import) libraries
424749e108a1Smrg      m4_if([$1], [GCJ], [],
424849e108a1Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4249b3a827e2Smrg      case $host_os in
4250b3a827e2Smrg      os2*)
4251b3a827e2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4252b3a827e2Smrg	;;
4253b3a827e2Smrg      esac
425449e108a1Smrg      ;;
425549e108a1Smrg    darwin* | rhapsody*)
425649e108a1Smrg      # PIC is the default on this platform
425749e108a1Smrg      # Common symbols not allowed in MH_DYLIB files
425849e108a1Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
425949e108a1Smrg      ;;
426049e108a1Smrg    *djgpp*)
426149e108a1Smrg      # DJGPP does not support shared libraries at all
426249e108a1Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
426349e108a1Smrg      ;;
426449e108a1Smrg    haiku*)
426549e108a1Smrg      # PIC is the default for Haiku.
426649e108a1Smrg      # The "-static" flag exists, but is broken.
426749e108a1Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
426849e108a1Smrg      ;;
426949e108a1Smrg    interix[[3-9]]*)
427049e108a1Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
427149e108a1Smrg      # Instead, we relocate shared libraries at runtime.
427249e108a1Smrg      ;;
427349e108a1Smrg    sysv4*MP*)
427449e108a1Smrg      if test -d /usr/nec; then
427549e108a1Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
427649e108a1Smrg      fi
427749e108a1Smrg      ;;
427849e108a1Smrg    hpux*)
427949e108a1Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
428049e108a1Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
428149e108a1Smrg      # sets the default TLS model and affects inlining.
428249e108a1Smrg      case $host_cpu in
428349e108a1Smrg      hppa*64*)
4284f05b35a2Smrg	;;
428549e108a1Smrg      *)
428649e108a1Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
428749e108a1Smrg	;;
428849e108a1Smrg      esac
428949e108a1Smrg      ;;
429049e108a1Smrg    *qnx* | *nto*)
429149e108a1Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
429249e108a1Smrg      # it will coredump.
429349e108a1Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
429449e108a1Smrg      ;;
429549e108a1Smrg    *)
429649e108a1Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
429749e108a1Smrg      ;;
429849e108a1Smrg    esac
429949e108a1Smrg  else
430049e108a1Smrg    case $host_os in
430149e108a1Smrg      aix[[4-9]]*)
430249e108a1Smrg	# All AIX code is PIC.
4303b3a827e2Smrg	if test ia64 = "$host_cpu"; then
430449e108a1Smrg	  # AIX 5 now supports IA64 processor
430549e108a1Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
430649e108a1Smrg	else
430749e108a1Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
430849e108a1Smrg	fi
430949e108a1Smrg	;;
431049e108a1Smrg      chorus*)
431149e108a1Smrg	case $cc_basename in
431249e108a1Smrg	cxch68*)
431349e108a1Smrg	  # Green Hills C++ Compiler
431449e108a1Smrg	  # _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"
431549e108a1Smrg	  ;;
431649e108a1Smrg	esac
431749e108a1Smrg	;;
431867ab2ff2Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
431967ab2ff2Smrg	# This hack is so that the source file can tell whether it is being
432067ab2ff2Smrg	# built for inclusion in a dll (and should export symbols for example).
432167ab2ff2Smrg	m4_if([$1], [GCJ], [],
432267ab2ff2Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
432367ab2ff2Smrg	;;
432449e108a1Smrg      dgux*)
432549e108a1Smrg	case $cc_basename in
432649e108a1Smrg	  ec++*)
432749e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4328f05b35a2Smrg	    ;;
432949e108a1Smrg	  ghcx*)
433049e108a1Smrg	    # Green Hills C++ Compiler
433149e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4332f05b35a2Smrg	    ;;
433349e108a1Smrg	  *)
4334f05b35a2Smrg	    ;;
433549e108a1Smrg	esac
433649e108a1Smrg	;;
433749e108a1Smrg      freebsd* | dragonfly*)
433849e108a1Smrg	# FreeBSD uses GNU C++
433949e108a1Smrg	;;
434049e108a1Smrg      hpux9* | hpux10* | hpux11*)
434149e108a1Smrg	case $cc_basename in
434249e108a1Smrg	  CC*)
434349e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4344b3a827e2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
4345b3a827e2Smrg	    if test ia64 != "$host_cpu"; then
434649e108a1Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
434749e108a1Smrg	    fi
4348f05b35a2Smrg	    ;;
434949e108a1Smrg	  aCC*)
435049e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4351b3a827e2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
435249e108a1Smrg	    case $host_cpu in
435349e108a1Smrg	    hppa*64*|ia64*)
435449e108a1Smrg	      # +Z the default
4355f05b35a2Smrg	      ;;
435649e108a1Smrg	    *)
435749e108a1Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4358f05b35a2Smrg	      ;;
4359f05b35a2Smrg	    esac
436049e108a1Smrg	    ;;
436149e108a1Smrg	  *)
436249e108a1Smrg	    ;;
436349e108a1Smrg	esac
436449e108a1Smrg	;;
436549e108a1Smrg      interix*)
436649e108a1Smrg	# This is c89, which is MS Visual C++ (no shared libs)
436749e108a1Smrg	# Anyone wants to do a port?
436849e108a1Smrg	;;
436949e108a1Smrg      irix5* | irix6* | nonstopux*)
437049e108a1Smrg	case $cc_basename in
437149e108a1Smrg	  CC*)
437249e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
437349e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
437449e108a1Smrg	    # CC pic flag -KPIC is the default.
437549e108a1Smrg	    ;;
437649e108a1Smrg	  *)
437749e108a1Smrg	    ;;
437849e108a1Smrg	esac
437949e108a1Smrg	;;
4380b3a827e2Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
438149e108a1Smrg	case $cc_basename in
438249e108a1Smrg	  KCC*)
438349e108a1Smrg	    # KAI C++ Compiler
438449e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
438549e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
438649e108a1Smrg	    ;;
438749e108a1Smrg	  ecpc* )
4388b3a827e2Smrg	    # old Intel C++ for x86_64, which still supported -KPIC.
438949e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439049e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
439149e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
439249e108a1Smrg	    ;;
439349e108a1Smrg	  icpc* )
439449e108a1Smrg	    # Intel C++, used to be incompatible with GCC.
439549e108a1Smrg	    # ICC 10 doesn't accept -KPIC any more.
439649e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
439749e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
439849e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
439949e108a1Smrg	    ;;
440049e108a1Smrg	  pgCC* | pgcpp*)
440149e108a1Smrg	    # Portland Group C++ compiler
440249e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
440349e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
440449e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
440549e108a1Smrg	    ;;
4406f05b35a2Smrg	  cxx*)
4407f05b35a2Smrg	    # Compaq C++
440849e108a1Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
440949e108a1Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
441049e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
441149e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4412f05b35a2Smrg	    ;;
441349e108a1Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
441449e108a1Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
441549e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
441649e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
441749e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4418f05b35a2Smrg	    ;;
4419f05b35a2Smrg	  *)
4420f05b35a2Smrg	    case `$CC -V 2>&1 | sed 5q` in
4421f05b35a2Smrg	    *Sun\ C*)
4422f05b35a2Smrg	      # Sun C++ 5.9
442349e108a1Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
442449e108a1Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
442549e108a1Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4426f05b35a2Smrg	      ;;
4427f05b35a2Smrg	    esac
4428f05b35a2Smrg	    ;;
4429f05b35a2Smrg	esac
4430f05b35a2Smrg	;;
443149e108a1Smrg      lynxos*)
443249e108a1Smrg	;;
443349e108a1Smrg      m88k*)
443449e108a1Smrg	;;
443549e108a1Smrg      mvs*)
443649e108a1Smrg	case $cc_basename in
443749e108a1Smrg	  cxx*)
443849e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
443949e108a1Smrg	    ;;
444049e108a1Smrg	  *)
444149e108a1Smrg	    ;;
444249e108a1Smrg	esac
444349e108a1Smrg	;;
444449e108a1Smrg      netbsd*)
444549e108a1Smrg	;;
444649e108a1Smrg      *qnx* | *nto*)
444749e108a1Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
444849e108a1Smrg        # it will coredump.
444949e108a1Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
445049e108a1Smrg        ;;
445149e108a1Smrg      osf3* | osf4* | osf5*)
445249e108a1Smrg	case $cc_basename in
445349e108a1Smrg	  KCC*)
445449e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
445549e108a1Smrg	    ;;
445649e108a1Smrg	  RCC*)
445749e108a1Smrg	    # Rational C++ 2.4.1
445849e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
445949e108a1Smrg	    ;;
446049e108a1Smrg	  cxx*)
446149e108a1Smrg	    # Digital/Compaq C++
446249e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
446349e108a1Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
446449e108a1Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
446549e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
446649e108a1Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
446749e108a1Smrg	    ;;
446849e108a1Smrg	  *)
446949e108a1Smrg	    ;;
447049e108a1Smrg	esac
447149e108a1Smrg	;;
447267ab2ff2Smrg      psos*)
447367ab2ff2Smrg	;;
447467ab2ff2Smrg      solaris*)
447567ab2ff2Smrg	case $cc_basename in
447667ab2ff2Smrg	  CC* | sunCC*)
447767ab2ff2Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
447867ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
447967ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
448067ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
448167ab2ff2Smrg	    ;;
448267ab2ff2Smrg	  gcx*)
448367ab2ff2Smrg	    # Green Hills C++ Compiler
448467ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
448567ab2ff2Smrg	    ;;
448667ab2ff2Smrg	  *)
448767ab2ff2Smrg	    ;;
448867ab2ff2Smrg	esac
448967ab2ff2Smrg	;;
449067ab2ff2Smrg      sunos4*)
449167ab2ff2Smrg	case $cc_basename in
449267ab2ff2Smrg	  CC*)
449367ab2ff2Smrg	    # Sun C++ 4.x
449467ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
449567ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
449667ab2ff2Smrg	    ;;
449767ab2ff2Smrg	  lcc*)
449867ab2ff2Smrg	    # Lucid
449967ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
450067ab2ff2Smrg	    ;;
450167ab2ff2Smrg	  *)
450267ab2ff2Smrg	    ;;
450367ab2ff2Smrg	esac
450467ab2ff2Smrg	;;
450567ab2ff2Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
450667ab2ff2Smrg	case $cc_basename in
450767ab2ff2Smrg	  CC*)
450867ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
450967ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
451067ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
451167ab2ff2Smrg	    ;;
451267ab2ff2Smrg	esac
451367ab2ff2Smrg	;;
451467ab2ff2Smrg      tandem*)
451567ab2ff2Smrg	case $cc_basename in
451667ab2ff2Smrg	  NCC*)
451767ab2ff2Smrg	    # NonStop-UX NCC 3.20
451867ab2ff2Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
451967ab2ff2Smrg	    ;;
452067ab2ff2Smrg	  *)
452167ab2ff2Smrg	    ;;
452267ab2ff2Smrg	esac
452367ab2ff2Smrg	;;
452467ab2ff2Smrg      vxworks*)
452567ab2ff2Smrg	;;
452667ab2ff2Smrg      *)
452767ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
452867ab2ff2Smrg	;;
452967ab2ff2Smrg    esac
453067ab2ff2Smrg  fi
453167ab2ff2Smrg],
453267ab2ff2Smrg[
4533b3a827e2Smrg  if test yes = "$GCC"; then
453467ab2ff2Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
453567ab2ff2Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
453667ab2ff2Smrg
453767ab2ff2Smrg    case $host_os in
453867ab2ff2Smrg      aix*)
453967ab2ff2Smrg      # All AIX code is PIC.
4540b3a827e2Smrg      if test ia64 = "$host_cpu"; then
454167ab2ff2Smrg	# AIX 5 now supports IA64 processor
454267ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
454367ab2ff2Smrg      fi
4544b3a827e2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
454567ab2ff2Smrg      ;;
454667ab2ff2Smrg
454767ab2ff2Smrg    amigaos*)
454867ab2ff2Smrg      case $host_cpu in
454967ab2ff2Smrg      powerpc)
455067ab2ff2Smrg            # see comment about AmigaOS4 .so support
455167ab2ff2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
455267ab2ff2Smrg        ;;
455367ab2ff2Smrg      m68k)
455467ab2ff2Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4555b3a827e2Smrg            # adding the '-m68020' flag to GCC prevents building anything better,
4556b3a827e2Smrg            # like '-m68040'.
455767ab2ff2Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
455867ab2ff2Smrg        ;;
455967ab2ff2Smrg      esac
456067ab2ff2Smrg      ;;
456167ab2ff2Smrg
456267ab2ff2Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
456367ab2ff2Smrg      # PIC is the default for these OSes.
456467ab2ff2Smrg      ;;
456567ab2ff2Smrg
456667ab2ff2Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
456767ab2ff2Smrg      # This hack is so that the source file can tell whether it is being
456867ab2ff2Smrg      # built for inclusion in a dll (and should export symbols for example).
456967ab2ff2Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
457067ab2ff2Smrg      # (--disable-auto-import) libraries
457167ab2ff2Smrg      m4_if([$1], [GCJ], [],
457267ab2ff2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4573b3a827e2Smrg      case $host_os in
4574b3a827e2Smrg      os2*)
4575b3a827e2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4576b3a827e2Smrg	;;
4577b3a827e2Smrg      esac
457867ab2ff2Smrg      ;;
457967ab2ff2Smrg
458067ab2ff2Smrg    darwin* | rhapsody*)
458167ab2ff2Smrg      # PIC is the default on this platform
458267ab2ff2Smrg      # Common symbols not allowed in MH_DYLIB files
458367ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
458467ab2ff2Smrg      ;;
458567ab2ff2Smrg
458667ab2ff2Smrg    haiku*)
458767ab2ff2Smrg      # PIC is the default for Haiku.
458867ab2ff2Smrg      # The "-static" flag exists, but is broken.
458967ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
459067ab2ff2Smrg      ;;
459167ab2ff2Smrg
459267ab2ff2Smrg    hpux*)
459367ab2ff2Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
459467ab2ff2Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
459567ab2ff2Smrg      # sets the default TLS model and affects inlining.
459667ab2ff2Smrg      case $host_cpu in
459767ab2ff2Smrg      hppa*64*)
459867ab2ff2Smrg	# +Z the default
459967ab2ff2Smrg	;;
460067ab2ff2Smrg      *)
460167ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
460267ab2ff2Smrg	;;
460367ab2ff2Smrg      esac
460467ab2ff2Smrg      ;;
460567ab2ff2Smrg
460667ab2ff2Smrg    interix[[3-9]]*)
460767ab2ff2Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
460867ab2ff2Smrg      # Instead, we relocate shared libraries at runtime.
460967ab2ff2Smrg      ;;
461067ab2ff2Smrg
461167ab2ff2Smrg    msdosdjgpp*)
461267ab2ff2Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
461367ab2ff2Smrg      # on systems that don't support them.
461467ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
461567ab2ff2Smrg      enable_shared=no
461667ab2ff2Smrg      ;;
461767ab2ff2Smrg
461867ab2ff2Smrg    *nto* | *qnx*)
461967ab2ff2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
462067ab2ff2Smrg      # it will coredump.
462167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
462267ab2ff2Smrg      ;;
462367ab2ff2Smrg
462467ab2ff2Smrg    sysv4*MP*)
462567ab2ff2Smrg      if test -d /usr/nec; then
462667ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
462767ab2ff2Smrg      fi
462867ab2ff2Smrg      ;;
462967ab2ff2Smrg
463067ab2ff2Smrg    *)
463167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
463267ab2ff2Smrg      ;;
463367ab2ff2Smrg    esac
463467ab2ff2Smrg
463567ab2ff2Smrg    case $cc_basename in
463667ab2ff2Smrg    nvcc*) # Cuda Compiler Driver 2.2
463767ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4638e494fffdSmrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4639e494fffdSmrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4640e494fffdSmrg      fi
464167ab2ff2Smrg      ;;
464267ab2ff2Smrg    esac
464367ab2ff2Smrg  else
464467ab2ff2Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
464567ab2ff2Smrg    case $host_os in
464667ab2ff2Smrg    aix*)
464767ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4648b3a827e2Smrg      if test ia64 = "$host_cpu"; then
464967ab2ff2Smrg	# AIX 5 now supports IA64 processor
465067ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
465167ab2ff2Smrg      else
465267ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
465367ab2ff2Smrg      fi
465467ab2ff2Smrg      ;;
465567ab2ff2Smrg
4656b3a827e2Smrg    darwin* | rhapsody*)
4657b3a827e2Smrg      # PIC is the default on this platform
4658b3a827e2Smrg      # Common symbols not allowed in MH_DYLIB files
4659b3a827e2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4660b3a827e2Smrg      case $cc_basename in
4661b3a827e2Smrg      nagfor*)
4662b3a827e2Smrg        # NAG Fortran compiler
4663b3a827e2Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4664b3a827e2Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4665b3a827e2Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4666b3a827e2Smrg        ;;
4667b3a827e2Smrg      esac
4668b3a827e2Smrg      ;;
4669b3a827e2Smrg
467067ab2ff2Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
467167ab2ff2Smrg      # This hack is so that the source file can tell whether it is being
467267ab2ff2Smrg      # built for inclusion in a dll (and should export symbols for example).
467367ab2ff2Smrg      m4_if([$1], [GCJ], [],
467467ab2ff2Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4675b3a827e2Smrg      case $host_os in
4676b3a827e2Smrg      os2*)
4677b3a827e2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
4678b3a827e2Smrg	;;
4679b3a827e2Smrg      esac
468067ab2ff2Smrg      ;;
468167ab2ff2Smrg
468267ab2ff2Smrg    hpux9* | hpux10* | hpux11*)
468367ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
468467ab2ff2Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
468567ab2ff2Smrg      # not for PA HP-UX.
468667ab2ff2Smrg      case $host_cpu in
468767ab2ff2Smrg      hppa*64*|ia64*)
468867ab2ff2Smrg	# +Z the default
468967ab2ff2Smrg	;;
469067ab2ff2Smrg      *)
469167ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
469267ab2ff2Smrg	;;
469367ab2ff2Smrg      esac
469467ab2ff2Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4695b3a827e2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
469667ab2ff2Smrg      ;;
469767ab2ff2Smrg
469867ab2ff2Smrg    irix5* | irix6* | nonstopux*)
469967ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470067ab2ff2Smrg      # PIC (with -KPIC) is the default.
470167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
470267ab2ff2Smrg      ;;
470367ab2ff2Smrg
4704b3a827e2Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
470567ab2ff2Smrg      case $cc_basename in
4706b3a827e2Smrg      # old Intel for x86_64, which still supported -KPIC.
470767ab2ff2Smrg      ecc*)
470867ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
470967ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
471067ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
471167ab2ff2Smrg        ;;
471267ab2ff2Smrg      # icc used to be incompatible with GCC.
471367ab2ff2Smrg      # ICC 10 doesn't accept -KPIC any more.
471467ab2ff2Smrg      icc* | ifort*)
471567ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
471667ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
471767ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
471867ab2ff2Smrg        ;;
471967ab2ff2Smrg      # Lahey Fortran 8.1.
472067ab2ff2Smrg      lf95*)
472167ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
472267ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
472367ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
472467ab2ff2Smrg	;;
472567ab2ff2Smrg      nagfor*)
472667ab2ff2Smrg	# NAG Fortran compiler
472767ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
472867ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
472967ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
473067ab2ff2Smrg	;;
4731b3a827e2Smrg      tcc*)
4732b3a827e2Smrg	# Fabrice Bellard et al's Tiny C Compiler
4733b3a827e2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4734b3a827e2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4735b3a827e2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4736b3a827e2Smrg	;;
473767ab2ff2Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
473867ab2ff2Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
473967ab2ff2Smrg	# which looks to be a dead project)
474067ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474167ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
474267ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
474367ab2ff2Smrg        ;;
474467ab2ff2Smrg      ccc*)
474567ab2ff2Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
474667ab2ff2Smrg        # All Alpha code is PIC.
474767ab2ff2Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
474867ab2ff2Smrg        ;;
474967ab2ff2Smrg      xl* | bgxl* | bgf* | mpixl*)
475067ab2ff2Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
475167ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
475267ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
475367ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
475467ab2ff2Smrg	;;
475567ab2ff2Smrg      *)
475667ab2ff2Smrg	case `$CC -V 2>&1 | sed 5q` in
4757e494fffdSmrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
475867ab2ff2Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
475967ab2ff2Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
476067ab2ff2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
476167ab2ff2Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
476267ab2ff2Smrg	  ;;
4763e494fffdSmrg	*Sun\ F* | *Sun*Fortran*)
4764e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4765e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4766e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4767e494fffdSmrg	  ;;
476867ab2ff2Smrg	*Sun\ C*)
476967ab2ff2Smrg	  # Sun C 5.9
477067ab2ff2Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
477167ab2ff2Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
477267ab2ff2Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
477367ab2ff2Smrg	  ;;
4774e494fffdSmrg        *Intel*\ [[CF]]*Compiler*)
4775e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4776e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4777e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4778e494fffdSmrg	  ;;
4779e494fffdSmrg	*Portland\ Group*)
4780e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4781e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4782e494fffdSmrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4783e494fffdSmrg	  ;;
478467ab2ff2Smrg	esac
478567ab2ff2Smrg	;;
478667ab2ff2Smrg      esac
478767ab2ff2Smrg      ;;
478867ab2ff2Smrg
478967ab2ff2Smrg    newsos6)
479067ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
479167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
479267ab2ff2Smrg      ;;
479367ab2ff2Smrg
479467ab2ff2Smrg    *nto* | *qnx*)
479567ab2ff2Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
479667ab2ff2Smrg      # it will coredump.
479767ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
479867ab2ff2Smrg      ;;
479967ab2ff2Smrg
480067ab2ff2Smrg    osf3* | osf4* | osf5*)
480167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
480267ab2ff2Smrg      # All OSF/1 code is PIC.
480367ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480467ab2ff2Smrg      ;;
480567ab2ff2Smrg
480667ab2ff2Smrg    rdos*)
480767ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
480867ab2ff2Smrg      ;;
480967ab2ff2Smrg
481067ab2ff2Smrg    solaris*)
481167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
481267ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
481367ab2ff2Smrg      case $cc_basename in
481467ab2ff2Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
481567ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
481667ab2ff2Smrg      *)
481767ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
481867ab2ff2Smrg      esac
481967ab2ff2Smrg      ;;
482067ab2ff2Smrg
482167ab2ff2Smrg    sunos4*)
482267ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
482367ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
482467ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
482567ab2ff2Smrg      ;;
482667ab2ff2Smrg
482767ab2ff2Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
482867ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
482967ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
483067ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483167ab2ff2Smrg      ;;
483267ab2ff2Smrg
483367ab2ff2Smrg    sysv4*MP*)
4834b3a827e2Smrg      if test -d /usr/nec; then
483567ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
483667ab2ff2Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
483767ab2ff2Smrg      fi
483867ab2ff2Smrg      ;;
483967ab2ff2Smrg
484067ab2ff2Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
484167ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
484267ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
484367ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
484467ab2ff2Smrg      ;;
484567ab2ff2Smrg
484667ab2ff2Smrg    unicos*)
484767ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
484867ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
484967ab2ff2Smrg      ;;
485067ab2ff2Smrg
485167ab2ff2Smrg    uts4*)
485267ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
485367ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
485467ab2ff2Smrg      ;;
485567ab2ff2Smrg
485667ab2ff2Smrg    *)
485767ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
485867ab2ff2Smrg      ;;
485967ab2ff2Smrg    esac
486067ab2ff2Smrg  fi
486167ab2ff2Smrg])
486267ab2ff2Smrgcase $host_os in
4863b3a827e2Smrg  # For platforms that do not support PIC, -DPIC is meaningless:
486467ab2ff2Smrg  *djgpp*)
486567ab2ff2Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
486667ab2ff2Smrg    ;;
486767ab2ff2Smrg  *)
486867ab2ff2Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
486967ab2ff2Smrg    ;;
487067ab2ff2Smrgesac
487167ab2ff2Smrg
487267ab2ff2SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
487367ab2ff2Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
487467ab2ff2Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
487567ab2ff2Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
487667ab2ff2Smrg
487767ab2ff2Smrg#
487867ab2ff2Smrg# Check to make sure the PIC flag actually works.
487967ab2ff2Smrg#
488067ab2ff2Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
488167ab2ff2Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
488267ab2ff2Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
488367ab2ff2Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
488467ab2ff2Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
488567ab2ff2Smrg     "" | " "*) ;;
488667ab2ff2Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
488767ab2ff2Smrg     esac],
488867ab2ff2Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
488967ab2ff2Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
489067ab2ff2Smrgfi
489167ab2ff2Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
489267ab2ff2Smrg	[Additional compiler flags for building library objects])
489367ab2ff2Smrg
489467ab2ff2Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
489567ab2ff2Smrg	[How to pass a linker flag through the compiler])
489667ab2ff2Smrg#
489767ab2ff2Smrg# Check to make sure the static flag actually works.
489867ab2ff2Smrg#
489967ab2ff2Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
490067ab2ff2Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
490167ab2ff2Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
490267ab2ff2Smrg  $lt_tmp_static_flag,
490367ab2ff2Smrg  [],
490467ab2ff2Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
490567ab2ff2Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
490667ab2ff2Smrg	[Compiler flag to prevent dynamic linking])
490767ab2ff2Smrg])# _LT_COMPILER_PIC
490867ab2ff2Smrg
490967ab2ff2Smrg
491067ab2ff2Smrg# _LT_LINKER_SHLIBS([TAGNAME])
491167ab2ff2Smrg# ----------------------------
491267ab2ff2Smrg# See if the linker supports building shared libraries.
491367ab2ff2Smrgm4_defun([_LT_LINKER_SHLIBS],
491467ab2ff2Smrg[AC_REQUIRE([LT_PATH_LD])dnl
491567ab2ff2SmrgAC_REQUIRE([LT_PATH_NM])dnl
491667ab2ff2Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
491767ab2ff2Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
491867ab2ff2Smrgm4_require([_LT_DECL_EGREP])dnl
491967ab2ff2Smrgm4_require([_LT_DECL_SED])dnl
492067ab2ff2Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
492167ab2ff2Smrgm4_require([_LT_TAG_COMPILER])dnl
492267ab2ff2SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
492367ab2ff2Smrgm4_if([$1], [CXX], [
492467ab2ff2Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
492567ab2ff2Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
492667ab2ff2Smrg  case $host_os in
492767ab2ff2Smrg  aix[[4-9]]*)
492867ab2ff2Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4929b3a827e2Smrg    # -C means demangle to GNU nm, but means don't demangle to AIX nm.
4930b3a827e2Smrg    # Without the "-l" option, or with the "-B" option, AIX nm treats
4931b3a827e2Smrg    # weak defined symbols like other global defined symbols, whereas
4932b3a827e2Smrg    # GNU nm marks them as "W".
4933b3a827e2Smrg    # While the 'weak' keyword is ignored in the Export File, we need
4934b3a827e2Smrg    # it in the Import File for the 'aix-soname' feature, so we have
4935b3a827e2Smrg    # to replace the "-B" option with "-P" for AIX nm.
493667ab2ff2Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4937b3a827e2Smrg      _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'
493867ab2ff2Smrg    else
4939b3a827e2Smrg      _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'
494067ab2ff2Smrg    fi
494167ab2ff2Smrg    ;;
494267ab2ff2Smrg  pw32*)
4943b3a827e2Smrg    _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
494467ab2ff2Smrg    ;;
494567ab2ff2Smrg  cygwin* | mingw* | cegcc*)
494667ab2ff2Smrg    case $cc_basename in
4947e494fffdSmrg    cl*)
4948e494fffdSmrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4949e494fffdSmrg      ;;
495067ab2ff2Smrg    *)
495167ab2ff2Smrg      _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'
495267ab2ff2Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
495367ab2ff2Smrg      ;;
495467ab2ff2Smrg    esac
495567ab2ff2Smrg    ;;
495667ab2ff2Smrg  *)
495767ab2ff2Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
495867ab2ff2Smrg    ;;
495967ab2ff2Smrg  esac
496067ab2ff2Smrg], [
496167ab2ff2Smrg  runpath_var=
496267ab2ff2Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
496367ab2ff2Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
496467ab2ff2Smrg  _LT_TAGVAR(archive_cmds, $1)=
496567ab2ff2Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
496667ab2ff2Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
496767ab2ff2Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
496867ab2ff2Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
496967ab2ff2Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
497067ab2ff2Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
497167ab2ff2Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
497267ab2ff2Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
497367ab2ff2Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
497467ab2ff2Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
497567ab2ff2Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
497667ab2ff2Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
497767ab2ff2Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
497867ab2ff2Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
497967ab2ff2Smrg  _LT_TAGVAR(module_cmds, $1)=
498067ab2ff2Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
498167ab2ff2Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
498267ab2ff2Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
498367ab2ff2Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
498467ab2ff2Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
498567ab2ff2Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
498667ab2ff2Smrg  # included in the symbol list
498767ab2ff2Smrg  _LT_TAGVAR(include_expsyms, $1)=
498867ab2ff2Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4989b3a827e2Smrg  # it will be wrapped by ' (' and ')$', so one must not match beginning or
4990b3a827e2Smrg  # end of line.  Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
4991b3a827e2Smrg  # as well as any symbol that contains 'd'.
499267ab2ff2Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
499367ab2ff2Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
499467ab2ff2Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
499567ab2ff2Smrg  # the symbol is explicitly referenced.  Since portable code cannot
499667ab2ff2Smrg  # rely on this symbol name, it's probably fine to never include it in
499767ab2ff2Smrg  # preloaded symbol tables.
499867ab2ff2Smrg  # Exclude shared library initialization/finalization symbols.
499967ab2ff2Smrgdnl Note also adjust exclude_expsyms for C++ above.
500067ab2ff2Smrg  extract_expsyms_cmds=
500167ab2ff2Smrg
500267ab2ff2Smrg  case $host_os in
500367ab2ff2Smrg  cygwin* | mingw* | pw32* | cegcc*)
500467ab2ff2Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
500567ab2ff2Smrg    # When not using gcc, we currently assume that we are using
500667ab2ff2Smrg    # Microsoft Visual C++.
5007b3a827e2Smrg    if test yes != "$GCC"; then
500867ab2ff2Smrg      with_gnu_ld=no
500967ab2ff2Smrg    fi
501067ab2ff2Smrg    ;;
501167ab2ff2Smrg  interix*)
501267ab2ff2Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
501367ab2ff2Smrg    with_gnu_ld=yes
501467ab2ff2Smrg    ;;
5015b3a827e2Smrg  openbsd* | bitrig*)
501667ab2ff2Smrg    with_gnu_ld=no
501767ab2ff2Smrg    ;;
501867ab2ff2Smrg  esac
501967ab2ff2Smrg
502067ab2ff2Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
502167ab2ff2Smrg
502267ab2ff2Smrg  # On some targets, GNU ld is compatible enough with the native linker
502367ab2ff2Smrg  # that we're better off using the native interface for both.
502467ab2ff2Smrg  lt_use_gnu_ld_interface=no
5025b3a827e2Smrg  if test yes = "$with_gnu_ld"; then
502667ab2ff2Smrg    case $host_os in
502767ab2ff2Smrg      aix*)
502867ab2ff2Smrg	# The AIX port of GNU ld has always aspired to compatibility
502967ab2ff2Smrg	# with the native linker.  However, as the warning in the GNU ld
503067ab2ff2Smrg	# block says, versions before 2.19.5* couldn't really create working
503167ab2ff2Smrg	# shared libraries, regardless of the interface used.
503267ab2ff2Smrg	case `$LD -v 2>&1` in
503367ab2ff2Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
503467ab2ff2Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
503567ab2ff2Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
503667ab2ff2Smrg	  *)
503767ab2ff2Smrg	    lt_use_gnu_ld_interface=yes
503867ab2ff2Smrg	    ;;
503967ab2ff2Smrg	esac
504067ab2ff2Smrg	;;
504167ab2ff2Smrg      *)
504267ab2ff2Smrg	lt_use_gnu_ld_interface=yes
5043f05b35a2Smrg	;;
504467ab2ff2Smrg    esac
504567ab2ff2Smrg  fi
504667ab2ff2Smrg
5047b3a827e2Smrg  if test yes = "$lt_use_gnu_ld_interface"; then
504867ab2ff2Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
5049b3a827e2Smrg    wlarc='$wl'
505067ab2ff2Smrg
505167ab2ff2Smrg    # Set some defaults for GNU ld with shared library support. These
505267ab2ff2Smrg    # are reset later if shared libraries are not supported. Putting them
505367ab2ff2Smrg    # here allows them to be overridden if necessary.
505467ab2ff2Smrg    runpath_var=LD_RUN_PATH
5055b3a827e2Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5056b3a827e2Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
505767ab2ff2Smrg    # ancient GNU ld didn't support --whole-archive et. al.
505867ab2ff2Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
5059b3a827e2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
506067ab2ff2Smrg    else
506167ab2ff2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
506267ab2ff2Smrg    fi
506367ab2ff2Smrg    supports_anon_versioning=no
5064b3a827e2Smrg    case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
506567ab2ff2Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
506667ab2ff2Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
506767ab2ff2Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
506867ab2ff2Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
506967ab2ff2Smrg      *\ 2.11.*) ;; # other 2.11 versions
507067ab2ff2Smrg      *) supports_anon_versioning=yes ;;
507167ab2ff2Smrg    esac
507267ab2ff2Smrg
507367ab2ff2Smrg    # See if GNU ld supports shared libraries.
507467ab2ff2Smrg    case $host_os in
507567ab2ff2Smrg    aix[[3-9]]*)
507667ab2ff2Smrg      # On AIX/PPC, the GNU linker is very broken
5077b3a827e2Smrg      if test ia64 != "$host_cpu"; then
507867ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
507967ab2ff2Smrg	cat <<_LT_EOF 1>&2
508067ab2ff2Smrg
508167ab2ff2Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
508267ab2ff2Smrg*** to be unable to reliably create shared libraries on AIX.
508367ab2ff2Smrg*** Therefore, libtool is disabling shared libraries support.  If you
508467ab2ff2Smrg*** really care for shared libraries, you may want to install binutils
508567ab2ff2Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
508667ab2ff2Smrg*** You will then need to restart the configuration process.
508767ab2ff2Smrg
508867ab2ff2Smrg_LT_EOF
508967ab2ff2Smrg      fi
509067ab2ff2Smrg      ;;
509167ab2ff2Smrg
509267ab2ff2Smrg    amigaos*)
509367ab2ff2Smrg      case $host_cpu in
509467ab2ff2Smrg      powerpc)
509567ab2ff2Smrg            # see comment about AmigaOS4 .so support
5096b3a827e2Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
509767ab2ff2Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
509867ab2ff2Smrg        ;;
509967ab2ff2Smrg      m68k)
510067ab2ff2Smrg            _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)'
510167ab2ff2Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
510267ab2ff2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
510367ab2ff2Smrg        ;;
510467ab2ff2Smrg      esac
510567ab2ff2Smrg      ;;
510667ab2ff2Smrg
510767ab2ff2Smrg    beos*)
510867ab2ff2Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
510967ab2ff2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
511067ab2ff2Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
511167ab2ff2Smrg	# support --undefined.  This deserves some investigation.  FIXME
5112b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
511367ab2ff2Smrg      else
511467ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
511567ab2ff2Smrg      fi
511667ab2ff2Smrg      ;;
511767ab2ff2Smrg
511867ab2ff2Smrg    cygwin* | mingw* | pw32* | cegcc*)
511967ab2ff2Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
512067ab2ff2Smrg      # as there is no search path for DLLs.
512167ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5122b3a827e2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
512367ab2ff2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
512467ab2ff2Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
512567ab2ff2Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
512667ab2ff2Smrg      _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'
512767ab2ff2Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
512867ab2ff2Smrg
512967ab2ff2Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
5130b3a827e2Smrg        _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'
5131b3a827e2Smrg	# If the export-symbols file already is a .def file, use it as
5132b3a827e2Smrg	# is; otherwise, prepend EXPORTS...
5133b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5134b3a827e2Smrg          cp $export_symbols $output_objdir/$soname.def;
5135b3a827e2Smrg        else
5136b3a827e2Smrg          echo EXPORTS > $output_objdir/$soname.def;
5137b3a827e2Smrg          cat $export_symbols >> $output_objdir/$soname.def;
5138b3a827e2Smrg        fi~
5139b3a827e2Smrg        $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
514067ab2ff2Smrg      else
514167ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
514267ab2ff2Smrg      fi
514367ab2ff2Smrg      ;;
514467ab2ff2Smrg
514567ab2ff2Smrg    haiku*)
5146b3a827e2Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
514767ab2ff2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
514867ab2ff2Smrg      ;;
514967ab2ff2Smrg
5150b3a827e2Smrg    os2*)
5151b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5152b3a827e2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5153b3a827e2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5154b3a827e2Smrg      shrext_cmds=.dll
5155b3a827e2Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5156b3a827e2Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5157b3a827e2Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5158b3a827e2Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5159b3a827e2Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5160b3a827e2Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5161b3a827e2Smrg	emximp -o $lib $output_objdir/$libname.def'
5162b3a827e2Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5163b3a827e2Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5164b3a827e2Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5165b3a827e2Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5166b3a827e2Smrg	prefix_cmds="$SED"~
5167b3a827e2Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5168b3a827e2Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5169b3a827e2Smrg	fi~
5170b3a827e2Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5171b3a827e2Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5172b3a827e2Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5173b3a827e2Smrg	emximp -o $lib $output_objdir/$libname.def'
5174b3a827e2Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5175b3a827e2Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5176b3a827e2Smrg      ;;
5177b3a827e2Smrg
5178b3a827e2Smrg    interix[[3-9]]*)
5179b3a827e2Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
5180b3a827e2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5181b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5182b3a827e2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
518367ab2ff2Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
518467ab2ff2Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
518567ab2ff2Smrg      # default) and relocated if they conflict, which is a slow very memory
518667ab2ff2Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
518767ab2ff2Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
518867ab2ff2Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
5189b3a827e2Smrg      _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'
5190b3a827e2Smrg      _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'
519167ab2ff2Smrg      ;;
519267ab2ff2Smrg
519367ab2ff2Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
519467ab2ff2Smrg      tmp_diet=no
5195b3a827e2Smrg      if test linux-dietlibc = "$host_os"; then
519649e108a1Smrg	case $cc_basename in
519767ab2ff2Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
519849e108a1Smrg	esac
519967ab2ff2Smrg      fi
520067ab2ff2Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
5201b3a827e2Smrg	 && test no = "$tmp_diet"
520267ab2ff2Smrg      then
520367ab2ff2Smrg	tmp_addflag=' $pic_flag'
520467ab2ff2Smrg	tmp_sharedflag='-shared'
520567ab2ff2Smrg	case $cc_basename,$host_cpu in
520667ab2ff2Smrg        pgcc*)				# Portland Group C compiler
5207b3a827e2Smrg	  _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'
520867ab2ff2Smrg	  tmp_addflag=' $pic_flag'
520967ab2ff2Smrg	  ;;
521067ab2ff2Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
521167ab2ff2Smrg					# Portland Group f77 and f90 compilers
5212b3a827e2Smrg	  _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'
521367ab2ff2Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
521467ab2ff2Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
521567ab2ff2Smrg	  tmp_addflag=' -i_dynamic' ;;
521667ab2ff2Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
521767ab2ff2Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
521867ab2ff2Smrg	ifc* | ifort*)			# Intel Fortran compiler
521967ab2ff2Smrg	  tmp_addflag=' -nofor_main' ;;
522067ab2ff2Smrg	lf95*)				# Lahey Fortran 8.1
522167ab2ff2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
522267ab2ff2Smrg	  tmp_sharedflag='--shared' ;;
5223b3a827e2Smrg        nagfor*)                        # NAGFOR 5.3
5224b3a827e2Smrg          tmp_sharedflag='-Wl,-shared' ;;
522567ab2ff2Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
522667ab2ff2Smrg	  tmp_sharedflag='-qmkshrobj'
522767ab2ff2Smrg	  tmp_addflag= ;;
522867ab2ff2Smrg	nvcc*)	# Cuda Compiler Driver 2.2
5229b3a827e2Smrg	  _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'
523067ab2ff2Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
523167ab2ff2Smrg	  ;;
5232f05b35a2Smrg	esac
523367ab2ff2Smrg	case `$CC -V 2>&1 | sed 5q` in
523467ab2ff2Smrg	*Sun\ C*)			# Sun C 5.9
5235b3a827e2Smrg	  _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'
523667ab2ff2Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
523767ab2ff2Smrg	  tmp_sharedflag='-G' ;;
523867ab2ff2Smrg	*Sun\ F*)			# Sun Fortran 8.3
523967ab2ff2Smrg	  tmp_sharedflag='-G' ;;
524049e108a1Smrg	esac
5241b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
524267ab2ff2Smrg
5243b3a827e2Smrg        if test yes = "$supports_anon_versioning"; then
524467ab2ff2Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5245b3a827e2Smrg            cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5246b3a827e2Smrg            echo "local: *; };" >> $output_objdir/$libname.ver~
5247b3a827e2Smrg            $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
524867ab2ff2Smrg        fi
524967ab2ff2Smrg
525049e108a1Smrg	case $cc_basename in
5251b3a827e2Smrg	tcc*)
5252b3a827e2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
5253b3a827e2Smrg	  ;;
525467ab2ff2Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
525567ab2ff2Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
525667ab2ff2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
5257b3a827e2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
525867ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
5259b3a827e2Smrg	  if test yes = "$supports_anon_versioning"; then
526067ab2ff2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
5261b3a827e2Smrg              cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
5262b3a827e2Smrg              echo "local: *; };" >> $output_objdir/$libname.ver~
5263b3a827e2Smrg              $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
526467ab2ff2Smrg	  fi
526567ab2ff2Smrg	  ;;
526649e108a1Smrg	esac
526767ab2ff2Smrg      else
526867ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
526967ab2ff2Smrg      fi
527067ab2ff2Smrg      ;;
527167ab2ff2Smrg
527267ab2ff2Smrg    netbsd*)
527367ab2ff2Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
527467ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
527567ab2ff2Smrg	wlarc=
527667ab2ff2Smrg      else
5277b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5278b3a827e2Smrg	_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'
527967ab2ff2Smrg      fi
528067ab2ff2Smrg      ;;
528167ab2ff2Smrg
528267ab2ff2Smrg    solaris*)
528367ab2ff2Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
528467ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
528567ab2ff2Smrg	cat <<_LT_EOF 1>&2
528667ab2ff2Smrg
528767ab2ff2Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
528867ab2ff2Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
528967ab2ff2Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
529067ab2ff2Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
529167ab2ff2Smrg*** your PATH or compiler configuration so that the native linker is
529267ab2ff2Smrg*** used, and then restart.
529367ab2ff2Smrg
529467ab2ff2Smrg_LT_EOF
529567ab2ff2Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5296b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5297b3a827e2Smrg	_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'
529867ab2ff2Smrg      else
529967ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
530067ab2ff2Smrg      fi
530167ab2ff2Smrg      ;;
530267ab2ff2Smrg
530367ab2ff2Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
530467ab2ff2Smrg      case `$LD -v 2>&1` in
530567ab2ff2Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
530667ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
530767ab2ff2Smrg	cat <<_LT_EOF 1>&2
530867ab2ff2Smrg
5309b3a827e2Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
531067ab2ff2Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
531167ab2ff2Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
531267ab2ff2Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
531367ab2ff2Smrg*** your PATH or compiler configuration so that the native linker is
531467ab2ff2Smrg*** used, and then restart.
531567ab2ff2Smrg
531667ab2ff2Smrg_LT_EOF
5317f05b35a2Smrg	;;
531867ab2ff2Smrg	*)
531967ab2ff2Smrg	  # For security reasons, it is highly recommended that you always
532067ab2ff2Smrg	  # use absolute paths for naming shared libraries, and exclude the
532167ab2ff2Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
532267ab2ff2Smrg	  # requires that you compile everything twice, which is a pain.
532367ab2ff2Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5324b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
5325b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5326b3a827e2Smrg	    _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'
532767ab2ff2Smrg	  else
532867ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
532967ab2ff2Smrg	  fi
5330f05b35a2Smrg	;;
533167ab2ff2Smrg      esac
533267ab2ff2Smrg      ;;
533367ab2ff2Smrg
533467ab2ff2Smrg    sunos4*)
533567ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
533667ab2ff2Smrg      wlarc=
533767ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
533867ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
533967ab2ff2Smrg      ;;
534067ab2ff2Smrg
534167ab2ff2Smrg    *)
534267ab2ff2Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
5343b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
5344b3a827e2Smrg	_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'
534567ab2ff2Smrg      else
534667ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
534767ab2ff2Smrg      fi
534867ab2ff2Smrg      ;;
534949e108a1Smrg    esac
5350e0963edeSmrg
5351b3a827e2Smrg    if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
535267ab2ff2Smrg      runpath_var=
535367ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
535467ab2ff2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
535567ab2ff2Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
535667ab2ff2Smrg    fi
535767ab2ff2Smrg  else
535867ab2ff2Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
535949e108a1Smrg    case $host_os in
536067ab2ff2Smrg    aix3*)
536167ab2ff2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
536267ab2ff2Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
536367ab2ff2Smrg      _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'
536467ab2ff2Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
536567ab2ff2Smrg      # are no directories specified by -L.
536667ab2ff2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5367b3a827e2Smrg      if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
536867ab2ff2Smrg	# Neither direct hardcoding nor static linking is supported with a
536967ab2ff2Smrg	# broken collect2.
537067ab2ff2Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
537167ab2ff2Smrg      fi
537267ab2ff2Smrg      ;;
537367ab2ff2Smrg
537467ab2ff2Smrg    aix[[4-9]]*)
5375b3a827e2Smrg      if test ia64 = "$host_cpu"; then
537667ab2ff2Smrg	# On IA64, the linker does run time linking by default, so we don't
537767ab2ff2Smrg	# have to do anything special.
537867ab2ff2Smrg	aix_use_runtimelinking=no
537967ab2ff2Smrg	exp_sym_flag='-Bexport'
5380b3a827e2Smrg	no_entry_flag=
538167ab2ff2Smrg      else
538267ab2ff2Smrg	# If we're using GNU nm, then we don't want the "-C" option.
5383b3a827e2Smrg	# -C means demangle to GNU nm, but means don't demangle to AIX nm.
5384b3a827e2Smrg	# Without the "-l" option, or with the "-B" option, AIX nm treats
5385b3a827e2Smrg	# weak defined symbols like other global defined symbols, whereas
5386b3a827e2Smrg	# GNU nm marks them as "W".
5387b3a827e2Smrg	# While the 'weak' keyword is ignored in the Export File, we need
5388b3a827e2Smrg	# it in the Import File for the 'aix-soname' feature, so we have
5389b3a827e2Smrg	# to replace the "-B" option with "-P" for AIX nm.
539067ab2ff2Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
5391b3a827e2Smrg	  _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'
539267ab2ff2Smrg	else
5393b3a827e2Smrg	  _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'
539467ab2ff2Smrg	fi
539567ab2ff2Smrg	aix_use_runtimelinking=no
539667ab2ff2Smrg
539767ab2ff2Smrg	# Test if we are trying to use run time linking or normal
539867ab2ff2Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5399b3a827e2Smrg	# have runtime linking enabled, and use it for executables.
5400b3a827e2Smrg	# For shared libraries, we enable/disable runtime linking
5401b3a827e2Smrg	# depending on the kind of the shared library created -
5402b3a827e2Smrg	# when "with_aix_soname,aix_use_runtimelinking" is:
5403b3a827e2Smrg	# "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
5404b3a827e2Smrg	# "aix,yes"  lib.so          shared, rtl:yes, for executables
5405b3a827e2Smrg	#            lib.a           static archive
5406b3a827e2Smrg	# "both,no"  lib.so.V(shr.o) shared, rtl:yes
5407b3a827e2Smrg	#            lib.a(lib.so.V) shared, rtl:no,  for executables
5408b3a827e2Smrg	# "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
5409b3a827e2Smrg	#            lib.a(lib.so.V) shared, rtl:no
5410b3a827e2Smrg	# "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
5411b3a827e2Smrg	#            lib.a           static archive
541267ab2ff2Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
541367ab2ff2Smrg	  for ld_flag in $LDFLAGS; do
5414b3a827e2Smrg	  if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
541567ab2ff2Smrg	    aix_use_runtimelinking=yes
541667ab2ff2Smrg	    break
541767ab2ff2Smrg	  fi
541867ab2ff2Smrg	  done
5419b3a827e2Smrg	  if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
5420b3a827e2Smrg	    # With aix-soname=svr4, we create the lib.so.V shared archives only,
5421b3a827e2Smrg	    # so we don't have lib.a shared libs to link our executables.
5422b3a827e2Smrg	    # We have to force runtime linking in this case.
5423b3a827e2Smrg	    aix_use_runtimelinking=yes
5424b3a827e2Smrg	    LDFLAGS="$LDFLAGS -Wl,-brtl"
5425b3a827e2Smrg	  fi
542667ab2ff2Smrg	  ;;
542767ab2ff2Smrg	esac
542867ab2ff2Smrg
542967ab2ff2Smrg	exp_sym_flag='-bexport'
543067ab2ff2Smrg	no_entry_flag='-bnoentry'
543167ab2ff2Smrg      fi
543267ab2ff2Smrg
543367ab2ff2Smrg      # When large executables or shared objects are built, AIX ld can
543467ab2ff2Smrg      # have problems creating the table of contents.  If linking a library
543567ab2ff2Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
543667ab2ff2Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
543767ab2ff2Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
543867ab2ff2Smrg
543967ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)=''
544067ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
544167ab2ff2Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
544267ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
544367ab2ff2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5444b3a827e2Smrg      _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
5445b3a827e2Smrg      case $with_aix_soname,$aix_use_runtimelinking in
5446b3a827e2Smrg      aix,*) ;; # traditional, no import file
5447b3a827e2Smrg      svr4,* | *,yes) # use import file
5448b3a827e2Smrg	# The Import File defines what to hardcode.
5449b3a827e2Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
5450b3a827e2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5451b3a827e2Smrg	;;
5452b3a827e2Smrg      esac
545367ab2ff2Smrg
5454b3a827e2Smrg      if test yes = "$GCC"; then
545567ab2ff2Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
545667ab2ff2Smrg	# We only want to do this on AIX 4.2 and lower, the check
545767ab2ff2Smrg	# below for broken collect2 doesn't work under 4.3+
5458b3a827e2Smrg	  collect2name=`$CC -print-prog-name=collect2`
545967ab2ff2Smrg	  if test -f "$collect2name" &&
546067ab2ff2Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
546167ab2ff2Smrg	  then
546267ab2ff2Smrg	  # We have reworked collect2
546367ab2ff2Smrg	  :
546467ab2ff2Smrg	  else
546567ab2ff2Smrg	  # We have old collect2
546667ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
546767ab2ff2Smrg	  # It fails to find uninstalled libraries when the uninstalled
546867ab2ff2Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
546967ab2ff2Smrg	  # to unsupported forces relinking
547067ab2ff2Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
547167ab2ff2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
547267ab2ff2Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
547367ab2ff2Smrg	  fi
547467ab2ff2Smrg	  ;;
547567ab2ff2Smrg	esac
547667ab2ff2Smrg	shared_flag='-shared'
5477b3a827e2Smrg	if test yes = "$aix_use_runtimelinking"; then
5478b3a827e2Smrg	  shared_flag="$shared_flag "'$wl-G'
547967ab2ff2Smrg	fi
5480b3a827e2Smrg	# Need to ensure runtime linking is disabled for the traditional
5481b3a827e2Smrg	# shared library, or the linker may eventually find shared libraries
5482b3a827e2Smrg	# /with/ Import File - we do not want to mix them.
5483b3a827e2Smrg	shared_flag_aix='-shared'
5484b3a827e2Smrg	shared_flag_svr4='-shared $wl-G'
548567ab2ff2Smrg      else
548667ab2ff2Smrg	# not using gcc
5487b3a827e2Smrg	if test ia64 = "$host_cpu"; then
548867ab2ff2Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
548967ab2ff2Smrg	# chokes on -Wl,-G. The following line is correct:
549067ab2ff2Smrg	  shared_flag='-G'
549167ab2ff2Smrg	else
5492b3a827e2Smrg	  if test yes = "$aix_use_runtimelinking"; then
5493b3a827e2Smrg	    shared_flag='$wl-G'
549467ab2ff2Smrg	  else
5495b3a827e2Smrg	    shared_flag='$wl-bM:SRE'
549667ab2ff2Smrg	  fi
5497b3a827e2Smrg	  shared_flag_aix='$wl-bM:SRE'
5498b3a827e2Smrg	  shared_flag_svr4='$wl-G'
549967ab2ff2Smrg	fi
550067ab2ff2Smrg      fi
550167ab2ff2Smrg
5502b3a827e2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
550367ab2ff2Smrg      # It seems that -bexpall does not export symbols beginning with
550467ab2ff2Smrg      # underscore (_), so it is better to generate a list of symbols to export.
550567ab2ff2Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5506b3a827e2Smrg      if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
550767ab2ff2Smrg	# Warning - without using the other runtime loading flags (-brtl),
550867ab2ff2Smrg	# -berok will link without error, but may produce a broken library.
550967ab2ff2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
551067ab2ff2Smrg        # Determine the default libpath from the value encoded in an
551167ab2ff2Smrg        # empty executable.
551267ab2ff2Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5513b3a827e2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
5514b3a827e2Smrg        _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
551567ab2ff2Smrg      else
5516b3a827e2Smrg	if test ia64 = "$host_cpu"; then
5517b3a827e2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
551867ab2ff2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5519b3a827e2Smrg	  _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"
552067ab2ff2Smrg	else
552167ab2ff2Smrg	 # Determine the default libpath from the value encoded in an
552267ab2ff2Smrg	 # empty executable.
552367ab2ff2Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5524b3a827e2Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
552567ab2ff2Smrg	  # Warning - without using the other run time loading flags,
552667ab2ff2Smrg	  # -berok will link without error, but may produce a broken library.
5527b3a827e2Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
5528b3a827e2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
5529b3a827e2Smrg	  if test yes = "$with_gnu_ld"; then
553067ab2ff2Smrg	    # We only use this code for GNU lds that support --whole-archive.
5531b3a827e2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
553267ab2ff2Smrg	  else
553367ab2ff2Smrg	    # Exported symbols can be pulled into shared objects from archives
553467ab2ff2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
553567ab2ff2Smrg	  fi
553667ab2ff2Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5537b3a827e2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
5538b3a827e2Smrg	  # -brtl affects multiple linker settings, -berok does not and is overridden later
5539b3a827e2Smrg	  compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
5540b3a827e2Smrg	  if test svr4 != "$with_aix_soname"; then
5541b3a827e2Smrg	    # This is similar to how AIX traditionally builds its shared libraries.
5542b3a827e2Smrg	    _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'
5543b3a827e2Smrg	  fi
5544b3a827e2Smrg	  if test aix != "$with_aix_soname"; then
5545b3a827e2Smrg	    _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'
5546b3a827e2Smrg	  else
5547b3a827e2Smrg	    # used by -dlpreopen to get the symbols
5548b3a827e2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
5549b3a827e2Smrg	  fi
5550b3a827e2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
555167ab2ff2Smrg	fi
555249e108a1Smrg      fi
555349e108a1Smrg      ;;
5554e0963edeSmrg
555549e108a1Smrg    amigaos*)
555649e108a1Smrg      case $host_cpu in
555749e108a1Smrg      powerpc)
555849e108a1Smrg            # see comment about AmigaOS4 .so support
5559b3a827e2Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
556067ab2ff2Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
556149e108a1Smrg        ;;
556249e108a1Smrg      m68k)
556367ab2ff2Smrg            _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)'
556467ab2ff2Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
556567ab2ff2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
556649e108a1Smrg        ;;
556749e108a1Smrg      esac
556849e108a1Smrg      ;;
5569f05b35a2Smrg
557067ab2ff2Smrg    bsdi[[45]]*)
557167ab2ff2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
557267ab2ff2Smrg      ;;
557367ab2ff2Smrg
557467ab2ff2Smrg    cygwin* | mingw* | pw32* | cegcc*)
557567ab2ff2Smrg      # When not using gcc, we currently assume that we are using
557667ab2ff2Smrg      # Microsoft Visual C++.
557767ab2ff2Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
557867ab2ff2Smrg      # no search path for DLLs.
557967ab2ff2Smrg      case $cc_basename in
558067ab2ff2Smrg      cl*)
558167ab2ff2Smrg	# Native MSVC
558267ab2ff2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
558367ab2ff2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
558467ab2ff2Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
558567ab2ff2Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
558667ab2ff2Smrg	# Tell ltmain to make .lib files, not .a files.
558767ab2ff2Smrg	libext=lib
558867ab2ff2Smrg	# Tell ltmain to make .dll files, not .so files.
5589b3a827e2Smrg	shrext_cmds=.dll
559067ab2ff2Smrg	# FIXME: Setting linknames here is a bad hack.
5591b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
5592b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
5593b3a827e2Smrg            cp "$export_symbols" "$output_objdir/$soname.def";
5594b3a827e2Smrg            echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
5595b3a827e2Smrg          else
5596b3a827e2Smrg            $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
5597b3a827e2Smrg          fi~
5598b3a827e2Smrg          $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5599b3a827e2Smrg          linknames='
560067ab2ff2Smrg	# The linker will not automatically build a static lib if we build a DLL.
560167ab2ff2Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
560267ab2ff2Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5603e494fffdSmrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
560467ab2ff2Smrg	_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'
560567ab2ff2Smrg	# Don't use ranlib
560667ab2ff2Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
560767ab2ff2Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5608b3a827e2Smrg          lt_tool_outputfile="@TOOL_OUTPUT@"~
5609b3a827e2Smrg          case $lt_outputfile in
5610b3a827e2Smrg            *.exe|*.EXE) ;;
5611b3a827e2Smrg            *)
5612b3a827e2Smrg              lt_outputfile=$lt_outputfile.exe
5613b3a827e2Smrg              lt_tool_outputfile=$lt_tool_outputfile.exe
5614b3a827e2Smrg              ;;
5615b3a827e2Smrg          esac~
5616b3a827e2Smrg          if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
5617b3a827e2Smrg            $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5618b3a827e2Smrg            $RM "$lt_outputfile.manifest";
5619b3a827e2Smrg          fi'
562049e108a1Smrg	;;
562149e108a1Smrg      *)
562267ab2ff2Smrg	# Assume MSVC wrapper
562367ab2ff2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
562467ab2ff2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
562567ab2ff2Smrg	# Tell ltmain to make .lib files, not .a files.
562667ab2ff2Smrg	libext=lib
562767ab2ff2Smrg	# Tell ltmain to make .dll files, not .so files.
5628b3a827e2Smrg	shrext_cmds=.dll
562967ab2ff2Smrg	# FIXME: Setting linknames here is a bad hack.
563067ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
563167ab2ff2Smrg	# The linker will automatically build a .lib file if we build a DLL.
563267ab2ff2Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
563367ab2ff2Smrg	# FIXME: Should let the user specify the lib program.
563467ab2ff2Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
563567ab2ff2Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
563649e108a1Smrg	;;
563749e108a1Smrg      esac
563849e108a1Smrg      ;;
5639e0963edeSmrg
564067ab2ff2Smrg    darwin* | rhapsody*)
564167ab2ff2Smrg      _LT_DARWIN_LINKER_FEATURES($1)
564249e108a1Smrg      ;;
5643f05b35a2Smrg
564467ab2ff2Smrg    dgux*)
564567ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
564667ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
564767ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
564849e108a1Smrg      ;;
5649e0963edeSmrg
565067ab2ff2Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
565167ab2ff2Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
565267ab2ff2Smrg    # does not break anything, and helps significantly (at the cost of a little
565367ab2ff2Smrg    # extra space).
565467ab2ff2Smrg    freebsd2.2*)
565567ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
565667ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
565767ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
565867ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
565949e108a1Smrg      ;;
5660e0963edeSmrg
566167ab2ff2Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5662e494fffdSmrg    freebsd2.*)
566367ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
566467ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
566567ab2ff2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
566667ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
566749e108a1Smrg      ;;
5668f05b35a2Smrg
566967ab2ff2Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
567067ab2ff2Smrg    freebsd* | dragonfly*)
567167ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
567267ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
567367ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
567467ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
567549e108a1Smrg      ;;
567667ab2ff2Smrg
567767ab2ff2Smrg    hpux9*)
5678b3a827e2Smrg      if test yes = "$GCC"; then
5679b3a827e2Smrg	_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'
568049e108a1Smrg      else
5681b3a827e2Smrg	_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'
568249e108a1Smrg      fi
5683b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
568467ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
568567ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5686f05b35a2Smrg
568767ab2ff2Smrg      # hardcode_minus_L: Not really in the search PATH,
568867ab2ff2Smrg      # but as the default location of the library.
568967ab2ff2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5690b3a827e2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
569149e108a1Smrg      ;;
5692f05b35a2Smrg
569367ab2ff2Smrg    hpux10*)
5694b3a827e2Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
5695b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
569667ab2ff2Smrg      else
569767ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
569867ab2ff2Smrg      fi
5699b3a827e2Smrg      if test no = "$with_gnu_ld"; then
5700b3a827e2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
570167ab2ff2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
570267ab2ff2Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
570367ab2ff2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5704b3a827e2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
570567ab2ff2Smrg	# hardcode_minus_L: Not really in the search PATH,
570667ab2ff2Smrg	# but as the default location of the library.
570767ab2ff2Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
570867ab2ff2Smrg      fi
570949e108a1Smrg      ;;
5710e0963edeSmrg
571167ab2ff2Smrg    hpux11*)
5712b3a827e2Smrg      if test yes,no = "$GCC,$with_gnu_ld"; then
571367ab2ff2Smrg	case $host_cpu in
571467ab2ff2Smrg	hppa*64*)
5715b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
571667ab2ff2Smrg	  ;;
571767ab2ff2Smrg	ia64*)
5718b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
571967ab2ff2Smrg	  ;;
572067ab2ff2Smrg	*)
5721b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
572267ab2ff2Smrg	  ;;
572367ab2ff2Smrg	esac
572467ab2ff2Smrg      else
572567ab2ff2Smrg	case $host_cpu in
572667ab2ff2Smrg	hppa*64*)
5727b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
572867ab2ff2Smrg	  ;;
572967ab2ff2Smrg	ia64*)
5730b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
573167ab2ff2Smrg	  ;;
573267ab2ff2Smrg	*)
573367ab2ff2Smrg	m4_if($1, [], [
573467ab2ff2Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
573567ab2ff2Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
573667ab2ff2Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
573767ab2ff2Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5738b3a827e2Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
573967ab2ff2Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5740b3a827e2Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
574167ab2ff2Smrg	  ;;
574267ab2ff2Smrg	esac
574367ab2ff2Smrg      fi
5744b3a827e2Smrg      if test no = "$with_gnu_ld"; then
5745b3a827e2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
574667ab2ff2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5747e0963edeSmrg
574867ab2ff2Smrg	case $host_cpu in
574967ab2ff2Smrg	hppa*64*|ia64*)
575067ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
575167ab2ff2Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5752f05b35a2Smrg	  ;;
575367ab2ff2Smrg	*)
575467ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
575567ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5756b3a827e2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
575767ab2ff2Smrg
575867ab2ff2Smrg	  # hardcode_minus_L: Not really in the search PATH,
575967ab2ff2Smrg	  # but as the default location of the library.
576067ab2ff2Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5761f05b35a2Smrg	  ;;
576249e108a1Smrg	esac
576367ab2ff2Smrg      fi
576467ab2ff2Smrg      ;;
576567ab2ff2Smrg
576667ab2ff2Smrg    irix5* | irix6* | nonstopux*)
5767b3a827e2Smrg      if test yes = "$GCC"; then
5768b3a827e2Smrg	_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'
576967ab2ff2Smrg	# Try to use the -exported_symbol ld option, if it does not
577067ab2ff2Smrg	# work, assume that -exports_file does not work either and
577167ab2ff2Smrg	# implicitly export all symbols.
577267ab2ff2Smrg	# This should be the same for all languages, so no per-tag cache variable.
577367ab2ff2Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
577467ab2ff2Smrg	  [lt_cv_irix_exported_symbol],
5775b3a827e2Smrg	  [save_LDFLAGS=$LDFLAGS
5776b3a827e2Smrg	   LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
577767ab2ff2Smrg	   AC_LINK_IFELSE(
577867ab2ff2Smrg	     [AC_LANG_SOURCE(
577967ab2ff2Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
578067ab2ff2Smrg			      [C++], [[int foo (void) { return 0; }]],
578167ab2ff2Smrg			      [Fortran 77], [[
578267ab2ff2Smrg      subroutine foo
578367ab2ff2Smrg      end]],
578467ab2ff2Smrg			      [Fortran], [[
578567ab2ff2Smrg      subroutine foo
578667ab2ff2Smrg      end]])])],
578767ab2ff2Smrg	      [lt_cv_irix_exported_symbol=yes],
578867ab2ff2Smrg	      [lt_cv_irix_exported_symbol=no])
5789b3a827e2Smrg           LDFLAGS=$save_LDFLAGS])
5790b3a827e2Smrg	if test yes = "$lt_cv_irix_exported_symbol"; then
5791b3a827e2Smrg          _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'
579267ab2ff2Smrg	fi
579367ab2ff2Smrg      else
5794b3a827e2Smrg	_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'
5795b3a827e2Smrg	_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'
579667ab2ff2Smrg      fi
579767ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5798b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
579967ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
580067ab2ff2Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
580167ab2ff2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
580267ab2ff2Smrg      ;;
580367ab2ff2Smrg
5804b3a827e2Smrg    linux*)
5805b3a827e2Smrg      case $cc_basename in
5806b3a827e2Smrg      tcc*)
5807b3a827e2Smrg	# Fabrice Bellard et al's Tiny C Compiler
5808b3a827e2Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5809b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5810b3a827e2Smrg	;;
5811b3a827e2Smrg      esac
5812b3a827e2Smrg      ;;
5813b3a827e2Smrg
581467ab2ff2Smrg    netbsd*)
581567ab2ff2Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
581667ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
581767ab2ff2Smrg      else
581867ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
581967ab2ff2Smrg      fi
582067ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
582167ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
582267ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5823f05b35a2Smrg      ;;
5824e0963edeSmrg
582549e108a1Smrg    newsos6)
582667ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
582767ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5828b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
582967ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
583067ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
583149e108a1Smrg      ;;
5832e0963edeSmrg
583349e108a1Smrg    *nto* | *qnx*)
5834f05b35a2Smrg      ;;
5835e0963edeSmrg
5836b3a827e2Smrg    openbsd* | bitrig*)
583767ab2ff2Smrg      if test -f /usr/libexec/ld.so; then
583867ab2ff2Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
583967ab2ff2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
584067ab2ff2Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5841b3a827e2Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
584267ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5843b3a827e2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
5844b3a827e2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
5845b3a827e2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
584667ab2ff2Smrg	else
5847b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5848b3a827e2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
584967ab2ff2Smrg	fi
585067ab2ff2Smrg      else
585167ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
585267ab2ff2Smrg      fi
585349e108a1Smrg      ;;
5854e0963edeSmrg
585567ab2ff2Smrg    os2*)
585667ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
585767ab2ff2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
585867ab2ff2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5859b3a827e2Smrg      shrext_cmds=.dll
5860b3a827e2Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5861b3a827e2Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5862b3a827e2Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5863b3a827e2Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5864b3a827e2Smrg	emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
5865b3a827e2Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5866b3a827e2Smrg	emximp -o $lib $output_objdir/$libname.def'
5867b3a827e2Smrg      _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
5868b3a827e2Smrg	$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
5869b3a827e2Smrg	$ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
5870b3a827e2Smrg	$ECHO EXPORTS >> $output_objdir/$libname.def~
5871b3a827e2Smrg	prefix_cmds="$SED"~
5872b3a827e2Smrg	if test EXPORTS = "`$SED 1q $export_symbols`"; then
5873b3a827e2Smrg	  prefix_cmds="$prefix_cmds -e 1d";
5874b3a827e2Smrg	fi~
5875b3a827e2Smrg	prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
5876b3a827e2Smrg	cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
5877b3a827e2Smrg	$CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
5878b3a827e2Smrg	emximp -o $lib $output_objdir/$libname.def'
5879b3a827e2Smrg      _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
5880b3a827e2Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
588167ab2ff2Smrg      ;;
588267ab2ff2Smrg
588367ab2ff2Smrg    osf3*)
5884b3a827e2Smrg      if test yes = "$GCC"; then
5885b3a827e2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5886b3a827e2Smrg	_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'
588767ab2ff2Smrg      else
588867ab2ff2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5889b3a827e2Smrg	_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'
589067ab2ff2Smrg      fi
589167ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5892b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
589367ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
589467ab2ff2Smrg      ;;
589567ab2ff2Smrg
589667ab2ff2Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5897b3a827e2Smrg      if test yes = "$GCC"; then
5898b3a827e2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
5899b3a827e2Smrg	_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'
5900b3a827e2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
590167ab2ff2Smrg      else
590267ab2ff2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5903b3a827e2Smrg	_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'
590467ab2ff2Smrg	_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~
5905b3a827e2Smrg          $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'
590667ab2ff2Smrg
590767ab2ff2Smrg	# Both c and cxx compiler support -rpath directly
590867ab2ff2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
590967ab2ff2Smrg      fi
591067ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
591167ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
591249e108a1Smrg      ;;
5913e0963edeSmrg
591449e108a1Smrg    solaris*)
591567ab2ff2Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5916b3a827e2Smrg      if test yes = "$GCC"; then
5917b3a827e2Smrg	wlarc='$wl'
5918b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
591967ab2ff2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5920b3a827e2Smrg          $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'
592167ab2ff2Smrg      else
592267ab2ff2Smrg	case `$CC -V 2>&1` in
592367ab2ff2Smrg	*"Compilers 5.0"*)
592467ab2ff2Smrg	  wlarc=''
5925b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
592667ab2ff2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5927b3a827e2Smrg            $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
592867ab2ff2Smrg	  ;;
592967ab2ff2Smrg	*)
5930b3a827e2Smrg	  wlarc='$wl'
5931b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
593267ab2ff2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5933b3a827e2Smrg            $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
593467ab2ff2Smrg	  ;;
593567ab2ff2Smrg	esac
593667ab2ff2Smrg      fi
593767ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
593867ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
593967ab2ff2Smrg      case $host_os in
594067ab2ff2Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5941f05b35a2Smrg      *)
594267ab2ff2Smrg	# The compiler driver will combine and reorder linker options,
5943b3a827e2Smrg	# but understands '-z linker_flag'.  GCC discards it without '$wl',
594467ab2ff2Smrg	# but is careful enough not to reorder.
594567ab2ff2Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5946b3a827e2Smrg	if test yes = "$GCC"; then
5947b3a827e2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
594867ab2ff2Smrg	else
594967ab2ff2Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
595067ab2ff2Smrg	fi
595167ab2ff2Smrg	;;
595249e108a1Smrg      esac
595367ab2ff2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
595449e108a1Smrg      ;;
5955e0963edeSmrg
595649e108a1Smrg    sunos4*)
5957b3a827e2Smrg      if test sequent = "$host_vendor"; then
595867ab2ff2Smrg	# Use $CC to link under sequent, because it throws in some extra .o
595967ab2ff2Smrg	# files that make .init and .fini sections work.
5960b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
596167ab2ff2Smrg      else
596267ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
596367ab2ff2Smrg      fi
596467ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
596567ab2ff2Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
596667ab2ff2Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
596767ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
596849e108a1Smrg      ;;
5969f05b35a2Smrg
597067ab2ff2Smrg    sysv4)
597167ab2ff2Smrg      case $host_vendor in
597267ab2ff2Smrg	sni)
597367ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
597467ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
597567ab2ff2Smrg	;;
597667ab2ff2Smrg	siemens)
597767ab2ff2Smrg	  ## LD is ld it makes a PLAMLIB
597867ab2ff2Smrg	  ## CC just makes a GrossModule.
597967ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
598067ab2ff2Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
598167ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
598267ab2ff2Smrg        ;;
598367ab2ff2Smrg	motorola)
598467ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
598567ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
598667ab2ff2Smrg	;;
598767ab2ff2Smrg      esac
598867ab2ff2Smrg      runpath_var='LD_RUN_PATH'
598967ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599067ab2ff2Smrg      ;;
599167ab2ff2Smrg
599267ab2ff2Smrg    sysv4.3*)
599367ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
599467ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
599567ab2ff2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
599649e108a1Smrg      ;;
5997f05b35a2Smrg
599849e108a1Smrg    sysv4*MP*)
599967ab2ff2Smrg      if test -d /usr/nec; then
600067ab2ff2Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
600167ab2ff2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
600267ab2ff2Smrg	runpath_var=LD_RUN_PATH
600367ab2ff2Smrg	hardcode_runpath_var=yes
600467ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
600549e108a1Smrg      fi
600649e108a1Smrg      ;;
6007f05b35a2Smrg
600867ab2ff2Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6009b3a827e2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
601067ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
601167ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
601267ab2ff2Smrg      runpath_var='LD_RUN_PATH'
601367ab2ff2Smrg
6014b3a827e2Smrg      if test yes = "$GCC"; then
6015b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6016b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
601767ab2ff2Smrg      else
6018b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6019b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
602067ab2ff2Smrg      fi
602149e108a1Smrg      ;;
6022f05b35a2Smrg
602367ab2ff2Smrg    sysv5* | sco3.2v5* | sco5v6*)
6024b3a827e2Smrg      # Note: We CANNOT use -z defs as we might desire, because we do not
602567ab2ff2Smrg      # link with -lc, and that would cause any symbols used from libc to
602667ab2ff2Smrg      # always be unresolved, which means just about no library would
602767ab2ff2Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
602867ab2ff2Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
602967ab2ff2Smrg      # as -z defs.
6030b3a827e2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
6031b3a827e2Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
603267ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
603367ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6034b3a827e2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
603567ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
603667ab2ff2Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
6037b3a827e2Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
603867ab2ff2Smrg      runpath_var='LD_RUN_PATH'
603967ab2ff2Smrg
6040b3a827e2Smrg      if test yes = "$GCC"; then
6041b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6042b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604367ab2ff2Smrg      else
6044b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6045b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
604667ab2ff2Smrg      fi
604749e108a1Smrg      ;;
6048e0963edeSmrg
604949e108a1Smrg    uts4*)
605067ab2ff2Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
605167ab2ff2Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
605267ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
605367ab2ff2Smrg      ;;
605467ab2ff2Smrg
605567ab2ff2Smrg    *)
605667ab2ff2Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
605767ab2ff2Smrg      ;;
605867ab2ff2Smrg    esac
605967ab2ff2Smrg
6060b3a827e2Smrg    if test sni = "$host_vendor"; then
606167ab2ff2Smrg      case $host in
606267ab2ff2Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
6063b3a827e2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
606467ab2ff2Smrg	;;
606567ab2ff2Smrg      esac
606667ab2ff2Smrg    fi
606767ab2ff2Smrg  fi
606867ab2ff2Smrg])
606967ab2ff2SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6070b3a827e2Smrgtest no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
607167ab2ff2Smrg
607267ab2ff2Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
607367ab2ff2Smrg
607467ab2ff2Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
607567ab2ff2Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
607667ab2ff2Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
607767ab2ff2Smrg    [The commands to extract the exported symbol list from a shared archive])
607867ab2ff2Smrg
607967ab2ff2Smrg#
608067ab2ff2Smrg# Do we need to explicitly link libc?
608167ab2ff2Smrg#
608267ab2ff2Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
608367ab2ff2Smrgx|xyes)
608467ab2ff2Smrg  # Assume -lc should be added
608567ab2ff2Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
608667ab2ff2Smrg
6087b3a827e2Smrg  if test yes,yes = "$GCC,$enable_shared"; then
608867ab2ff2Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
608967ab2ff2Smrg    *'~'*)
609067ab2ff2Smrg      # FIXME: we may have to deal with multi-command sequences.
609149e108a1Smrg      ;;
609267ab2ff2Smrg    '$CC '*)
609367ab2ff2Smrg      # Test whether the compiler implicitly links with -lc since on some
609467ab2ff2Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
609567ab2ff2Smrg      # to ld, don't add -lc before -lgcc.
609667ab2ff2Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
609767ab2ff2Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
609867ab2ff2Smrg	[$RM conftest*
609967ab2ff2Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
6100e0963edeSmrg
610167ab2ff2Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
610267ab2ff2Smrg	  soname=conftest
610367ab2ff2Smrg	  lib=conftest
610467ab2ff2Smrg	  libobjs=conftest.$ac_objext
610567ab2ff2Smrg	  deplibs=
610667ab2ff2Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
610767ab2ff2Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
610867ab2ff2Smrg	  compiler_flags=-v
610967ab2ff2Smrg	  linker_flags=-v
611067ab2ff2Smrg	  verstring=
611167ab2ff2Smrg	  output_objdir=.
611267ab2ff2Smrg	  libname=conftest
611367ab2ff2Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
611467ab2ff2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
611567ab2ff2Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
611667ab2ff2Smrg	  then
611767ab2ff2Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
611867ab2ff2Smrg	  else
611967ab2ff2Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
612067ab2ff2Smrg	  fi
612167ab2ff2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
612267ab2ff2Smrg	else
612367ab2ff2Smrg	  cat conftest.err 1>&5
612467ab2ff2Smrg	fi
612567ab2ff2Smrg	$RM conftest*
612667ab2ff2Smrg	])
612767ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
612849e108a1Smrg      ;;
612949e108a1Smrg    esac
613049e108a1Smrg  fi
613167ab2ff2Smrg  ;;
613249e108a1Smrgesac
6133e0963edeSmrg
613467ab2ff2Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
613567ab2ff2Smrg    [Whether or not to add -lc for building shared libraries])
613667ab2ff2Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
613767ab2ff2Smrg    [enable_shared_with_static_runtimes], [0],
613867ab2ff2Smrg    [Whether or not to disallow shared libs when runtime libs are static])
613967ab2ff2Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
614067ab2ff2Smrg    [Compiler flag to allow reflexive dlopens])
614167ab2ff2Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
614267ab2ff2Smrg    [Compiler flag to generate shared objects directly from archives])
614367ab2ff2Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
614467ab2ff2Smrg    [Whether the compiler copes with passing no objects directly])
614567ab2ff2Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
614667ab2ff2Smrg    [Create an old-style archive from a shared archive])
614767ab2ff2Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
614867ab2ff2Smrg    [Create a temporary old-style archive to link instead of a shared archive])
614967ab2ff2Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
615067ab2ff2Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
615167ab2ff2Smrg_LT_TAGDECL([], [module_cmds], [2],
615267ab2ff2Smrg    [Commands used to build a loadable module if different from building
615367ab2ff2Smrg    a shared archive.])
615467ab2ff2Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
615567ab2ff2Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
615667ab2ff2Smrg    [Whether we are building with GNU ld or not])
615767ab2ff2Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
615867ab2ff2Smrg    [Flag that allows shared libraries with undefined symbols to be built])
615967ab2ff2Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
616067ab2ff2Smrg    [Flag that enforces no undefined symbols])
616167ab2ff2Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
616267ab2ff2Smrg    [Flag to hardcode $libdir into a binary during linking.
616367ab2ff2Smrg    This must work even if $libdir does not exist])
616467ab2ff2Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
616567ab2ff2Smrg    [Whether we need a single "-rpath" flag with a separated argument])
616667ab2ff2Smrg_LT_TAGDECL([], [hardcode_direct], [0],
6167b3a827e2Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
616867ab2ff2Smrg    DIR into the resulting binary])
616967ab2ff2Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
6170b3a827e2Smrg    [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
617167ab2ff2Smrg    DIR into the resulting binary and the resulting library dependency is
6172b3a827e2Smrg    "absolute", i.e impossible to change by setting $shlibpath_var if the
617367ab2ff2Smrg    library is relocated])
617467ab2ff2Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
617567ab2ff2Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
617667ab2ff2Smrg    into the resulting binary])
617767ab2ff2Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
617867ab2ff2Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
617967ab2ff2Smrg    into the resulting binary])
618067ab2ff2Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
618167ab2ff2Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
618267ab2ff2Smrg    into the library and all subsequent libraries and executables linked
618367ab2ff2Smrg    against it])
618467ab2ff2Smrg_LT_TAGDECL([], [inherit_rpath], [0],
618567ab2ff2Smrg    [Set to yes if linker adds runtime paths of dependent libraries
618667ab2ff2Smrg    to runtime path list])
618767ab2ff2Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
618867ab2ff2Smrg    [Whether libtool must link a program against all its dependency libraries])
618967ab2ff2Smrg_LT_TAGDECL([], [always_export_symbols], [0],
619067ab2ff2Smrg    [Set to "yes" if exported symbols are required])
619167ab2ff2Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
619267ab2ff2Smrg    [The commands to list exported symbols])
619367ab2ff2Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
619467ab2ff2Smrg    [Symbols that should not be listed in the preloaded symbols])
619567ab2ff2Smrg_LT_TAGDECL([], [include_expsyms], [1],
619667ab2ff2Smrg    [Symbols that must always be exported])
619767ab2ff2Smrg_LT_TAGDECL([], [prelink_cmds], [2],
619867ab2ff2Smrg    [Commands necessary for linking programs (against libraries) with templates])
619967ab2ff2Smrg_LT_TAGDECL([], [postlink_cmds], [2],
620067ab2ff2Smrg    [Commands necessary for finishing linking programs])
620167ab2ff2Smrg_LT_TAGDECL([], [file_list_spec], [1],
620267ab2ff2Smrg    [Specify filename containing input files])
620367ab2ff2Smrgdnl FIXME: Not yet implemented
620467ab2ff2Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
620567ab2ff2Smrgdnl    [Compiler flag to generate thread safe objects])
620667ab2ff2Smrg])# _LT_LINKER_SHLIBS
6207e0963edeSmrg
620849e108a1Smrg
620967ab2ff2Smrg# _LT_LANG_C_CONFIG([TAG])
621067ab2ff2Smrg# ------------------------
621167ab2ff2Smrg# Ensure that the configuration variables for a C compiler are suitably
621267ab2ff2Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6213b3a827e2Smrg# the compiler configuration to 'libtool'.
621467ab2ff2Smrgm4_defun([_LT_LANG_C_CONFIG],
621567ab2ff2Smrg[m4_require([_LT_DECL_EGREP])dnl
6216b3a827e2Smrglt_save_CC=$CC
621767ab2ff2SmrgAC_LANG_PUSH(C)
6218e0963edeSmrg
621967ab2ff2Smrg# Source file extension for C test sources.
622067ab2ff2Smrgac_ext=c
6221e0963edeSmrg
622267ab2ff2Smrg# Object file extension for compiled C test sources.
622367ab2ff2Smrgobjext=o
622467ab2ff2Smrg_LT_TAGVAR(objext, $1)=$objext
6225e0963edeSmrg
622667ab2ff2Smrg# Code to be used in simple compile tests
622767ab2ff2Smrglt_simple_compile_test_code="int some_variable = 0;"
6228e0963edeSmrg
622967ab2ff2Smrg# Code to be used in simple link tests
623067ab2ff2Smrglt_simple_link_test_code='int main(){return(0);}'
6231e0963edeSmrg
623267ab2ff2Smrg_LT_TAG_COMPILER
623367ab2ff2Smrg# Save the default compiler, since it gets overwritten when the other
623467ab2ff2Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
623567ab2ff2Smrgcompiler_DEFAULT=$CC
6236e0963edeSmrg
623767ab2ff2Smrg# save warnings/boilerplate of simple test code
623867ab2ff2Smrg_LT_COMPILER_BOILERPLATE
623967ab2ff2Smrg_LT_LINKER_BOILERPLATE
6240e0963edeSmrg
624167ab2ff2Smrgif test -n "$compiler"; then
624267ab2ff2Smrg  _LT_COMPILER_NO_RTTI($1)
624367ab2ff2Smrg  _LT_COMPILER_PIC($1)
624467ab2ff2Smrg  _LT_COMPILER_C_O($1)
624567ab2ff2Smrg  _LT_COMPILER_FILE_LOCKS($1)
624667ab2ff2Smrg  _LT_LINKER_SHLIBS($1)
624767ab2ff2Smrg  _LT_SYS_DYNAMIC_LINKER($1)
624867ab2ff2Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
624967ab2ff2Smrg  LT_SYS_DLOPEN_SELF
625067ab2ff2Smrg  _LT_CMD_STRIPLIB
6251e0963edeSmrg
6252b3a827e2Smrg  # Report what library types will actually be built
625367ab2ff2Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
625467ab2ff2Smrg  AC_MSG_RESULT([$can_build_shared])
6255e0963edeSmrg
625667ab2ff2Smrg  AC_MSG_CHECKING([whether to build shared libraries])
6257b3a827e2Smrg  test no = "$can_build_shared" && enable_shared=no
6258e0963edeSmrg
625967ab2ff2Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
626067ab2ff2Smrg  # are all built from PIC.
626167ab2ff2Smrg  case $host_os in
626267ab2ff2Smrg  aix3*)
6263b3a827e2Smrg    test yes = "$enable_shared" && enable_static=no
626467ab2ff2Smrg    if test -n "$RANLIB"; then
626567ab2ff2Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
626667ab2ff2Smrg      postinstall_cmds='$RANLIB $lib'
626767ab2ff2Smrg    fi
626867ab2ff2Smrg    ;;
6269e0963edeSmrg
627067ab2ff2Smrg  aix[[4-9]]*)
6271b3a827e2Smrg    if test ia64 != "$host_cpu"; then
6272b3a827e2Smrg      case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
6273b3a827e2Smrg      yes,aix,yes) ;;			# shared object as lib.so file only
6274b3a827e2Smrg      yes,svr4,*) ;;			# shared object as lib.so archive member only
6275b3a827e2Smrg      yes,*) enable_static=no ;;	# shared object in lib.a archive as well
6276b3a827e2Smrg      esac
627767ab2ff2Smrg    fi
627867ab2ff2Smrg    ;;
627967ab2ff2Smrg  esac
628067ab2ff2Smrg  AC_MSG_RESULT([$enable_shared])
6281e0963edeSmrg
628267ab2ff2Smrg  AC_MSG_CHECKING([whether to build static libraries])
628367ab2ff2Smrg  # Make sure either enable_shared or enable_static is yes.
6284b3a827e2Smrg  test yes = "$enable_shared" || enable_static=yes
628567ab2ff2Smrg  AC_MSG_RESULT([$enable_static])
6286f05b35a2Smrg
628767ab2ff2Smrg  _LT_CONFIG($1)
628867ab2ff2Smrgfi
628967ab2ff2SmrgAC_LANG_POP
6290b3a827e2SmrgCC=$lt_save_CC
629167ab2ff2Smrg])# _LT_LANG_C_CONFIG
6292e0963edeSmrg
6293e0963edeSmrg
629467ab2ff2Smrg# _LT_LANG_CXX_CONFIG([TAG])
629567ab2ff2Smrg# --------------------------
629667ab2ff2Smrg# Ensure that the configuration variables for a C++ compiler are suitably
629767ab2ff2Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
6298b3a827e2Smrg# the compiler configuration to 'libtool'.
629967ab2ff2Smrgm4_defun([_LT_LANG_CXX_CONFIG],
630067ab2ff2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
630167ab2ff2Smrgm4_require([_LT_DECL_EGREP])dnl
630267ab2ff2Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
6303b3a827e2Smrgif test -n "$CXX" && ( test no != "$CXX" &&
6304b3a827e2Smrg    ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
6305b3a827e2Smrg    (test g++ != "$CXX"))); then
630667ab2ff2Smrg  AC_PROG_CXXCPP
630767ab2ff2Smrgelse
630867ab2ff2Smrg  _lt_caught_CXX_error=yes
630967ab2ff2Smrgfi
631067ab2ff2Smrg
631167ab2ff2SmrgAC_LANG_PUSH(C++)
631267ab2ff2Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
631367ab2ff2Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
631467ab2ff2Smrg_LT_TAGVAR(always_export_symbols, $1)=no
631567ab2ff2Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
631667ab2ff2Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
631767ab2ff2Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
631867ab2ff2Smrg_LT_TAGVAR(hardcode_direct, $1)=no
631967ab2ff2Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
632067ab2ff2Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
632167ab2ff2Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
632267ab2ff2Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
632367ab2ff2Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
632467ab2ff2Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
632567ab2ff2Smrg_LT_TAGVAR(inherit_rpath, $1)=no
632667ab2ff2Smrg_LT_TAGVAR(module_cmds, $1)=
632767ab2ff2Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
632867ab2ff2Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
632967ab2ff2Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
633067ab2ff2Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
633167ab2ff2Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
633267ab2ff2Smrg_LT_TAGVAR(no_undefined_flag, $1)=
633367ab2ff2Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
633467ab2ff2Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
633567ab2ff2Smrg
633667ab2ff2Smrg# Source file extension for C++ test sources.
633767ab2ff2Smrgac_ext=cpp
6338f05b35a2Smrg
633967ab2ff2Smrg# Object file extension for compiled C++ test sources.
634067ab2ff2Smrgobjext=o
634167ab2ff2Smrg_LT_TAGVAR(objext, $1)=$objext
6342f05b35a2Smrg
634367ab2ff2Smrg# No sense in running all these tests if we already determined that
634467ab2ff2Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
634567ab2ff2Smrg# are currently assumed to apply to all compilers on this platform,
634667ab2ff2Smrg# and will be corrupted by setting them based on a non-working compiler.
6347b3a827e2Smrgif test yes != "$_lt_caught_CXX_error"; then
634867ab2ff2Smrg  # Code to be used in simple compile tests
634967ab2ff2Smrg  lt_simple_compile_test_code="int some_variable = 0;"
6350e0963edeSmrg
635167ab2ff2Smrg  # Code to be used in simple link tests
635267ab2ff2Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
6353e0963edeSmrg
635467ab2ff2Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
635567ab2ff2Smrg  _LT_TAG_COMPILER
6356e0963edeSmrg
635767ab2ff2Smrg  # save warnings/boilerplate of simple test code
635867ab2ff2Smrg  _LT_COMPILER_BOILERPLATE
635967ab2ff2Smrg  _LT_LINKER_BOILERPLATE
6360e0963edeSmrg
636167ab2ff2Smrg  # Allow CC to be a program name with arguments.
636267ab2ff2Smrg  lt_save_CC=$CC
636367ab2ff2Smrg  lt_save_CFLAGS=$CFLAGS
636467ab2ff2Smrg  lt_save_LD=$LD
636567ab2ff2Smrg  lt_save_GCC=$GCC
636667ab2ff2Smrg  GCC=$GXX
636767ab2ff2Smrg  lt_save_with_gnu_ld=$with_gnu_ld
636867ab2ff2Smrg  lt_save_path_LD=$lt_cv_path_LD
636967ab2ff2Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
637067ab2ff2Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
637167ab2ff2Smrg  else
637267ab2ff2Smrg    $as_unset lt_cv_prog_gnu_ld
637367ab2ff2Smrg  fi
637467ab2ff2Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
637567ab2ff2Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
637667ab2ff2Smrg  else
637767ab2ff2Smrg    $as_unset lt_cv_path_LD
637867ab2ff2Smrg  fi
637967ab2ff2Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
638067ab2ff2Smrg  CC=${CXX-"c++"}
638167ab2ff2Smrg  CFLAGS=$CXXFLAGS
638267ab2ff2Smrg  compiler=$CC
638367ab2ff2Smrg  _LT_TAGVAR(compiler, $1)=$CC
638467ab2ff2Smrg  _LT_CC_BASENAME([$compiler])
6385e0963edeSmrg
638667ab2ff2Smrg  if test -n "$compiler"; then
638767ab2ff2Smrg    # We don't want -fno-exception when compiling C++ code, so set the
638867ab2ff2Smrg    # no_builtin_flag separately
6389b3a827e2Smrg    if test yes = "$GXX"; then
639067ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
639167ab2ff2Smrg    else
639267ab2ff2Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
639367ab2ff2Smrg    fi
6394e0963edeSmrg
6395b3a827e2Smrg    if test yes = "$GXX"; then
639667ab2ff2Smrg      # Set up default GNU C++ configuration
6397f05b35a2Smrg
639867ab2ff2Smrg      LT_PATH_LD
6399e0963edeSmrg
640067ab2ff2Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
640167ab2ff2Smrg      # archiving commands below assume that GNU ld is being used.
6402b3a827e2Smrg      if test yes = "$with_gnu_ld"; then
6403b3a827e2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6404b3a827e2Smrg        _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'
640567ab2ff2Smrg
6406b3a827e2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
6407b3a827e2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
640867ab2ff2Smrg
640967ab2ff2Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
641067ab2ff2Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
641167ab2ff2Smrg        #     investigate it a little bit more. (MM)
6412b3a827e2Smrg        wlarc='$wl'
641367ab2ff2Smrg
641467ab2ff2Smrg        # ancient GNU ld didn't support --whole-archive et. al.
641567ab2ff2Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
641667ab2ff2Smrg	  $GREP 'no-whole-archive' > /dev/null; then
6417b3a827e2Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
641867ab2ff2Smrg        else
641967ab2ff2Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
642067ab2ff2Smrg        fi
642149e108a1Smrg      else
642267ab2ff2Smrg        with_gnu_ld=no
642367ab2ff2Smrg        wlarc=
642467ab2ff2Smrg
642567ab2ff2Smrg        # A generic and very simple default shared library creation
642667ab2ff2Smrg        # command for GNU C++ for the case where it uses the native
642767ab2ff2Smrg        # linker, instead of GNU ld.  If possible, this setting should
642867ab2ff2Smrg        # overridden to take advantage of the native linker features on
642967ab2ff2Smrg        # the platform it is being used on.
643067ab2ff2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
643149e108a1Smrg      fi
6432e0963edeSmrg
643367ab2ff2Smrg      # Commands to make compiler produce verbose output that lists
643467ab2ff2Smrg      # what "hidden" libraries, object files and flags are used when
643567ab2ff2Smrg      # linking a shared library.
643667ab2ff2Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
643767ab2ff2Smrg
643867ab2ff2Smrg    else
643967ab2ff2Smrg      GXX=no
644067ab2ff2Smrg      with_gnu_ld=no
644167ab2ff2Smrg      wlarc=
644249e108a1Smrg    fi
6443e0963edeSmrg
644467ab2ff2Smrg    # PORTME: fill in a description of your system's C++ link characteristics
644567ab2ff2Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
644667ab2ff2Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
644767ab2ff2Smrg    case $host_os in
644867ab2ff2Smrg      aix3*)
644967ab2ff2Smrg        # FIXME: insert proper C++ library support
645067ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
645167ab2ff2Smrg        ;;
645267ab2ff2Smrg      aix[[4-9]]*)
6453b3a827e2Smrg        if test ia64 = "$host_cpu"; then
645467ab2ff2Smrg          # On IA64, the linker does run time linking by default, so we don't
645567ab2ff2Smrg          # have to do anything special.
645667ab2ff2Smrg          aix_use_runtimelinking=no
645767ab2ff2Smrg          exp_sym_flag='-Bexport'
6458b3a827e2Smrg          no_entry_flag=
645967ab2ff2Smrg        else
646067ab2ff2Smrg          aix_use_runtimelinking=no
6461e0963edeSmrg
646267ab2ff2Smrg          # Test if we are trying to use run time linking or normal
646367ab2ff2Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
6464b3a827e2Smrg          # have runtime linking enabled, and use it for executables.
6465b3a827e2Smrg          # For shared libraries, we enable/disable runtime linking
6466b3a827e2Smrg          # depending on the kind of the shared library created -
6467b3a827e2Smrg          # when "with_aix_soname,aix_use_runtimelinking" is:
6468b3a827e2Smrg          # "aix,no"   lib.a(lib.so.V) shared, rtl:no,  for executables
6469b3a827e2Smrg          # "aix,yes"  lib.so          shared, rtl:yes, for executables
6470b3a827e2Smrg          #            lib.a           static archive
6471b3a827e2Smrg          # "both,no"  lib.so.V(shr.o) shared, rtl:yes
6472b3a827e2Smrg          #            lib.a(lib.so.V) shared, rtl:no,  for executables
6473b3a827e2Smrg          # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
6474b3a827e2Smrg          #            lib.a(lib.so.V) shared, rtl:no
6475b3a827e2Smrg          # "svr4,*"   lib.so.V(shr.o) shared, rtl:yes, for executables
6476b3a827e2Smrg          #            lib.a           static archive
647767ab2ff2Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
647867ab2ff2Smrg	    for ld_flag in $LDFLAGS; do
647967ab2ff2Smrg	      case $ld_flag in
648067ab2ff2Smrg	      *-brtl*)
648167ab2ff2Smrg	        aix_use_runtimelinking=yes
648267ab2ff2Smrg	        break
648367ab2ff2Smrg	        ;;
648467ab2ff2Smrg	      esac
648567ab2ff2Smrg	    done
6486b3a827e2Smrg	    if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
6487b3a827e2Smrg	      # With aix-soname=svr4, we create the lib.so.V shared archives only,
6488b3a827e2Smrg	      # so we don't have lib.a shared libs to link our executables.
6489b3a827e2Smrg	      # We have to force runtime linking in this case.
6490b3a827e2Smrg	      aix_use_runtimelinking=yes
6491b3a827e2Smrg	      LDFLAGS="$LDFLAGS -Wl,-brtl"
6492b3a827e2Smrg	    fi
649367ab2ff2Smrg	    ;;
649467ab2ff2Smrg          esac
6495e0963edeSmrg
649667ab2ff2Smrg          exp_sym_flag='-bexport'
649767ab2ff2Smrg          no_entry_flag='-bnoentry'
649867ab2ff2Smrg        fi
6499f05b35a2Smrg
650067ab2ff2Smrg        # When large executables or shared objects are built, AIX ld can
650167ab2ff2Smrg        # have problems creating the table of contents.  If linking a library
650267ab2ff2Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
650367ab2ff2Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
650467ab2ff2Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6505f05b35a2Smrg
650667ab2ff2Smrg        _LT_TAGVAR(archive_cmds, $1)=''
650767ab2ff2Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
650867ab2ff2Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
650967ab2ff2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
651067ab2ff2Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6511b3a827e2Smrg        _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
6512b3a827e2Smrg        case $with_aix_soname,$aix_use_runtimelinking in
6513b3a827e2Smrg        aix,*) ;;	# no import file
6514b3a827e2Smrg        svr4,* | *,yes) # use import file
6515b3a827e2Smrg          # The Import File defines what to hardcode.
6516b3a827e2Smrg          _LT_TAGVAR(hardcode_direct, $1)=no
6517b3a827e2Smrg          _LT_TAGVAR(hardcode_direct_absolute, $1)=no
6518b3a827e2Smrg          ;;
6519b3a827e2Smrg        esac
6520f05b35a2Smrg
6521b3a827e2Smrg        if test yes = "$GXX"; then
652267ab2ff2Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
652367ab2ff2Smrg          # We only want to do this on AIX 4.2 and lower, the check
652467ab2ff2Smrg          # below for broken collect2 doesn't work under 4.3+
6525b3a827e2Smrg	  collect2name=`$CC -print-prog-name=collect2`
652649e108a1Smrg	  if test -f "$collect2name" &&
652767ab2ff2Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
652849e108a1Smrg	  then
652967ab2ff2Smrg	    # We have reworked collect2
653067ab2ff2Smrg	    :
653149e108a1Smrg	  else
653267ab2ff2Smrg	    # We have old collect2
653367ab2ff2Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
653467ab2ff2Smrg	    # It fails to find uninstalled libraries when the uninstalled
653567ab2ff2Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
653667ab2ff2Smrg	    # to unsupported forces relinking
653767ab2ff2Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
653867ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
653967ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
654049e108a1Smrg	  fi
654167ab2ff2Smrg          esac
654267ab2ff2Smrg          shared_flag='-shared'
6543b3a827e2Smrg	  if test yes = "$aix_use_runtimelinking"; then
6544b3a827e2Smrg	    shared_flag=$shared_flag' $wl-G'
654549e108a1Smrg	  fi
6546b3a827e2Smrg	  # Need to ensure runtime linking is disabled for the traditional
6547b3a827e2Smrg	  # shared library, or the linker may eventually find shared libraries
6548b3a827e2Smrg	  # /with/ Import File - we do not want to mix them.
6549b3a827e2Smrg	  shared_flag_aix='-shared'
6550b3a827e2Smrg	  shared_flag_svr4='-shared $wl-G'
655167ab2ff2Smrg        else
655267ab2ff2Smrg          # not using gcc
6553b3a827e2Smrg          if test ia64 = "$host_cpu"; then
655467ab2ff2Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
655567ab2ff2Smrg	  # chokes on -Wl,-G. The following line is correct:
655667ab2ff2Smrg	  shared_flag='-G'
655767ab2ff2Smrg          else
6558b3a827e2Smrg	    if test yes = "$aix_use_runtimelinking"; then
6559b3a827e2Smrg	      shared_flag='$wl-G'
656067ab2ff2Smrg	    else
6561b3a827e2Smrg	      shared_flag='$wl-bM:SRE'
656267ab2ff2Smrg	    fi
6563b3a827e2Smrg	    shared_flag_aix='$wl-bM:SRE'
6564b3a827e2Smrg	    shared_flag_svr4='$wl-G'
656567ab2ff2Smrg          fi
656667ab2ff2Smrg        fi
6567f05b35a2Smrg
6568b3a827e2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
656967ab2ff2Smrg        # It seems that -bexpall does not export symbols beginning with
657067ab2ff2Smrg        # underscore (_), so it is better to generate a list of symbols to
657167ab2ff2Smrg	# export.
657267ab2ff2Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6573b3a827e2Smrg	if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
657467ab2ff2Smrg          # Warning - without using the other runtime loading flags (-brtl),
657567ab2ff2Smrg          # -berok will link without error, but may produce a broken library.
6576b3a827e2Smrg          # The "-G" linker flag allows undefined symbols.
6577b3a827e2Smrg          _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
657867ab2ff2Smrg          # Determine the default libpath from the value encoded in an empty
657967ab2ff2Smrg          # executable.
658067ab2ff2Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6581b3a827e2Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
6582f05b35a2Smrg
6583b3a827e2Smrg          _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
658467ab2ff2Smrg        else
6585b3a827e2Smrg          if test ia64 = "$host_cpu"; then
6586b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
658767ab2ff2Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6588b3a827e2Smrg	    _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"
658967ab2ff2Smrg          else
659067ab2ff2Smrg	    # Determine the default libpath from the value encoded in an
659167ab2ff2Smrg	    # empty executable.
659267ab2ff2Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6593b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
659467ab2ff2Smrg	    # Warning - without using the other run time loading flags,
659567ab2ff2Smrg	    # -berok will link without error, but may produce a broken library.
6596b3a827e2Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
6597b3a827e2Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
6598b3a827e2Smrg	    if test yes = "$with_gnu_ld"; then
659967ab2ff2Smrg	      # We only use this code for GNU lds that support --whole-archive.
6600b3a827e2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
660167ab2ff2Smrg	    else
660267ab2ff2Smrg	      # Exported symbols can be pulled into shared objects from archives
660367ab2ff2Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
660467ab2ff2Smrg	    fi
660567ab2ff2Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6606b3a827e2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
6607b3a827e2Smrg	    # -brtl affects multiple linker settings, -berok does not and is overridden later
6608b3a827e2Smrg	    compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
6609b3a827e2Smrg	    if test svr4 != "$with_aix_soname"; then
6610b3a827e2Smrg	      # This is similar to how AIX traditionally builds its shared
6611b3a827e2Smrg	      # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
6612b3a827e2Smrg	      _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'
6613b3a827e2Smrg	    fi
6614b3a827e2Smrg	    if test aix != "$with_aix_soname"; then
6615b3a827e2Smrg	      _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'
6616b3a827e2Smrg	    else
6617b3a827e2Smrg	      # used by -dlpreopen to get the symbols
6618b3a827e2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV  $output_objdir/$realname.d/$soname $output_objdir'
6619b3a827e2Smrg	    fi
6620b3a827e2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
662167ab2ff2Smrg          fi
662267ab2ff2Smrg        fi
662349e108a1Smrg        ;;
6624f05b35a2Smrg
662567ab2ff2Smrg      beos*)
662667ab2ff2Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
662767ab2ff2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
662867ab2ff2Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
662967ab2ff2Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6630b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
663167ab2ff2Smrg	else
663267ab2ff2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
663367ab2ff2Smrg	fi
663467ab2ff2Smrg	;;
6635e0963edeSmrg
663667ab2ff2Smrg      chorus*)
663767ab2ff2Smrg        case $cc_basename in
663867ab2ff2Smrg          *)
663967ab2ff2Smrg	  # FIXME: insert proper C++ library support
664067ab2ff2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
664167ab2ff2Smrg	  ;;
664267ab2ff2Smrg        esac
664367ab2ff2Smrg        ;;
6644f05b35a2Smrg
664567ab2ff2Smrg      cygwin* | mingw* | pw32* | cegcc*)
664667ab2ff2Smrg	case $GXX,$cc_basename in
664767ab2ff2Smrg	,cl* | no,cl*)
664867ab2ff2Smrg	  # Native MSVC
664967ab2ff2Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
665067ab2ff2Smrg	  # no search path for DLLs.
665167ab2ff2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
665267ab2ff2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
665367ab2ff2Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
665467ab2ff2Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
665567ab2ff2Smrg	  # Tell ltmain to make .lib files, not .a files.
665667ab2ff2Smrg	  libext=lib
665767ab2ff2Smrg	  # Tell ltmain to make .dll files, not .so files.
6658b3a827e2Smrg	  shrext_cmds=.dll
665967ab2ff2Smrg	  # FIXME: Setting linknames here is a bad hack.
6660b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
6661b3a827e2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6662b3a827e2Smrg              cp "$export_symbols" "$output_objdir/$soname.def";
6663b3a827e2Smrg              echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
6664b3a827e2Smrg            else
6665b3a827e2Smrg              $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
6666b3a827e2Smrg            fi~
6667b3a827e2Smrg            $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6668b3a827e2Smrg            linknames='
666967ab2ff2Smrg	  # The linker will not automatically build a static lib if we build a DLL.
667067ab2ff2Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
667167ab2ff2Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
667267ab2ff2Smrg	  # Don't use ranlib
667367ab2ff2Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
667467ab2ff2Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6675b3a827e2Smrg            lt_tool_outputfile="@TOOL_OUTPUT@"~
6676b3a827e2Smrg            case $lt_outputfile in
6677b3a827e2Smrg              *.exe|*.EXE) ;;
6678b3a827e2Smrg              *)
6679b3a827e2Smrg                lt_outputfile=$lt_outputfile.exe
6680b3a827e2Smrg                lt_tool_outputfile=$lt_tool_outputfile.exe
6681b3a827e2Smrg                ;;
6682b3a827e2Smrg            esac~
6683b3a827e2Smrg            func_to_tool_file "$lt_outputfile"~
6684b3a827e2Smrg            if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
6685b3a827e2Smrg              $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6686b3a827e2Smrg              $RM "$lt_outputfile.manifest";
6687b3a827e2Smrg            fi'
668867ab2ff2Smrg	  ;;
668967ab2ff2Smrg	*)
669067ab2ff2Smrg	  # g++
669167ab2ff2Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
669267ab2ff2Smrg	  # as there is no search path for DLLs.
669367ab2ff2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6694b3a827e2Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
669567ab2ff2Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
669667ab2ff2Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
669767ab2ff2Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
669867ab2ff2Smrg
669967ab2ff2Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6700b3a827e2Smrg	    _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'
6701b3a827e2Smrg	    # If the export-symbols file already is a .def file, use it as
6702b3a827e2Smrg	    # is; otherwise, prepend EXPORTS...
6703b3a827e2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
6704b3a827e2Smrg              cp $export_symbols $output_objdir/$soname.def;
6705b3a827e2Smrg            else
6706b3a827e2Smrg              echo EXPORTS > $output_objdir/$soname.def;
6707b3a827e2Smrg              cat $export_symbols >> $output_objdir/$soname.def;
6708b3a827e2Smrg            fi~
6709b3a827e2Smrg            $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'
671067ab2ff2Smrg	  else
671167ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
671267ab2ff2Smrg	  fi
671367ab2ff2Smrg	  ;;
671467ab2ff2Smrg	esac
671567ab2ff2Smrg	;;
671667ab2ff2Smrg      darwin* | rhapsody*)
671767ab2ff2Smrg        _LT_DARWIN_LINKER_FEATURES($1)
671867ab2ff2Smrg	;;
6719f05b35a2Smrg
6720b3a827e2Smrg      os2*)
6721b3a827e2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6722b3a827e2Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
6723b3a827e2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6724b3a827e2Smrg	shrext_cmds=.dll
6725b3a827e2Smrg	_LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6726b3a827e2Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6727b3a827e2Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6728b3a827e2Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6729b3a827e2Smrg	  emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
6730b3a827e2Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6731b3a827e2Smrg	  emximp -o $lib $output_objdir/$libname.def'
6732b3a827e2Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
6733b3a827e2Smrg	  $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
6734b3a827e2Smrg	  $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
6735b3a827e2Smrg	  $ECHO EXPORTS >> $output_objdir/$libname.def~
6736b3a827e2Smrg	  prefix_cmds="$SED"~
6737b3a827e2Smrg	  if test EXPORTS = "`$SED 1q $export_symbols`"; then
6738b3a827e2Smrg	    prefix_cmds="$prefix_cmds -e 1d";
6739b3a827e2Smrg	  fi~
6740b3a827e2Smrg	  prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
6741b3a827e2Smrg	  cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
6742b3a827e2Smrg	  $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
6743b3a827e2Smrg	  emximp -o $lib $output_objdir/$libname.def'
6744b3a827e2Smrg	_LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
6745b3a827e2Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6746b3a827e2Smrg	;;
6747b3a827e2Smrg
674867ab2ff2Smrg      dgux*)
674967ab2ff2Smrg        case $cc_basename in
675067ab2ff2Smrg          ec++*)
675167ab2ff2Smrg	    # FIXME: insert proper C++ library support
675267ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675367ab2ff2Smrg	    ;;
675467ab2ff2Smrg          ghcx*)
675567ab2ff2Smrg	    # Green Hills C++ Compiler
675667ab2ff2Smrg	    # FIXME: insert proper C++ library support
675767ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
675867ab2ff2Smrg	    ;;
675967ab2ff2Smrg          *)
676067ab2ff2Smrg	    # FIXME: insert proper C++ library support
676167ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
676267ab2ff2Smrg	    ;;
676367ab2ff2Smrg        esac
676467ab2ff2Smrg        ;;
6765e0963edeSmrg
6766e494fffdSmrg      freebsd2.*)
676767ab2ff2Smrg        # C++ shared libraries reported to be fairly broken before
676867ab2ff2Smrg	# switch to ELF
676967ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
677067ab2ff2Smrg        ;;
6771e0963edeSmrg
677267ab2ff2Smrg      freebsd-elf*)
677367ab2ff2Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
677467ab2ff2Smrg        ;;
6775e0963edeSmrg
677667ab2ff2Smrg      freebsd* | dragonfly*)
677767ab2ff2Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
677867ab2ff2Smrg        # conventions
677967ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
678067ab2ff2Smrg        ;;
6781f05b35a2Smrg
678267ab2ff2Smrg      haiku*)
6783b3a827e2Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
678467ab2ff2Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
678567ab2ff2Smrg        ;;
6786f05b35a2Smrg
678767ab2ff2Smrg      hpux9*)
6788b3a827e2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
678967ab2ff2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6790b3a827e2Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
679167ab2ff2Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
679267ab2ff2Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
679367ab2ff2Smrg				             # but as the default
679467ab2ff2Smrg				             # location of the library.
6795f05b35a2Smrg
679667ab2ff2Smrg        case $cc_basename in
679767ab2ff2Smrg          CC*)
679867ab2ff2Smrg            # FIXME: insert proper C++ library support
679967ab2ff2Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
680067ab2ff2Smrg            ;;
680167ab2ff2Smrg          aCC*)
6802b3a827e2Smrg            _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'
680367ab2ff2Smrg            # Commands to make compiler produce verbose output that lists
680467ab2ff2Smrg            # what "hidden" libraries, object files and flags are used when
680567ab2ff2Smrg            # linking a shared library.
680667ab2ff2Smrg            #
680767ab2ff2Smrg            # There doesn't appear to be a way to prevent this compiler from
680867ab2ff2Smrg            # explicitly linking system object files so we need to strip them
680967ab2ff2Smrg            # from the output so that they don't get included in the library
681067ab2ff2Smrg            # dependencies.
6811b3a827e2Smrg            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"'
681267ab2ff2Smrg            ;;
681367ab2ff2Smrg          *)
6814b3a827e2Smrg            if test yes = "$GXX"; then
6815b3a827e2Smrg              _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'
681667ab2ff2Smrg            else
681767ab2ff2Smrg              # FIXME: insert proper C++ library support
681867ab2ff2Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
681967ab2ff2Smrg            fi
682067ab2ff2Smrg            ;;
682167ab2ff2Smrg        esac
682267ab2ff2Smrg        ;;
6823f05b35a2Smrg
682467ab2ff2Smrg      hpux10*|hpux11*)
6825b3a827e2Smrg        if test no = "$with_gnu_ld"; then
6826b3a827e2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
682767ab2ff2Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6828f05b35a2Smrg
682967ab2ff2Smrg          case $host_cpu in
683067ab2ff2Smrg            hppa*64*|ia64*)
683167ab2ff2Smrg              ;;
683267ab2ff2Smrg            *)
6833b3a827e2Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
683467ab2ff2Smrg              ;;
683567ab2ff2Smrg          esac
683667ab2ff2Smrg        fi
683767ab2ff2Smrg        case $host_cpu in
683867ab2ff2Smrg          hppa*64*|ia64*)
683967ab2ff2Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
684067ab2ff2Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
684167ab2ff2Smrg            ;;
684267ab2ff2Smrg          *)
684367ab2ff2Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
684467ab2ff2Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
684567ab2ff2Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
684667ab2ff2Smrg					         # but as the default
684767ab2ff2Smrg					         # location of the library.
684867ab2ff2Smrg            ;;
684967ab2ff2Smrg        esac
6850f05b35a2Smrg
685167ab2ff2Smrg        case $cc_basename in
685267ab2ff2Smrg          CC*)
685367ab2ff2Smrg	    # FIXME: insert proper C++ library support
685467ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
685567ab2ff2Smrg	    ;;
685667ab2ff2Smrg          aCC*)
685767ab2ff2Smrg	    case $host_cpu in
685867ab2ff2Smrg	      hppa*64*)
6859b3a827e2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
686067ab2ff2Smrg	        ;;
686167ab2ff2Smrg	      ia64*)
6862b3a827e2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
686367ab2ff2Smrg	        ;;
686467ab2ff2Smrg	      *)
6865b3a827e2Smrg	        _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'
686667ab2ff2Smrg	        ;;
686767ab2ff2Smrg	    esac
686867ab2ff2Smrg	    # Commands to make compiler produce verbose output that lists
686967ab2ff2Smrg	    # what "hidden" libraries, object files and flags are used when
687067ab2ff2Smrg	    # linking a shared library.
687167ab2ff2Smrg	    #
687267ab2ff2Smrg	    # There doesn't appear to be a way to prevent this compiler from
687367ab2ff2Smrg	    # explicitly linking system object files so we need to strip them
687467ab2ff2Smrg	    # from the output so that they don't get included in the library
687567ab2ff2Smrg	    # dependencies.
6876b3a827e2Smrg	    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"'
687767ab2ff2Smrg	    ;;
687867ab2ff2Smrg          *)
6879b3a827e2Smrg	    if test yes = "$GXX"; then
6880b3a827e2Smrg	      if test no = "$with_gnu_ld"; then
688167ab2ff2Smrg	        case $host_cpu in
688267ab2ff2Smrg	          hppa*64*)
6883b3a827e2Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
688467ab2ff2Smrg	            ;;
688567ab2ff2Smrg	          ia64*)
6886b3a827e2Smrg	            _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'
688767ab2ff2Smrg	            ;;
688867ab2ff2Smrg	          *)
6889b3a827e2Smrg	            _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'
689067ab2ff2Smrg	            ;;
689167ab2ff2Smrg	        esac
689267ab2ff2Smrg	      fi
689367ab2ff2Smrg	    else
689467ab2ff2Smrg	      # FIXME: insert proper C++ library support
689567ab2ff2Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
689667ab2ff2Smrg	    fi
689767ab2ff2Smrg	    ;;
689867ab2ff2Smrg        esac
689967ab2ff2Smrg        ;;
6900e0963edeSmrg
690167ab2ff2Smrg      interix[[3-9]]*)
690267ab2ff2Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
690367ab2ff2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6904b3a827e2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6905b3a827e2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
690667ab2ff2Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
690767ab2ff2Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
690867ab2ff2Smrg	# default) and relocated if they conflict, which is a slow very memory
690967ab2ff2Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
691067ab2ff2Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
691167ab2ff2Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6912b3a827e2Smrg	_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'
6913b3a827e2Smrg	_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'
691467ab2ff2Smrg	;;
691567ab2ff2Smrg      irix5* | irix6*)
691667ab2ff2Smrg        case $cc_basename in
691767ab2ff2Smrg          CC*)
691867ab2ff2Smrg	    # SGI C++
6919b3a827e2Smrg	    _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'
6920f05b35a2Smrg
692167ab2ff2Smrg	    # Archives containing C++ object files must be created using
692267ab2ff2Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
692367ab2ff2Smrg	    # necessary to make sure instantiated templates are included
692467ab2ff2Smrg	    # in the archive.
692567ab2ff2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
692667ab2ff2Smrg	    ;;
692767ab2ff2Smrg          *)
6928b3a827e2Smrg	    if test yes = "$GXX"; then
6929b3a827e2Smrg	      if test no = "$with_gnu_ld"; then
6930b3a827e2Smrg	        _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'
693167ab2ff2Smrg	      else
6932b3a827e2Smrg	        _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'
693367ab2ff2Smrg	      fi
693467ab2ff2Smrg	    fi
693567ab2ff2Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
693667ab2ff2Smrg	    ;;
693767ab2ff2Smrg        esac
6938b3a827e2Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
693967ab2ff2Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
694067ab2ff2Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
694167ab2ff2Smrg        ;;
6942f05b35a2Smrg
6943b3a827e2Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
694467ab2ff2Smrg        case $cc_basename in
694567ab2ff2Smrg          KCC*)
694667ab2ff2Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6947f05b35a2Smrg
694867ab2ff2Smrg	    # KCC will only create a shared library if the output file
694967ab2ff2Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
695067ab2ff2Smrg	    # to its proper name (with version) after linking.
6951b3a827e2Smrg	    _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'
6952b3a827e2Smrg	    _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'
695367ab2ff2Smrg	    # Commands to make compiler produce verbose output that lists
695467ab2ff2Smrg	    # what "hidden" libraries, object files and flags are used when
695567ab2ff2Smrg	    # linking a shared library.
695667ab2ff2Smrg	    #
695767ab2ff2Smrg	    # There doesn't appear to be a way to prevent this compiler from
695867ab2ff2Smrg	    # explicitly linking system object files so we need to strip them
695967ab2ff2Smrg	    # from the output so that they don't get included in the library
696067ab2ff2Smrg	    # dependencies.
6961b3a827e2Smrg	    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"'
6962f05b35a2Smrg
6963b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6964b3a827e2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6965f05b35a2Smrg
696667ab2ff2Smrg	    # Archives containing C++ object files must be created using
696767ab2ff2Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
696867ab2ff2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
696967ab2ff2Smrg	    ;;
697067ab2ff2Smrg	  icpc* | ecpc* )
697167ab2ff2Smrg	    # Intel C++
697267ab2ff2Smrg	    with_gnu_ld=yes
697367ab2ff2Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
697467ab2ff2Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
697567ab2ff2Smrg	    # earlier do not add the objects themselves.
697667ab2ff2Smrg	    case `$CC -V 2>&1` in
697767ab2ff2Smrg	      *"Version 7."*)
6978b3a827e2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
6979b3a827e2Smrg		_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'
698067ab2ff2Smrg		;;
698167ab2ff2Smrg	      *)  # Version 8.0 or newer
698267ab2ff2Smrg	        tmp_idyn=
698367ab2ff2Smrg	        case $host_cpu in
698467ab2ff2Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
698567ab2ff2Smrg		esac
6986b3a827e2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
6987b3a827e2Smrg		_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'
698867ab2ff2Smrg		;;
698967ab2ff2Smrg	    esac
699067ab2ff2Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6991b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
6992b3a827e2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
6993b3a827e2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
699467ab2ff2Smrg	    ;;
699567ab2ff2Smrg          pgCC* | pgcpp*)
699667ab2ff2Smrg            # Portland Group C++ compiler
699767ab2ff2Smrg	    case `$CC -V` in
699867ab2ff2Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
699967ab2ff2Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
7000b3a827e2Smrg               rm -rf $tpldir~
7001b3a827e2Smrg               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
7002b3a827e2Smrg               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
700367ab2ff2Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
7004b3a827e2Smrg                rm -rf $tpldir~
7005b3a827e2Smrg                $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
7006b3a827e2Smrg                $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
7007b3a827e2Smrg                $RANLIB $oldlib'
700867ab2ff2Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
7009b3a827e2Smrg                rm -rf $tpldir~
7010b3a827e2Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7011b3a827e2Smrg                $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
701267ab2ff2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
7013b3a827e2Smrg                rm -rf $tpldir~
7014b3a827e2Smrg                $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
7015b3a827e2Smrg                $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'
701667ab2ff2Smrg	      ;;
701767ab2ff2Smrg	    *) # Version 6 and above use weak symbols
7018b3a827e2Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7019b3a827e2Smrg	      _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'
702067ab2ff2Smrg	      ;;
702167ab2ff2Smrg	    esac
7022f05b35a2Smrg
7023b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
7024b3a827e2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7025b3a827e2Smrg	    _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'
702667ab2ff2Smrg            ;;
702767ab2ff2Smrg	  cxx*)
702867ab2ff2Smrg	    # Compaq C++
7029b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
7030b3a827e2Smrg	    _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'
7031f05b35a2Smrg
703267ab2ff2Smrg	    runpath_var=LD_RUN_PATH
703367ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
703467ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7035f05b35a2Smrg
703667ab2ff2Smrg	    # Commands to make compiler produce verbose output that lists
703767ab2ff2Smrg	    # what "hidden" libraries, object files and flags are used when
703867ab2ff2Smrg	    # linking a shared library.
703967ab2ff2Smrg	    #
704067ab2ff2Smrg	    # There doesn't appear to be a way to prevent this compiler from
704167ab2ff2Smrg	    # explicitly linking system object files so we need to strip them
704267ab2ff2Smrg	    # from the output so that they don't get included in the library
704367ab2ff2Smrg	    # dependencies.
7044b3a827e2Smrg	    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'
704567ab2ff2Smrg	    ;;
704667ab2ff2Smrg	  xl* | mpixl* | bgxl*)
704767ab2ff2Smrg	    # IBM XL 8.0 on PPC, with GNU ld
7048b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
7049b3a827e2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
7050b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
7051b3a827e2Smrg	    if test yes = "$supports_anon_versioning"; then
705267ab2ff2Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
7053b3a827e2Smrg                cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
7054b3a827e2Smrg                echo "local: *; };" >> $output_objdir/$libname.ver~
7055b3a827e2Smrg                $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
705667ab2ff2Smrg	    fi
705767ab2ff2Smrg	    ;;
705867ab2ff2Smrg	  *)
705967ab2ff2Smrg	    case `$CC -V 2>&1 | sed 5q` in
706067ab2ff2Smrg	    *Sun\ C*)
706167ab2ff2Smrg	      # Sun C++ 5.9
706267ab2ff2Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7063b3a827e2Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
7064b3a827e2Smrg	      _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'
706567ab2ff2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
7066b3a827e2Smrg	      _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'
706767ab2ff2Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
706867ab2ff2Smrg
706967ab2ff2Smrg	      # Not sure whether something based on
707067ab2ff2Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
707167ab2ff2Smrg	      # would be better.
707267ab2ff2Smrg	      output_verbose_link_cmd='func_echo_all'
7073f05b35a2Smrg
707467ab2ff2Smrg	      # Archives containing C++ object files must be created using
707567ab2ff2Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
707667ab2ff2Smrg	      # necessary to make sure instantiated templates are included
707767ab2ff2Smrg	      # in the archive.
707867ab2ff2Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
707967ab2ff2Smrg	      ;;
708067ab2ff2Smrg	    esac
708167ab2ff2Smrg	    ;;
708249e108a1Smrg	esac
708349e108a1Smrg	;;
7084e0963edeSmrg
708567ab2ff2Smrg      lynxos*)
708667ab2ff2Smrg        # FIXME: insert proper C++ library support
708767ab2ff2Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
708849e108a1Smrg	;;
7089e0963edeSmrg
709067ab2ff2Smrg      m88k*)
709167ab2ff2Smrg        # FIXME: insert proper C++ library support
709267ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
709367ab2ff2Smrg	;;
7094e0963edeSmrg
709567ab2ff2Smrg      mvs*)
709667ab2ff2Smrg        case $cc_basename in
709767ab2ff2Smrg          cxx*)
709867ab2ff2Smrg	    # FIXME: insert proper C++ library support
709967ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
710067ab2ff2Smrg	    ;;
710167ab2ff2Smrg	  *)
710267ab2ff2Smrg	    # FIXME: insert proper C++ library support
710367ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
710467ab2ff2Smrg	    ;;
710567ab2ff2Smrg	esac
710667ab2ff2Smrg	;;
7107e0963edeSmrg
710867ab2ff2Smrg      netbsd*)
710967ab2ff2Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
711067ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
711167ab2ff2Smrg	  wlarc=
711267ab2ff2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
711367ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
711467ab2ff2Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
711567ab2ff2Smrg	fi
711667ab2ff2Smrg	# Workaround some broken pre-1.5 toolchains
711767ab2ff2Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
711867ab2ff2Smrg	;;
7119e0963edeSmrg
712067ab2ff2Smrg      *nto* | *qnx*)
712167ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
712267ab2ff2Smrg	;;
7123e0963edeSmrg
7124b3a827e2Smrg      openbsd* | bitrig*)
712567ab2ff2Smrg	if test -f /usr/libexec/ld.so; then
712667ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
712767ab2ff2Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
712867ab2ff2Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
712967ab2ff2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
7130b3a827e2Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
7131b3a827e2Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
7132b3a827e2Smrg	    _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'
7133b3a827e2Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
7134b3a827e2Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
713567ab2ff2Smrg	  fi
713667ab2ff2Smrg	  output_verbose_link_cmd=func_echo_all
713767ab2ff2Smrg	else
713867ab2ff2Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
713967ab2ff2Smrg	fi
714049e108a1Smrg	;;
7141f05b35a2Smrg
714267ab2ff2Smrg      osf3* | osf4* | osf5*)
714367ab2ff2Smrg        case $cc_basename in
714467ab2ff2Smrg          KCC*)
714567ab2ff2Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
7146f05b35a2Smrg
714767ab2ff2Smrg	    # KCC will only create a shared library if the output file
714867ab2ff2Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
714967ab2ff2Smrg	    # to its proper name (with version) after linking.
7150b3a827e2Smrg	    _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'
7151f05b35a2Smrg
7152b3a827e2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
715367ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
715467ab2ff2Smrg
715567ab2ff2Smrg	    # Archives containing C++ object files must be created using
715667ab2ff2Smrg	    # the KAI C++ compiler.
715767ab2ff2Smrg	    case $host in
715867ab2ff2Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
715967ab2ff2Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
716067ab2ff2Smrg	    esac
716167ab2ff2Smrg	    ;;
716267ab2ff2Smrg          RCC*)
716367ab2ff2Smrg	    # Rational C++ 2.4.1
716467ab2ff2Smrg	    # FIXME: insert proper C++ library support
716567ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
716667ab2ff2Smrg	    ;;
716767ab2ff2Smrg          cxx*)
716867ab2ff2Smrg	    case $host in
716967ab2ff2Smrg	      osf3*)
7170b3a827e2Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
7171b3a827e2Smrg	        _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'
7172b3a827e2Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
717367ab2ff2Smrg		;;
717467ab2ff2Smrg	      *)
717567ab2ff2Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
7176b3a827e2Smrg	        _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'
717767ab2ff2Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
7178b3a827e2Smrg                  echo "-hidden">> $lib.exp~
7179b3a827e2Smrg                  $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~
7180b3a827e2Smrg                  $RM $lib.exp'
718167ab2ff2Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
718267ab2ff2Smrg		;;
718367ab2ff2Smrg	    esac
7184f05b35a2Smrg
718567ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
718649e108a1Smrg
718767ab2ff2Smrg	    # Commands to make compiler produce verbose output that lists
718867ab2ff2Smrg	    # what "hidden" libraries, object files and flags are used when
718967ab2ff2Smrg	    # linking a shared library.
719067ab2ff2Smrg	    #
719167ab2ff2Smrg	    # There doesn't appear to be a way to prevent this compiler from
719267ab2ff2Smrg	    # explicitly linking system object files so we need to strip them
719367ab2ff2Smrg	    # from the output so that they don't get included in the library
719467ab2ff2Smrg	    # dependencies.
7195b3a827e2Smrg	    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"'
719667ab2ff2Smrg	    ;;
719767ab2ff2Smrg	  *)
7198b3a827e2Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7199b3a827e2Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
720067ab2ff2Smrg	      case $host in
720167ab2ff2Smrg	        osf3*)
7202b3a827e2Smrg	          _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'
720367ab2ff2Smrg		  ;;
720467ab2ff2Smrg	        *)
7205b3a827e2Smrg	          _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'
720667ab2ff2Smrg		  ;;
720767ab2ff2Smrg	      esac
7208f05b35a2Smrg
7209b3a827e2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
721067ab2ff2Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
7211f05b35a2Smrg
721267ab2ff2Smrg	      # Commands to make compiler produce verbose output that lists
721367ab2ff2Smrg	      # what "hidden" libraries, object files and flags are used when
721467ab2ff2Smrg	      # linking a shared library.
721567ab2ff2Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
7216f05b35a2Smrg
721767ab2ff2Smrg	    else
721867ab2ff2Smrg	      # FIXME: insert proper C++ library support
721967ab2ff2Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
722067ab2ff2Smrg	    fi
722167ab2ff2Smrg	    ;;
722267ab2ff2Smrg        esac
722367ab2ff2Smrg        ;;
7224f05b35a2Smrg
722567ab2ff2Smrg      psos*)
722667ab2ff2Smrg        # FIXME: insert proper C++ library support
722767ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
722867ab2ff2Smrg        ;;
7229f05b35a2Smrg
723067ab2ff2Smrg      sunos4*)
723167ab2ff2Smrg        case $cc_basename in
723267ab2ff2Smrg          CC*)
723367ab2ff2Smrg	    # Sun C++ 4.x
723467ab2ff2Smrg	    # FIXME: insert proper C++ library support
723567ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
723667ab2ff2Smrg	    ;;
723767ab2ff2Smrg          lcc*)
723867ab2ff2Smrg	    # Lucid
723967ab2ff2Smrg	    # FIXME: insert proper C++ library support
724067ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724167ab2ff2Smrg	    ;;
724267ab2ff2Smrg          *)
724367ab2ff2Smrg	    # FIXME: insert proper C++ library support
724467ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
724567ab2ff2Smrg	    ;;
724667ab2ff2Smrg        esac
724767ab2ff2Smrg        ;;
7248f05b35a2Smrg
724967ab2ff2Smrg      solaris*)
725067ab2ff2Smrg        case $cc_basename in
725167ab2ff2Smrg          CC* | sunCC*)
725267ab2ff2Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
725367ab2ff2Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
725467ab2ff2Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
7255b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
725667ab2ff2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7257b3a827e2Smrg              $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'
7258f05b35a2Smrg
725967ab2ff2Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
726067ab2ff2Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
726167ab2ff2Smrg	    case $host_os in
726267ab2ff2Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
726367ab2ff2Smrg	      *)
726467ab2ff2Smrg		# The compiler driver will combine and reorder linker options,
7265b3a827e2Smrg		# but understands '-z linker_flag'.
726667ab2ff2Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
726767ab2ff2Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
726867ab2ff2Smrg	        ;;
726967ab2ff2Smrg	    esac
727067ab2ff2Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
7271f05b35a2Smrg
727267ab2ff2Smrg	    output_verbose_link_cmd='func_echo_all'
7273f05b35a2Smrg
727467ab2ff2Smrg	    # Archives containing C++ object files must be created using
727567ab2ff2Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
727667ab2ff2Smrg	    # necessary to make sure instantiated templates are included
727767ab2ff2Smrg	    # in the archive.
727867ab2ff2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
727967ab2ff2Smrg	    ;;
728067ab2ff2Smrg          gcx*)
728167ab2ff2Smrg	    # Green Hills C++ Compiler
7282b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
7283f05b35a2Smrg
728467ab2ff2Smrg	    # The C++ compiler must be used to create the archive.
728567ab2ff2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
728667ab2ff2Smrg	    ;;
728767ab2ff2Smrg          *)
728867ab2ff2Smrg	    # GNU C++ compiler with Solaris linker
7289b3a827e2Smrg	    if test yes,no = "$GXX,$with_gnu_ld"; then
7290b3a827e2Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
729167ab2ff2Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
7292b3a827e2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
729367ab2ff2Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7294b3a827e2Smrg                  $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'
729567ab2ff2Smrg
729667ab2ff2Smrg	        # Commands to make compiler produce verbose output that lists
729767ab2ff2Smrg	        # what "hidden" libraries, object files and flags are used when
729867ab2ff2Smrg	        # linking a shared library.
729967ab2ff2Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
730067ab2ff2Smrg	      else
7301b3a827e2Smrg	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
730267ab2ff2Smrg	        # platform.
7303b3a827e2Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
730467ab2ff2Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
7305b3a827e2Smrg                  $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'
7306e0963edeSmrg
730767ab2ff2Smrg	        # Commands to make compiler produce verbose output that lists
730867ab2ff2Smrg	        # what "hidden" libraries, object files and flags are used when
730967ab2ff2Smrg	        # linking a shared library.
731067ab2ff2Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
731167ab2ff2Smrg	      fi
7312f05b35a2Smrg
7313b3a827e2Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
731467ab2ff2Smrg	      case $host_os in
731567ab2ff2Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
731667ab2ff2Smrg		*)
7317b3a827e2Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
731867ab2ff2Smrg		  ;;
731967ab2ff2Smrg	      esac
732067ab2ff2Smrg	    fi
732167ab2ff2Smrg	    ;;
732267ab2ff2Smrg        esac
732367ab2ff2Smrg        ;;
7324e0963edeSmrg
732567ab2ff2Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
7326b3a827e2Smrg      _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
732767ab2ff2Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
732867ab2ff2Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
732967ab2ff2Smrg      runpath_var='LD_RUN_PATH'
7330f05b35a2Smrg
733167ab2ff2Smrg      case $cc_basename in
733267ab2ff2Smrg        CC*)
7333b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7334b3a827e2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
733567ab2ff2Smrg	  ;;
733667ab2ff2Smrg	*)
7337b3a827e2Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7338b3a827e2Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
733967ab2ff2Smrg	  ;;
734067ab2ff2Smrg      esac
734167ab2ff2Smrg      ;;
7342f05b35a2Smrg
734367ab2ff2Smrg      sysv5* | sco3.2v5* | sco5v6*)
7344b3a827e2Smrg	# Note: We CANNOT use -z defs as we might desire, because we do not
734567ab2ff2Smrg	# link with -lc, and that would cause any symbols used from libc to
734667ab2ff2Smrg	# always be unresolved, which means just about no library would
734767ab2ff2Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
734867ab2ff2Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
734967ab2ff2Smrg	# as -z defs.
7350b3a827e2Smrg	_LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
7351b3a827e2Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
735267ab2ff2Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
735367ab2ff2Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
7354b3a827e2Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
735567ab2ff2Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
735667ab2ff2Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
7357b3a827e2Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
735867ab2ff2Smrg	runpath_var='LD_RUN_PATH'
7359f05b35a2Smrg
736067ab2ff2Smrg	case $cc_basename in
736167ab2ff2Smrg          CC*)
7362b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7363b3a827e2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
736467ab2ff2Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
7365b3a827e2Smrg              '"$_LT_TAGVAR(old_archive_cmds, $1)"
736667ab2ff2Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
7367b3a827e2Smrg              '"$_LT_TAGVAR(reload_cmds, $1)"
736867ab2ff2Smrg	    ;;
736967ab2ff2Smrg	  *)
7370b3a827e2Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
7371b3a827e2Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
737267ab2ff2Smrg	    ;;
737367ab2ff2Smrg	esac
737467ab2ff2Smrg      ;;
7375f05b35a2Smrg
737667ab2ff2Smrg      tandem*)
737767ab2ff2Smrg        case $cc_basename in
737867ab2ff2Smrg          NCC*)
737967ab2ff2Smrg	    # NonStop-UX NCC 3.20
738067ab2ff2Smrg	    # FIXME: insert proper C++ library support
738167ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
738267ab2ff2Smrg	    ;;
738367ab2ff2Smrg          *)
738467ab2ff2Smrg	    # FIXME: insert proper C++ library support
738567ab2ff2Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
738667ab2ff2Smrg	    ;;
738767ab2ff2Smrg        esac
738867ab2ff2Smrg        ;;
7389f05b35a2Smrg
739067ab2ff2Smrg      vxworks*)
739167ab2ff2Smrg        # FIXME: insert proper C++ library support
739267ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
739367ab2ff2Smrg        ;;
7394f05b35a2Smrg
739567ab2ff2Smrg      *)
739667ab2ff2Smrg        # FIXME: insert proper C++ library support
739767ab2ff2Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
739867ab2ff2Smrg        ;;
739967ab2ff2Smrg    esac
7400f05b35a2Smrg
740167ab2ff2Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
7402b3a827e2Smrg    test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
7403f05b35a2Smrg
7404b3a827e2Smrg    _LT_TAGVAR(GCC, $1)=$GXX
7405b3a827e2Smrg    _LT_TAGVAR(LD, $1)=$LD
7406f05b35a2Smrg
740767ab2ff2Smrg    ## CAVEAT EMPTOR:
740867ab2ff2Smrg    ## There is no encapsulation within the following macros, do not change
740967ab2ff2Smrg    ## the running order or otherwise move them around unless you know exactly
741067ab2ff2Smrg    ## what you are doing...
741167ab2ff2Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
741267ab2ff2Smrg    _LT_COMPILER_PIC($1)
741367ab2ff2Smrg    _LT_COMPILER_C_O($1)
741467ab2ff2Smrg    _LT_COMPILER_FILE_LOCKS($1)
741567ab2ff2Smrg    _LT_LINKER_SHLIBS($1)
741667ab2ff2Smrg    _LT_SYS_DYNAMIC_LINKER($1)
741767ab2ff2Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7418f05b35a2Smrg
741967ab2ff2Smrg    _LT_CONFIG($1)
742067ab2ff2Smrg  fi # test -n "$compiler"
7421f05b35a2Smrg
742267ab2ff2Smrg  CC=$lt_save_CC
742367ab2ff2Smrg  CFLAGS=$lt_save_CFLAGS
742467ab2ff2Smrg  LDCXX=$LD
742567ab2ff2Smrg  LD=$lt_save_LD
742667ab2ff2Smrg  GCC=$lt_save_GCC
742767ab2ff2Smrg  with_gnu_ld=$lt_save_with_gnu_ld
742867ab2ff2Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
742967ab2ff2Smrg  lt_cv_path_LD=$lt_save_path_LD
743067ab2ff2Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
743167ab2ff2Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
7432b3a827e2Smrgfi # test yes != "$_lt_caught_CXX_error"
7433f05b35a2Smrg
743467ab2ff2SmrgAC_LANG_POP
743567ab2ff2Smrg])# _LT_LANG_CXX_CONFIG
7436f05b35a2Smrg
7437e0963edeSmrg
743867ab2ff2Smrg# _LT_FUNC_STRIPNAME_CNF
743967ab2ff2Smrg# ----------------------
744067ab2ff2Smrg# func_stripname_cnf prefix suffix name
744167ab2ff2Smrg# strip PREFIX and SUFFIX off of NAME.
744267ab2ff2Smrg# PREFIX and SUFFIX must not contain globbing or regex special
744367ab2ff2Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
744467ab2ff2Smrg# dot (in which case that matches only a dot).
744567ab2ff2Smrg#
744667ab2ff2Smrg# This function is identical to the (non-XSI) version of func_stripname,
744767ab2ff2Smrg# except this one can be used by m4 code that may be executed by configure,
744867ab2ff2Smrg# rather than the libtool script.
744967ab2ff2Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
745067ab2ff2SmrgAC_REQUIRE([_LT_DECL_SED])
745167ab2ff2SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
745267ab2ff2Smrgfunc_stripname_cnf ()
745367ab2ff2Smrg{
7454b3a827e2Smrg  case @S|@2 in
7455b3a827e2Smrg  .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
7456b3a827e2Smrg  *)  func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
745767ab2ff2Smrg  esac
745867ab2ff2Smrg} # func_stripname_cnf
745967ab2ff2Smrg])# _LT_FUNC_STRIPNAME_CNF
746067ab2ff2Smrg
7461b3a827e2Smrg
746267ab2ff2Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
746367ab2ff2Smrg# ---------------------------------
746467ab2ff2Smrg# Figure out "hidden" library dependencies from verbose
746567ab2ff2Smrg# compiler output when linking a shared library.
746667ab2ff2Smrg# Parse the compiler output and extract the necessary
746767ab2ff2Smrg# objects, libraries and library flags.
746867ab2ff2Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
746967ab2ff2Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
747067ab2ff2SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
747167ab2ff2Smrg# Dependencies to place before and after the object being linked:
747267ab2ff2Smrg_LT_TAGVAR(predep_objects, $1)=
747367ab2ff2Smrg_LT_TAGVAR(postdep_objects, $1)=
747467ab2ff2Smrg_LT_TAGVAR(predeps, $1)=
747567ab2ff2Smrg_LT_TAGVAR(postdeps, $1)=
747667ab2ff2Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
7477e0963edeSmrg
747867ab2ff2Smrgdnl we can't use the lt_simple_compile_test_code here,
747967ab2ff2Smrgdnl because it contains code intended for an executable,
748067ab2ff2Smrgdnl not a library.  It's possible we should let each
748167ab2ff2Smrgdnl tag define a new lt_????_link_test_code variable,
748267ab2ff2Smrgdnl but it's only used here...
748367ab2ff2Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
748467ab2ff2Smrgint a;
748567ab2ff2Smrgvoid foo (void) { a = 0; }
748667ab2ff2Smrg_LT_EOF
748767ab2ff2Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
748867ab2ff2Smrgclass Foo
748967ab2ff2Smrg{
749067ab2ff2Smrgpublic:
749167ab2ff2Smrg  Foo (void) { a = 0; }
749267ab2ff2Smrgprivate:
749367ab2ff2Smrg  int a;
749467ab2ff2Smrg};
749567ab2ff2Smrg_LT_EOF
749667ab2ff2Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
749767ab2ff2Smrg      subroutine foo
749867ab2ff2Smrg      implicit none
749967ab2ff2Smrg      integer*4 a
750067ab2ff2Smrg      a=0
750167ab2ff2Smrg      return
750267ab2ff2Smrg      end
750367ab2ff2Smrg_LT_EOF
750467ab2ff2Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
750567ab2ff2Smrg      subroutine foo
750667ab2ff2Smrg      implicit none
750767ab2ff2Smrg      integer a
750867ab2ff2Smrg      a=0
750967ab2ff2Smrg      return
751067ab2ff2Smrg      end
751167ab2ff2Smrg_LT_EOF
751267ab2ff2Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
751367ab2ff2Smrgpublic class foo {
751467ab2ff2Smrg  private int a;
751567ab2ff2Smrg  public void bar (void) {
751667ab2ff2Smrg    a = 0;
751767ab2ff2Smrg  }
751867ab2ff2Smrg};
751967ab2ff2Smrg_LT_EOF
7520e494fffdSmrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
7521e494fffdSmrgpackage foo
7522e494fffdSmrgfunc foo() {
7523e494fffdSmrg}
7524e494fffdSmrg_LT_EOF
752567ab2ff2Smrg])
7526e0963edeSmrg
752767ab2ff2Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
752867ab2ff2Smrgcase "$CC $CFLAGS " in #(
752967ab2ff2Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
753067ab2ff2Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
7531e494fffdSmrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
753267ab2ff2Smrgesac
7533e0963edeSmrg
753467ab2ff2Smrgdnl Parse the compiler output and extract the necessary
753567ab2ff2Smrgdnl objects, libraries and library flags.
753667ab2ff2Smrgif AC_TRY_EVAL(ac_compile); then
753767ab2ff2Smrg  # Parse the compiler output and extract the necessary
753867ab2ff2Smrg  # objects, libraries and library flags.
7539e0963edeSmrg
754067ab2ff2Smrg  # Sentinel used to keep track of whether or not we are before
754167ab2ff2Smrg  # the conftest object file.
754267ab2ff2Smrg  pre_test_object_deps_done=no
7543e0963edeSmrg
754467ab2ff2Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7545b3a827e2Smrg    case $prev$p in
7546e0963edeSmrg
754767ab2ff2Smrg    -L* | -R* | -l*)
754867ab2ff2Smrg       # Some compilers place space between "-{L,R}" and the path.
754967ab2ff2Smrg       # Remove the space.
7550b3a827e2Smrg       if test x-L = "$p" ||
7551b3a827e2Smrg          test x-R = "$p"; then
755267ab2ff2Smrg	 prev=$p
755367ab2ff2Smrg	 continue
755467ab2ff2Smrg       fi
7555e0963edeSmrg
755667ab2ff2Smrg       # Expand the sysroot to ease extracting the directories later.
755767ab2ff2Smrg       if test -z "$prev"; then
755867ab2ff2Smrg         case $p in
755967ab2ff2Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
756067ab2ff2Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
756167ab2ff2Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
756267ab2ff2Smrg         esac
756367ab2ff2Smrg       fi
756467ab2ff2Smrg       case $p in
756567ab2ff2Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
756667ab2ff2Smrg       esac
7567b3a827e2Smrg       if test no = "$pre_test_object_deps_done"; then
7568b3a827e2Smrg	 case $prev in
756967ab2ff2Smrg	 -L | -R)
757067ab2ff2Smrg	   # Internal compiler library paths should come after those
757167ab2ff2Smrg	   # provided the user.  The postdeps already come after the
757267ab2ff2Smrg	   # user supplied libs so there is no need to process them.
757367ab2ff2Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7574b3a827e2Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
757567ab2ff2Smrg	   else
7576b3a827e2Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
757767ab2ff2Smrg	   fi
757867ab2ff2Smrg	   ;;
757967ab2ff2Smrg	 # The "-l" case would never come before the object being
758067ab2ff2Smrg	 # linked, so don't bother handling this case.
758167ab2ff2Smrg	 esac
758267ab2ff2Smrg       else
758367ab2ff2Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7584b3a827e2Smrg	   _LT_TAGVAR(postdeps, $1)=$prev$p
758567ab2ff2Smrg	 else
7586b3a827e2Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
758767ab2ff2Smrg	 fi
758867ab2ff2Smrg       fi
758967ab2ff2Smrg       prev=
759067ab2ff2Smrg       ;;
7591e0963edeSmrg
759267ab2ff2Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
759367ab2ff2Smrg    *.$objext)
759467ab2ff2Smrg       # This assumes that the test object file only shows up
759567ab2ff2Smrg       # once in the compiler output.
759667ab2ff2Smrg       if test "$p" = "conftest.$objext"; then
759767ab2ff2Smrg	 pre_test_object_deps_done=yes
759867ab2ff2Smrg	 continue
759967ab2ff2Smrg       fi
7600e0963edeSmrg
7601b3a827e2Smrg       if test no = "$pre_test_object_deps_done"; then
760267ab2ff2Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7603b3a827e2Smrg	   _LT_TAGVAR(predep_objects, $1)=$p
760467ab2ff2Smrg	 else
760567ab2ff2Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
760667ab2ff2Smrg	 fi
760767ab2ff2Smrg       else
760867ab2ff2Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7609b3a827e2Smrg	   _LT_TAGVAR(postdep_objects, $1)=$p
761067ab2ff2Smrg	 else
761167ab2ff2Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
761267ab2ff2Smrg	 fi
761367ab2ff2Smrg       fi
761467ab2ff2Smrg       ;;
7615e0963edeSmrg
761667ab2ff2Smrg    *) ;; # Ignore the rest.
7617e0963edeSmrg
761867ab2ff2Smrg    esac
761967ab2ff2Smrg  done
7620e0963edeSmrg
762167ab2ff2Smrg  # Clean up.
762267ab2ff2Smrg  rm -f a.out a.exe
762367ab2ff2Smrgelse
762467ab2ff2Smrg  echo "libtool.m4: error: problem compiling $1 test program"
762567ab2ff2Smrgfi
7626e0963edeSmrg
762767ab2ff2Smrg$RM -f confest.$objext
762867ab2ff2SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7629e0963edeSmrg
763067ab2ff2Smrg# PORTME: override above test on systems where it is broken
763167ab2ff2Smrgm4_if([$1], [CXX],
763267ab2ff2Smrg[case $host_os in
763367ab2ff2Smrginterix[[3-9]]*)
763467ab2ff2Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
763567ab2ff2Smrg  # hack all around it, let's just trust "g++" to DTRT.
763667ab2ff2Smrg  _LT_TAGVAR(predep_objects,$1)=
763767ab2ff2Smrg  _LT_TAGVAR(postdep_objects,$1)=
763867ab2ff2Smrg  _LT_TAGVAR(postdeps,$1)=
763967ab2ff2Smrg  ;;
764067ab2ff2Smrgesac
764167ab2ff2Smrg])
7642e0963edeSmrg
764367ab2ff2Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
764467ab2ff2Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
764567ab2ff2Smrgesac
764667ab2ff2Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
764767ab2ff2Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7648b3a827e2Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
764967ab2ff2Smrgfi
765067ab2ff2Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
765167ab2ff2Smrg    [The directories searched by this compiler when creating a shared library])
765267ab2ff2Smrg_LT_TAGDECL([], [predep_objects], [1],
765367ab2ff2Smrg    [Dependencies to place before and after the objects being linked to
765467ab2ff2Smrg    create a shared library])
765567ab2ff2Smrg_LT_TAGDECL([], [postdep_objects], [1])
765667ab2ff2Smrg_LT_TAGDECL([], [predeps], [1])
765767ab2ff2Smrg_LT_TAGDECL([], [postdeps], [1])
765867ab2ff2Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
765967ab2ff2Smrg    [The library search path used internally by the compiler when linking
766067ab2ff2Smrg    a shared library])
766167ab2ff2Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7662f05b35a2Smrg
7663e0963edeSmrg
766467ab2ff2Smrg# _LT_LANG_F77_CONFIG([TAG])
766567ab2ff2Smrg# --------------------------
766667ab2ff2Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
766767ab2ff2Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7668b3a827e2Smrg# to write the compiler configuration to 'libtool'.
766967ab2ff2Smrgm4_defun([_LT_LANG_F77_CONFIG],
767067ab2ff2Smrg[AC_LANG_PUSH(Fortran 77)
7671b3a827e2Smrgif test -z "$F77" || test no = "$F77"; then
767267ab2ff2Smrg  _lt_disable_F77=yes
767367ab2ff2Smrgfi
7674e0963edeSmrg
767567ab2ff2Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
767667ab2ff2Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
767767ab2ff2Smrg_LT_TAGVAR(always_export_symbols, $1)=no
767867ab2ff2Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
767967ab2ff2Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
768067ab2ff2Smrg_LT_TAGVAR(hardcode_direct, $1)=no
768167ab2ff2Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
768267ab2ff2Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
768367ab2ff2Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
768467ab2ff2Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
768567ab2ff2Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
768667ab2ff2Smrg_LT_TAGVAR(inherit_rpath, $1)=no
768767ab2ff2Smrg_LT_TAGVAR(module_cmds, $1)=
768867ab2ff2Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
768967ab2ff2Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
769067ab2ff2Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
769167ab2ff2Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
769267ab2ff2Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
769367ab2ff2Smrg_LT_TAGVAR(no_undefined_flag, $1)=
769467ab2ff2Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
769567ab2ff2Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7696e0963edeSmrg
769767ab2ff2Smrg# Source file extension for f77 test sources.
769867ab2ff2Smrgac_ext=f
7699e0963edeSmrg
770067ab2ff2Smrg# Object file extension for compiled f77 test sources.
770167ab2ff2Smrgobjext=o
770267ab2ff2Smrg_LT_TAGVAR(objext, $1)=$objext
7703e0963edeSmrg
770467ab2ff2Smrg# No sense in running all these tests if we already determined that
770567ab2ff2Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
770667ab2ff2Smrg# are currently assumed to apply to all compilers on this platform,
770767ab2ff2Smrg# and will be corrupted by setting them based on a non-working compiler.
7708b3a827e2Smrgif test yes != "$_lt_disable_F77"; then
770967ab2ff2Smrg  # Code to be used in simple compile tests
771067ab2ff2Smrg  lt_simple_compile_test_code="\
771167ab2ff2Smrg      subroutine t
771267ab2ff2Smrg      return
771367ab2ff2Smrg      end
771467ab2ff2Smrg"
7715e0963edeSmrg
771667ab2ff2Smrg  # Code to be used in simple link tests
771767ab2ff2Smrg  lt_simple_link_test_code="\
771867ab2ff2Smrg      program t
771967ab2ff2Smrg      end
772067ab2ff2Smrg"
7721e0963edeSmrg
772267ab2ff2Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
772367ab2ff2Smrg  _LT_TAG_COMPILER
772467ab2ff2Smrg
772567ab2ff2Smrg  # save warnings/boilerplate of simple test code
772667ab2ff2Smrg  _LT_COMPILER_BOILERPLATE
772767ab2ff2Smrg  _LT_LINKER_BOILERPLATE
772867ab2ff2Smrg
772967ab2ff2Smrg  # Allow CC to be a program name with arguments.
7730b3a827e2Smrg  lt_save_CC=$CC
773167ab2ff2Smrg  lt_save_GCC=$GCC
773267ab2ff2Smrg  lt_save_CFLAGS=$CFLAGS
773367ab2ff2Smrg  CC=${F77-"f77"}
773467ab2ff2Smrg  CFLAGS=$FFLAGS
773567ab2ff2Smrg  compiler=$CC
773667ab2ff2Smrg  _LT_TAGVAR(compiler, $1)=$CC
773767ab2ff2Smrg  _LT_CC_BASENAME([$compiler])
773867ab2ff2Smrg  GCC=$G77
773967ab2ff2Smrg  if test -n "$compiler"; then
774067ab2ff2Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
774167ab2ff2Smrg    AC_MSG_RESULT([$can_build_shared])
7742e0963edeSmrg
774367ab2ff2Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7744b3a827e2Smrg    test no = "$can_build_shared" && enable_shared=no
7745e0963edeSmrg
774667ab2ff2Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
774767ab2ff2Smrg    # are all built from PIC.
774867ab2ff2Smrg    case $host_os in
774967ab2ff2Smrg      aix3*)
7750b3a827e2Smrg        test yes = "$enable_shared" && enable_static=no
775167ab2ff2Smrg        if test -n "$RANLIB"; then
775267ab2ff2Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
775367ab2ff2Smrg          postinstall_cmds='$RANLIB $lib'
775449e108a1Smrg        fi
775549e108a1Smrg        ;;
775667ab2ff2Smrg      aix[[4-9]]*)
7757b3a827e2Smrg	if test ia64 != "$host_cpu"; then
7758b3a827e2Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7759b3a827e2Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7760b3a827e2Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7761b3a827e2Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7762b3a827e2Smrg	  esac
776367ab2ff2Smrg	fi
776467ab2ff2Smrg        ;;
776567ab2ff2Smrg    esac
776667ab2ff2Smrg    AC_MSG_RESULT([$enable_shared])
7767e0963edeSmrg
776867ab2ff2Smrg    AC_MSG_CHECKING([whether to build static libraries])
776967ab2ff2Smrg    # Make sure either enable_shared or enable_static is yes.
7770b3a827e2Smrg    test yes = "$enable_shared" || enable_static=yes
777167ab2ff2Smrg    AC_MSG_RESULT([$enable_static])
7772f05b35a2Smrg
7773b3a827e2Smrg    _LT_TAGVAR(GCC, $1)=$G77
7774b3a827e2Smrg    _LT_TAGVAR(LD, $1)=$LD
7775e0963edeSmrg
777667ab2ff2Smrg    ## CAVEAT EMPTOR:
777767ab2ff2Smrg    ## There is no encapsulation within the following macros, do not change
777867ab2ff2Smrg    ## the running order or otherwise move them around unless you know exactly
777967ab2ff2Smrg    ## what you are doing...
778067ab2ff2Smrg    _LT_COMPILER_PIC($1)
778167ab2ff2Smrg    _LT_COMPILER_C_O($1)
778267ab2ff2Smrg    _LT_COMPILER_FILE_LOCKS($1)
778367ab2ff2Smrg    _LT_LINKER_SHLIBS($1)
778467ab2ff2Smrg    _LT_SYS_DYNAMIC_LINKER($1)
778567ab2ff2Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7786e0963edeSmrg
778767ab2ff2Smrg    _LT_CONFIG($1)
778867ab2ff2Smrg  fi # test -n "$compiler"
7789e0963edeSmrg
779067ab2ff2Smrg  GCC=$lt_save_GCC
7791b3a827e2Smrg  CC=$lt_save_CC
7792b3a827e2Smrg  CFLAGS=$lt_save_CFLAGS
7793b3a827e2Smrgfi # test yes != "$_lt_disable_F77"
7794e0963edeSmrg
779567ab2ff2SmrgAC_LANG_POP
779667ab2ff2Smrg])# _LT_LANG_F77_CONFIG
779767ab2ff2Smrg
779867ab2ff2Smrg
779967ab2ff2Smrg# _LT_LANG_FC_CONFIG([TAG])
780067ab2ff2Smrg# -------------------------
780167ab2ff2Smrg# Ensure that the configuration variables for a Fortran compiler are
780267ab2ff2Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7803b3a827e2Smrg# to write the compiler configuration to 'libtool'.
780467ab2ff2Smrgm4_defun([_LT_LANG_FC_CONFIG],
780567ab2ff2Smrg[AC_LANG_PUSH(Fortran)
780667ab2ff2Smrg
7807b3a827e2Smrgif test -z "$FC" || test no = "$FC"; then
780867ab2ff2Smrg  _lt_disable_FC=yes
780967ab2ff2Smrgfi
781067ab2ff2Smrg
781167ab2ff2Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
781267ab2ff2Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
781367ab2ff2Smrg_LT_TAGVAR(always_export_symbols, $1)=no
781467ab2ff2Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
781567ab2ff2Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
781667ab2ff2Smrg_LT_TAGVAR(hardcode_direct, $1)=no
781767ab2ff2Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
781867ab2ff2Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
781967ab2ff2Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
782067ab2ff2Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
782167ab2ff2Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
782267ab2ff2Smrg_LT_TAGVAR(inherit_rpath, $1)=no
782367ab2ff2Smrg_LT_TAGVAR(module_cmds, $1)=
782467ab2ff2Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
782567ab2ff2Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
782667ab2ff2Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
782767ab2ff2Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
782867ab2ff2Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
782967ab2ff2Smrg_LT_TAGVAR(no_undefined_flag, $1)=
783067ab2ff2Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
783167ab2ff2Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7832e0963edeSmrg
783367ab2ff2Smrg# Source file extension for fc test sources.
783467ab2ff2Smrgac_ext=${ac_fc_srcext-f}
7835e0963edeSmrg
783667ab2ff2Smrg# Object file extension for compiled fc test sources.
783767ab2ff2Smrgobjext=o
783867ab2ff2Smrg_LT_TAGVAR(objext, $1)=$objext
7839f05b35a2Smrg
784067ab2ff2Smrg# No sense in running all these tests if we already determined that
784167ab2ff2Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
784267ab2ff2Smrg# are currently assumed to apply to all compilers on this platform,
784367ab2ff2Smrg# and will be corrupted by setting them based on a non-working compiler.
7844b3a827e2Smrgif test yes != "$_lt_disable_FC"; then
784567ab2ff2Smrg  # Code to be used in simple compile tests
784667ab2ff2Smrg  lt_simple_compile_test_code="\
784767ab2ff2Smrg      subroutine t
784867ab2ff2Smrg      return
784967ab2ff2Smrg      end
785067ab2ff2Smrg"
7851e0963edeSmrg
785267ab2ff2Smrg  # Code to be used in simple link tests
785367ab2ff2Smrg  lt_simple_link_test_code="\
785467ab2ff2Smrg      program t
785567ab2ff2Smrg      end
785667ab2ff2Smrg"
7857e0963edeSmrg
785867ab2ff2Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
785967ab2ff2Smrg  _LT_TAG_COMPILER
7860e0963edeSmrg
786167ab2ff2Smrg  # save warnings/boilerplate of simple test code
786267ab2ff2Smrg  _LT_COMPILER_BOILERPLATE
786367ab2ff2Smrg  _LT_LINKER_BOILERPLATE
7864e0963edeSmrg
786567ab2ff2Smrg  # Allow CC to be a program name with arguments.
7866b3a827e2Smrg  lt_save_CC=$CC
786767ab2ff2Smrg  lt_save_GCC=$GCC
786867ab2ff2Smrg  lt_save_CFLAGS=$CFLAGS
786967ab2ff2Smrg  CC=${FC-"f95"}
787067ab2ff2Smrg  CFLAGS=$FCFLAGS
787167ab2ff2Smrg  compiler=$CC
787267ab2ff2Smrg  GCC=$ac_cv_fc_compiler_gnu
7873e0963edeSmrg
787467ab2ff2Smrg  _LT_TAGVAR(compiler, $1)=$CC
787567ab2ff2Smrg  _LT_CC_BASENAME([$compiler])
7876e0963edeSmrg
787767ab2ff2Smrg  if test -n "$compiler"; then
787867ab2ff2Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
787967ab2ff2Smrg    AC_MSG_RESULT([$can_build_shared])
788067ab2ff2Smrg
788167ab2ff2Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7882b3a827e2Smrg    test no = "$can_build_shared" && enable_shared=no
788367ab2ff2Smrg
788467ab2ff2Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
788567ab2ff2Smrg    # are all built from PIC.
788667ab2ff2Smrg    case $host_os in
788767ab2ff2Smrg      aix3*)
7888b3a827e2Smrg        test yes = "$enable_shared" && enable_static=no
788967ab2ff2Smrg        if test -n "$RANLIB"; then
789067ab2ff2Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
789167ab2ff2Smrg          postinstall_cmds='$RANLIB $lib'
789267ab2ff2Smrg        fi
789367ab2ff2Smrg        ;;
789467ab2ff2Smrg      aix[[4-9]]*)
7895b3a827e2Smrg	if test ia64 != "$host_cpu"; then
7896b3a827e2Smrg	  case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
7897b3a827e2Smrg	  yes,aix,yes) ;;		# shared object as lib.so file only
7898b3a827e2Smrg	  yes,svr4,*) ;;		# shared object as lib.so archive member only
7899b3a827e2Smrg	  yes,*) enable_static=no ;;	# shared object in lib.a archive as well
7900b3a827e2Smrg	  esac
790149e108a1Smrg	fi
790267ab2ff2Smrg        ;;
790367ab2ff2Smrg    esac
790467ab2ff2Smrg    AC_MSG_RESULT([$enable_shared])
7905e0963edeSmrg
790667ab2ff2Smrg    AC_MSG_CHECKING([whether to build static libraries])
790767ab2ff2Smrg    # Make sure either enable_shared or enable_static is yes.
7908b3a827e2Smrg    test yes = "$enable_shared" || enable_static=yes
790967ab2ff2Smrg    AC_MSG_RESULT([$enable_static])
7910e0963edeSmrg
7911b3a827e2Smrg    _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
7912b3a827e2Smrg    _LT_TAGVAR(LD, $1)=$LD
7913e0963edeSmrg
791467ab2ff2Smrg    ## CAVEAT EMPTOR:
791567ab2ff2Smrg    ## There is no encapsulation within the following macros, do not change
791667ab2ff2Smrg    ## the running order or otherwise move them around unless you know exactly
791767ab2ff2Smrg    ## what you are doing...
791867ab2ff2Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
791967ab2ff2Smrg    _LT_COMPILER_PIC($1)
792067ab2ff2Smrg    _LT_COMPILER_C_O($1)
792167ab2ff2Smrg    _LT_COMPILER_FILE_LOCKS($1)
792267ab2ff2Smrg    _LT_LINKER_SHLIBS($1)
792367ab2ff2Smrg    _LT_SYS_DYNAMIC_LINKER($1)
792467ab2ff2Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7925e0963edeSmrg
792667ab2ff2Smrg    _LT_CONFIG($1)
792767ab2ff2Smrg  fi # test -n "$compiler"
7928e0963edeSmrg
792967ab2ff2Smrg  GCC=$lt_save_GCC
793067ab2ff2Smrg  CC=$lt_save_CC
793167ab2ff2Smrg  CFLAGS=$lt_save_CFLAGS
7932b3a827e2Smrgfi # test yes != "$_lt_disable_FC"
7933e0963edeSmrg
793467ab2ff2SmrgAC_LANG_POP
793567ab2ff2Smrg])# _LT_LANG_FC_CONFIG
7936e0963edeSmrg
7937e0963edeSmrg
793867ab2ff2Smrg# _LT_LANG_GCJ_CONFIG([TAG])
793967ab2ff2Smrg# --------------------------
794067ab2ff2Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
794167ab2ff2Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7942b3a827e2Smrg# to write the compiler configuration to 'libtool'.
794367ab2ff2Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
794467ab2ff2Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
794567ab2ff2SmrgAC_LANG_SAVE
794667ab2ff2Smrg
794767ab2ff2Smrg# Source file extension for Java test sources.
794867ab2ff2Smrgac_ext=java
794967ab2ff2Smrg
795067ab2ff2Smrg# Object file extension for compiled Java test sources.
795167ab2ff2Smrgobjext=o
795267ab2ff2Smrg_LT_TAGVAR(objext, $1)=$objext
7953e0963edeSmrg
795467ab2ff2Smrg# Code to be used in simple compile tests
795567ab2ff2Smrglt_simple_compile_test_code="class foo {}"
7956e0963edeSmrg
795767ab2ff2Smrg# Code to be used in simple link tests
795867ab2ff2Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7959e0963edeSmrg
796067ab2ff2Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
796167ab2ff2Smrg_LT_TAG_COMPILER
7962f05b35a2Smrg
796367ab2ff2Smrg# save warnings/boilerplate of simple test code
796467ab2ff2Smrg_LT_COMPILER_BOILERPLATE
796567ab2ff2Smrg_LT_LINKER_BOILERPLATE
7966e0963edeSmrg
796767ab2ff2Smrg# Allow CC to be a program name with arguments.
796867ab2ff2Smrglt_save_CC=$CC
796967ab2ff2Smrglt_save_CFLAGS=$CFLAGS
797067ab2ff2Smrglt_save_GCC=$GCC
797167ab2ff2SmrgGCC=yes
797267ab2ff2SmrgCC=${GCJ-"gcj"}
797367ab2ff2SmrgCFLAGS=$GCJFLAGS
797467ab2ff2Smrgcompiler=$CC
797567ab2ff2Smrg_LT_TAGVAR(compiler, $1)=$CC
7976b3a827e2Smrg_LT_TAGVAR(LD, $1)=$LD
797767ab2ff2Smrg_LT_CC_BASENAME([$compiler])
7978e0963edeSmrg
797967ab2ff2Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
798067ab2ff2Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7981e0963edeSmrg
798267ab2ff2Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
798367ab2ff2Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
798467ab2ff2Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7985e0963edeSmrg
798667ab2ff2Smrgif test -n "$compiler"; then
798767ab2ff2Smrg  _LT_COMPILER_NO_RTTI($1)
798867ab2ff2Smrg  _LT_COMPILER_PIC($1)
798967ab2ff2Smrg  _LT_COMPILER_C_O($1)
799067ab2ff2Smrg  _LT_COMPILER_FILE_LOCKS($1)
799167ab2ff2Smrg  _LT_LINKER_SHLIBS($1)
799267ab2ff2Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7993e0963edeSmrg
799467ab2ff2Smrg  _LT_CONFIG($1)
799567ab2ff2Smrgfi
7996e0963edeSmrg
799767ab2ff2SmrgAC_LANG_RESTORE
7998e0963edeSmrg
799967ab2ff2SmrgGCC=$lt_save_GCC
800067ab2ff2SmrgCC=$lt_save_CC
800167ab2ff2SmrgCFLAGS=$lt_save_CFLAGS
800267ab2ff2Smrg])# _LT_LANG_GCJ_CONFIG
8003f05b35a2Smrg
8004f05b35a2Smrg
8005e494fffdSmrg# _LT_LANG_GO_CONFIG([TAG])
8006e494fffdSmrg# --------------------------
8007e494fffdSmrg# Ensure that the configuration variables for the GNU Go compiler
8008e494fffdSmrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8009b3a827e2Smrg# to write the compiler configuration to 'libtool'.
8010e494fffdSmrgm4_defun([_LT_LANG_GO_CONFIG],
8011e494fffdSmrg[AC_REQUIRE([LT_PROG_GO])dnl
8012e494fffdSmrgAC_LANG_SAVE
8013e494fffdSmrg
8014e494fffdSmrg# Source file extension for Go test sources.
8015e494fffdSmrgac_ext=go
8016e494fffdSmrg
8017e494fffdSmrg# Object file extension for compiled Go test sources.
8018e494fffdSmrgobjext=o
8019e494fffdSmrg_LT_TAGVAR(objext, $1)=$objext
8020e494fffdSmrg
8021e494fffdSmrg# Code to be used in simple compile tests
8022e494fffdSmrglt_simple_compile_test_code="package main; func main() { }"
8023e494fffdSmrg
8024e494fffdSmrg# Code to be used in simple link tests
8025e494fffdSmrglt_simple_link_test_code='package main; func main() { }'
8026e494fffdSmrg
8027e494fffdSmrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
8028e494fffdSmrg_LT_TAG_COMPILER
8029e494fffdSmrg
8030e494fffdSmrg# save warnings/boilerplate of simple test code
8031e494fffdSmrg_LT_COMPILER_BOILERPLATE
8032e494fffdSmrg_LT_LINKER_BOILERPLATE
8033e494fffdSmrg
8034e494fffdSmrg# Allow CC to be a program name with arguments.
8035e494fffdSmrglt_save_CC=$CC
8036e494fffdSmrglt_save_CFLAGS=$CFLAGS
8037e494fffdSmrglt_save_GCC=$GCC
8038e494fffdSmrgGCC=yes
8039e494fffdSmrgCC=${GOC-"gccgo"}
8040e494fffdSmrgCFLAGS=$GOFLAGS
8041e494fffdSmrgcompiler=$CC
8042e494fffdSmrg_LT_TAGVAR(compiler, $1)=$CC
8043b3a827e2Smrg_LT_TAGVAR(LD, $1)=$LD
8044e494fffdSmrg_LT_CC_BASENAME([$compiler])
8045e494fffdSmrg
8046e494fffdSmrg# Go did not exist at the time GCC didn't implicitly link libc in.
8047e494fffdSmrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
8048e494fffdSmrg
8049e494fffdSmrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
8050e494fffdSmrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
8051e494fffdSmrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
8052e494fffdSmrg
8053e494fffdSmrgif test -n "$compiler"; then
8054e494fffdSmrg  _LT_COMPILER_NO_RTTI($1)
8055e494fffdSmrg  _LT_COMPILER_PIC($1)
8056e494fffdSmrg  _LT_COMPILER_C_O($1)
8057e494fffdSmrg  _LT_COMPILER_FILE_LOCKS($1)
8058e494fffdSmrg  _LT_LINKER_SHLIBS($1)
8059e494fffdSmrg  _LT_LINKER_HARDCODE_LIBPATH($1)
8060e494fffdSmrg
8061e494fffdSmrg  _LT_CONFIG($1)
8062e494fffdSmrgfi
8063e494fffdSmrg
8064e494fffdSmrgAC_LANG_RESTORE
8065e494fffdSmrg
8066e494fffdSmrgGCC=$lt_save_GCC
8067e494fffdSmrgCC=$lt_save_CC
8068e494fffdSmrgCFLAGS=$lt_save_CFLAGS
8069e494fffdSmrg])# _LT_LANG_GO_CONFIG
8070e494fffdSmrg
8071e494fffdSmrg
807267ab2ff2Smrg# _LT_LANG_RC_CONFIG([TAG])
807367ab2ff2Smrg# -------------------------
807467ab2ff2Smrg# Ensure that the configuration variables for the Windows resource compiler
807567ab2ff2Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
8076b3a827e2Smrg# to write the compiler configuration to 'libtool'.
807767ab2ff2Smrgm4_defun([_LT_LANG_RC_CONFIG],
807867ab2ff2Smrg[AC_REQUIRE([LT_PROG_RC])dnl
807967ab2ff2SmrgAC_LANG_SAVE
8080f05b35a2Smrg
808167ab2ff2Smrg# Source file extension for RC test sources.
808267ab2ff2Smrgac_ext=rc
8083f05b35a2Smrg
808467ab2ff2Smrg# Object file extension for compiled RC test sources.
808567ab2ff2Smrgobjext=o
808667ab2ff2Smrg_LT_TAGVAR(objext, $1)=$objext
8087f05b35a2Smrg
808867ab2ff2Smrg# Code to be used in simple compile tests
808967ab2ff2Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
8090e0963edeSmrg
809167ab2ff2Smrg# Code to be used in simple link tests
8092b3a827e2Smrglt_simple_link_test_code=$lt_simple_compile_test_code
8093e0963edeSmrg
809467ab2ff2Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
809567ab2ff2Smrg_LT_TAG_COMPILER
8096e0963edeSmrg
809767ab2ff2Smrg# save warnings/boilerplate of simple test code
809867ab2ff2Smrg_LT_COMPILER_BOILERPLATE
809967ab2ff2Smrg_LT_LINKER_BOILERPLATE
810067ab2ff2Smrg
810167ab2ff2Smrg# Allow CC to be a program name with arguments.
8102b3a827e2Smrglt_save_CC=$CC
810367ab2ff2Smrglt_save_CFLAGS=$CFLAGS
810467ab2ff2Smrglt_save_GCC=$GCC
810567ab2ff2SmrgGCC=
810667ab2ff2SmrgCC=${RC-"windres"}
810767ab2ff2SmrgCFLAGS=
810867ab2ff2Smrgcompiler=$CC
810967ab2ff2Smrg_LT_TAGVAR(compiler, $1)=$CC
811067ab2ff2Smrg_LT_CC_BASENAME([$compiler])
811167ab2ff2Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
811267ab2ff2Smrg
811367ab2ff2Smrgif test -n "$compiler"; then
811467ab2ff2Smrg  :
811567ab2ff2Smrg  _LT_CONFIG($1)
811667ab2ff2Smrgfi
8117e0963edeSmrg
811867ab2ff2SmrgGCC=$lt_save_GCC
811967ab2ff2SmrgAC_LANG_RESTORE
812067ab2ff2SmrgCC=$lt_save_CC
812167ab2ff2SmrgCFLAGS=$lt_save_CFLAGS
812267ab2ff2Smrg])# _LT_LANG_RC_CONFIG
8123e0963edeSmrg
8124e0963edeSmrg
812567ab2ff2Smrg# LT_PROG_GCJ
812667ab2ff2Smrg# -----------
812767ab2ff2SmrgAC_DEFUN([LT_PROG_GCJ],
812867ab2ff2Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
812967ab2ff2Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
813067ab2ff2Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
8131b3a827e2Smrg      test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
813267ab2ff2Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
813367ab2ff2Smrg])
8134e0963edeSmrg
813567ab2ff2Smrg# Old name:
813667ab2ff2SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
813767ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
813867ab2ff2Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
8139e0963edeSmrg
8140f05b35a2Smrg
8141e494fffdSmrg# LT_PROG_GO
8142e494fffdSmrg# ----------
8143e494fffdSmrgAC_DEFUN([LT_PROG_GO],
8144e494fffdSmrg[AC_CHECK_TOOL(GOC, gccgo,)
8145e494fffdSmrg])
8146e494fffdSmrg
8147e494fffdSmrg
814867ab2ff2Smrg# LT_PROG_RC
814967ab2ff2Smrg# ----------
815067ab2ff2SmrgAC_DEFUN([LT_PROG_RC],
815167ab2ff2Smrg[AC_CHECK_TOOL(RC, windres,)
815267ab2ff2Smrg])
8153f05b35a2Smrg
815467ab2ff2Smrg# Old name:
815567ab2ff2SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
815667ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
815767ab2ff2Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
8158f05b35a2Smrg
8159f05b35a2Smrg
816067ab2ff2Smrg# _LT_DECL_EGREP
816167ab2ff2Smrg# --------------
816267ab2ff2Smrg# If we don't have a new enough Autoconf to choose the best grep
816367ab2ff2Smrg# available, choose the one first in the user's PATH.
816467ab2ff2Smrgm4_defun([_LT_DECL_EGREP],
816567ab2ff2Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
816667ab2ff2SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
816767ab2ff2Smrgtest -z "$GREP" && GREP=grep
816867ab2ff2Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
816967ab2ff2Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
817067ab2ff2Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
817167ab2ff2Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
817267ab2ff2SmrgAC_SUBST([GREP])
817367ab2ff2Smrg])
8174f05b35a2Smrg
8175f05b35a2Smrg
817667ab2ff2Smrg# _LT_DECL_OBJDUMP
817767ab2ff2Smrg# --------------
817867ab2ff2Smrg# If we don't have a new enough Autoconf to choose the best objdump
817967ab2ff2Smrg# available, choose the one first in the user's PATH.
818067ab2ff2Smrgm4_defun([_LT_DECL_OBJDUMP],
818167ab2ff2Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
818267ab2ff2Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
818367ab2ff2Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
818467ab2ff2SmrgAC_SUBST([OBJDUMP])
818549e108a1Smrg])
8186f05b35a2Smrg
818767ab2ff2Smrg# _LT_DECL_DLLTOOL
818867ab2ff2Smrg# ----------------
818967ab2ff2Smrg# Ensure DLLTOOL variable is set.
819067ab2ff2Smrgm4_defun([_LT_DECL_DLLTOOL],
819167ab2ff2Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
819267ab2ff2Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
819367ab2ff2Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
819467ab2ff2SmrgAC_SUBST([DLLTOOL])
819567ab2ff2Smrg])
8196f05b35a2Smrg
819767ab2ff2Smrg# _LT_DECL_SED
819867ab2ff2Smrg# ------------
819967ab2ff2Smrg# Check for a fully-functional sed program, that truncates
820067ab2ff2Smrg# as few characters as possible.  Prefer GNU sed if found.
820167ab2ff2Smrgm4_defun([_LT_DECL_SED],
820267ab2ff2Smrg[AC_PROG_SED
820367ab2ff2Smrgtest -z "$SED" && SED=sed
820467ab2ff2SmrgXsed="$SED -e 1s/^X//"
820567ab2ff2Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
820667ab2ff2Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
820767ab2ff2Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
820867ab2ff2Smrg])# _LT_DECL_SED
8209f05b35a2Smrg
821067ab2ff2Smrgm4_ifndef([AC_PROG_SED], [
821167ab2ff2Smrg# NOTE: This macro has been submitted for inclusion into   #
821267ab2ff2Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
821367ab2ff2Smrg#  a released version of Autoconf we should remove this    #
821467ab2ff2Smrg#  macro and use it instead.                               #
8215f05b35a2Smrg
821667ab2ff2Smrgm4_defun([AC_PROG_SED],
821767ab2ff2Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
821867ab2ff2SmrgAC_CACHE_VAL(lt_cv_path_SED,
821967ab2ff2Smrg[# Loop through the user's path and test for sed and gsed.
822067ab2ff2Smrg# Then use that list of sed's as ones to test for truncation.
822167ab2ff2Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
822267ab2ff2Smrgfor as_dir in $PATH
822367ab2ff2Smrgdo
822467ab2ff2Smrg  IFS=$as_save_IFS
822567ab2ff2Smrg  test -z "$as_dir" && as_dir=.
822667ab2ff2Smrg  for lt_ac_prog in sed gsed; do
822767ab2ff2Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
822867ab2ff2Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
822967ab2ff2Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
823067ab2ff2Smrg      fi
823167ab2ff2Smrg    done
823267ab2ff2Smrg  done
823367ab2ff2Smrgdone
823467ab2ff2SmrgIFS=$as_save_IFS
823567ab2ff2Smrglt_ac_max=0
823667ab2ff2Smrglt_ac_count=0
823767ab2ff2Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
823867ab2ff2Smrg# along with /bin/sed that truncates output.
823967ab2ff2Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
8240b3a827e2Smrg  test ! -f "$lt_ac_sed" && continue
824167ab2ff2Smrg  cat /dev/null > conftest.in
824267ab2ff2Smrg  lt_ac_count=0
824367ab2ff2Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
824467ab2ff2Smrg  # Check for GNU sed and select it if it is found.
824567ab2ff2Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
824667ab2ff2Smrg    lt_cv_path_SED=$lt_ac_sed
824767ab2ff2Smrg    break
824867ab2ff2Smrg  fi
824967ab2ff2Smrg  while true; do
825067ab2ff2Smrg    cat conftest.in conftest.in >conftest.tmp
825167ab2ff2Smrg    mv conftest.tmp conftest.in
825267ab2ff2Smrg    cp conftest.in conftest.nl
825367ab2ff2Smrg    echo >>conftest.nl
825467ab2ff2Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
825567ab2ff2Smrg    cmp -s conftest.out conftest.nl || break
825667ab2ff2Smrg    # 10000 chars as input seems more than enough
8257b3a827e2Smrg    test 10 -lt "$lt_ac_count" && break
825867ab2ff2Smrg    lt_ac_count=`expr $lt_ac_count + 1`
8259b3a827e2Smrg    if test "$lt_ac_count" -gt "$lt_ac_max"; then
826067ab2ff2Smrg      lt_ac_max=$lt_ac_count
826167ab2ff2Smrg      lt_cv_path_SED=$lt_ac_sed
826267ab2ff2Smrg    fi
826367ab2ff2Smrg  done
826467ab2ff2Smrgdone
826567ab2ff2Smrg])
826667ab2ff2SmrgSED=$lt_cv_path_SED
826767ab2ff2SmrgAC_SUBST([SED])
826867ab2ff2SmrgAC_MSG_RESULT([$SED])
826967ab2ff2Smrg])#AC_PROG_SED
827067ab2ff2Smrg])#m4_ifndef
8271f05b35a2Smrg
827267ab2ff2Smrg# Old name:
827367ab2ff2SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
827467ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
827567ab2ff2Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
8276e0963edeSmrg
8277e0963edeSmrg
827867ab2ff2Smrg# _LT_CHECK_SHELL_FEATURES
827967ab2ff2Smrg# ------------------------
828067ab2ff2Smrg# Find out whether the shell is Bourne or XSI compatible,
828167ab2ff2Smrg# or has some other useful features.
828267ab2ff2Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
8283b3a827e2Smrg[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
828467ab2ff2Smrg  lt_unset=unset
828549e108a1Smrgelse
828667ab2ff2Smrg  lt_unset=false
828749e108a1Smrgfi
828867ab2ff2Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
8289e0963edeSmrg
829067ab2ff2Smrg# test EBCDIC or ASCII
829167ab2ff2Smrgcase `echo X|tr X '\101'` in
829267ab2ff2Smrg A) # ASCII based system
829367ab2ff2Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
829467ab2ff2Smrg  lt_SP2NL='tr \040 \012'
829567ab2ff2Smrg  lt_NL2SP='tr \015\012 \040\040'
829649e108a1Smrg  ;;
829767ab2ff2Smrg *) # EBCDIC based system
829867ab2ff2Smrg  lt_SP2NL='tr \100 \n'
829967ab2ff2Smrg  lt_NL2SP='tr \r\n \100\100'
830049e108a1Smrg  ;;
830167ab2ff2Smrgesac
830267ab2ff2Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
830367ab2ff2Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
830467ab2ff2Smrg])# _LT_CHECK_SHELL_FEATURES
8305e0963edeSmrg
8306e0963edeSmrg
830767ab2ff2Smrg# _LT_PATH_CONVERSION_FUNCTIONS
830867ab2ff2Smrg# -----------------------------
8309b3a827e2Smrg# Determine what file name conversion functions should be used by
831067ab2ff2Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
831167ab2ff2Smrg# for certain cross-compile configurations and native mingw.
831267ab2ff2Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
831367ab2ff2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
831467ab2ff2SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
831567ab2ff2SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
831667ab2ff2SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
831767ab2ff2Smrg[case $host in
831867ab2ff2Smrg  *-*-mingw* )
831967ab2ff2Smrg    case $build in
832067ab2ff2Smrg      *-*-mingw* ) # actually msys
832167ab2ff2Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
832249e108a1Smrg        ;;
832367ab2ff2Smrg      *-*-cygwin* )
832467ab2ff2Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
832567ab2ff2Smrg        ;;
832667ab2ff2Smrg      * ) # otherwise, assume *nix
832767ab2ff2Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
832849e108a1Smrg        ;;
832949e108a1Smrg    esac
833067ab2ff2Smrg    ;;
833167ab2ff2Smrg  *-*-cygwin* )
833267ab2ff2Smrg    case $build in
833367ab2ff2Smrg      *-*-mingw* ) # actually msys
833467ab2ff2Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
833567ab2ff2Smrg        ;;
833667ab2ff2Smrg      *-*-cygwin* )
833767ab2ff2Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
833867ab2ff2Smrg        ;;
833967ab2ff2Smrg      * ) # otherwise, assume *nix
834067ab2ff2Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
834167ab2ff2Smrg        ;;
834267ab2ff2Smrg    esac
834367ab2ff2Smrg    ;;
834467ab2ff2Smrg  * ) # unhandled hosts (and "normal" native builds)
834567ab2ff2Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
834667ab2ff2Smrg    ;;
834767ab2ff2Smrgesac
834867ab2ff2Smrg])
834967ab2ff2Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
835067ab2ff2SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
835167ab2ff2Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
835267ab2ff2Smrg         [0], [convert $build file names to $host format])dnl
835367ab2ff2Smrg
835467ab2ff2SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
835567ab2ff2SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
835667ab2ff2Smrg[#assume ordinary cross tools, or native build.
835767ab2ff2Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
835867ab2ff2Smrgcase $host in
835967ab2ff2Smrg  *-*-mingw* )
836067ab2ff2Smrg    case $build in
836167ab2ff2Smrg      *-*-mingw* ) # actually msys
836267ab2ff2Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
836367ab2ff2Smrg        ;;
836467ab2ff2Smrg    esac
836567ab2ff2Smrg    ;;
836667ab2ff2Smrgesac
836767ab2ff2Smrg])
836867ab2ff2Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
836967ab2ff2SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
837067ab2ff2Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
837167ab2ff2Smrg         [0], [convert $build files to toolchain format])dnl
837267ab2ff2Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
8373e0963edeSmrg
837467ab2ff2Smrg# Helper functions for option handling.                    -*- Autoconf -*-
837567ab2ff2Smrg#
8376b3a827e2Smrg#   Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
8377b3a827e2Smrg#   Foundation, Inc.
837867ab2ff2Smrg#   Written by Gary V. Vaughan, 2004
837967ab2ff2Smrg#
838067ab2ff2Smrg# This file is free software; the Free Software Foundation gives
838167ab2ff2Smrg# unlimited permission to copy and/or distribute it, with or without
838267ab2ff2Smrg# modifications, as long as this notice is preserved.
8383e0963edeSmrg
8384b3a827e2Smrg# serial 8 ltoptions.m4
8385e0963edeSmrg
838667ab2ff2Smrg# This is to help aclocal find these macros, as it can't see m4_define.
838767ab2ff2SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8388e0963edeSmrg
8389e0963edeSmrg
839067ab2ff2Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
839167ab2ff2Smrg# ------------------------------------------
839267ab2ff2Smrgm4_define([_LT_MANGLE_OPTION],
839367ab2ff2Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8394e0963edeSmrg
8395e0963edeSmrg
839667ab2ff2Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
839767ab2ff2Smrg# ---------------------------------------
839867ab2ff2Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
839967ab2ff2Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
840067ab2ff2Smrg# saved as a flag.
840167ab2ff2Smrgm4_define([_LT_SET_OPTION],
840267ab2ff2Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
840367ab2ff2Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
840467ab2ff2Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
8405b3a827e2Smrg    [m4_warning([Unknown $1 option '$2'])])[]dnl
840667ab2ff2Smrg])
8407e0963edeSmrg
8408e0963edeSmrg
840967ab2ff2Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
841067ab2ff2Smrg# ------------------------------------------------------------
841167ab2ff2Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
841267ab2ff2Smrgm4_define([_LT_IF_OPTION],
841367ab2ff2Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8414e0963edeSmrg
8415e0963edeSmrg
841667ab2ff2Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
841767ab2ff2Smrg# -------------------------------------------------------
841867ab2ff2Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
841967ab2ff2Smrg# are set.
842067ab2ff2Smrgm4_define([_LT_UNLESS_OPTIONS],
842167ab2ff2Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
842267ab2ff2Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
842367ab2ff2Smrg		      [m4_define([$0_found])])])[]dnl
842467ab2ff2Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
842567ab2ff2Smrg])[]dnl
842667ab2ff2Smrg])
8427e0963edeSmrg
8428e0963edeSmrg
842967ab2ff2Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
843067ab2ff2Smrg# ----------------------------------------
843167ab2ff2Smrg# OPTION-LIST is a space-separated list of Libtool options associated
843267ab2ff2Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
843367ab2ff2Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
843467ab2ff2Smrg# the unknown option and exit.
843567ab2ff2Smrgm4_defun([_LT_SET_OPTIONS],
843667ab2ff2Smrg[# Set options
843767ab2ff2Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
843867ab2ff2Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
8439e0963edeSmrg
844067ab2ff2Smrgm4_if([$1],[LT_INIT],[
844167ab2ff2Smrg  dnl
844267ab2ff2Smrg  dnl Simply set some default values (i.e off) if boolean options were not
844367ab2ff2Smrg  dnl specified:
844467ab2ff2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
844567ab2ff2Smrg  ])
844667ab2ff2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
844767ab2ff2Smrg  ])
844867ab2ff2Smrg  dnl
844967ab2ff2Smrg  dnl If no reference was made to various pairs of opposing options, then
845067ab2ff2Smrg  dnl we run the default mode handler for the pair.  For example, if neither
8451b3a827e2Smrg  dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
845267ab2ff2Smrg  dnl archives by default:
845367ab2ff2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
845467ab2ff2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
845567ab2ff2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
845667ab2ff2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8457b3a827e2Smrg		   [_LT_ENABLE_FAST_INSTALL])
8458b3a827e2Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
8459b3a827e2Smrg		   [_LT_WITH_AIX_SONAME([aix])])
846067ab2ff2Smrg  ])
846167ab2ff2Smrg])# _LT_SET_OPTIONS
8462e0963edeSmrg
846349e108a1Smrg
8464e0963edeSmrg
846567ab2ff2Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
846667ab2ff2Smrg# -----------------------------------------
846767ab2ff2Smrgm4_define([_LT_MANGLE_DEFUN],
846867ab2ff2Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8469e0963edeSmrg
8470e0963edeSmrg
847167ab2ff2Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
847267ab2ff2Smrg# -----------------------------------------------
847367ab2ff2Smrgm4_define([LT_OPTION_DEFINE],
847467ab2ff2Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
847567ab2ff2Smrg])# LT_OPTION_DEFINE
8476e0963edeSmrg
8477e0963edeSmrg
847867ab2ff2Smrg# dlopen
847967ab2ff2Smrg# ------
848067ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
848167ab2ff2Smrg])
8482e0963edeSmrg
848367ab2ff2SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
848467ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
848567ab2ff2SmrgAC_DIAGNOSE([obsolete],
848667ab2ff2Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8487b3a827e2Smrgput the 'dlopen' option into LT_INIT's first parameter.])
848867ab2ff2Smrg])
8489f05b35a2Smrg
849067ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
849167ab2ff2Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
8492f05b35a2Smrg
8493e0963edeSmrg
849467ab2ff2Smrg# win32-dll
849567ab2ff2Smrg# ---------
849667ab2ff2Smrg# Declare package support for building win32 dll's.
849767ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
849867ab2ff2Smrg[enable_win32_dll=yes
8499e0963edeSmrg
850067ab2ff2Smrgcase $host in
850167ab2ff2Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
850267ab2ff2Smrg  AC_CHECK_TOOL(AS, as, false)
850367ab2ff2Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
850467ab2ff2Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
850567ab2ff2Smrg  ;;
850667ab2ff2Smrgesac
850767ab2ff2Smrg
850867ab2ff2Smrgtest -z "$AS" && AS=as
850967ab2ff2Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
851067ab2ff2Smrg
851167ab2ff2Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
851267ab2ff2Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
851367ab2ff2Smrg
851467ab2ff2Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
851567ab2ff2Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
851667ab2ff2Smrg])# win32-dll
851767ab2ff2Smrg
851867ab2ff2SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
851967ab2ff2Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
852067ab2ff2Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
852167ab2ff2SmrgAC_DIAGNOSE([obsolete],
852267ab2ff2Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8523b3a827e2Smrgput the 'win32-dll' option into LT_INIT's first parameter.])
852467ab2ff2Smrg])
8525e0963edeSmrg
852667ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
852767ab2ff2Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
8528e0963edeSmrg
8529e0963edeSmrg
853067ab2ff2Smrg# _LT_ENABLE_SHARED([DEFAULT])
853167ab2ff2Smrg# ----------------------------
8532b3a827e2Smrg# implement the --enable-shared flag, and supports the 'shared' and
8533b3a827e2Smrg# 'disable-shared' LT_INIT options.
8534b3a827e2Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
853567ab2ff2Smrgm4_define([_LT_ENABLE_SHARED],
853667ab2ff2Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
853767ab2ff2SmrgAC_ARG_ENABLE([shared],
853867ab2ff2Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
853967ab2ff2Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
854067ab2ff2Smrg    [p=${PACKAGE-default}
854167ab2ff2Smrg    case $enableval in
854267ab2ff2Smrg    yes) enable_shared=yes ;;
854367ab2ff2Smrg    no) enable_shared=no ;;
854467ab2ff2Smrg    *)
854567ab2ff2Smrg      enable_shared=no
854667ab2ff2Smrg      # Look at the argument we got.  We use all the common list separators.
8547b3a827e2Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
854867ab2ff2Smrg      for pkg in $enableval; do
8549b3a827e2Smrg	IFS=$lt_save_ifs
855067ab2ff2Smrg	if test "X$pkg" = "X$p"; then
855167ab2ff2Smrg	  enable_shared=yes
855267ab2ff2Smrg	fi
855367ab2ff2Smrg      done
8554b3a827e2Smrg      IFS=$lt_save_ifs
855567ab2ff2Smrg      ;;
855667ab2ff2Smrg    esac],
855767ab2ff2Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8558e0963edeSmrg
855967ab2ff2Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
856067ab2ff2Smrg	[Whether or not to build shared libraries])
856167ab2ff2Smrg])# _LT_ENABLE_SHARED
8562e0963edeSmrg
856367ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
856467ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8565e0963edeSmrg
856667ab2ff2Smrg# Old names:
856767ab2ff2SmrgAC_DEFUN([AC_ENABLE_SHARED],
856867ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
856967ab2ff2Smrg])
8570e0963edeSmrg
857167ab2ff2SmrgAC_DEFUN([AC_DISABLE_SHARED],
857267ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
857367ab2ff2Smrg])
8574e0963edeSmrg
857567ab2ff2SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
857667ab2ff2SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8577e0963edeSmrg
857867ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
857967ab2ff2Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
858067ab2ff2Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8581e0963edeSmrg
8582e0963edeSmrg
8583e0963edeSmrg
858467ab2ff2Smrg# _LT_ENABLE_STATIC([DEFAULT])
858567ab2ff2Smrg# ----------------------------
8586b3a827e2Smrg# implement the --enable-static flag, and support the 'static' and
8587b3a827e2Smrg# 'disable-static' LT_INIT options.
8588b3a827e2Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
858967ab2ff2Smrgm4_define([_LT_ENABLE_STATIC],
859067ab2ff2Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
859167ab2ff2SmrgAC_ARG_ENABLE([static],
859267ab2ff2Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
859367ab2ff2Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
859467ab2ff2Smrg    [p=${PACKAGE-default}
859567ab2ff2Smrg    case $enableval in
859667ab2ff2Smrg    yes) enable_static=yes ;;
859767ab2ff2Smrg    no) enable_static=no ;;
859867ab2ff2Smrg    *)
859967ab2ff2Smrg     enable_static=no
860067ab2ff2Smrg      # Look at the argument we got.  We use all the common list separators.
8601b3a827e2Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
860267ab2ff2Smrg      for pkg in $enableval; do
8603b3a827e2Smrg	IFS=$lt_save_ifs
860467ab2ff2Smrg	if test "X$pkg" = "X$p"; then
860567ab2ff2Smrg	  enable_static=yes
860667ab2ff2Smrg	fi
860767ab2ff2Smrg      done
8608b3a827e2Smrg      IFS=$lt_save_ifs
860967ab2ff2Smrg      ;;
861067ab2ff2Smrg    esac],
861167ab2ff2Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8612f05b35a2Smrg
861367ab2ff2Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
861467ab2ff2Smrg	[Whether or not to build static libraries])
861567ab2ff2Smrg])# _LT_ENABLE_STATIC
8616f05b35a2Smrg
861767ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
861867ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8619e0963edeSmrg
862067ab2ff2Smrg# Old names:
862167ab2ff2SmrgAC_DEFUN([AC_ENABLE_STATIC],
862267ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
862367ab2ff2Smrg])
8624e0963edeSmrg
862567ab2ff2SmrgAC_DEFUN([AC_DISABLE_STATIC],
862667ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
862767ab2ff2Smrg])
8628e0963edeSmrg
862967ab2ff2SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
863067ab2ff2SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8631e0963edeSmrg
863267ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
863367ab2ff2Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
863467ab2ff2Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8635e0963edeSmrg
8636e0963edeSmrg
8637e0963edeSmrg
863867ab2ff2Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
863967ab2ff2Smrg# ----------------------------------
8640b3a827e2Smrg# implement the --enable-fast-install flag, and support the 'fast-install'
8641b3a827e2Smrg# and 'disable-fast-install' LT_INIT options.
8642b3a827e2Smrg# DEFAULT is either 'yes' or 'no'.  If omitted, it defaults to 'yes'.
864367ab2ff2Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
864467ab2ff2Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
864567ab2ff2SmrgAC_ARG_ENABLE([fast-install],
864667ab2ff2Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
864767ab2ff2Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
864867ab2ff2Smrg    [p=${PACKAGE-default}
864967ab2ff2Smrg    case $enableval in
865067ab2ff2Smrg    yes) enable_fast_install=yes ;;
865167ab2ff2Smrg    no) enable_fast_install=no ;;
865267ab2ff2Smrg    *)
865367ab2ff2Smrg      enable_fast_install=no
865467ab2ff2Smrg      # Look at the argument we got.  We use all the common list separators.
8655b3a827e2Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
865667ab2ff2Smrg      for pkg in $enableval; do
8657b3a827e2Smrg	IFS=$lt_save_ifs
865867ab2ff2Smrg	if test "X$pkg" = "X$p"; then
865967ab2ff2Smrg	  enable_fast_install=yes
866067ab2ff2Smrg	fi
866167ab2ff2Smrg      done
8662b3a827e2Smrg      IFS=$lt_save_ifs
866367ab2ff2Smrg      ;;
866467ab2ff2Smrg    esac],
866567ab2ff2Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8666e0963edeSmrg
866767ab2ff2Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
866867ab2ff2Smrg	 [Whether or not to optimize for fast installation])dnl
866967ab2ff2Smrg])# _LT_ENABLE_FAST_INSTALL
8670e0963edeSmrg
867167ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
867267ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8673e0963edeSmrg
867467ab2ff2Smrg# Old names:
867567ab2ff2SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
867667ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
867767ab2ff2SmrgAC_DIAGNOSE([obsolete],
867867ab2ff2Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8679b3a827e2Smrgthe 'fast-install' option into LT_INIT's first parameter.])
868067ab2ff2Smrg])
868149e108a1Smrg
868267ab2ff2SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
868367ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
868467ab2ff2SmrgAC_DIAGNOSE([obsolete],
868567ab2ff2Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8686b3a827e2Smrgthe 'disable-fast-install' option into LT_INIT's first parameter.])
868767ab2ff2Smrg])
868849e108a1Smrg
868967ab2ff2Smrgdnl aclocal-1.4 backwards compatibility:
869067ab2ff2Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
869167ab2ff2Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
869249e108a1Smrg
869349e108a1Smrg
8694b3a827e2Smrg# _LT_WITH_AIX_SONAME([DEFAULT])
8695b3a827e2Smrg# ----------------------------------
8696b3a827e2Smrg# implement the --with-aix-soname flag, and support the `aix-soname=aix'
8697b3a827e2Smrg# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
8698b3a827e2Smrg# is either `aix', `both' or `svr4'.  If omitted, it defaults to `aix'.
8699b3a827e2Smrgm4_define([_LT_WITH_AIX_SONAME],
8700b3a827e2Smrg[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
8701b3a827e2Smrgshared_archive_member_spec=
8702b3a827e2Smrgcase $host,$enable_shared in
8703b3a827e2Smrgpower*-*-aix[[5-9]]*,yes)
8704b3a827e2Smrg  AC_MSG_CHECKING([which variant of shared library versioning to provide])
8705b3a827e2Smrg  AC_ARG_WITH([aix-soname],
8706b3a827e2Smrg    [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
8707b3a827e2Smrg      [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
8708b3a827e2Smrg    [case $withval in
8709b3a827e2Smrg    aix|svr4|both)
8710b3a827e2Smrg      ;;
8711b3a827e2Smrg    *)
8712b3a827e2Smrg      AC_MSG_ERROR([Unknown argument to --with-aix-soname])
8713b3a827e2Smrg      ;;
8714b3a827e2Smrg    esac
8715b3a827e2Smrg    lt_cv_with_aix_soname=$with_aix_soname],
8716b3a827e2Smrg    [AC_CACHE_VAL([lt_cv_with_aix_soname],
8717b3a827e2Smrg      [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
8718b3a827e2Smrg    with_aix_soname=$lt_cv_with_aix_soname])
8719b3a827e2Smrg  AC_MSG_RESULT([$with_aix_soname])
8720b3a827e2Smrg  if test aix != "$with_aix_soname"; then
8721b3a827e2Smrg    # For the AIX way of multilib, we name the shared archive member
8722b3a827e2Smrg    # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
8723b3a827e2Smrg    # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
8724b3a827e2Smrg    # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
8725b3a827e2Smrg    # the AIX toolchain works better with OBJECT_MODE set (default 32).
8726b3a827e2Smrg    if test 64 = "${OBJECT_MODE-32}"; then
8727b3a827e2Smrg      shared_archive_member_spec=shr_64
8728b3a827e2Smrg    else
8729b3a827e2Smrg      shared_archive_member_spec=shr
8730b3a827e2Smrg    fi
8731b3a827e2Smrg  fi
8732b3a827e2Smrg  ;;
8733b3a827e2Smrg*)
8734b3a827e2Smrg  with_aix_soname=aix
8735b3a827e2Smrg  ;;
8736b3a827e2Smrgesac
8737b3a827e2Smrg
8738b3a827e2Smrg_LT_DECL([], [shared_archive_member_spec], [0],
8739b3a827e2Smrg    [Shared archive member basename, for filename based shared library versioning on AIX])dnl
8740b3a827e2Smrg])# _LT_WITH_AIX_SONAME
8741b3a827e2Smrg
8742b3a827e2SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
8743b3a827e2SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
8744b3a827e2SmrgLT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
8745b3a827e2Smrg
8746b3a827e2Smrg
874767ab2ff2Smrg# _LT_WITH_PIC([MODE])
874867ab2ff2Smrg# --------------------
8749b3a827e2Smrg# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
875067ab2ff2Smrg# LT_INIT options.
8751b3a827e2Smrg# MODE is either 'yes' or 'no'.  If omitted, it defaults to 'both'.
875267ab2ff2Smrgm4_define([_LT_WITH_PIC],
875367ab2ff2Smrg[AC_ARG_WITH([pic],
8754e494fffdSmrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
875567ab2ff2Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8756e494fffdSmrg    [lt_p=${PACKAGE-default}
8757e494fffdSmrg    case $withval in
8758e494fffdSmrg    yes|no) pic_mode=$withval ;;
8759e494fffdSmrg    *)
8760e494fffdSmrg      pic_mode=default
8761e494fffdSmrg      # Look at the argument we got.  We use all the common list separators.
8762b3a827e2Smrg      lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
8763e494fffdSmrg      for lt_pkg in $withval; do
8764b3a827e2Smrg	IFS=$lt_save_ifs
8765e494fffdSmrg	if test "X$lt_pkg" = "X$lt_p"; then
8766e494fffdSmrg	  pic_mode=yes
8767e494fffdSmrg	fi
8768e494fffdSmrg      done
8769b3a827e2Smrg      IFS=$lt_save_ifs
8770e494fffdSmrg      ;;
8771e494fffdSmrg    esac],
8772b3a827e2Smrg    [pic_mode=m4_default([$1], [default])])
877349e108a1Smrg
877467ab2ff2Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
877567ab2ff2Smrg])# _LT_WITH_PIC
877667ab2ff2Smrg
877767ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
877867ab2ff2SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8779e0963edeSmrg
878049e108a1Smrg# Old name:
878167ab2ff2SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
878267ab2ff2Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
878367ab2ff2SmrgAC_DIAGNOSE([obsolete],
878467ab2ff2Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8785b3a827e2Smrgput the 'pic-only' option into LT_INIT's first parameter.])
878667ab2ff2Smrg])
878767ab2ff2Smrg
878849e108a1Smrgdnl aclocal-1.4 backwards compatibility:
878967ab2ff2Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8790e0963edeSmrg
8791e0963edeSmrg
879267ab2ff2Smrgm4_define([_LTDL_MODE], [])
879367ab2ff2SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
879467ab2ff2Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
879567ab2ff2SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
879667ab2ff2Smrg		 [m4_define([_LTDL_MODE], [recursive])])
879767ab2ff2SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
879867ab2ff2Smrg		 [m4_define([_LTDL_MODE], [subproject])])
8799e0963edeSmrg
880067ab2ff2Smrgm4_define([_LTDL_TYPE], [])
880167ab2ff2SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
880267ab2ff2Smrg		 [m4_define([_LTDL_TYPE], [installable])])
880367ab2ff2SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
880467ab2ff2Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8805e0963edeSmrg
880667ab2ff2Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
880767ab2ff2Smrg#
8808b3a827e2Smrg# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
8809b3a827e2Smrg# Foundation, Inc.
881067ab2ff2Smrg# Written by Gary V. Vaughan, 2004
881167ab2ff2Smrg#
881267ab2ff2Smrg# This file is free software; the Free Software Foundation gives
881367ab2ff2Smrg# unlimited permission to copy and/or distribute it, with or without
881467ab2ff2Smrg# modifications, as long as this notice is preserved.
8815e0963edeSmrg
881667ab2ff2Smrg# serial 6 ltsugar.m4
8817f05b35a2Smrg
881867ab2ff2Smrg# This is to help aclocal find these macros, as it can't see m4_define.
881967ab2ff2SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8820f05b35a2Smrg
882167ab2ff2Smrg
882267ab2ff2Smrg# lt_join(SEP, ARG1, [ARG2...])
882367ab2ff2Smrg# -----------------------------
882467ab2ff2Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
882567ab2ff2Smrg# associated separator.
882667ab2ff2Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
882767ab2ff2Smrg# versions in m4sugar had bugs.
882867ab2ff2Smrgm4_define([lt_join],
882967ab2ff2Smrg[m4_if([$#], [1], [],
883067ab2ff2Smrg       [$#], [2], [[$2]],
883167ab2ff2Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
883267ab2ff2Smrgm4_define([_lt_join],
883367ab2ff2Smrg[m4_if([$#$2], [2], [],
883467ab2ff2Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8835e0963edeSmrg
8836e0963edeSmrg
883767ab2ff2Smrg# lt_car(LIST)
883867ab2ff2Smrg# lt_cdr(LIST)
883949e108a1Smrg# ------------
884067ab2ff2Smrg# Manipulate m4 lists.
884167ab2ff2Smrg# These macros are necessary as long as will still need to support
8842b3a827e2Smrg# Autoconf-2.59, which quotes differently.
884367ab2ff2Smrgm4_define([lt_car], [[$1]])
884467ab2ff2Smrgm4_define([lt_cdr],
884567ab2ff2Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
884667ab2ff2Smrg       [$#], 1, [],
884767ab2ff2Smrg       [m4_dquote(m4_shift($@))])])
884867ab2ff2Smrgm4_define([lt_unquote], $1)
8849f05b35a2Smrg
8850f05b35a2Smrg
885167ab2ff2Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
885267ab2ff2Smrg# ------------------------------------------
8853b3a827e2Smrg# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
885467ab2ff2Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
885567ab2ff2Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
885667ab2ff2Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
885767ab2ff2Smrg# than defined and empty).
885867ab2ff2Smrg#
885967ab2ff2Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
886067ab2ff2Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
886167ab2ff2Smrgm4_define([lt_append],
886267ab2ff2Smrg[m4_define([$1],
886367ab2ff2Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8864e0963edeSmrg
8865e0963edeSmrg
8866e0963edeSmrg
886767ab2ff2Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
886867ab2ff2Smrg# ----------------------------------------------------------
886967ab2ff2Smrg# Produce a SEP delimited list of all paired combinations of elements of
887067ab2ff2Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
887167ab2ff2Smrg# has the form PREFIXmINFIXSUFFIXn.
887267ab2ff2Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
887367ab2ff2Smrgm4_define([lt_combine],
887467ab2ff2Smrg[m4_if(m4_eval([$# > 3]), [1],
887567ab2ff2Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
887667ab2ff2Smrg[[m4_foreach([_Lt_prefix], [$2],
887767ab2ff2Smrg	     [m4_foreach([_Lt_suffix],
887867ab2ff2Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
887967ab2ff2Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8880e0963edeSmrg
8881e0963edeSmrg
888267ab2ff2Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
888367ab2ff2Smrg# -----------------------------------------------------------------------
888467ab2ff2Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
888567ab2ff2Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
888667ab2ff2Smrgm4_define([lt_if_append_uniq],
888767ab2ff2Smrg[m4_ifdef([$1],
888867ab2ff2Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
888967ab2ff2Smrg		 [lt_append([$1], [$2], [$3])$4],
889067ab2ff2Smrg		 [$5])],
889167ab2ff2Smrg	  [lt_append([$1], [$2], [$3])$4])])
8892e0963edeSmrg
889367ab2ff2Smrg
889467ab2ff2Smrg# lt_dict_add(DICT, KEY, VALUE)
889567ab2ff2Smrg# -----------------------------
889667ab2ff2Smrgm4_define([lt_dict_add],
889767ab2ff2Smrg[m4_define([$1($2)], [$3])])
889867ab2ff2Smrg
889967ab2ff2Smrg
890067ab2ff2Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
890167ab2ff2Smrg# --------------------------------------------
890267ab2ff2Smrgm4_define([lt_dict_add_subkey],
890367ab2ff2Smrg[m4_define([$1($2:$3)], [$4])])
8904e0963edeSmrg
8905e0963edeSmrg
890667ab2ff2Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
890767ab2ff2Smrg# ----------------------------------
890867ab2ff2Smrgm4_define([lt_dict_fetch],
890967ab2ff2Smrg[m4_ifval([$3],
891067ab2ff2Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
891167ab2ff2Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8912e0963edeSmrg
8913e0963edeSmrg
891467ab2ff2Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
891567ab2ff2Smrg# -----------------------------------------------------------------
891667ab2ff2Smrgm4_define([lt_if_dict_fetch],
891767ab2ff2Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
891867ab2ff2Smrg	[$5],
891967ab2ff2Smrg    [$6])])
8920e0963edeSmrg
8921e0963edeSmrg
892267ab2ff2Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
892367ab2ff2Smrg# --------------------------------------------------------------
892467ab2ff2Smrgm4_define([lt_dict_filter],
892567ab2ff2Smrg[m4_if([$5], [], [],
892667ab2ff2Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
892767ab2ff2Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
892867ab2ff2Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
892967ab2ff2Smrg])
8930f05b35a2Smrg
893167ab2ff2Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
893267ab2ff2Smrg#
8933b3a827e2Smrg#   Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
893467ab2ff2Smrg#   Written by Scott James Remnant, 2004
893567ab2ff2Smrg#
893667ab2ff2Smrg# This file is free software; the Free Software Foundation gives
893767ab2ff2Smrg# unlimited permission to copy and/or distribute it, with or without
893867ab2ff2Smrg# modifications, as long as this notice is preserved.
8939e0963edeSmrg
894067ab2ff2Smrg# @configure_input@
8941e0963edeSmrg
8942b3a827e2Smrg# serial 4179 ltversion.m4
894367ab2ff2Smrg# This file is part of GNU Libtool
8944e0963edeSmrg
8945b3a827e2Smrgm4_define([LT_PACKAGE_VERSION], [2.4.6])
8946b3a827e2Smrgm4_define([LT_PACKAGE_REVISION], [2.4.6])
894749e108a1Smrg
894867ab2ff2SmrgAC_DEFUN([LTVERSION_VERSION],
8949b3a827e2Smrg[macro_version='2.4.6'
8950b3a827e2Smrgmacro_revision='2.4.6'
895167ab2ff2Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
895267ab2ff2Smrg_LT_DECL(, macro_revision, 0)
895367ab2ff2Smrg])
895449e108a1Smrg
895567ab2ff2Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
895667ab2ff2Smrg#
8957b3a827e2Smrg#   Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
8958b3a827e2Smrg#   Foundation, Inc.
895967ab2ff2Smrg#   Written by Scott James Remnant, 2004.
896067ab2ff2Smrg#
896167ab2ff2Smrg# This file is free software; the Free Software Foundation gives
896267ab2ff2Smrg# unlimited permission to copy and/or distribute it, with or without
896367ab2ff2Smrg# modifications, as long as this notice is preserved.
8964e0963edeSmrg
896567ab2ff2Smrg# serial 5 lt~obsolete.m4
896667ab2ff2Smrg
896767ab2ff2Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
896867ab2ff2Smrg#
8969b3a827e2Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
897067ab2ff2Smrg# which have later been changed to m4_define as they aren't part of the
897167ab2ff2Smrg# exported API, or moved to Autoconf or Automake where they belong.
897267ab2ff2Smrg#
897367ab2ff2Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
897467ab2ff2Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
897567ab2ff2Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
897667ab2ff2Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
897767ab2ff2Smrg# and doesn't know about Autoconf macros at all.)
897867ab2ff2Smrg#
897967ab2ff2Smrg# So we provide this file, which has a silly filename so it's always
898067ab2ff2Smrg# included after everything else.  This provides aclocal with the
898167ab2ff2Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
898267ab2ff2Smrg# because those macros already exist, or will be overwritten later.
8983b3a827e2Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
898467ab2ff2Smrg#
898567ab2ff2Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
898667ab2ff2Smrg# Yes, that means every name once taken will need to remain here until
898767ab2ff2Smrg# we give up compatibility with versions before 1.7, at which point
898867ab2ff2Smrg# we need to keep only those names which we still refer to.
8989f05b35a2Smrg
899067ab2ff2Smrg# This is to help aclocal find these macros, as it can't see m4_define.
899167ab2ff2SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8992e0963edeSmrg
899367ab2ff2Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
899467ab2ff2Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
899567ab2ff2Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
899667ab2ff2Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
899767ab2ff2Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
899867ab2ff2Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
899967ab2ff2Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
900067ab2ff2Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
900167ab2ff2Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
900267ab2ff2Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
900367ab2ff2Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
900467ab2ff2Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
900567ab2ff2Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
900667ab2ff2Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
900767ab2ff2Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
900867ab2ff2Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
900967ab2ff2Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
901067ab2ff2Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
901167ab2ff2Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
901267ab2ff2Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
901367ab2ff2Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
901467ab2ff2Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
901567ab2ff2Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
901667ab2ff2Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
901767ab2ff2Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
901867ab2ff2Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
901967ab2ff2Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
902067ab2ff2Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
902167ab2ff2Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
902267ab2ff2Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
902367ab2ff2Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
902467ab2ff2Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
902567ab2ff2Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
902667ab2ff2Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
902767ab2ff2Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
902867ab2ff2Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
902967ab2ff2Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
903067ab2ff2Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
903167ab2ff2Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
903267ab2ff2Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
903367ab2ff2Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
903467ab2ff2Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
903567ab2ff2Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
903667ab2ff2Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
903767ab2ff2Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
903867ab2ff2Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
903967ab2ff2Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
904067ab2ff2Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
904167ab2ff2Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
904267ab2ff2Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
904367ab2ff2Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
904467ab2ff2Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
904567ab2ff2Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
904667ab2ff2Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
904767ab2ff2Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
904867ab2ff2Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
904967ab2ff2Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
905067ab2ff2Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
905167ab2ff2Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
905267ab2ff2Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
905367ab2ff2Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
905467ab2ff2Smrg
9055b3a827e2Smrg# pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
9056b3a827e2Smrg# serial 11 (pkg-config-0.29.1)
9057e494fffdSmrg
9058b3a827e2Smrgdnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
9059b3a827e2Smrgdnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
9060b3a827e2Smrgdnl
9061b3a827e2Smrgdnl This program is free software; you can redistribute it and/or modify
9062b3a827e2Smrgdnl it under the terms of the GNU General Public License as published by
9063b3a827e2Smrgdnl the Free Software Foundation; either version 2 of the License, or
9064b3a827e2Smrgdnl (at your option) any later version.
9065b3a827e2Smrgdnl
9066b3a827e2Smrgdnl This program is distributed in the hope that it will be useful, but
9067b3a827e2Smrgdnl WITHOUT ANY WARRANTY; without even the implied warranty of
9068b3a827e2Smrgdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9069b3a827e2Smrgdnl General Public License for more details.
9070b3a827e2Smrgdnl
9071b3a827e2Smrgdnl You should have received a copy of the GNU General Public License
9072b3a827e2Smrgdnl along with this program; if not, write to the Free Software
9073b3a827e2Smrgdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
9074b3a827e2Smrgdnl 02111-1307, USA.
9075b3a827e2Smrgdnl
9076b3a827e2Smrgdnl As a special exception to the GNU General Public License, if you
9077b3a827e2Smrgdnl distribute this file as part of a program that contains a
9078b3a827e2Smrgdnl configuration script generated by Autoconf, you may include it under
9079b3a827e2Smrgdnl the same distribution terms that you use for the rest of that
9080b3a827e2Smrgdnl program.
9081b3a827e2Smrg
9082b3a827e2Smrgdnl PKG_PREREQ(MIN-VERSION)
9083b3a827e2Smrgdnl -----------------------
9084b3a827e2Smrgdnl Since: 0.29
9085b3a827e2Smrgdnl
9086b3a827e2Smrgdnl Verify that the version of the pkg-config macros are at least
9087b3a827e2Smrgdnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
9088b3a827e2Smrgdnl installed version of pkg-config, this checks the developer's version
9089b3a827e2Smrgdnl of pkg.m4 when generating configure.
9090b3a827e2Smrgdnl
9091b3a827e2Smrgdnl To ensure that this macro is defined, also add:
9092b3a827e2Smrgdnl m4_ifndef([PKG_PREREQ],
9093b3a827e2Smrgdnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
9094b3a827e2Smrgdnl
9095b3a827e2Smrgdnl See the "Since" comment for each macro you use to see what version
9096b3a827e2Smrgdnl of the macros you require.
9097b3a827e2Smrgm4_defun([PKG_PREREQ],
9098b3a827e2Smrg[m4_define([PKG_MACROS_VERSION], [0.29.1])
9099b3a827e2Smrgm4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
9100b3a827e2Smrg    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
9101b3a827e2Smrg])dnl PKG_PREREQ
9102b3a827e2Smrg
9103b3a827e2Smrgdnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
9104b3a827e2Smrgdnl ----------------------------------
9105b3a827e2Smrgdnl Since: 0.16
9106b3a827e2Smrgdnl
9107b3a827e2Smrgdnl Search for the pkg-config tool and set the PKG_CONFIG variable to
9108b3a827e2Smrgdnl first found in the path. Checks that the version of pkg-config found
9109b3a827e2Smrgdnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
9110b3a827e2Smrgdnl used since that's the first version where most current features of
9111b3a827e2Smrgdnl pkg-config existed.
9112e494fffdSmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
9113e494fffdSmrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
9114b3a827e2Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
9115b3a827e2Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
9116b3a827e2SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
9117b3a827e2SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
9118b3a827e2SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
9119b3a827e2Smrg
9120e494fffdSmrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9121e494fffdSmrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
9122e494fffdSmrgfi
9123e494fffdSmrgif test -n "$PKG_CONFIG"; then
9124e494fffdSmrg	_pkg_min_version=m4_default([$1], [0.9.0])
9125e494fffdSmrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
9126e494fffdSmrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9127e494fffdSmrg		AC_MSG_RESULT([yes])
9128e494fffdSmrg	else
9129e494fffdSmrg		AC_MSG_RESULT([no])
9130e494fffdSmrg		PKG_CONFIG=""
9131e494fffdSmrg	fi
9132e494fffdSmrgfi[]dnl
9133b3a827e2Smrg])dnl PKG_PROG_PKG_CONFIG
9134e494fffdSmrg
9135b3a827e2Smrgdnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9136b3a827e2Smrgdnl -------------------------------------------------------------------
9137b3a827e2Smrgdnl Since: 0.18
9138b3a827e2Smrgdnl
9139b3a827e2Smrgdnl Check to see whether a particular set of modules exists. Similar to
9140b3a827e2Smrgdnl PKG_CHECK_MODULES(), but does not set variables or print errors.
9141b3a827e2Smrgdnl
9142b3a827e2Smrgdnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9143b3a827e2Smrgdnl only at the first occurence in configure.ac, so if the first place
9144b3a827e2Smrgdnl it's called might be skipped (such as if it is within an "if", you
9145b3a827e2Smrgdnl have to call PKG_CHECK_EXISTS manually
9146e494fffdSmrgAC_DEFUN([PKG_CHECK_EXISTS],
9147e494fffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9148e494fffdSmrgif test -n "$PKG_CONFIG" && \
9149e494fffdSmrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
9150b3a827e2Smrg  m4_default([$2], [:])
9151e494fffdSmrgm4_ifvaln([$3], [else
9152e494fffdSmrg  $3])dnl
9153e494fffdSmrgfi])
9154e494fffdSmrg
9155b3a827e2Smrgdnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
9156b3a827e2Smrgdnl ---------------------------------------------
9157b3a827e2Smrgdnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
9158b3a827e2Smrgdnl pkg_failed based on the result.
9159e494fffdSmrgm4_define([_PKG_CONFIG],
9160e494fffdSmrg[if test -n "$$1"; then
9161e494fffdSmrg    pkg_cv_[]$1="$$1"
9162e494fffdSmrg elif test -n "$PKG_CONFIG"; then
9163e494fffdSmrg    PKG_CHECK_EXISTS([$3],
9164b3a827e2Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
9165b3a827e2Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
9166e494fffdSmrg		     [pkg_failed=yes])
9167e494fffdSmrg else
9168e494fffdSmrg    pkg_failed=untried
9169e494fffdSmrgfi[]dnl
9170b3a827e2Smrg])dnl _PKG_CONFIG
9171e494fffdSmrg
9172b3a827e2Smrgdnl _PKG_SHORT_ERRORS_SUPPORTED
9173b3a827e2Smrgdnl ---------------------------
9174b3a827e2Smrgdnl Internal check to see if pkg-config supports short errors.
9175e494fffdSmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
9176e494fffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
9177e494fffdSmrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
9178e494fffdSmrg        _pkg_short_errors_supported=yes
9179e494fffdSmrgelse
9180e494fffdSmrg        _pkg_short_errors_supported=no
9181e494fffdSmrgfi[]dnl
9182b3a827e2Smrg])dnl _PKG_SHORT_ERRORS_SUPPORTED
9183e494fffdSmrg
9184e494fffdSmrg
9185b3a827e2Smrgdnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9186b3a827e2Smrgdnl   [ACTION-IF-NOT-FOUND])
9187b3a827e2Smrgdnl --------------------------------------------------------------
9188b3a827e2Smrgdnl Since: 0.4.0
9189b3a827e2Smrgdnl
9190b3a827e2Smrgdnl Note that if there is a possibility the first call to
9191b3a827e2Smrgdnl PKG_CHECK_MODULES might not happen, you should be sure to include an
9192b3a827e2Smrgdnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
9193e494fffdSmrgAC_DEFUN([PKG_CHECK_MODULES],
9194e494fffdSmrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9195e494fffdSmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
9196e494fffdSmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
9197e494fffdSmrg
9198e494fffdSmrgpkg_failed=no
9199e494fffdSmrgAC_MSG_CHECKING([for $1])
9200e494fffdSmrg
9201e494fffdSmrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
9202e494fffdSmrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
9203e494fffdSmrg
9204e494fffdSmrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
9205e494fffdSmrgand $1[]_LIBS to avoid the need to call pkg-config.
9206e494fffdSmrgSee the pkg-config man page for more details.])
9207e494fffdSmrg
9208e494fffdSmrgif test $pkg_failed = yes; then
9209b3a827e2Smrg   	AC_MSG_RESULT([no])
9210e494fffdSmrg        _PKG_SHORT_ERRORS_SUPPORTED
9211e494fffdSmrg        if test $_pkg_short_errors_supported = yes; then
9212b3a827e2Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
9213e494fffdSmrg        else 
9214b3a827e2Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
9215e494fffdSmrg        fi
9216e494fffdSmrg	# Put the nasty error message in config.log where it belongs
9217e494fffdSmrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
9218e494fffdSmrg
9219b3a827e2Smrg	m4_default([$4], [AC_MSG_ERROR(
9220e494fffdSmrg[Package requirements ($2) were not met:
9221e494fffdSmrg
9222e494fffdSmrg$$1_PKG_ERRORS
9223e494fffdSmrg
9224e494fffdSmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
9225e494fffdSmrginstalled software in a non-standard prefix.
9226e494fffdSmrg
9227b3a827e2Smrg_PKG_TEXT])[]dnl
9228b3a827e2Smrg        ])
9229e494fffdSmrgelif test $pkg_failed = untried; then
9230b3a827e2Smrg     	AC_MSG_RESULT([no])
9231b3a827e2Smrg	m4_default([$4], [AC_MSG_FAILURE(
9232e494fffdSmrg[The pkg-config script could not be found or is too old.  Make sure it
9233e494fffdSmrgis in your PATH or set the PKG_CONFIG environment variable to the full
9234e494fffdSmrgpath to pkg-config.
9235e494fffdSmrg
9236e494fffdSmrg_PKG_TEXT
9237e494fffdSmrg
9238b3a827e2SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
9239b3a827e2Smrg        ])
9240e494fffdSmrgelse
9241e494fffdSmrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
9242e494fffdSmrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
9243e494fffdSmrg        AC_MSG_RESULT([yes])
9244b3a827e2Smrg	$3
9245e494fffdSmrgfi[]dnl
9246b3a827e2Smrg])dnl PKG_CHECK_MODULES
9247b3a827e2Smrg
9248b3a827e2Smrg
9249b3a827e2Smrgdnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
9250b3a827e2Smrgdnl   [ACTION-IF-NOT-FOUND])
9251b3a827e2Smrgdnl ---------------------------------------------------------------------
9252b3a827e2Smrgdnl Since: 0.29
9253b3a827e2Smrgdnl
9254b3a827e2Smrgdnl Checks for existence of MODULES and gathers its build flags with
9255b3a827e2Smrgdnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
9256b3a827e2Smrgdnl and VARIABLE-PREFIX_LIBS from --libs.
9257b3a827e2Smrgdnl
9258b3a827e2Smrgdnl Note that if there is a possibility the first call to
9259b3a827e2Smrgdnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
9260b3a827e2Smrgdnl include an explicit call to PKG_PROG_PKG_CONFIG in your
9261b3a827e2Smrgdnl configure.ac.
9262b3a827e2SmrgAC_DEFUN([PKG_CHECK_MODULES_STATIC],
9263b3a827e2Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9264b3a827e2Smrg_save_PKG_CONFIG=$PKG_CONFIG
9265b3a827e2SmrgPKG_CONFIG="$PKG_CONFIG --static"
9266b3a827e2SmrgPKG_CHECK_MODULES($@)
9267b3a827e2SmrgPKG_CONFIG=$_save_PKG_CONFIG[]dnl
9268b3a827e2Smrg])dnl PKG_CHECK_MODULES_STATIC
9269b3a827e2Smrg
9270b3a827e2Smrg
9271b3a827e2Smrgdnl PKG_INSTALLDIR([DIRECTORY])
9272b3a827e2Smrgdnl -------------------------
9273b3a827e2Smrgdnl Since: 0.27
9274b3a827e2Smrgdnl
9275b3a827e2Smrgdnl Substitutes the variable pkgconfigdir as the location where a module
9276b3a827e2Smrgdnl should install pkg-config .pc files. By default the directory is
9277b3a827e2Smrgdnl $libdir/pkgconfig, but the default can be changed by passing
9278b3a827e2Smrgdnl DIRECTORY. The user can override through the --with-pkgconfigdir
9279b3a827e2Smrgdnl parameter.
9280b3a827e2SmrgAC_DEFUN([PKG_INSTALLDIR],
9281b3a827e2Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
9282b3a827e2Smrgm4_pushdef([pkg_description],
9283b3a827e2Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
9284b3a827e2SmrgAC_ARG_WITH([pkgconfigdir],
9285b3a827e2Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
9286b3a827e2Smrg    [with_pkgconfigdir=]pkg_default)
9287b3a827e2SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
9288b3a827e2Smrgm4_popdef([pkg_default])
9289b3a827e2Smrgm4_popdef([pkg_description])
9290b3a827e2Smrg])dnl PKG_INSTALLDIR
9291b3a827e2Smrg
9292b3a827e2Smrg
9293b3a827e2Smrgdnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
9294b3a827e2Smrgdnl --------------------------------
9295b3a827e2Smrgdnl Since: 0.27
9296b3a827e2Smrgdnl
9297b3a827e2Smrgdnl Substitutes the variable noarch_pkgconfigdir as the location where a
9298b3a827e2Smrgdnl module should install arch-independent pkg-config .pc files. By
9299b3a827e2Smrgdnl default the directory is $datadir/pkgconfig, but the default can be
9300b3a827e2Smrgdnl changed by passing DIRECTORY. The user can override through the
9301b3a827e2Smrgdnl --with-noarch-pkgconfigdir parameter.
9302b3a827e2SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
9303b3a827e2Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
9304b3a827e2Smrgm4_pushdef([pkg_description],
9305b3a827e2Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
9306b3a827e2SmrgAC_ARG_WITH([noarch-pkgconfigdir],
9307b3a827e2Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
9308b3a827e2Smrg    [with_noarch_pkgconfigdir=]pkg_default)
9309b3a827e2SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
9310b3a827e2Smrgm4_popdef([pkg_default])
9311b3a827e2Smrgm4_popdef([pkg_description])
9312b3a827e2Smrg])dnl PKG_NOARCH_INSTALLDIR
9313b3a827e2Smrg
9314b3a827e2Smrg
9315b3a827e2Smrgdnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
9316b3a827e2Smrgdnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
9317b3a827e2Smrgdnl -------------------------------------------
9318b3a827e2Smrgdnl Since: 0.28
9319b3a827e2Smrgdnl
9320b3a827e2Smrgdnl Retrieves the value of the pkg-config variable for the given module.
9321b3a827e2SmrgAC_DEFUN([PKG_CHECK_VAR],
9322b3a827e2Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
9323b3a827e2SmrgAC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
9324b3a827e2Smrg
9325b3a827e2Smrg_PKG_CONFIG([$1], [variable="][$3]["], [$2])
9326b3a827e2SmrgAS_VAR_COPY([$1], [pkg_cv_][$1])
9327b3a827e2Smrg
9328b3a827e2SmrgAS_VAR_IF([$1], [""], [$5], [$4])dnl
9329b3a827e2Smrg])dnl PKG_CHECK_VAR
9330b3a827e2Smrg
9331b3a827e2Smrgdnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
9332b3a827e2Smrgdnl   [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
9333b3a827e2Smrgdnl   [DESCRIPTION], [DEFAULT])
9334b3a827e2Smrgdnl ------------------------------------------
9335b3a827e2Smrgdnl
9336b3a827e2Smrgdnl Prepare a "--with-" configure option using the lowercase
9337b3a827e2Smrgdnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
9338b3a827e2Smrgdnl PKG_CHECK_MODULES in a single macro.
9339b3a827e2SmrgAC_DEFUN([PKG_WITH_MODULES],
9340b3a827e2Smrg[
9341b3a827e2Smrgm4_pushdef([with_arg], m4_tolower([$1]))
9342b3a827e2Smrg
9343b3a827e2Smrgm4_pushdef([description],
9344b3a827e2Smrg           [m4_default([$5], [build with ]with_arg[ support])])
9345b3a827e2Smrg
9346b3a827e2Smrgm4_pushdef([def_arg], [m4_default([$6], [auto])])
9347b3a827e2Smrgm4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
9348b3a827e2Smrgm4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
9349b3a827e2Smrg
9350b3a827e2Smrgm4_case(def_arg,
9351b3a827e2Smrg            [yes],[m4_pushdef([with_without], [--without-]with_arg)],
9352b3a827e2Smrg            [m4_pushdef([with_without],[--with-]with_arg)])
9353b3a827e2Smrg
9354b3a827e2SmrgAC_ARG_WITH(with_arg,
9355b3a827e2Smrg     AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
9356b3a827e2Smrg    [AS_TR_SH([with_]with_arg)=def_arg])
9357b3a827e2Smrg
9358b3a827e2SmrgAS_CASE([$AS_TR_SH([with_]with_arg)],
9359b3a827e2Smrg            [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
9360b3a827e2Smrg            [auto],[PKG_CHECK_MODULES([$1],[$2],
9361b3a827e2Smrg                                        [m4_n([def_action_if_found]) $3],
9362b3a827e2Smrg                                        [m4_n([def_action_if_not_found]) $4])])
9363b3a827e2Smrg
9364b3a827e2Smrgm4_popdef([with_arg])
9365b3a827e2Smrgm4_popdef([description])
9366b3a827e2Smrgm4_popdef([def_arg])
9367b3a827e2Smrg
9368b3a827e2Smrg])dnl PKG_WITH_MODULES
9369b3a827e2Smrg
9370b3a827e2Smrgdnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
9371b3a827e2Smrgdnl   [DESCRIPTION], [DEFAULT])
9372b3a827e2Smrgdnl -----------------------------------------------
9373b3a827e2Smrgdnl
9374b3a827e2Smrgdnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
9375b3a827e2Smrgdnl check._[VARIABLE-PREFIX] is exported as make variable.
9376b3a827e2SmrgAC_DEFUN([PKG_HAVE_WITH_MODULES],
9377b3a827e2Smrg[
9378b3a827e2SmrgPKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
9379b3a827e2Smrg
9380b3a827e2SmrgAM_CONDITIONAL([HAVE_][$1],
9381b3a827e2Smrg               [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
9382b3a827e2Smrg])dnl PKG_HAVE_WITH_MODULES
9383b3a827e2Smrg
9384b3a827e2Smrgdnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
9385b3a827e2Smrgdnl   [DESCRIPTION], [DEFAULT])
9386b3a827e2Smrgdnl ------------------------------------------------------
9387b3a827e2Smrgdnl
9388b3a827e2Smrgdnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
9389b3a827e2Smrgdnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
9390b3a827e2Smrgdnl and preprocessor variable.
9391b3a827e2SmrgAC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
9392b3a827e2Smrg[
9393b3a827e2SmrgPKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
9394b3a827e2Smrg
9395b3a827e2SmrgAS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
9396b3a827e2Smrg        [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
9397b3a827e2Smrg])dnl PKG_HAVE_DEFINE_WITH_MODULES
9398e494fffdSmrg
939967ab2ff2Smrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
940067ab2ff2Smrgdnl
940167ab2ff2Smrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9402b3a827e2Smrgdnl
940367ab2ff2Smrgdnl Permission is hereby granted, free of charge, to any person obtaining a
940467ab2ff2Smrgdnl copy of this software and associated documentation files (the "Software"),
940567ab2ff2Smrgdnl to deal in the Software without restriction, including without limitation
940667ab2ff2Smrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
940767ab2ff2Smrgdnl and/or sell copies of the Software, and to permit persons to whom the
940867ab2ff2Smrgdnl Software is furnished to do so, subject to the following conditions:
940967ab2ff2Smrgdnl
941067ab2ff2Smrgdnl The above copyright notice and this permission notice (including the next
941167ab2ff2Smrgdnl paragraph) shall be included in all copies or substantial portions of the
941267ab2ff2Smrgdnl Software.
941367ab2ff2Smrgdnl
941467ab2ff2Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
941567ab2ff2Smrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
941667ab2ff2Smrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
941767ab2ff2Smrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
941867ab2ff2Smrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
941967ab2ff2Smrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
942067ab2ff2Smrgdnl DEALINGS IN THE SOFTWARE.
9421e0963edeSmrg
942267ab2ff2Smrg# XORG_MACROS_VERSION(required-version)
942367ab2ff2Smrg# -------------------------------------
942467ab2ff2Smrg# Minimum version: 1.1.0
942567ab2ff2Smrg#
942667ab2ff2Smrg# If you're using a macro added in Version 1.1 or newer, include this in
942767ab2ff2Smrg# your configure.ac with the minimum required version, such as:
942867ab2ff2Smrg# XORG_MACROS_VERSION(1.1)
942967ab2ff2Smrg#
943067ab2ff2Smrg# To ensure that this macro is defined, also add:
943167ab2ff2Smrg# m4_ifndef([XORG_MACROS_VERSION],
943267ab2ff2Smrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
943367ab2ff2Smrg#
943467ab2ff2Smrg#
9435b3a827e2Smrg# See the "minimum version" comment for each macro you use to see what
943667ab2ff2Smrg# version you require.
943767ab2ff2Smrgm4_defun([XORG_MACROS_VERSION],[
9438b3a827e2Smrgm4_define([vers_have], [1.19.0])
943967ab2ff2Smrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
944067ab2ff2Smrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
944167ab2ff2Smrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
944267ab2ff2Smrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
944367ab2ff2Smrgm4_if(m4_version_compare(vers_have, [$1]), -1,
944467ab2ff2Smrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
944567ab2ff2Smrgm4_undefine([vers_have])
944667ab2ff2Smrgm4_undefine([maj_have])
944767ab2ff2Smrgm4_undefine([maj_needed])
944867ab2ff2Smrg]) # XORG_MACROS_VERSION
9449e0963edeSmrg
945067ab2ff2Smrg# XORG_PROG_RAWCPP()
945167ab2ff2Smrg# ------------------
945267ab2ff2Smrg# Minimum version: 1.0.0
945367ab2ff2Smrg#
945467ab2ff2Smrg# Find cpp program and necessary flags for use in pre-processing text files
945567ab2ff2Smrg# such as man pages and config files
945667ab2ff2SmrgAC_DEFUN([XORG_PROG_RAWCPP],[
945767ab2ff2SmrgAC_REQUIRE([AC_PROG_CPP])
9458b3a827e2SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
945967ab2ff2Smrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9460e0963edeSmrg
946167ab2ff2Smrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
946267ab2ff2Smrg# which is not the best choice for supporting other OS'es, but covers most
946367ab2ff2Smrg# of the ones we need for now.
946467ab2ff2SmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
946567ab2ff2SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
946667ab2ff2Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
946767ab2ff2Smrg	AC_MSG_RESULT([no])
946867ab2ff2Smrgelse
946967ab2ff2Smrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
947067ab2ff2Smrg		RAWCPPFLAGS=-undef
947167ab2ff2Smrg		AC_MSG_RESULT([yes])
947267ab2ff2Smrg	# under Cygwin unix is still defined even with -undef
947367ab2ff2Smrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
947467ab2ff2Smrg		RAWCPPFLAGS="-undef -ansi"
947567ab2ff2Smrg		AC_MSG_RESULT([yes, with -ansi])
947667ab2ff2Smrg	else
947767ab2ff2Smrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
947867ab2ff2Smrg	fi
947967ab2ff2Smrgfi
948067ab2ff2Smrgrm -f conftest.$ac_ext
948149e108a1Smrg
948267ab2ff2SmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
948367ab2ff2SmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
948467ab2ff2Smrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
948567ab2ff2Smrg	AC_MSG_RESULT([no])
948667ab2ff2Smrgelse
948767ab2ff2Smrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9488b3a827e2Smrg		TRADITIONALCPPFLAGS="-traditional"
948967ab2ff2Smrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
949067ab2ff2Smrg		AC_MSG_RESULT([yes])
949167ab2ff2Smrg	else
949267ab2ff2Smrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
949367ab2ff2Smrg	fi
949467ab2ff2Smrgfi
949567ab2ff2Smrgrm -f conftest.$ac_ext
949667ab2ff2SmrgAC_SUBST(RAWCPPFLAGS)
9497b3a827e2SmrgAC_SUBST(TRADITIONALCPPFLAGS)
949867ab2ff2Smrg]) # XORG_PROG_RAWCPP
949949e108a1Smrg
950067ab2ff2Smrg# XORG_MANPAGE_SECTIONS()
950167ab2ff2Smrg# -----------------------
950267ab2ff2Smrg# Minimum version: 1.0.0
950367ab2ff2Smrg#
950467ab2ff2Smrg# Determine which sections man pages go in for the different man page types
950567ab2ff2Smrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
950667ab2ff2Smrg# Not sure if there's any better way than just hardcoding by OS name.
950767ab2ff2Smrg# Override default settings by setting environment variables
950867ab2ff2Smrg# Added MAN_SUBSTS in version 1.8
950967ab2ff2Smrg# Added AC_PROG_SED in version 1.8
951049e108a1Smrg
951167ab2ff2SmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
951267ab2ff2SmrgAC_REQUIRE([AC_CANONICAL_HOST])
951367ab2ff2SmrgAC_REQUIRE([AC_PROG_SED])
951449e108a1Smrg
951567ab2ff2Smrgif test x$APP_MAN_SUFFIX = x    ; then
951667ab2ff2Smrg    APP_MAN_SUFFIX=1
951767ab2ff2Smrgfi
951867ab2ff2Smrgif test x$APP_MAN_DIR = x    ; then
951967ab2ff2Smrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
952067ab2ff2Smrgfi
952149e108a1Smrg
952267ab2ff2Smrgif test x$LIB_MAN_SUFFIX = x    ; then
952367ab2ff2Smrg    LIB_MAN_SUFFIX=3
952467ab2ff2Smrgfi
952567ab2ff2Smrgif test x$LIB_MAN_DIR = x    ; then
952667ab2ff2Smrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
952767ab2ff2Smrgfi
952849e108a1Smrg
952967ab2ff2Smrgif test x$FILE_MAN_SUFFIX = x    ; then
953067ab2ff2Smrg    case $host_os in
953167ab2ff2Smrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
953267ab2ff2Smrg	*)		FILE_MAN_SUFFIX=5  ;;
953367ab2ff2Smrg    esac
953467ab2ff2Smrgfi
953567ab2ff2Smrgif test x$FILE_MAN_DIR = x    ; then
953667ab2ff2Smrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
953767ab2ff2Smrgfi
953849e108a1Smrg
953967ab2ff2Smrgif test x$MISC_MAN_SUFFIX = x    ; then
954067ab2ff2Smrg    case $host_os in
954167ab2ff2Smrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
954267ab2ff2Smrg	*)		MISC_MAN_SUFFIX=7  ;;
954367ab2ff2Smrg    esac
954467ab2ff2Smrgfi
954567ab2ff2Smrgif test x$MISC_MAN_DIR = x    ; then
954667ab2ff2Smrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
954767ab2ff2Smrgfi
954849e108a1Smrg
954967ab2ff2Smrgif test x$DRIVER_MAN_SUFFIX = x    ; then
955067ab2ff2Smrg    case $host_os in
955167ab2ff2Smrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
955267ab2ff2Smrg	*)		DRIVER_MAN_SUFFIX=4  ;;
955367ab2ff2Smrg    esac
955467ab2ff2Smrgfi
955567ab2ff2Smrgif test x$DRIVER_MAN_DIR = x    ; then
955667ab2ff2Smrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
955767ab2ff2Smrgfi
9558e0963edeSmrg
955967ab2ff2Smrgif test x$ADMIN_MAN_SUFFIX = x    ; then
956067ab2ff2Smrg    case $host_os in
956167ab2ff2Smrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
956267ab2ff2Smrg	*)		ADMIN_MAN_SUFFIX=8  ;;
956367ab2ff2Smrg    esac
956467ab2ff2Smrgfi
956567ab2ff2Smrgif test x$ADMIN_MAN_DIR = x    ; then
956667ab2ff2Smrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
956767ab2ff2Smrgfi
9568e0963edeSmrg
9569e0963edeSmrg
957067ab2ff2SmrgAC_SUBST([APP_MAN_SUFFIX])
957167ab2ff2SmrgAC_SUBST([LIB_MAN_SUFFIX])
957267ab2ff2SmrgAC_SUBST([FILE_MAN_SUFFIX])
957367ab2ff2SmrgAC_SUBST([MISC_MAN_SUFFIX])
957467ab2ff2SmrgAC_SUBST([DRIVER_MAN_SUFFIX])
957567ab2ff2SmrgAC_SUBST([ADMIN_MAN_SUFFIX])
957667ab2ff2SmrgAC_SUBST([APP_MAN_DIR])
957767ab2ff2SmrgAC_SUBST([LIB_MAN_DIR])
957867ab2ff2SmrgAC_SUBST([FILE_MAN_DIR])
957967ab2ff2SmrgAC_SUBST([MISC_MAN_DIR])
958067ab2ff2SmrgAC_SUBST([DRIVER_MAN_DIR])
958167ab2ff2SmrgAC_SUBST([ADMIN_MAN_DIR])
9582e0963edeSmrg
958367ab2ff2SmrgXORG_MAN_PAGE="X Version 11"
958467ab2ff2SmrgAC_SUBST([XORG_MAN_PAGE])
958567ab2ff2SmrgMAN_SUBSTS="\
958667ab2ff2Smrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
958767ab2ff2Smrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
958867ab2ff2Smrg	-e 's|__xservername__|Xorg|g' \
958967ab2ff2Smrg	-e 's|__xconfigfile__|xorg.conf|g' \
959067ab2ff2Smrg	-e 's|__projectroot__|\$(prefix)|g' \
959167ab2ff2Smrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
959267ab2ff2Smrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
959367ab2ff2Smrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
959467ab2ff2Smrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
959567ab2ff2Smrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
959667ab2ff2Smrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
959767ab2ff2Smrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
959867ab2ff2SmrgAC_SUBST([MAN_SUBSTS])
9599f05b35a2Smrg
960067ab2ff2Smrg]) # XORG_MANPAGE_SECTIONS
9601f05b35a2Smrg
960267ab2ff2Smrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
960367ab2ff2Smrg# ------------------------
960467ab2ff2Smrg# Minimum version: 1.7.0
960567ab2ff2Smrg#
960667ab2ff2Smrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
960767ab2ff2Smrg# provided by xorg-sgml-doctools, if installed.
960867ab2ff2SmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
960967ab2ff2SmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
961067ab2ff2SmrgXORG_SGML_PATH=
961167ab2ff2SmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
961267ab2ff2Smrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
961367ab2ff2Smrg    [m4_ifval([$1],[:],
961467ab2ff2Smrg        [if test x"$cross_compiling" != x"yes" ; then
961567ab2ff2Smrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
961667ab2ff2Smrg                          [XORG_SGML_PATH=$prefix/share/sgml])
961767ab2ff2Smrg         fi])
961867ab2ff2Smrg    ])
9619f05b35a2Smrg
962067ab2ff2Smrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
962167ab2ff2Smrg# the path and the name of the doc stylesheet
962267ab2ff2Smrgif test "x$XORG_SGML_PATH" != "x" ; then
962367ab2ff2Smrg   AC_MSG_RESULT([$XORG_SGML_PATH])
962467ab2ff2Smrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
962567ab2ff2Smrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
962667ab2ff2Smrgelse
962767ab2ff2Smrg   AC_MSG_RESULT([no])
962867ab2ff2Smrgfi
9629f05b35a2Smrg
963067ab2ff2SmrgAC_SUBST(XORG_SGML_PATH)
963167ab2ff2SmrgAC_SUBST(STYLESHEET_SRCDIR)
963267ab2ff2SmrgAC_SUBST(XSL_STYLESHEET)
963367ab2ff2SmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
963467ab2ff2Smrg]) # XORG_CHECK_SGML_DOCTOOLS
9635e0963edeSmrg
963667ab2ff2Smrg# XORG_CHECK_LINUXDOC
963767ab2ff2Smrg# -------------------
963867ab2ff2Smrg# Minimum version: 1.0.0
963967ab2ff2Smrg#
964067ab2ff2Smrg# Defines the variable MAKE_TEXT if the necessary tools and
964167ab2ff2Smrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
964267ab2ff2Smrg# Whether or not the necessary tools and files are found can be checked
964367ab2ff2Smrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
964467ab2ff2SmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
964567ab2ff2SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
964667ab2ff2SmrgAC_REQUIRE([XORG_WITH_PS2PDF])
9647f05b35a2Smrg
964867ab2ff2SmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
9649e0963edeSmrg
965067ab2ff2SmrgAC_MSG_CHECKING([whether to build documentation])
9651e0963edeSmrg
965267ab2ff2Smrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
965367ab2ff2Smrg   BUILDDOC=yes
965467ab2ff2Smrgelse
965567ab2ff2Smrg   BUILDDOC=no
965667ab2ff2Smrgfi
9657e0963edeSmrg
965867ab2ff2SmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
9659e0963edeSmrg
966067ab2ff2SmrgAC_MSG_RESULT([$BUILDDOC])
9661e0963edeSmrg
966267ab2ff2SmrgAC_MSG_CHECKING([whether to build pdf documentation])
9663e0963edeSmrg
966467ab2ff2Smrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
966567ab2ff2Smrg   BUILDPDFDOC=yes
966667ab2ff2Smrgelse
966767ab2ff2Smrg   BUILDPDFDOC=no
966867ab2ff2Smrgfi
9669f05b35a2Smrg
967067ab2ff2SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
9671e0963edeSmrg
967267ab2ff2SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9673e0963edeSmrg
967467ab2ff2SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
967567ab2ff2SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
967667ab2ff2SmrgMAKE_PDF="$PS2PDF"
967767ab2ff2SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
967849e108a1Smrg
967967ab2ff2SmrgAC_SUBST(MAKE_TEXT)
968067ab2ff2SmrgAC_SUBST(MAKE_PS)
968167ab2ff2SmrgAC_SUBST(MAKE_PDF)
968267ab2ff2SmrgAC_SUBST(MAKE_HTML)
968367ab2ff2Smrg]) # XORG_CHECK_LINUXDOC
968449e108a1Smrg
968567ab2ff2Smrg# XORG_CHECK_DOCBOOK
968667ab2ff2Smrg# -------------------
968767ab2ff2Smrg# Minimum version: 1.0.0
968867ab2ff2Smrg#
968967ab2ff2Smrg# Checks for the ability to build output formats from SGML DocBook source.
969067ab2ff2Smrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
969167ab2ff2Smrg# indicates whether the necessary tools and files are found and, if set,
969267ab2ff2Smrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
969367ab2ff2SmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
969467ab2ff2SmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
9695e0963edeSmrg
969667ab2ff2SmrgBUILDTXTDOC=no
969767ab2ff2SmrgBUILDPDFDOC=no
969867ab2ff2SmrgBUILDPSDOC=no
969967ab2ff2SmrgBUILDHTMLDOC=no
9700e0963edeSmrg
970167ab2ff2SmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
970267ab2ff2SmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
970367ab2ff2SmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
970467ab2ff2SmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
9705e0963edeSmrg
970667ab2ff2SmrgAC_MSG_CHECKING([whether to build text documentation])
970767ab2ff2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
970867ab2ff2Smrg   test x$BUILD_TXTDOC != xno; then
970967ab2ff2Smrg	BUILDTXTDOC=yes
971067ab2ff2Smrgfi
971167ab2ff2SmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
971267ab2ff2SmrgAC_MSG_RESULT([$BUILDTXTDOC])
9713e0963edeSmrg
971467ab2ff2SmrgAC_MSG_CHECKING([whether to build PDF documentation])
971567ab2ff2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
971667ab2ff2Smrg   test x$BUILD_PDFDOC != xno; then
971767ab2ff2Smrg	BUILDPDFDOC=yes
971867ab2ff2Smrgfi
971967ab2ff2SmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
972067ab2ff2SmrgAC_MSG_RESULT([$BUILDPDFDOC])
9721e0963edeSmrg
972267ab2ff2SmrgAC_MSG_CHECKING([whether to build PostScript documentation])
972367ab2ff2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
972467ab2ff2Smrg   test x$BUILD_PSDOC != xno; then
972567ab2ff2Smrg	BUILDPSDOC=yes
972667ab2ff2Smrgfi
972767ab2ff2SmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
972867ab2ff2SmrgAC_MSG_RESULT([$BUILDPSDOC])
9729e0963edeSmrg
973067ab2ff2SmrgAC_MSG_CHECKING([whether to build HTML documentation])
973167ab2ff2Smrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
973267ab2ff2Smrg   test x$BUILD_HTMLDOC != xno; then
973367ab2ff2Smrg	BUILDHTMLDOC=yes
973467ab2ff2Smrgfi
973567ab2ff2SmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
973667ab2ff2SmrgAC_MSG_RESULT([$BUILDHTMLDOC])
9737e0963edeSmrg
973867ab2ff2SmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
973967ab2ff2SmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
974067ab2ff2SmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
974167ab2ff2SmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
9742e0963edeSmrg
974367ab2ff2SmrgAC_SUBST(MAKE_TEXT)
974467ab2ff2SmrgAC_SUBST(MAKE_PS)
974567ab2ff2SmrgAC_SUBST(MAKE_PDF)
974667ab2ff2SmrgAC_SUBST(MAKE_HTML)
974767ab2ff2Smrg]) # XORG_CHECK_DOCBOOK
9748e0963edeSmrg
974967ab2ff2Smrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
975067ab2ff2Smrg# ----------------
975167ab2ff2Smrg# Minimum version: 1.5.0
975267ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.11.0
975367ab2ff2Smrg#
975467ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
975567ab2ff2Smrg# not at the appropriate level. This macro enables a module to test for the
975667ab2ff2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
975767ab2ff2Smrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
975867ab2ff2Smrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
975967ab2ff2Smrg# --with-xmlto assumes 'auto'.
976067ab2ff2Smrg#
976167ab2ff2Smrg# Interface to module:
976267ab2ff2Smrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
976367ab2ff2Smrg# XMLTO:	returns the path of the xmlto program found
976467ab2ff2Smrg#		returns the path set by the user in the environment
976567ab2ff2Smrg# --with-xmlto:	'yes' user instructs the module to use xmlto
976667ab2ff2Smrg#		'no' user instructs the module not to use xmlto
976767ab2ff2Smrg#
976867ab2ff2Smrg# Added in version 1.10.0
976967ab2ff2Smrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
977067ab2ff2Smrg#                  xmlto for text output requires either lynx, links, or w3m browsers
977167ab2ff2Smrg#
977267ab2ff2Smrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
977367ab2ff2Smrg#
977467ab2ff2SmrgAC_DEFUN([XORG_WITH_XMLTO],[
977567ab2ff2SmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
977667ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
977767ab2ff2SmrgAC_ARG_WITH(xmlto,
977867ab2ff2Smrg	AS_HELP_STRING([--with-xmlto],
977967ab2ff2Smrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
978067ab2ff2Smrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
978167ab2ff2Smrgm4_undefine([_defopt])
9782f05b35a2Smrg
978367ab2ff2Smrgif test "x$use_xmlto" = x"auto"; then
978467ab2ff2Smrg   AC_PATH_PROG([XMLTO], [xmlto])
978567ab2ff2Smrg   if test "x$XMLTO" = "x"; then
978667ab2ff2Smrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
978767ab2ff2Smrg	have_xmlto=no
978867ab2ff2Smrg   else
978967ab2ff2Smrg        have_xmlto=yes
979067ab2ff2Smrg   fi
979167ab2ff2Smrgelif test "x$use_xmlto" = x"yes" ; then
979267ab2ff2Smrg   AC_PATH_PROG([XMLTO], [xmlto])
979367ab2ff2Smrg   if test "x$XMLTO" = "x"; then
979467ab2ff2Smrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
979567ab2ff2Smrg   fi
979667ab2ff2Smrg   have_xmlto=yes
979767ab2ff2Smrgelif test "x$use_xmlto" = x"no" ; then
979867ab2ff2Smrg   if test "x$XMLTO" != "x"; then
979967ab2ff2Smrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
980067ab2ff2Smrg   fi
980167ab2ff2Smrg   have_xmlto=no
980267ab2ff2Smrgelse
980367ab2ff2Smrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
980467ab2ff2Smrgfi
9805e0963edeSmrg
980667ab2ff2Smrg# Test for a minimum version of xmlto, if provided.
980767ab2ff2Smrgm4_ifval([$1],
980867ab2ff2Smrg[if test "$have_xmlto" = yes; then
980967ab2ff2Smrg    # scrape the xmlto version
981067ab2ff2Smrg    AC_MSG_CHECKING([the xmlto version])
981167ab2ff2Smrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
981267ab2ff2Smrg    AC_MSG_RESULT([$xmlto_version])
981367ab2ff2Smrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
981467ab2ff2Smrg        [if test "x$use_xmlto" = xauto; then
981567ab2ff2Smrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
981667ab2ff2Smrg            have_xmlto=no
981767ab2ff2Smrg        else
981867ab2ff2Smrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
981967ab2ff2Smrg        fi])
982067ab2ff2Smrgfi])
9821e0963edeSmrg
982267ab2ff2Smrg# Test for the ability of xmlto to generate a text target
982367ab2ff2Smrghave_xmlto_text=no
982467ab2ff2Smrgcat > conftest.xml << "EOF"
982567ab2ff2SmrgEOF
982667ab2ff2SmrgAS_IF([test "$have_xmlto" = yes],
982767ab2ff2Smrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
982867ab2ff2Smrg             [have_xmlto_text=yes],
982967ab2ff2Smrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
983067ab2ff2Smrgrm -f conftest.xml
983167ab2ff2SmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
983267ab2ff2SmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
983367ab2ff2Smrg]) # XORG_WITH_XMLTO
983449e108a1Smrg
983567ab2ff2Smrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
983667ab2ff2Smrg# --------------------------------------------
983767ab2ff2Smrg# Minimum version: 1.12.0
983867ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.12.0
983967ab2ff2Smrg#
984067ab2ff2Smrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
984167ab2ff2Smrg# XML-based language used for the transformation of XML documents.
984267ab2ff2Smrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
984367ab2ff2Smrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
984467ab2ff2Smrg# The XSLT processor is often used as a standalone tool for transformations.
984567ab2ff2Smrg# It should not be assumed that this tool is used only to work with documnetation.
984667ab2ff2Smrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
984767ab2ff2Smrg#
984867ab2ff2Smrg# Interface to module:
984967ab2ff2Smrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
985067ab2ff2Smrg# XSLTPROC:	 returns the path of the xsltproc program found
985167ab2ff2Smrg#		 returns the path set by the user in the environment
985267ab2ff2Smrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
985367ab2ff2Smrg#		  'no' user instructs the module not to use xsltproc
985467ab2ff2Smrg# have_xsltproc: returns yes if xsltproc found in PATH or no
985567ab2ff2Smrg#
985667ab2ff2Smrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
985767ab2ff2Smrg#
985867ab2ff2SmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
985967ab2ff2SmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
986067ab2ff2Smrg# Preserves the interface, should it be implemented later
986167ab2ff2Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
986267ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
986367ab2ff2SmrgAC_ARG_WITH(xsltproc,
986467ab2ff2Smrg	AS_HELP_STRING([--with-xsltproc],
986567ab2ff2Smrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
986667ab2ff2Smrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
986767ab2ff2Smrgm4_undefine([_defopt])
986867ab2ff2Smrg
986967ab2ff2Smrgif test "x$use_xsltproc" = x"auto"; then
987067ab2ff2Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
987167ab2ff2Smrg   if test "x$XSLTPROC" = "x"; then
987267ab2ff2Smrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
987367ab2ff2Smrg	have_xsltproc=no
987467ab2ff2Smrg   else
987567ab2ff2Smrg        have_xsltproc=yes
987667ab2ff2Smrg   fi
987767ab2ff2Smrgelif test "x$use_xsltproc" = x"yes" ; then
987867ab2ff2Smrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
987967ab2ff2Smrg   if test "x$XSLTPROC" = "x"; then
988067ab2ff2Smrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
988167ab2ff2Smrg   fi
988267ab2ff2Smrg   have_xsltproc=yes
988367ab2ff2Smrgelif test "x$use_xsltproc" = x"no" ; then
988467ab2ff2Smrg   if test "x$XSLTPROC" != "x"; then
988567ab2ff2Smrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
988667ab2ff2Smrg   fi
988767ab2ff2Smrg   have_xsltproc=no
988867ab2ff2Smrgelse
988967ab2ff2Smrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
989067ab2ff2Smrgfi
989149e108a1Smrg
989267ab2ff2SmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
989367ab2ff2Smrg]) # XORG_WITH_XSLTPROC
989449e108a1Smrg
989567ab2ff2Smrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
989667ab2ff2Smrg# ----------------------------------------
989767ab2ff2Smrg# Minimum version: 1.15.0
989867ab2ff2Smrg#
989967ab2ff2Smrg# PERL (Practical Extraction and Report Language) is a language optimized for
990067ab2ff2Smrg# scanning arbitrary text files, extracting information from those text files,
990167ab2ff2Smrg# and printing reports based on that information.
990267ab2ff2Smrg#
990367ab2ff2Smrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
990467ab2ff2Smrg#
990567ab2ff2Smrg# Interface to module:
990667ab2ff2Smrg# HAVE_PERL: used in makefiles to conditionally scan text files
990767ab2ff2Smrg# PERL:	     returns the path of the perl program found
990867ab2ff2Smrg#	     returns the path set by the user in the environment
990967ab2ff2Smrg# --with-perl: 'yes' user instructs the module to use perl
991067ab2ff2Smrg#	       'no' user instructs the module not to use perl
991167ab2ff2Smrg# have_perl: returns yes if perl found in PATH or no
991267ab2ff2Smrg#
991367ab2ff2Smrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
991467ab2ff2Smrg#
991567ab2ff2SmrgAC_DEFUN([XORG_WITH_PERL],[
991667ab2ff2SmrgAC_ARG_VAR([PERL], [Path to perl command])
991767ab2ff2Smrg# Preserves the interface, should it be implemented later
991867ab2ff2Smrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
991967ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
992067ab2ff2SmrgAC_ARG_WITH(perl,
992167ab2ff2Smrg	AS_HELP_STRING([--with-perl],
992267ab2ff2Smrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
992367ab2ff2Smrg	   [use_perl=$withval], [use_perl=]_defopt)
992467ab2ff2Smrgm4_undefine([_defopt])
992567ab2ff2Smrg
992667ab2ff2Smrgif test "x$use_perl" = x"auto"; then
992767ab2ff2Smrg   AC_PATH_PROG([PERL], [perl])
992867ab2ff2Smrg   if test "x$PERL" = "x"; then
992967ab2ff2Smrg        AC_MSG_WARN([perl not found - cannot extract information and report])
993067ab2ff2Smrg	have_perl=no
993167ab2ff2Smrg   else
993267ab2ff2Smrg        have_perl=yes
993367ab2ff2Smrg   fi
993467ab2ff2Smrgelif test "x$use_perl" = x"yes" ; then
993567ab2ff2Smrg   AC_PATH_PROG([PERL], [perl])
993667ab2ff2Smrg   if test "x$PERL" = "x"; then
993767ab2ff2Smrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
993867ab2ff2Smrg   fi
993967ab2ff2Smrg   have_perl=yes
994067ab2ff2Smrgelif test "x$use_perl" = x"no" ; then
994167ab2ff2Smrg   if test "x$PERL" != "x"; then
994267ab2ff2Smrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
994367ab2ff2Smrg   fi
994467ab2ff2Smrg   have_perl=no
994567ab2ff2Smrgelse
994667ab2ff2Smrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
994767ab2ff2Smrgfi
9948e0963edeSmrg
994967ab2ff2SmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
995067ab2ff2Smrg]) # XORG_WITH_PERL
9951e0963edeSmrg
995267ab2ff2Smrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
995367ab2ff2Smrg# ----------------
995467ab2ff2Smrg# Minimum version: 1.5.0
995567ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.11.0
995667ab2ff2Smrg#
995767ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
995867ab2ff2Smrg# not at the appropriate level. This macro enables a module to test for the
995967ab2ff2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
996067ab2ff2Smrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
996167ab2ff2Smrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
996267ab2ff2Smrg# --with-asciidoc assumes 'auto'.
996367ab2ff2Smrg#
996467ab2ff2Smrg# Interface to module:
996567ab2ff2Smrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
996667ab2ff2Smrg# ASCIIDOC:	 returns the path of the asciidoc program found
996767ab2ff2Smrg#		 returns the path set by the user in the environment
996867ab2ff2Smrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
996967ab2ff2Smrg#		  'no' user instructs the module not to use asciidoc
997067ab2ff2Smrg#
997167ab2ff2Smrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
997267ab2ff2Smrg#
997367ab2ff2SmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
997467ab2ff2SmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
997567ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
997667ab2ff2SmrgAC_ARG_WITH(asciidoc,
997767ab2ff2Smrg	AS_HELP_STRING([--with-asciidoc],
997867ab2ff2Smrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
997967ab2ff2Smrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
998067ab2ff2Smrgm4_undefine([_defopt])
9981e0963edeSmrg
998267ab2ff2Smrgif test "x$use_asciidoc" = x"auto"; then
998367ab2ff2Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
998467ab2ff2Smrg   if test "x$ASCIIDOC" = "x"; then
998567ab2ff2Smrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
998667ab2ff2Smrg	have_asciidoc=no
998767ab2ff2Smrg   else
998867ab2ff2Smrg        have_asciidoc=yes
998967ab2ff2Smrg   fi
999067ab2ff2Smrgelif test "x$use_asciidoc" = x"yes" ; then
999167ab2ff2Smrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
999267ab2ff2Smrg   if test "x$ASCIIDOC" = "x"; then
999367ab2ff2Smrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
999467ab2ff2Smrg   fi
999567ab2ff2Smrg   have_asciidoc=yes
999667ab2ff2Smrgelif test "x$use_asciidoc" = x"no" ; then
999767ab2ff2Smrg   if test "x$ASCIIDOC" != "x"; then
999867ab2ff2Smrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
999967ab2ff2Smrg   fi
1000067ab2ff2Smrg   have_asciidoc=no
1000167ab2ff2Smrgelse
1000267ab2ff2Smrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
1000367ab2ff2Smrgfi
1000467ab2ff2Smrgm4_ifval([$1],
1000567ab2ff2Smrg[if test "$have_asciidoc" = yes; then
1000667ab2ff2Smrg    # scrape the asciidoc version
1000767ab2ff2Smrg    AC_MSG_CHECKING([the asciidoc version])
1000867ab2ff2Smrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
1000967ab2ff2Smrg    AC_MSG_RESULT([$asciidoc_version])
1001067ab2ff2Smrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
1001167ab2ff2Smrg        [if test "x$use_asciidoc" = xauto; then
1001267ab2ff2Smrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
1001367ab2ff2Smrg            have_asciidoc=no
1001467ab2ff2Smrg        else
1001567ab2ff2Smrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
1001667ab2ff2Smrg        fi])
1001767ab2ff2Smrgfi])
1001867ab2ff2SmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
1001967ab2ff2Smrg]) # XORG_WITH_ASCIIDOC
10020e0963edeSmrg
1002167ab2ff2Smrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10022b3a827e2Smrg# -------------------------------------------
1002367ab2ff2Smrg# Minimum version: 1.5.0
1002467ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.11.0
10025b3a827e2Smrg# Minimum version for optional DOT checking: 1.18.0
1002667ab2ff2Smrg#
1002767ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
1002867ab2ff2Smrg# not at the appropriate level. This macro enables a module to test for the
1002967ab2ff2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1003067ab2ff2Smrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
1003167ab2ff2Smrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
1003267ab2ff2Smrg# --with-doxygen assumes 'auto'.
1003367ab2ff2Smrg#
1003467ab2ff2Smrg# Interface to module:
1003567ab2ff2Smrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
1003667ab2ff2Smrg# DOXYGEN:	 returns the path of the doxygen program found
1003767ab2ff2Smrg#		 returns the path set by the user in the environment
1003867ab2ff2Smrg# --with-doxygen: 'yes' user instructs the module to use doxygen
1003967ab2ff2Smrg#		  'no' user instructs the module not to use doxygen
1004067ab2ff2Smrg#
1004167ab2ff2Smrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
1004267ab2ff2Smrg#
1004367ab2ff2SmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
1004467ab2ff2SmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10045b3a827e2SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
1004667ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
1004767ab2ff2SmrgAC_ARG_WITH(doxygen,
1004867ab2ff2Smrg	AS_HELP_STRING([--with-doxygen],
1004967ab2ff2Smrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
1005067ab2ff2Smrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
1005167ab2ff2Smrgm4_undefine([_defopt])
10052e0963edeSmrg
1005367ab2ff2Smrgif test "x$use_doxygen" = x"auto"; then
1005467ab2ff2Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1005567ab2ff2Smrg   if test "x$DOXYGEN" = "x"; then
1005667ab2ff2Smrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
1005767ab2ff2Smrg	have_doxygen=no
1005867ab2ff2Smrg   else
1005967ab2ff2Smrg        have_doxygen=yes
1006067ab2ff2Smrg   fi
1006167ab2ff2Smrgelif test "x$use_doxygen" = x"yes" ; then
1006267ab2ff2Smrg   AC_PATH_PROG([DOXYGEN], [doxygen])
1006367ab2ff2Smrg   if test "x$DOXYGEN" = "x"; then
1006467ab2ff2Smrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
1006567ab2ff2Smrg   fi
1006667ab2ff2Smrg   have_doxygen=yes
1006767ab2ff2Smrgelif test "x$use_doxygen" = x"no" ; then
1006867ab2ff2Smrg   if test "x$DOXYGEN" != "x"; then
1006967ab2ff2Smrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
1007067ab2ff2Smrg   fi
1007167ab2ff2Smrg   have_doxygen=no
1007267ab2ff2Smrgelse
1007367ab2ff2Smrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
1007467ab2ff2Smrgfi
1007567ab2ff2Smrgm4_ifval([$1],
1007667ab2ff2Smrg[if test "$have_doxygen" = yes; then
1007767ab2ff2Smrg    # scrape the doxygen version
1007867ab2ff2Smrg    AC_MSG_CHECKING([the doxygen version])
1007967ab2ff2Smrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
1008067ab2ff2Smrg    AC_MSG_RESULT([$doxygen_version])
1008167ab2ff2Smrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
1008267ab2ff2Smrg        [if test "x$use_doxygen" = xauto; then
1008367ab2ff2Smrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
1008467ab2ff2Smrg            have_doxygen=no
1008567ab2ff2Smrg        else
1008667ab2ff2Smrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
1008767ab2ff2Smrg        fi])
1008867ab2ff2Smrgfi])
10089b3a827e2Smrg
10090b3a827e2Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10091b3a827e2Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10092b3a827e2Smrgdnl 	HAVE_DOT = @HAVE_DOT@
10093b3a827e2SmrgHAVE_DOT=no
10094b3a827e2Smrgif test "x$have_doxygen" = "xyes"; then
10095b3a827e2Smrg  AC_PATH_PROG([DOT], [dot])
10096b3a827e2Smrg    if test "x$DOT" != "x"; then
10097b3a827e2Smrg      HAVE_DOT=yes
10098b3a827e2Smrg    fi
10099b3a827e2Smrgfi
10100b3a827e2Smrg
10101b3a827e2SmrgAC_SUBST([HAVE_DOT])
10102b3a827e2SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
1010367ab2ff2SmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
1010467ab2ff2Smrg]) # XORG_WITH_DOXYGEN
10105e0963edeSmrg
1010667ab2ff2Smrg# XORG_WITH_GROFF([DEFAULT])
1010767ab2ff2Smrg# ----------------
1010867ab2ff2Smrg# Minimum version: 1.6.0
1010967ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1011067ab2ff2Smrg#
1011167ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
1011267ab2ff2Smrg# not at the appropriate level. This macro enables a module to test for the
1011367ab2ff2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1011467ab2ff2Smrg# the --with-groff option, it allows maximum flexibilty in making decisions
1011567ab2ff2Smrg# as whether or not to use the groff package. When DEFAULT is not specified,
1011667ab2ff2Smrg# --with-groff assumes 'auto'.
1011767ab2ff2Smrg#
1011867ab2ff2Smrg# Interface to module:
1011967ab2ff2Smrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
1012067ab2ff2Smrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
1012167ab2ff2Smrg# HAVE_GROFF_MS: the -ms macros package
1012267ab2ff2Smrg# GROFF:	 returns the path of the groff program found
1012367ab2ff2Smrg#		 returns the path set by the user in the environment
1012467ab2ff2Smrg# --with-groff:	 'yes' user instructs the module to use groff
1012567ab2ff2Smrg#		 'no' user instructs the module not to use groff
1012667ab2ff2Smrg#
1012767ab2ff2Smrg# Added in version 1.9.0:
1012867ab2ff2Smrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
1012967ab2ff2Smrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
1013067ab2ff2Smrg#		   psselect from the psutils package.
1013167ab2ff2Smrg#		   the ghostcript package. Refer to the grohtml man pages
1013267ab2ff2Smrg#
1013367ab2ff2Smrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
1013467ab2ff2Smrg#
1013567ab2ff2Smrg# OS and distros often splits groff in a basic and full package, the former
1013667ab2ff2Smrg# having the groff program and the later having devices, fonts and macros
1013767ab2ff2Smrg# Checking for the groff executable is not enough.
1013867ab2ff2Smrg#
1013967ab2ff2Smrg# If macros are missing, we cannot assume that groff is useless, so we don't
1014067ab2ff2Smrg# unset HAVE_GROFF or GROFF env variables.
1014167ab2ff2Smrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
1014267ab2ff2Smrg#
1014367ab2ff2SmrgAC_DEFUN([XORG_WITH_GROFF],[
1014467ab2ff2SmrgAC_ARG_VAR([GROFF], [Path to groff command])
1014567ab2ff2Smrgm4_define([_defopt], m4_default([$1], [auto]))
1014667ab2ff2SmrgAC_ARG_WITH(groff,
1014767ab2ff2Smrg	AS_HELP_STRING([--with-groff],
1014867ab2ff2Smrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
1014967ab2ff2Smrg	   [use_groff=$withval], [use_groff=]_defopt)
1015067ab2ff2Smrgm4_undefine([_defopt])
10151e0963edeSmrg
1015267ab2ff2Smrgif test "x$use_groff" = x"auto"; then
1015367ab2ff2Smrg   AC_PATH_PROG([GROFF], [groff])
1015467ab2ff2Smrg   if test "x$GROFF" = "x"; then
1015567ab2ff2Smrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
1015667ab2ff2Smrg	have_groff=no
1015767ab2ff2Smrg   else
1015867ab2ff2Smrg        have_groff=yes
1015967ab2ff2Smrg   fi
1016067ab2ff2Smrgelif test "x$use_groff" = x"yes" ; then
1016167ab2ff2Smrg   AC_PATH_PROG([GROFF], [groff])
1016267ab2ff2Smrg   if test "x$GROFF" = "x"; then
1016367ab2ff2Smrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
1016467ab2ff2Smrg   fi
1016567ab2ff2Smrg   have_groff=yes
1016667ab2ff2Smrgelif test "x$use_groff" = x"no" ; then
1016767ab2ff2Smrg   if test "x$GROFF" != "x"; then
1016867ab2ff2Smrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
1016967ab2ff2Smrg   fi
1017067ab2ff2Smrg   have_groff=no
1017167ab2ff2Smrgelse
1017267ab2ff2Smrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
1017367ab2ff2Smrgfi
10174e0963edeSmrg
1017567ab2ff2Smrg# We have groff, test for the presence of the macro packages
1017667ab2ff2Smrgif test "x$have_groff" = x"yes"; then
1017767ab2ff2Smrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
1017867ab2ff2Smrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
1017967ab2ff2Smrg        groff_ms_works=yes
1018067ab2ff2Smrg    else
1018167ab2ff2Smrg        groff_ms_works=no
1018267ab2ff2Smrg    fi
1018367ab2ff2Smrg    AC_MSG_RESULT([$groff_ms_works])
1018467ab2ff2Smrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
1018567ab2ff2Smrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
1018667ab2ff2Smrg        groff_mm_works=yes
1018767ab2ff2Smrg    else
1018867ab2ff2Smrg        groff_mm_works=no
1018967ab2ff2Smrg    fi
1019067ab2ff2Smrg    AC_MSG_RESULT([$groff_mm_works])
1019167ab2ff2Smrgfi
10192e0963edeSmrg
1019367ab2ff2Smrg# We have groff, test for HTML dependencies, one command per package
1019467ab2ff2Smrgif test "x$have_groff" = x"yes"; then
1019567ab2ff2Smrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
1019667ab2ff2Smrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
1019767ab2ff2Smrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
1019867ab2ff2Smrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
1019967ab2ff2Smrg      have_groff_html=yes
1020067ab2ff2Smrg   else
1020167ab2ff2Smrg      have_groff_html=no
1020267ab2ff2Smrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
1020367ab2ff2Smrg   fi
1020467ab2ff2Smrgfi
10205e0963edeSmrg
1020667ab2ff2Smrg# Set Automake conditionals for Makefiles
1020767ab2ff2SmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
1020867ab2ff2SmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
1020967ab2ff2SmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
1021067ab2ff2SmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
1021167ab2ff2Smrg]) # XORG_WITH_GROFF
10212e0963edeSmrg
1021367ab2ff2Smrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
1021467ab2ff2Smrg# ---------------------------------------
1021567ab2ff2Smrg# Minimum version: 1.6.0
1021667ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1021767ab2ff2Smrg# Minimum version for optional MIN-VERSION argument: 1.15.0
1021867ab2ff2Smrg#
1021967ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
1022067ab2ff2Smrg# not at the appropriate level. This macro enables a module to test for the
1022167ab2ff2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1022267ab2ff2Smrg# the --with-fop option, it allows maximum flexibilty in making decisions
1022367ab2ff2Smrg# as whether or not to use the fop package. When DEFAULT is not specified,
1022467ab2ff2Smrg# --with-fop assumes 'auto'.
1022567ab2ff2Smrg#
1022667ab2ff2Smrg# Interface to module:
1022767ab2ff2Smrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
1022867ab2ff2Smrg# FOP:	 	returns the path of the fop program found
1022967ab2ff2Smrg#		returns the path set by the user in the environment
1023067ab2ff2Smrg# --with-fop: 	'yes' user instructs the module to use fop
1023167ab2ff2Smrg#		'no' user instructs the module not to use fop
1023267ab2ff2Smrg#
1023367ab2ff2Smrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
1023467ab2ff2Smrg#
1023567ab2ff2SmrgAC_DEFUN([XORG_WITH_FOP],[
1023667ab2ff2SmrgAC_ARG_VAR([FOP], [Path to fop command])
1023767ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
1023867ab2ff2SmrgAC_ARG_WITH(fop,
1023967ab2ff2Smrg	AS_HELP_STRING([--with-fop],
1024067ab2ff2Smrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
1024167ab2ff2Smrg	   [use_fop=$withval], [use_fop=]_defopt)
1024267ab2ff2Smrgm4_undefine([_defopt])
10243e0963edeSmrg
1024467ab2ff2Smrgif test "x$use_fop" = x"auto"; then
1024567ab2ff2Smrg   AC_PATH_PROG([FOP], [fop])
1024667ab2ff2Smrg   if test "x$FOP" = "x"; then
1024767ab2ff2Smrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
1024867ab2ff2Smrg	have_fop=no
1024967ab2ff2Smrg   else
1025067ab2ff2Smrg        have_fop=yes
1025167ab2ff2Smrg   fi
1025267ab2ff2Smrgelif test "x$use_fop" = x"yes" ; then
1025367ab2ff2Smrg   AC_PATH_PROG([FOP], [fop])
1025467ab2ff2Smrg   if test "x$FOP" = "x"; then
1025567ab2ff2Smrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
1025667ab2ff2Smrg   fi
1025767ab2ff2Smrg   have_fop=yes
1025867ab2ff2Smrgelif test "x$use_fop" = x"no" ; then
1025967ab2ff2Smrg   if test "x$FOP" != "x"; then
1026067ab2ff2Smrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
1026167ab2ff2Smrg   fi
1026267ab2ff2Smrg   have_fop=no
1026367ab2ff2Smrgelse
1026467ab2ff2Smrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1026567ab2ff2Smrgfi
10266e0963edeSmrg
1026767ab2ff2Smrg# Test for a minimum version of fop, if provided.
1026867ab2ff2Smrgm4_ifval([$1],
1026967ab2ff2Smrg[if test "$have_fop" = yes; then
1027067ab2ff2Smrg    # scrape the fop version
1027167ab2ff2Smrg    AC_MSG_CHECKING([for fop minimum version])
1027267ab2ff2Smrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
1027367ab2ff2Smrg    AC_MSG_RESULT([$fop_version])
1027467ab2ff2Smrg    AS_VERSION_COMPARE([$fop_version], [$1],
1027567ab2ff2Smrg        [if test "x$use_fop" = xauto; then
1027667ab2ff2Smrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
1027767ab2ff2Smrg            have_fop=no
1027867ab2ff2Smrg        else
1027967ab2ff2Smrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
1028067ab2ff2Smrg        fi])
1028167ab2ff2Smrgfi])
1028267ab2ff2SmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
1028367ab2ff2Smrg]) # XORG_WITH_FOP
10284e0963edeSmrg
10285b3a827e2Smrg# XORG_WITH_M4([MIN-VERSION])
10286b3a827e2Smrg# ---------------------------
10287b3a827e2Smrg# Minimum version: 1.19.0
10288b3a827e2Smrg#
10289b3a827e2Smrg# This macro attempts to locate an m4 macro processor which supports
10290b3a827e2Smrg# -I option and is only useful for modules relying on M4 in order to
10291b3a827e2Smrg# expand macros in source code files.
10292b3a827e2Smrg#
10293b3a827e2Smrg# Interface to module:
10294b3a827e2Smrg# M4:	 	returns the path of the m4 program found
10295b3a827e2Smrg#		returns the path set by the user in the environment
10296b3a827e2Smrg#
10297b3a827e2SmrgAC_DEFUN([XORG_WITH_M4], [
10298b3a827e2SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10299b3a827e2Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10300b3a827e2Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10301b3a827e2Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10302b3a827e2Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10303b3a827e2Smrg   [$PATH:/usr/gnu/bin])])
10304b3a827e2Smrg
10305b3a827e2SmrgAC_SUBST([M4], [$ac_cv_path_M4])
10306b3a827e2Smrg]) # XORG_WITH_M4
10307b3a827e2Smrg
1030867ab2ff2Smrg# XORG_WITH_PS2PDF([DEFAULT])
1030967ab2ff2Smrg# ----------------
1031067ab2ff2Smrg# Minimum version: 1.6.0
1031167ab2ff2Smrg# Minimum version for optional DEFAULT argument: 1.11.0
1031267ab2ff2Smrg#
1031367ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
1031467ab2ff2Smrg# not at the appropriate level. This macro enables a module to test for the
1031567ab2ff2Smrg# presence of the tool and obtain it's path in separate variables. Coupled with
1031667ab2ff2Smrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
1031767ab2ff2Smrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
1031867ab2ff2Smrg# --with-ps2pdf assumes 'auto'.
1031967ab2ff2Smrg#
1032067ab2ff2Smrg# Interface to module:
1032167ab2ff2Smrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
1032267ab2ff2Smrg# PS2PDF:	returns the path of the ps2pdf program found
1032367ab2ff2Smrg#		returns the path set by the user in the environment
1032467ab2ff2Smrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
1032567ab2ff2Smrg#		 'no' user instructs the module not to use ps2pdf
1032667ab2ff2Smrg#
1032767ab2ff2Smrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
1032867ab2ff2Smrg#
1032967ab2ff2SmrgAC_DEFUN([XORG_WITH_PS2PDF],[
1033067ab2ff2SmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
1033167ab2ff2Smrgm4_define([_defopt], m4_default([$1], [auto]))
1033267ab2ff2SmrgAC_ARG_WITH(ps2pdf,
1033367ab2ff2Smrg	AS_HELP_STRING([--with-ps2pdf],
1033467ab2ff2Smrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
1033567ab2ff2Smrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
1033667ab2ff2Smrgm4_undefine([_defopt])
10337f05b35a2Smrg
1033867ab2ff2Smrgif test "x$use_ps2pdf" = x"auto"; then
1033967ab2ff2Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1034067ab2ff2Smrg   if test "x$PS2PDF" = "x"; then
1034167ab2ff2Smrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
1034267ab2ff2Smrg	have_ps2pdf=no
1034367ab2ff2Smrg   else
1034467ab2ff2Smrg        have_ps2pdf=yes
1034567ab2ff2Smrg   fi
1034667ab2ff2Smrgelif test "x$use_ps2pdf" = x"yes" ; then
1034767ab2ff2Smrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
1034867ab2ff2Smrg   if test "x$PS2PDF" = "x"; then
1034967ab2ff2Smrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
1035067ab2ff2Smrg   fi
1035167ab2ff2Smrg   have_ps2pdf=yes
1035267ab2ff2Smrgelif test "x$use_ps2pdf" = x"no" ; then
1035367ab2ff2Smrg   if test "x$PS2PDF" != "x"; then
1035467ab2ff2Smrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
1035567ab2ff2Smrg   fi
1035667ab2ff2Smrg   have_ps2pdf=no
1035767ab2ff2Smrgelse
1035867ab2ff2Smrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
1035967ab2ff2Smrgfi
1036067ab2ff2SmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
1036167ab2ff2Smrg]) # XORG_WITH_PS2PDF
1036249e108a1Smrg
1036367ab2ff2Smrg# XORG_ENABLE_DOCS (enable_docs=yes)
1036467ab2ff2Smrg# ----------------
1036567ab2ff2Smrg# Minimum version: 1.6.0
1036667ab2ff2Smrg#
1036767ab2ff2Smrg# Documentation tools are not always available on all platforms and sometimes
1036867ab2ff2Smrg# not at the appropriate level. This macro enables a builder to skip all
1036967ab2ff2Smrg# documentation targets except traditional man pages.
1037067ab2ff2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1037167ab2ff2Smrg# maximum flexibilty in controlling documentation building.
1037267ab2ff2Smrg# Refer to:
1037367ab2ff2Smrg# XORG_WITH_XMLTO         --with-xmlto
1037467ab2ff2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1037567ab2ff2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1037667ab2ff2Smrg# XORG_WITH_FOP           --with-fop
1037767ab2ff2Smrg# XORG_WITH_GROFF         --with-groff
1037867ab2ff2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1037967ab2ff2Smrg#
1038067ab2ff2Smrg# Interface to module:
1038167ab2ff2Smrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
1038267ab2ff2Smrg# --enable-docs: 'yes' user instructs the module to generate docs
1038367ab2ff2Smrg#		 'no' user instructs the module not to generate docs
1038467ab2ff2Smrg# parm1:	specify the default value, yes or no.
1038567ab2ff2Smrg#
1038667ab2ff2SmrgAC_DEFUN([XORG_ENABLE_DOCS],[
1038767ab2ff2Smrgm4_define([docs_default], m4_default([$1], [yes]))
1038867ab2ff2SmrgAC_ARG_ENABLE(docs,
1038967ab2ff2Smrg	AS_HELP_STRING([--enable-docs],
1039067ab2ff2Smrg	   [Enable building the documentation (default: ]docs_default[)]),
1039167ab2ff2Smrg	   [build_docs=$enableval], [build_docs=]docs_default)
1039267ab2ff2Smrgm4_undefine([docs_default])
1039367ab2ff2SmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
1039467ab2ff2SmrgAC_MSG_CHECKING([whether to build documentation])
1039567ab2ff2SmrgAC_MSG_RESULT([$build_docs])
1039667ab2ff2Smrg]) # XORG_ENABLE_DOCS
10397f05b35a2Smrg
1039867ab2ff2Smrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
1039967ab2ff2Smrg# ----------------
1040067ab2ff2Smrg# Minimum version: 1.6.0
1040167ab2ff2Smrg#
1040267ab2ff2Smrg# This macro enables a builder to skip all developer documentation.
1040367ab2ff2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1040467ab2ff2Smrg# maximum flexibilty in controlling documentation building.
1040567ab2ff2Smrg# Refer to:
1040667ab2ff2Smrg# XORG_WITH_XMLTO         --with-xmlto
1040767ab2ff2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1040867ab2ff2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1040967ab2ff2Smrg# XORG_WITH_FOP           --with-fop
1041067ab2ff2Smrg# XORG_WITH_GROFF         --with-groff
1041167ab2ff2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1041267ab2ff2Smrg#
1041367ab2ff2Smrg# Interface to module:
1041467ab2ff2Smrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
1041567ab2ff2Smrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
1041667ab2ff2Smrg#			'no' user instructs the module not to generate developer docs
1041767ab2ff2Smrg# parm1:		specify the default value, yes or no.
1041867ab2ff2Smrg#
1041967ab2ff2SmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
1042067ab2ff2Smrgm4_define([devel_default], m4_default([$1], [yes]))
1042167ab2ff2SmrgAC_ARG_ENABLE(devel-docs,
1042267ab2ff2Smrg	AS_HELP_STRING([--enable-devel-docs],
1042367ab2ff2Smrg	   [Enable building the developer documentation (default: ]devel_default[)]),
1042467ab2ff2Smrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
1042567ab2ff2Smrgm4_undefine([devel_default])
1042667ab2ff2SmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
1042767ab2ff2SmrgAC_MSG_CHECKING([whether to build developer documentation])
1042867ab2ff2SmrgAC_MSG_RESULT([$build_devel_docs])
1042967ab2ff2Smrg]) # XORG_ENABLE_DEVEL_DOCS
10430f05b35a2Smrg
1043167ab2ff2Smrg# XORG_ENABLE_SPECS (enable_specs=yes)
1043267ab2ff2Smrg# ----------------
1043367ab2ff2Smrg# Minimum version: 1.6.0
1043467ab2ff2Smrg#
1043567ab2ff2Smrg# This macro enables a builder to skip all functional specification targets.
1043667ab2ff2Smrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
1043767ab2ff2Smrg# maximum flexibilty in controlling documentation building.
1043867ab2ff2Smrg# Refer to:
1043967ab2ff2Smrg# XORG_WITH_XMLTO         --with-xmlto
1044067ab2ff2Smrg# XORG_WITH_ASCIIDOC      --with-asciidoc
1044167ab2ff2Smrg# XORG_WITH_DOXYGEN       --with-doxygen
1044267ab2ff2Smrg# XORG_WITH_FOP           --with-fop
1044367ab2ff2Smrg# XORG_WITH_GROFF         --with-groff
1044467ab2ff2Smrg# XORG_WITH_PS2PDF        --with-ps2pdf
1044567ab2ff2Smrg#
1044667ab2ff2Smrg# Interface to module:
1044767ab2ff2Smrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
1044867ab2ff2Smrg# --enable-specs:	'yes' user instructs the module to generate specs
1044967ab2ff2Smrg#			'no' user instructs the module not to generate specs
1045067ab2ff2Smrg# parm1:		specify the default value, yes or no.
1045167ab2ff2Smrg#
1045267ab2ff2SmrgAC_DEFUN([XORG_ENABLE_SPECS],[
1045367ab2ff2Smrgm4_define([spec_default], m4_default([$1], [yes]))
1045467ab2ff2SmrgAC_ARG_ENABLE(specs,
1045567ab2ff2Smrg	AS_HELP_STRING([--enable-specs],
1045667ab2ff2Smrg	   [Enable building the specs (default: ]spec_default[)]),
1045767ab2ff2Smrg	   [build_specs=$enableval], [build_specs=]spec_default)
1045867ab2ff2Smrgm4_undefine([spec_default])
1045967ab2ff2SmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
1046067ab2ff2SmrgAC_MSG_CHECKING([whether to build functional specifications])
1046167ab2ff2SmrgAC_MSG_RESULT([$build_specs])
1046267ab2ff2Smrg]) # XORG_ENABLE_SPECS
10463f05b35a2Smrg
1046467ab2ff2Smrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
1046567ab2ff2Smrg# ----------------------------------------------
1046667ab2ff2Smrg# Minimum version: 1.13.0
1046767ab2ff2Smrg#
1046867ab2ff2Smrg# This macro enables a builder to enable/disable unit testing
1046967ab2ff2Smrg# It makes no assumption about the test cases implementation
1047067ab2ff2Smrg# Test cases may or may not use Automake "Support for test suites"
1047167ab2ff2Smrg# They may or may not use the software utility library GLib
1047267ab2ff2Smrg#
1047367ab2ff2Smrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
1047467ab2ff2Smrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
1047567ab2ff2Smrg# The variable enable_unit_tests is used by other macros in this file.
1047667ab2ff2Smrg#
1047767ab2ff2Smrg# Interface to module:
1047867ab2ff2Smrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
1047967ab2ff2Smrg# enable_unit_tests:    used in configure.ac for additional configuration
1048067ab2ff2Smrg# --enable-unit-tests:	'yes' user instructs the module to build tests
1048167ab2ff2Smrg#			'no' user instructs the module not to build tests
1048267ab2ff2Smrg# parm1:		specify the default value, yes or no.
1048367ab2ff2Smrg#
1048467ab2ff2SmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
1048567ab2ff2SmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
1048667ab2ff2SmrgAC_BEFORE([$0], [XORG_LD_WRAP])
1048767ab2ff2SmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
1048867ab2ff2Smrgm4_define([_defopt], m4_default([$1], [auto]))
1048967ab2ff2SmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
1049067ab2ff2Smrg	[Enable building unit test cases (default: ]_defopt[)]),
1049167ab2ff2Smrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
1049267ab2ff2Smrgm4_undefine([_defopt])
1049367ab2ff2SmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
1049467ab2ff2SmrgAC_MSG_CHECKING([whether to build unit test cases])
1049567ab2ff2SmrgAC_MSG_RESULT([$enable_unit_tests])
1049667ab2ff2Smrg]) # XORG_ENABLE_UNIT_TESTS
1049767ab2ff2Smrg
10498e494fffdSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
10499e494fffdSmrg# ------------------------------------------------------
10500e494fffdSmrg# Minimum version: 1.17.0
10501e494fffdSmrg#
10502e494fffdSmrg# This macro enables a builder to enable/disable integration testing
10503e494fffdSmrg# It makes no assumption about the test cases' implementation
10504e494fffdSmrg# Test cases may or may not use Automake "Support for test suites"
10505e494fffdSmrg#
10506e494fffdSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
10507e494fffdSmrg# usually requires less dependencies and may be built and run under less
10508e494fffdSmrg# stringent environments than integration tests.
10509e494fffdSmrg#
10510e494fffdSmrg# Interface to module:
10511e494fffdSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
10512e494fffdSmrg# enable_integration_tests:   used in configure.ac for additional configuration
10513e494fffdSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
10514e494fffdSmrg#                             'no' user instructs the module not to build tests
10515e494fffdSmrg# parm1:                      specify the default value, yes or no.
10516e494fffdSmrg#
10517e494fffdSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
10518e494fffdSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
10519e494fffdSmrgm4_define([_defopt], m4_default([$1], [auto]))
10520e494fffdSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
10521e494fffdSmrg	[Enable building integration test cases (default: ]_defopt[)]),
10522e494fffdSmrg	[enable_integration_tests=$enableval],
10523e494fffdSmrg	[enable_integration_tests=]_defopt)
10524e494fffdSmrgm4_undefine([_defopt])
10525e494fffdSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
10526e494fffdSmrg	[test "x$enable_integration_tests" != xno])
10527e494fffdSmrgAC_MSG_CHECKING([whether to build unit test cases])
10528e494fffdSmrgAC_MSG_RESULT([$enable_integration_tests])
10529e494fffdSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10530e494fffdSmrg
1053167ab2ff2Smrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
1053267ab2ff2Smrg# ----------------------------------------
1053367ab2ff2Smrg# Minimum version: 1.13.0
1053467ab2ff2Smrg#
1053567ab2ff2Smrg# GLib is a library which provides advanced data structures and functions.
1053667ab2ff2Smrg# This macro enables a module to test for the presence of Glib.
1053767ab2ff2Smrg#
1053867ab2ff2Smrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
1053967ab2ff2Smrg# Otherwise the value of $enable_unit_tests is blank.
1054067ab2ff2Smrg#
10541e494fffdSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
10542e494fffdSmrg# test support usually requires less dependencies and may be built and run under
10543e494fffdSmrg# less stringent environments than integration tests.
10544e494fffdSmrg#
1054567ab2ff2Smrg# Interface to module:
1054667ab2ff2Smrg# HAVE_GLIB: used in makefiles to conditionally build targets
1054767ab2ff2Smrg# with_glib: used in configure.ac to know if GLib has been found
1054867ab2ff2Smrg# --with-glib:	'yes' user instructs the module to use glib
1054967ab2ff2Smrg#		'no' user instructs the module not to use glib
1055067ab2ff2Smrg#
1055167ab2ff2SmrgAC_DEFUN([XORG_WITH_GLIB],[
1055267ab2ff2SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
1055367ab2ff2Smrgm4_define([_defopt], m4_default([$2], [auto]))
1055467ab2ff2SmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
1055567ab2ff2Smrg	[Use GLib library for unit testing (default: ]_defopt[)]),
1055667ab2ff2Smrg	[with_glib=$withval], [with_glib=]_defopt)
1055767ab2ff2Smrgm4_undefine([_defopt])
1055867ab2ff2Smrg
1055967ab2ff2Smrghave_glib=no
1056067ab2ff2Smrg# Do not probe GLib if user explicitly disabled unit testing
1056167ab2ff2Smrgif test "x$enable_unit_tests" != x"no"; then
1056267ab2ff2Smrg  # Do not probe GLib if user explicitly disabled it
1056367ab2ff2Smrg  if test "x$with_glib" != x"no"; then
1056467ab2ff2Smrg    m4_ifval(
1056567ab2ff2Smrg      [$1],
1056667ab2ff2Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
1056767ab2ff2Smrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
1056867ab2ff2Smrg    )
1056967ab2ff2Smrg  fi
1057067ab2ff2Smrgfi
10571e0963edeSmrg
1057267ab2ff2Smrg# Not having GLib when unit testing has been explicitly requested is an error
1057367ab2ff2Smrgif test "x$enable_unit_tests" = x"yes"; then
1057467ab2ff2Smrg  if test "x$have_glib" = x"no"; then
1057567ab2ff2Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1057667ab2ff2Smrg  fi
1057767ab2ff2Smrgfi
10578e0963edeSmrg
1057967ab2ff2Smrg# Having unit testing disabled when GLib has been explicitly requested is an error
1058067ab2ff2Smrgif test "x$enable_unit_tests" = x"no"; then
1058167ab2ff2Smrg  if test "x$with_glib" = x"yes"; then
1058267ab2ff2Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
1058367ab2ff2Smrg  fi
1058467ab2ff2Smrgfi
10585e0963edeSmrg
1058667ab2ff2Smrg# Not having GLib when it has been explicitly requested is an error
1058767ab2ff2Smrgif test "x$with_glib" = x"yes"; then
1058867ab2ff2Smrg  if test "x$have_glib" = x"no"; then
1058967ab2ff2Smrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
1059067ab2ff2Smrg  fi
1059167ab2ff2Smrgfi
10592e0963edeSmrg
1059367ab2ff2SmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
1059467ab2ff2Smrg]) # XORG_WITH_GLIB
10595e0963edeSmrg
1059667ab2ff2Smrg# XORG_LD_WRAP([required|optional])
1059767ab2ff2Smrg# ---------------------------------
1059867ab2ff2Smrg# Minimum version: 1.13.0
1059967ab2ff2Smrg#
1060067ab2ff2Smrg# Check if linker supports -wrap, passed via compiler flags
1060167ab2ff2Smrg#
1060267ab2ff2Smrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
1060367ab2ff2Smrg# Otherwise the value of $enable_unit_tests is blank.
1060467ab2ff2Smrg#
1060567ab2ff2Smrg# Argument added in 1.16.0 - default is "required", to match existing behavior
1060667ab2ff2Smrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
1060767ab2ff2Smrg# available, an argument of "optional" allows use when some unit tests require
1060867ab2ff2Smrg# ld -wrap and others do not.
1060967ab2ff2Smrg#
1061067ab2ff2SmrgAC_DEFUN([XORG_LD_WRAP],[
1061167ab2ff2SmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
1061267ab2ff2Smrg    [AC_LANG_PROGRAM([#include <stdlib.h>
1061367ab2ff2Smrg                      void __wrap_exit(int status) { return; }],
1061467ab2ff2Smrg                     [exit(0);])])
1061567ab2ff2Smrg# Not having ld wrap when unit testing has been explicitly requested is an error
1061667ab2ff2Smrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
1061767ab2ff2Smrg  if test "x$have_ld_wrap" = x"no"; then
1061867ab2ff2Smrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
1061967ab2ff2Smrg  fi
1062067ab2ff2Smrgfi
1062167ab2ff2SmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
1062267ab2ff2Smrg#
1062367ab2ff2Smrg]) # XORG_LD_WRAP
10624e0963edeSmrg
1062567ab2ff2Smrg# XORG_CHECK_LINKER_FLAGS
1062667ab2ff2Smrg# -----------------------
1062767ab2ff2Smrg# SYNOPSIS
1062867ab2ff2Smrg#
1062967ab2ff2Smrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
1063067ab2ff2Smrg#
1063167ab2ff2Smrg# DESCRIPTION
1063267ab2ff2Smrg#
1063367ab2ff2Smrg#   Check whether the given linker FLAGS work with the current language's
1063467ab2ff2Smrg#   linker, or whether they give an error.
1063567ab2ff2Smrg#
1063667ab2ff2Smrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
1063767ab2ff2Smrg#   success/failure.
1063867ab2ff2Smrg#
1063967ab2ff2Smrg#   PROGRAM-SOURCE is the program source to link with, if needed
1064067ab2ff2Smrg#
1064167ab2ff2Smrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
1064267ab2ff2Smrg#
1064367ab2ff2Smrg# LICENSE
1064467ab2ff2Smrg#
1064567ab2ff2Smrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
1064667ab2ff2Smrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
1064767ab2ff2Smrg#   Copyright (c) 2009 Matteo Frigo
1064867ab2ff2Smrg#
1064967ab2ff2Smrg#   This program is free software: you can redistribute it and/or modify it
1065067ab2ff2Smrg#   under the terms of the GNU General Public License as published by the
1065167ab2ff2Smrg#   Free Software Foundation, either version 3 of the License, or (at your
1065267ab2ff2Smrg#   option) any later version.
1065367ab2ff2Smrg#
1065467ab2ff2Smrg#   This program is distributed in the hope that it will be useful, but
1065567ab2ff2Smrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
1065667ab2ff2Smrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
1065767ab2ff2Smrg#   Public License for more details.
1065867ab2ff2Smrg#
1065967ab2ff2Smrg#   You should have received a copy of the GNU General Public License along
1066067ab2ff2Smrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
1066167ab2ff2Smrg#
1066267ab2ff2Smrg#   As a special exception, the respective Autoconf Macro's copyright owner
1066367ab2ff2Smrg#   gives unlimited permission to copy, distribute and modify the configure
1066467ab2ff2Smrg#   scripts that are the output of Autoconf when processing the Macro. You
1066567ab2ff2Smrg#   need not follow the terms of the GNU General Public License when using
1066667ab2ff2Smrg#   or distributing such scripts, even though portions of the text of the
1066767ab2ff2Smrg#   Macro appear in them. The GNU General Public License (GPL) does govern
1066867ab2ff2Smrg#   all other use of the material that constitutes the Autoconf Macro.
1066967ab2ff2Smrg#
1067067ab2ff2Smrg#   This special exception to the GPL applies to versions of the Autoconf
1067167ab2ff2Smrg#   Macro released by the Autoconf Archive. When you make and distribute a
1067267ab2ff2Smrg#   modified version of the Autoconf Macro, you may extend this special
1067367ab2ff2Smrg#   exception to the GPL to apply to your modified version as well.#
1067467ab2ff2SmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
1067567ab2ff2Smrg[AC_MSG_CHECKING([whether the linker accepts $1])
1067667ab2ff2Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
1067767ab2ff2SmrgAS_LITERAL_IF([$1],
1067867ab2ff2Smrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
1067967ab2ff2Smrg      ax_save_FLAGS=$LDFLAGS
1068067ab2ff2Smrg      LDFLAGS="$1"
1068167ab2ff2Smrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
1068267ab2ff2Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1068367ab2ff2Smrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1068467ab2ff2Smrg      LDFLAGS=$ax_save_FLAGS])],
1068567ab2ff2Smrg  [ax_save_FLAGS=$LDFLAGS
1068667ab2ff2Smrg   LDFLAGS="$1"
1068767ab2ff2Smrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
1068867ab2ff2Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
1068967ab2ff2Smrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
1069067ab2ff2Smrg   LDFLAGS=$ax_save_FLAGS])
1069167ab2ff2Smrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
1069267ab2ff2SmrgAC_MSG_RESULT($xorg_check_linker_flags)
1069367ab2ff2Smrgif test "x$xorg_check_linker_flags" = xyes; then
1069467ab2ff2Smrg	m4_default([$2], :)
1069567ab2ff2Smrgelse
1069667ab2ff2Smrg	m4_default([$3], :)
1069767ab2ff2Smrgfi
1069867ab2ff2Smrg]) # XORG_CHECK_LINKER_FLAGS
10699f05b35a2Smrg
1070067ab2ff2Smrg# XORG_MEMORY_CHECK_FLAGS
1070167ab2ff2Smrg# -----------------------
1070267ab2ff2Smrg# Minimum version: 1.16.0
1070367ab2ff2Smrg#
1070467ab2ff2Smrg# This macro attempts to find appropriate memory checking functionality
1070567ab2ff2Smrg# for various platforms which unit testing code may use to catch various
1070667ab2ff2Smrg# forms of memory allocation and access errors in testing.
1070767ab2ff2Smrg#
1070867ab2ff2Smrg# Interface to module:
1070967ab2ff2Smrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
1071067ab2ff2Smrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
1071167ab2ff2Smrg#
1071267ab2ff2Smrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
1071367ab2ff2Smrg#
1071467ab2ff2SmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
10715e0963edeSmrg
1071667ab2ff2SmrgAC_REQUIRE([AC_CANONICAL_HOST])
1071767ab2ff2SmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
1071867ab2ff2Smrg           [Environment variables to enable memory checking in tests])
10719e0963edeSmrg
1072067ab2ff2Smrg# Check for different types of support on different platforms
1072167ab2ff2Smrgcase $host_os in
1072267ab2ff2Smrg    solaris*)
1072367ab2ff2Smrg        AC_CHECK_LIB([umem], [umem_alloc],
1072467ab2ff2Smrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
1072567ab2ff2Smrg        ;;
1072667ab2ff2Smrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
1072767ab2ff2Smrg        # both directly and inverted, so should not be 0 or 255.
1072867ab2ff2Smrg        malloc_debug_env='MALLOC_PERTURB_=15'
1072967ab2ff2Smrg        ;;
1073067ab2ff2Smrg    darwin*)
1073167ab2ff2Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
1073267ab2ff2Smrg        ;;
1073367ab2ff2Smrg    *bsd*)
1073467ab2ff2Smrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
1073567ab2ff2Smrg        ;;
1073667ab2ff2Smrgesac
10737e0963edeSmrg
1073867ab2ff2Smrg# User supplied flags override default flags
1073967ab2ff2Smrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
1074067ab2ff2Smrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
1074167ab2ff2Smrgfi
10742f05b35a2Smrg
10743b3a827e2SmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
10744b3a827e2Smrg]) # XORG_WITH_LINT
10745b3a827e2Smrg
10746b3a827e2Smrg# XORG_CHECK_MALLOC_ZERO
10747b3a827e2Smrg# ----------------------
10748b3a827e2Smrg# Minimum version: 1.0.0
10749b3a827e2Smrg#
10750b3a827e2Smrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
10751b3a827e2Smrg# malloc(0) returns NULL.  Packages should add one of these cflags to
10752b3a827e2Smrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
10753b3a827e2SmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
10754b3a827e2SmrgAC_ARG_ENABLE(malloc0returnsnull,
10755b3a827e2Smrg	AS_HELP_STRING([--enable-malloc0returnsnull],
10756b3a827e2Smrg		       [malloc(0) returns NULL (default: auto)]),
10757b3a827e2Smrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
10758b3a827e2Smrg	[MALLOC_ZERO_RETURNS_NULL=auto])
10759b3a827e2Smrg
10760b3a827e2SmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
10761b3a827e2Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
10762b3a827e2SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
10763b3a827e2Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
10764b3a827e2Smrg#include <stdlib.h>
10765b3a827e2Smrg],[
10766b3a827e2Smrg    char *m0, *r0, *c0, *p;
10767b3a827e2Smrg    m0 = malloc(0);
10768b3a827e2Smrg    p = malloc(10);
10769b3a827e2Smrg    r0 = realloc(p,0);
10770b3a827e2Smrg    c0 = calloc(0,10);
10771b3a827e2Smrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
10772b3a827e2Smrg])],
10773b3a827e2Smrg		[xorg_cv_malloc0_returns_null=yes],
10774b3a827e2Smrg		[xorg_cv_malloc0_returns_null=no])])
10775b3a827e2SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
10776b3a827e2Smrgfi
10777b3a827e2SmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
10778b3a827e2Smrg
10779b3a827e2Smrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
10780b3a827e2Smrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
10781b3a827e2Smrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
10782b3a827e2Smrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
10783b3a827e2Smrgelse
10784b3a827e2Smrg	MALLOC_ZERO_CFLAGS=""
10785b3a827e2Smrg	XMALLOC_ZERO_CFLAGS=""
10786b3a827e2Smrg	XTMALLOC_ZERO_CFLAGS=""
10787b3a827e2Smrgfi
10788b3a827e2Smrg
10789b3a827e2SmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
10790b3a827e2SmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
10791b3a827e2SmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
10792b3a827e2Smrg]) # XORG_CHECK_MALLOC_ZERO
10793b3a827e2Smrg
10794b3a827e2Smrg# XORG_WITH_LINT()
10795b3a827e2Smrg# ----------------
10796b3a827e2Smrg# Minimum version: 1.1.0
10797b3a827e2Smrg#
10798b3a827e2Smrg# This macro enables the use of a tool that flags some suspicious and
10799b3a827e2Smrg# non-portable constructs (likely to be bugs) in C language source code.
10800b3a827e2Smrg# It will attempt to locate the tool and use appropriate options.
10801b3a827e2Smrg# There are various lint type tools on different platforms.
10802b3a827e2Smrg#
10803b3a827e2Smrg# Interface to module:
10804b3a827e2Smrg# LINT:		returns the path to the tool found on the platform
10805b3a827e2Smrg#		or the value set to LINT on the configure cmd line
10806b3a827e2Smrg#		also an Automake conditional
10807b3a827e2Smrg# LINT_FLAGS:	an Automake variable with appropriate flags
10808b3a827e2Smrg#
10809b3a827e2Smrg# --with-lint:	'yes' user instructs the module to use lint
10810b3a827e2Smrg#		'no' user instructs the module not to use lint (default)
10811b3a827e2Smrg#
10812b3a827e2Smrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
10813b3a827e2Smrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
10814b3a827e2Smrg#
10815b3a827e2SmrgAC_DEFUN([XORG_WITH_LINT],[
10816b3a827e2Smrg
10817b3a827e2SmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
10818b3a827e2SmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
10819b3a827e2SmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
10820b3a827e2Smrg		[Use a lint-style source code checker (default: disabled)])],
10821b3a827e2Smrg		[use_lint=$withval], [use_lint=no])
10822b3a827e2Smrg
10823b3a827e2Smrg# Obtain platform specific info like program name and options
10824b3a827e2Smrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
10825b3a827e2Smrgcase $host_os in
10826b3a827e2Smrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
10827b3a827e2Smrg	lint_name=splint
10828b3a827e2Smrg	lint_options="-badflag"
10829b3a827e2Smrg	;;
10830b3a827e2Smrg  *freebsd* | *netbsd*)
10831b3a827e2Smrg	lint_name=lint
10832b3a827e2Smrg	lint_options="-u -b"
10833b3a827e2Smrg	;;
10834b3a827e2Smrg  *solaris*)
10835b3a827e2Smrg	lint_name=lint
10836b3a827e2Smrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
10837b3a827e2Smrg	;;
10838b3a827e2Smrgesac
10839b3a827e2Smrg
10840b3a827e2Smrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
10841b3a827e2Smrgif test "x$use_lint" = x"yes" ; then
10842b3a827e2Smrg   AC_PATH_PROG([LINT], [$lint_name])
10843b3a827e2Smrg   if test "x$LINT" = "x"; then
10844b3a827e2Smrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
10845b3a827e2Smrg   fi
10846b3a827e2Smrgelif test "x$use_lint" = x"no" ; then
10847b3a827e2Smrg   if test "x$LINT" != "x"; then
10848b3a827e2Smrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
10849b3a827e2Smrg   fi
10850b3a827e2Smrgelse
10851b3a827e2Smrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
10852b3a827e2Smrgfi
10853b3a827e2Smrg
10854b3a827e2Smrg# User supplied flags override default flags
10855b3a827e2Smrgif test "x$LINT_FLAGS" != "x"; then
10856b3a827e2Smrg   lint_options=$LINT_FLAGS
10857b3a827e2Smrgfi
10858b3a827e2Smrg
10859b3a827e2SmrgAC_SUBST([LINT_FLAGS],[$lint_options])
10860b3a827e2SmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
10861b3a827e2Smrg
10862b3a827e2Smrg]) # XORG_WITH_LINT
10863b3a827e2Smrg
10864b3a827e2Smrg# XORG_LINT_LIBRARY(LIBNAME)
10865b3a827e2Smrg# --------------------------
10866b3a827e2Smrg# Minimum version: 1.1.0
10867b3a827e2Smrg#
10868b3a827e2Smrg# Sets up flags for building lint libraries for checking programs that call
10869b3a827e2Smrg# functions in the library.
10870b3a827e2Smrg#
10871b3a827e2Smrg# Interface to module:
10872b3a827e2Smrg# LINTLIB		- Automake variable with the name of lint library file to make
10873b3a827e2Smrg# MAKE_LINT_LIB		- Automake conditional
10874b3a827e2Smrg#
10875b3a827e2Smrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
10876b3a827e2Smrg#			  - 'no' user instructs the module not to create a lint library (default)
10877b3a827e2Smrg
10878b3a827e2SmrgAC_DEFUN([XORG_LINT_LIBRARY],[
10879b3a827e2SmrgAC_REQUIRE([XORG_WITH_LINT])
10880b3a827e2SmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
10881b3a827e2Smrg	[Create lint library (default: disabled)])],
10882b3a827e2Smrg	[make_lint_lib=$enableval], [make_lint_lib=no])
10883b3a827e2Smrg
10884b3a827e2Smrgif test "x$make_lint_lib" = x"yes" ; then
10885b3a827e2Smrg   LINTLIB=llib-l$1.ln
10886b3a827e2Smrg   if test "x$LINT" = "x"; then
10887b3a827e2Smrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
10888b3a827e2Smrg   fi
10889b3a827e2Smrgelif test "x$make_lint_lib" != x"no" ; then
10890b3a827e2Smrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
10891b3a827e2Smrgfi
10892b3a827e2Smrg
10893b3a827e2SmrgAC_SUBST(LINTLIB)
10894b3a827e2SmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
10895b3a827e2Smrg
10896b3a827e2Smrg]) # XORG_LINT_LIBRARY
10897b3a827e2Smrg
10898b3a827e2Smrg# XORG_COMPILER_BRAND
10899b3a827e2Smrg# -------------------
10900b3a827e2Smrg# Minimum version: 1.14.0
10901b3a827e2Smrg#
10902b3a827e2Smrg# Checks for various brands of compilers and sets flags as appropriate:
10903b3a827e2Smrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
10904b3a827e2Smrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
10905b3a827e2Smrg#   clang compiler - sets CLANGCC to "yes"
10906b3a827e2Smrg#   Intel compiler - sets INTELCC to "yes"
10907b3a827e2Smrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
10908b3a827e2Smrg#
10909b3a827e2SmrgAC_DEFUN([XORG_COMPILER_BRAND], [
10910b3a827e2SmrgAC_LANG_CASE(
10911b3a827e2Smrg	[C], [
10912b3a827e2Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10913b3a827e2Smrg	],
10914b3a827e2Smrg	[C++], [
10915b3a827e2Smrg		AC_REQUIRE([AC_PROG_CXX])
10916b3a827e2Smrg	]
10917b3a827e2Smrg)
10918b3a827e2SmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
10919b3a827e2SmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
10920b3a827e2SmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
10921b3a827e2Smrg]) # XORG_COMPILER_BRAND
10922b3a827e2Smrg
10923b3a827e2Smrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
10924b3a827e2Smrg# ---------------
10925b3a827e2Smrg# Minimum version: 1.16.0
10926b3a827e2Smrg#
10927b3a827e2Smrg# Test if the compiler works when passed the given flag as a command line argument.
10928b3a827e2Smrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
10929b3a827e2Smrg# next flag in the list until there are no more options.
10930b3a827e2Smrg#
10931b3a827e2Smrg# Note that this does not guarantee that the compiler supports the flag as some
10932b3a827e2Smrg# compilers will simply ignore arguments that they do not understand, but we do
10933b3a827e2Smrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
10934b3a827e2Smrg# -Werror=unused-command-line-argument
10935b3a827e2Smrg#
10936b3a827e2SmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
10937b3a827e2Smrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10938b3a827e2Smrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
10939b3a827e2Smrg
10940b3a827e2SmrgAC_LANG_COMPILER_REQUIRE
10941b3a827e2Smrg
10942b3a827e2SmrgAC_LANG_CASE(
10943b3a827e2Smrg	[C], [
10944b3a827e2Smrg		AC_REQUIRE([AC_PROG_CC_C99])
10945b3a827e2Smrg		define([PREFIX], [C])
10946b3a827e2Smrg		define([CACHE_PREFIX], [cc])
10947b3a827e2Smrg		define([COMPILER], [$CC])
10948b3a827e2Smrg	],
10949b3a827e2Smrg	[C++], [
10950b3a827e2Smrg		define([PREFIX], [CXX])
10951b3a827e2Smrg		define([CACHE_PREFIX], [cxx])
10952b3a827e2Smrg		define([COMPILER], [$CXX])
10953b3a827e2Smrg	]
10954b3a827e2Smrg)
10955b3a827e2Smrg
10956b3a827e2Smrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
10957b3a827e2Smrg
10958b3a827e2Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
10959b3a827e2Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10960b3a827e2Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
10961b3a827e2Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
10962b3a827e2Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10963b3a827e2Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
10964b3a827e2Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
10965b3a827e2Smrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
10966b3a827e2Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10967b3a827e2Smrgfi
10968b3a827e2Smrg
10969b3a827e2Smrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
10970b3a827e2Smrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
10971b3a827e2Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10972b3a827e2Smrg	fi
10973b3a827e2Smrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10974b3a827e2Smrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
10975b3a827e2Smrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
10976b3a827e2Smrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
10977b3a827e2Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
10978b3a827e2Smrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
10979b3a827e2Smrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
10980b3a827e2Smrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
10981b3a827e2Smrgfi
10982b3a827e2Smrg
10983b3a827e2Smrgfound="no"
10984b3a827e2Smrgm4_foreach([flag], m4_cdr($@), [
10985b3a827e2Smrg	if test $found = "no" ; then
10986b3a827e2Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
10987b3a827e2Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
10988b3a827e2Smrg		fi
10989b3a827e2Smrg
10990b3a827e2Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
10991b3a827e2Smrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
10992b3a827e2Smrg		fi
10993b3a827e2Smrg
10994b3a827e2Smrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
10995b3a827e2Smrg
10996b3a827e2Smrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
10997b3a827e2Smrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
10998b3a827e2Smrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
10999b3a827e2Smrg		AC_CACHE_VAL($cacheid,
11000b3a827e2Smrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
11001b3a827e2Smrg					     [eval $cacheid=yes],
11002b3a827e2Smrg					     [eval $cacheid=no])])
11003b3a827e2Smrg
11004b3a827e2Smrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11005b3a827e2Smrg
11006b3a827e2Smrg		eval supported=\$$cacheid
11007b3a827e2Smrg		AC_MSG_RESULT([$supported])
11008b3a827e2Smrg		if test "$supported" = "yes" ; then
11009b3a827e2Smrg			$1="$$1 ]flag["
11010b3a827e2Smrg			found="yes"
11011b3a827e2Smrg		fi
11012b3a827e2Smrg	fi
11013b3a827e2Smrg])
11014b3a827e2Smrg]) # XORG_TESTSET_CFLAG
11015b3a827e2Smrg
11016b3a827e2Smrg# XORG_COMPILER_FLAGS
11017b3a827e2Smrg# ---------------
11018b3a827e2Smrg# Minimum version: 1.16.0
11019b3a827e2Smrg#
11020b3a827e2Smrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
11021b3a827e2Smrg# arguments supported by the selected compiler which do NOT alter the generated
11022b3a827e2Smrg# code.  These arguments will cause the compiler to print various warnings
11023b3a827e2Smrg# during compilation AND turn a conservative set of warnings into errors.
11024b3a827e2Smrg#
11025b3a827e2Smrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
11026b3a827e2Smrg# future versions of util-macros as options are added to new compilers.
11027b3a827e2Smrg#
11028b3a827e2SmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
11029b3a827e2SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11030b3a827e2Smrg
11031b3a827e2SmrgAC_ARG_ENABLE(selective-werror,
11032b3a827e2Smrg              AS_HELP_STRING([--disable-selective-werror],
11033b3a827e2Smrg                             [Turn off selective compiler errors. (default: enabled)]),
11034b3a827e2Smrg              [SELECTIVE_WERROR=$enableval],
11035b3a827e2Smrg              [SELECTIVE_WERROR=yes])
11036b3a827e2Smrg
11037b3a827e2SmrgAC_LANG_CASE(
11038b3a827e2Smrg        [C], [
11039b3a827e2Smrg                define([PREFIX], [C])
11040b3a827e2Smrg        ],
11041b3a827e2Smrg        [C++], [
11042b3a827e2Smrg                define([PREFIX], [CXX])
11043b3a827e2Smrg        ]
11044b3a827e2Smrg)
11045b3a827e2Smrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
11046b3a827e2Smrgif test "x$SUNCC" = "xyes"; then
11047b3a827e2Smrg    [BASE_]PREFIX[FLAGS]="-v"
11048b3a827e2Smrgelse
11049b3a827e2Smrg    [BASE_]PREFIX[FLAGS]=""
11050b3a827e2Smrgfi
11051b3a827e2Smrg
11052b3a827e2Smrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
11053b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
11054b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
11055b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
11056b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
11057b3a827e2Smrg
11058b3a827e2SmrgAC_LANG_CASE(
11059b3a827e2Smrg	[C], [
11060b3a827e2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
11061b3a827e2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
11062b3a827e2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
11063b3a827e2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11064b3a827e2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
11065b3a827e2Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
11066b3a827e2Smrg	]
11067b3a827e2Smrg)
11068b3a827e2Smrg
11069b3a827e2Smrg# This chunk adds additional warnings that could catch undesired effects.
11070b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
11071b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
11072b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
11073b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
11074b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
11075b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11076b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
11077b3a827e2Smrg
11078b3a827e2Smrg# These are currently disabled because they are noisy.  They will be enabled
11079b3a827e2Smrg# in the future once the codebase is sufficiently modernized to silence
11080b3a827e2Smrg# them.  For now, I don't want them to drown out the other warnings.
11081b3a827e2Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
11082b3a827e2Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11083b3a827e2Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11084b3a827e2Smrg
11085b3a827e2Smrg# Turn some warnings into errors, so we don't accidently get successful builds
11086b3a827e2Smrg# when there are problems that should be fixed.
11087b3a827e2Smrg
11088b3a827e2Smrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
11089b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
11090b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
11091b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
11092b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
11093b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
11094b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
11095b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
11096b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
11097b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
11098b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
11099b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
11100b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
11101b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
11102b3a827e2Smrgelse
11103b3a827e2SmrgAC_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])
11104b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
11105b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
11106b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
11107b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
11108b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
11109b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
11110b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
11111b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
11112b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
11113b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
11114b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
11115b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
11116b3a827e2SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11117b3a827e2Smrgfi
11118b3a827e2Smrg
11119b3a827e2SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11120b3a827e2Smrg]) # XORG_COMPILER_FLAGS
11121b3a827e2Smrg
11122b3a827e2Smrg# XORG_CWARNFLAGS
11123b3a827e2Smrg# ---------------
11124b3a827e2Smrg# Minimum version: 1.2.0
11125b3a827e2Smrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11126b3a827e2Smrg#
11127b3a827e2Smrg# Defines CWARNFLAGS to enable C compiler warnings.
11128b3a827e2Smrg#
11129b3a827e2Smrg# This function is deprecated because it defines -fno-strict-aliasing
11130b3a827e2Smrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
11131b3a827e2Smrg# is needed, then it should be added explicitly in the module when
11132b3a827e2Smrg# it is updated to use BASE_CFLAGS.
11133b3a827e2Smrg#
11134b3a827e2SmrgAC_DEFUN([XORG_CWARNFLAGS], [
11135b3a827e2SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11136b3a827e2SmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11137b3a827e2SmrgAC_LANG_CASE(
11138b3a827e2Smrg	[C], [
11139b3a827e2Smrg		CWARNFLAGS="$BASE_CFLAGS"
11140b3a827e2Smrg		if  test "x$GCC" = xyes ; then
11141b3a827e2Smrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
11142b3a827e2Smrg		fi
11143b3a827e2Smrg		AC_SUBST(CWARNFLAGS)
11144b3a827e2Smrg	]
11145b3a827e2Smrg)
11146b3a827e2Smrg]) # XORG_CWARNFLAGS
11147b3a827e2Smrg
11148b3a827e2Smrg# XORG_STRICT_OPTION
11149b3a827e2Smrg# -----------------------
11150b3a827e2Smrg# Minimum version: 1.3.0
11151b3a827e2Smrg#
11152b3a827e2Smrg# Add configure option to enable strict compilation flags, such as treating
11153b3a827e2Smrg# warnings as fatal errors.
11154b3a827e2Smrg# If --enable-strict-compilation is passed to configure, adds strict flags to
11155b3a827e2Smrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
11156b3a827e2Smrg#
11157b3a827e2Smrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
11158b3a827e2Smrg# when strict compilation is unconditionally desired.
11159b3a827e2SmrgAC_DEFUN([XORG_STRICT_OPTION], [
11160b3a827e2SmrgAC_REQUIRE([XORG_CWARNFLAGS])
11161b3a827e2SmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
11162b3a827e2Smrg
11163b3a827e2SmrgAC_ARG_ENABLE(strict-compilation,
11164b3a827e2Smrg			  AS_HELP_STRING([--enable-strict-compilation],
11165b3a827e2Smrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
11166b3a827e2Smrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
11167b3a827e2Smrg
11168b3a827e2SmrgAC_LANG_CASE(
11169b3a827e2Smrg        [C], [
11170b3a827e2Smrg                define([PREFIX], [C])
11171b3a827e2Smrg        ],
11172b3a827e2Smrg        [C++], [
11173b3a827e2Smrg                define([PREFIX], [CXX])
11174b3a827e2Smrg        ]
11175b3a827e2Smrg)
11176b3a827e2Smrg
11177b3a827e2Smrg[STRICT_]PREFIX[FLAGS]=""
11178b3a827e2SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
11179b3a827e2SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11180b3a827e2Smrg
11181b3a827e2Smrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
11182b3a827e2Smrg# activate it with -Werror, so we add it here explicitly.
11183b3a827e2SmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
11184b3a827e2Smrg
11185b3a827e2Smrgif test "x$STRICT_COMPILE" = "xyes"; then
11186b3a827e2Smrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
11187b3a827e2Smrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
11188b3a827e2Smrgfi
11189b3a827e2SmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
11190b3a827e2SmrgAC_SUBST([BASE_]PREFIX[FLAGS])
11191b3a827e2SmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
11192b3a827e2Smrg]) # XORG_STRICT_OPTION
11193b3a827e2Smrg
11194b3a827e2Smrg# XORG_DEFAULT_OPTIONS
11195b3a827e2Smrg# --------------------
11196b3a827e2Smrg# Minimum version: 1.3.0
11197b3a827e2Smrg#
11198b3a827e2Smrg# Defines default options for X.Org modules.
11199b3a827e2Smrg#
11200b3a827e2SmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
11201b3a827e2SmrgAC_REQUIRE([AC_PROG_INSTALL])
11202b3a827e2SmrgXORG_COMPILER_FLAGS
11203b3a827e2SmrgXORG_CWARNFLAGS
11204b3a827e2SmrgXORG_STRICT_OPTION
11205b3a827e2SmrgXORG_RELEASE_VERSION
11206b3a827e2SmrgXORG_CHANGELOG
11207b3a827e2SmrgXORG_INSTALL
11208b3a827e2SmrgXORG_MANPAGE_SECTIONS
11209b3a827e2Smrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
11210b3a827e2Smrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
11211b3a827e2Smrg]) # XORG_DEFAULT_OPTIONS
11212b3a827e2Smrg
11213b3a827e2Smrg# XORG_INSTALL()
11214b3a827e2Smrg# ----------------
11215b3a827e2Smrg# Minimum version: 1.4.0
11216b3a827e2Smrg#
11217b3a827e2Smrg# Defines the variable INSTALL_CMD as the command to copy
11218b3a827e2Smrg# INSTALL from $prefix/share/util-macros.
11219b3a827e2Smrg#
11220b3a827e2SmrgAC_DEFUN([XORG_INSTALL], [
11221b3a827e2SmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
11222b3a827e2Smrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
11223b3a827e2SmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
11224b3a827e2Smrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
11225b3a827e2Smrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
11226b3a827e2Smrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
11227b3a827e2SmrgAC_SUBST([INSTALL_CMD])
11228b3a827e2Smrg]) # XORG_INSTALL
11229b3a827e2Smrgdnl Copyright 2005 Red Hat, Inc
11230b3a827e2Smrgdnl
11231b3a827e2Smrgdnl Permission to use, copy, modify, distribute, and sell this software and its
11232b3a827e2Smrgdnl documentation for any purpose is hereby granted without fee, provided that
11233b3a827e2Smrgdnl the above copyright notice appear in all copies and that both that
11234b3a827e2Smrgdnl copyright notice and this permission notice appear in supporting
11235b3a827e2Smrgdnl documentation.
11236b3a827e2Smrgdnl
11237b3a827e2Smrgdnl The above copyright notice and this permission notice shall be included
11238b3a827e2Smrgdnl in all copies or substantial portions of the Software.
11239b3a827e2Smrgdnl
11240b3a827e2Smrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11241b3a827e2Smrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
11242b3a827e2Smrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
11243b3a827e2Smrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
11244b3a827e2Smrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
11245b3a827e2Smrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
11246b3a827e2Smrgdnl OTHER DEALINGS IN THE SOFTWARE.
11247b3a827e2Smrgdnl
11248b3a827e2Smrgdnl Except as contained in this notice, the name of the copyright holders shall
11249b3a827e2Smrgdnl not be used in advertising or otherwise to promote the sale, use or
11250b3a827e2Smrgdnl other dealings in this Software without prior written authorization
11251b3a827e2Smrgdnl from the copyright holders.
11252b3a827e2Smrgdnl
11253b3a827e2Smrg
11254b3a827e2Smrg# XORG_RELEASE_VERSION
11255b3a827e2Smrg# --------------------
11256b3a827e2Smrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11257b3a827e2Smrg
11258b3a827e2SmrgAC_DEFUN([XORG_RELEASE_VERSION],[
11259b3a827e2Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
11260b3a827e2Smrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
11261b3a827e2Smrg		[Major version of this package])
11262b3a827e2Smrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
11263b3a827e2Smrg	if test "x$PVM" = "x"; then
11264b3a827e2Smrg		PVM="0"
11265b3a827e2Smrg	fi
11266b3a827e2Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
11267b3a827e2Smrg		[$PVM],
11268b3a827e2Smrg		[Minor version of this package])
11269b3a827e2Smrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
11270b3a827e2Smrg	if test "x$PVP" = "x"; then
11271b3a827e2Smrg		PVP="0"
11272b3a827e2Smrg	fi
11273b3a827e2Smrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
11274b3a827e2Smrg		[$PVP],
11275b3a827e2Smrg		[Patch version of this package])
11276b3a827e2Smrg])
11277b3a827e2Smrg
11278b3a827e2Smrg# XORG_CHANGELOG()
11279b3a827e2Smrg# ----------------
11280b3a827e2Smrg# Minimum version: 1.2.0
11281b3a827e2Smrg#
11282b3a827e2Smrg# Defines the variable CHANGELOG_CMD as the command to generate
11283b3a827e2Smrg# ChangeLog from git.
11284b3a827e2Smrg#
11285b3a827e2Smrg#
11286b3a827e2SmrgAC_DEFUN([XORG_CHANGELOG], [
11287b3a827e2SmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
11288b3a827e2Smrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
11289b3a827e2Smrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
11290b3a827e2Smrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
11291b3a827e2SmrgAC_SUBST([CHANGELOG_CMD])
11292b3a827e2Smrg]) # XORG_CHANGELOG
11293b3a827e2Smrg
11294b3a827e2Smrg# Copyright (C) 2002-2017 Free Software Foundation, Inc.
11295b3a827e2Smrg#
11296b3a827e2Smrg# This file is free software; the Free Software Foundation
11297b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11298b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11299b3a827e2Smrg
11300b3a827e2Smrg# AM_AUTOMAKE_VERSION(VERSION)
11301b3a827e2Smrg# ----------------------------
11302b3a827e2Smrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
11303b3a827e2Smrg# generated from the m4 files accompanying Automake X.Y.
11304b3a827e2Smrg# (This private macro should not be called outside this file.)
11305b3a827e2SmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
11306b3a827e2Smrg[am__api_version='1.15'
11307b3a827e2Smrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
11308b3a827e2Smrgdnl require some minimum version.  Point them to the right macro.
11309b3a827e2Smrgm4_if([$1], [1.15.1], [],
11310b3a827e2Smrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
11311b3a827e2Smrg])
11312b3a827e2Smrg
11313b3a827e2Smrg# _AM_AUTOCONF_VERSION(VERSION)
11314b3a827e2Smrg# -----------------------------
11315b3a827e2Smrg# aclocal traces this macro to find the Autoconf version.
11316b3a827e2Smrg# This is a private macro too.  Using m4_define simplifies
11317b3a827e2Smrg# the logic in aclocal, which can simply ignore this definition.
11318b3a827e2Smrgm4_define([_AM_AUTOCONF_VERSION], [])
11319b3a827e2Smrg
11320b3a827e2Smrg# AM_SET_CURRENT_AUTOMAKE_VERSION
11321b3a827e2Smrg# -------------------------------
11322b3a827e2Smrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
11323b3a827e2Smrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
11324b3a827e2SmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11325b3a827e2Smrg[AM_AUTOMAKE_VERSION([1.15.1])dnl
11326b3a827e2Smrgm4_ifndef([AC_AUTOCONF_VERSION],
11327b3a827e2Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
11328b3a827e2Smrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
11329b3a827e2Smrg
11330b3a827e2Smrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
11331b3a827e2Smrg
11332b3a827e2Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
11333b3a827e2Smrg#
11334b3a827e2Smrg# This file is free software; the Free Software Foundation
11335b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11336b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11337b3a827e2Smrg
11338b3a827e2Smrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11339b3a827e2Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
11340b3a827e2Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
11341b3a827e2Smrg#
11342b3a827e2Smrg# Of course, Automake must honor this variable whenever it calls a
11343b3a827e2Smrg# tool from the auxiliary directory.  The problem is that $srcdir (and
11344b3a827e2Smrg# therefore $ac_aux_dir as well) can be either absolute or relative,
11345b3a827e2Smrg# depending on how configure is run.  This is pretty annoying, since
11346b3a827e2Smrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11347b3a827e2Smrg# source directory, any form will work fine, but in subdirectories a
11348b3a827e2Smrg# relative path needs to be adjusted first.
11349b3a827e2Smrg#
11350b3a827e2Smrg# $ac_aux_dir/missing
11351b3a827e2Smrg#    fails when called from a subdirectory if $ac_aux_dir is relative
11352b3a827e2Smrg# $top_srcdir/$ac_aux_dir/missing
11353b3a827e2Smrg#    fails if $ac_aux_dir is absolute,
11354b3a827e2Smrg#    fails when called from a subdirectory in a VPATH build with
11355b3a827e2Smrg#          a relative $ac_aux_dir
11356b3a827e2Smrg#
11357b3a827e2Smrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11358b3a827e2Smrg# are both prefixed by $srcdir.  In an in-source build this is usually
11359b3a827e2Smrg# harmless because $srcdir is '.', but things will broke when you
11360b3a827e2Smrg# start a VPATH build or use an absolute $srcdir.
11361b3a827e2Smrg#
11362b3a827e2Smrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11363b3a827e2Smrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
11364b3a827e2Smrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11365b3a827e2Smrg# and then we would define $MISSING as
11366b3a827e2Smrg#   MISSING="\${SHELL} $am_aux_dir/missing"
11367b3a827e2Smrg# This will work as long as MISSING is not called from configure, because
11368b3a827e2Smrg# unfortunately $(top_srcdir) has no meaning in configure.
11369b3a827e2Smrg# However there are other variables, like CC, which are often used in
11370b3a827e2Smrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
11371b3a827e2Smrg#
11372b3a827e2Smrg# Another solution, used here, is to always expand $ac_aux_dir to an
11373b3a827e2Smrg# absolute PATH.  The drawback is that using absolute paths prevent a
11374b3a827e2Smrg# configured tree to be moved without reconfiguration.
11375b3a827e2Smrg
11376b3a827e2SmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
11377b3a827e2Smrg[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
11378b3a827e2Smrg# Expand $ac_aux_dir to an absolute path.
11379b3a827e2Smrgam_aux_dir=`cd "$ac_aux_dir" && pwd`
11380b3a827e2Smrg])
11381b3a827e2Smrg
11382b3a827e2Smrg# AM_CONDITIONAL                                            -*- Autoconf -*-
11383b3a827e2Smrg
11384b3a827e2Smrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
11385b3a827e2Smrg#
11386b3a827e2Smrg# This file is free software; the Free Software Foundation
11387b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11388b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11389b3a827e2Smrg
11390b3a827e2Smrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11391b3a827e2Smrg# -------------------------------------
11392b3a827e2Smrg# Define a conditional.
11393b3a827e2SmrgAC_DEFUN([AM_CONDITIONAL],
11394b3a827e2Smrg[AC_PREREQ([2.52])dnl
11395b3a827e2Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
11396b3a827e2Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11397b3a827e2SmrgAC_SUBST([$1_TRUE])dnl
11398b3a827e2SmrgAC_SUBST([$1_FALSE])dnl
11399b3a827e2Smrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
11400b3a827e2Smrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
11401b3a827e2Smrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
11402b3a827e2Smrgif $2; then
11403b3a827e2Smrg  $1_TRUE=
11404b3a827e2Smrg  $1_FALSE='#'
11405b3a827e2Smrgelse
11406b3a827e2Smrg  $1_TRUE='#'
11407b3a827e2Smrg  $1_FALSE=
11408b3a827e2Smrgfi
11409b3a827e2SmrgAC_CONFIG_COMMANDS_PRE(
11410b3a827e2Smrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11411b3a827e2Smrg  AC_MSG_ERROR([[conditional "$1" was never defined.
11412b3a827e2SmrgUsually this means the macro was only invoked conditionally.]])
11413b3a827e2Smrgfi])])
11414b3a827e2Smrg
11415b3a827e2Smrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
11416b3a827e2Smrg#
11417b3a827e2Smrg# This file is free software; the Free Software Foundation
11418b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11419b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11420b3a827e2Smrg
11421b3a827e2Smrg
11422b3a827e2Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
11423b3a827e2Smrg# written in clear, in which case automake, when reading aclocal.m4,
11424b3a827e2Smrg# will think it sees a *use*, and therefore will trigger all it's
11425b3a827e2Smrg# C support machinery.  Also note that it means that autoscan, seeing
11426b3a827e2Smrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11427b3a827e2Smrg
11428b3a827e2Smrg
11429b3a827e2Smrg# _AM_DEPENDENCIES(NAME)
11430b3a827e2Smrg# ----------------------
11431b3a827e2Smrg# See how the compiler implements dependency checking.
11432b3a827e2Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
11433b3a827e2Smrg# We try a few techniques and use that to set a single cache variable.
11434b3a827e2Smrg#
11435b3a827e2Smrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11436b3a827e2Smrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11437b3a827e2Smrg# dependency, and given that the user is not expected to run this macro,
11438b3a827e2Smrg# just rely on AC_PROG_CC.
11439b3a827e2SmrgAC_DEFUN([_AM_DEPENDENCIES],
11440b3a827e2Smrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
11441b3a827e2SmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11442b3a827e2SmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
11443b3a827e2SmrgAC_REQUIRE([AM_DEP_TRACK])dnl
11444b3a827e2Smrg
11445b3a827e2Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
11446b3a827e2Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
11447b3a827e2Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11448b3a827e2Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
11449b3a827e2Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
11450b3a827e2Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
11451b3a827e2Smrg                    [depcc="$$1"   am_compiler_list=])
11452b3a827e2Smrg
11453b3a827e2SmrgAC_CACHE_CHECK([dependency style of $depcc],
11454b3a827e2Smrg               [am_cv_$1_dependencies_compiler_type],
11455b3a827e2Smrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11456b3a827e2Smrg  # We make a subdir and do the tests there.  Otherwise we can end up
11457b3a827e2Smrg  # making bogus files that we don't know about and never remove.  For
11458b3a827e2Smrg  # instance it was reported that on HP-UX the gcc test will end up
11459b3a827e2Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
11460b3a827e2Smrg  # in D".
11461b3a827e2Smrg  rm -rf conftest.dir
11462b3a827e2Smrg  mkdir conftest.dir
11463b3a827e2Smrg  # Copy depcomp to subdir because otherwise we won't find it if we're
11464b3a827e2Smrg  # using a relative directory.
11465b3a827e2Smrg  cp "$am_depcomp" conftest.dir
11466b3a827e2Smrg  cd conftest.dir
11467b3a827e2Smrg  # We will build objects and dependencies in a subdirectory because
11468b3a827e2Smrg  # it helps to detect inapplicable dependency modes.  For instance
11469b3a827e2Smrg  # both Tru64's cc and ICC support -MD to output dependencies as a
11470b3a827e2Smrg  # side effect of compilation, but ICC will put the dependencies in
11471b3a827e2Smrg  # the current directory while Tru64 will put them in the object
11472b3a827e2Smrg  # directory.
11473b3a827e2Smrg  mkdir sub
11474b3a827e2Smrg
11475b3a827e2Smrg  am_cv_$1_dependencies_compiler_type=none
11476b3a827e2Smrg  if test "$am_compiler_list" = ""; then
11477b3a827e2Smrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11478b3a827e2Smrg  fi
11479b3a827e2Smrg  am__universal=false
11480b3a827e2Smrg  m4_case([$1], [CC],
11481b3a827e2Smrg    [case " $depcc " in #(
11482b3a827e2Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11483b3a827e2Smrg     esac],
11484b3a827e2Smrg    [CXX],
11485b3a827e2Smrg    [case " $depcc " in #(
11486b3a827e2Smrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
11487b3a827e2Smrg     esac])
11488b3a827e2Smrg
11489b3a827e2Smrg  for depmode in $am_compiler_list; do
11490b3a827e2Smrg    # Setup a source with many dependencies, because some compilers
11491b3a827e2Smrg    # like to wrap large dependency lists on column 80 (with \), and
11492b3a827e2Smrg    # we should not choose a depcomp mode which is confused by this.
11493b3a827e2Smrg    #
11494b3a827e2Smrg    # We need to recreate these files for each test, as the compiler may
11495b3a827e2Smrg    # overwrite some of them when testing with obscure command lines.
11496b3a827e2Smrg    # This happens at least with the AIX C compiler.
11497b3a827e2Smrg    : > sub/conftest.c
11498b3a827e2Smrg    for i in 1 2 3 4 5 6; do
11499b3a827e2Smrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
11500b3a827e2Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
11501b3a827e2Smrg      # Solaris 10 /bin/sh.
11502b3a827e2Smrg      echo '/* dummy */' > sub/conftst$i.h
11503b3a827e2Smrg    done
11504b3a827e2Smrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
11505b3a827e2Smrg
11506b3a827e2Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
11507b3a827e2Smrg    # mode.  It turns out that the SunPro C++ compiler does not properly
11508b3a827e2Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
11509b3a827e2Smrg    # versions had trouble with output in subdirs.
11510b3a827e2Smrg    am__obj=sub/conftest.${OBJEXT-o}
11511b3a827e2Smrg    am__minus_obj="-o $am__obj"
11512b3a827e2Smrg    case $depmode in
11513b3a827e2Smrg    gcc)
11514b3a827e2Smrg      # This depmode causes a compiler race in universal mode.
11515b3a827e2Smrg      test "$am__universal" = false || continue
11516b3a827e2Smrg      ;;
11517b3a827e2Smrg    nosideeffect)
11518b3a827e2Smrg      # After this tag, mechanisms are not by side-effect, so they'll
11519b3a827e2Smrg      # only be used when explicitly requested.
11520b3a827e2Smrg      if test "x$enable_dependency_tracking" = xyes; then
11521b3a827e2Smrg	continue
11522b3a827e2Smrg      else
11523b3a827e2Smrg	break
11524b3a827e2Smrg      fi
11525b3a827e2Smrg      ;;
11526b3a827e2Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
11527b3a827e2Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
11528b3a827e2Smrg      # not run yet.  These depmodes are late enough in the game, and
11529b3a827e2Smrg      # so weak that their functioning should not be impacted.
11530b3a827e2Smrg      am__obj=conftest.${OBJEXT-o}
11531b3a827e2Smrg      am__minus_obj=
11532b3a827e2Smrg      ;;
11533b3a827e2Smrg    none) break ;;
11534b3a827e2Smrg    esac
11535b3a827e2Smrg    if depmode=$depmode \
11536b3a827e2Smrg       source=sub/conftest.c object=$am__obj \
11537b3a827e2Smrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
11538b3a827e2Smrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
11539b3a827e2Smrg         >/dev/null 2>conftest.err &&
11540b3a827e2Smrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
11541b3a827e2Smrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
11542b3a827e2Smrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
11543b3a827e2Smrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
11544b3a827e2Smrg      # icc doesn't choke on unknown options, it will just issue warnings
11545b3a827e2Smrg      # or remarks (even with -Werror).  So we grep stderr for any message
11546b3a827e2Smrg      # that says an option was ignored or not supported.
11547b3a827e2Smrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
11548b3a827e2Smrg      #   icc: Command line warning: ignoring option '-M'; no argument required
11549b3a827e2Smrg      # The diagnosis changed in icc 8.0:
11550b3a827e2Smrg      #   icc: Command line remark: option '-MP' not supported
11551b3a827e2Smrg      if (grep 'ignoring option' conftest.err ||
11552b3a827e2Smrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
11553b3a827e2Smrg        am_cv_$1_dependencies_compiler_type=$depmode
11554b3a827e2Smrg        break
11555b3a827e2Smrg      fi
11556b3a827e2Smrg    fi
11557b3a827e2Smrg  done
11558b3a827e2Smrg
11559b3a827e2Smrg  cd ..
11560b3a827e2Smrg  rm -rf conftest.dir
11561b3a827e2Smrgelse
11562b3a827e2Smrg  am_cv_$1_dependencies_compiler_type=none
11563b3a827e2Smrgfi
11564b3a827e2Smrg])
11565b3a827e2SmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
11566b3a827e2SmrgAM_CONDITIONAL([am__fastdep$1], [
11567b3a827e2Smrg  test "x$enable_dependency_tracking" != xno \
11568b3a827e2Smrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
11569b3a827e2Smrg])
11570b3a827e2Smrg
11571b3a827e2Smrg
11572b3a827e2Smrg# AM_SET_DEPDIR
11573b3a827e2Smrg# -------------
11574b3a827e2Smrg# Choose a directory name for dependency files.
11575b3a827e2Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
11576b3a827e2SmrgAC_DEFUN([AM_SET_DEPDIR],
11577b3a827e2Smrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
11578b3a827e2SmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
11579b3a827e2Smrg])
11580b3a827e2Smrg
11581b3a827e2Smrg
11582b3a827e2Smrg# AM_DEP_TRACK
11583b3a827e2Smrg# ------------
11584b3a827e2SmrgAC_DEFUN([AM_DEP_TRACK],
11585b3a827e2Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
11586b3a827e2SmrgAS_HELP_STRING(
11587b3a827e2Smrg  [--enable-dependency-tracking],
11588b3a827e2Smrg  [do not reject slow dependency extractors])
11589b3a827e2SmrgAS_HELP_STRING(
11590b3a827e2Smrg  [--disable-dependency-tracking],
11591b3a827e2Smrg  [speeds up one-time build])])
11592b3a827e2Smrgif test "x$enable_dependency_tracking" != xno; then
11593b3a827e2Smrg  am_depcomp="$ac_aux_dir/depcomp"
11594b3a827e2Smrg  AMDEPBACKSLASH='\'
11595b3a827e2Smrg  am__nodep='_no'
11596b3a827e2Smrgfi
11597b3a827e2SmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
11598b3a827e2SmrgAC_SUBST([AMDEPBACKSLASH])dnl
11599b3a827e2Smrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
11600b3a827e2SmrgAC_SUBST([am__nodep])dnl
11601b3a827e2Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
11602b3a827e2Smrg])
11603b3a827e2Smrg
11604b3a827e2Smrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
11605b3a827e2Smrg
11606b3a827e2Smrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
11607b3a827e2Smrg#
11608b3a827e2Smrg# This file is free software; the Free Software Foundation
11609b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11610b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11611b3a827e2Smrg
11612b3a827e2Smrg
11613b3a827e2Smrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
11614b3a827e2Smrg# ------------------------------
11615b3a827e2SmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
11616b3a827e2Smrg[{
11617b3a827e2Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
11618b3a827e2Smrg  # are listed without --file.  Let's play safe and only enable the eval
11619b3a827e2Smrg  # if we detect the quoting.
11620b3a827e2Smrg  case $CONFIG_FILES in
11621b3a827e2Smrg  *\'*) eval set x "$CONFIG_FILES" ;;
11622b3a827e2Smrg  *)   set x $CONFIG_FILES ;;
11623b3a827e2Smrg  esac
11624b3a827e2Smrg  shift
11625b3a827e2Smrg  for mf
11626b3a827e2Smrg  do
11627b3a827e2Smrg    # Strip MF so we end up with the name of the file.
11628b3a827e2Smrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
11629b3a827e2Smrg    # Check whether this is an Automake generated Makefile or not.
11630b3a827e2Smrg    # We used to match only the files named 'Makefile.in', but
11631b3a827e2Smrg    # some people rename them; so instead we look at the file content.
11632b3a827e2Smrg    # Grep'ing the first line is not enough: some people post-process
11633b3a827e2Smrg    # each Makefile.in and add a new line on top of each file to say so.
11634b3a827e2Smrg    # Grep'ing the whole file is not good either: AIX grep has a line
11635b3a827e2Smrg    # limit of 2048, but all sed's we know have understand at least 4000.
11636b3a827e2Smrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
11637b3a827e2Smrg      dirpart=`AS_DIRNAME("$mf")`
11638b3a827e2Smrg    else
11639b3a827e2Smrg      continue
11640b3a827e2Smrg    fi
11641b3a827e2Smrg    # Extract the definition of DEPDIR, am__include, and am__quote
11642b3a827e2Smrg    # from the Makefile without running 'make'.
11643b3a827e2Smrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
11644b3a827e2Smrg    test -z "$DEPDIR" && continue
11645b3a827e2Smrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
11646b3a827e2Smrg    test -z "$am__include" && continue
11647b3a827e2Smrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
11648b3a827e2Smrg    # Find all dependency output files, they are included files with
11649b3a827e2Smrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
11650b3a827e2Smrg    # simplest approach to changing $(DEPDIR) to its actual value in the
11651b3a827e2Smrg    # expansion.
11652b3a827e2Smrg    for file in `sed -n "
11653b3a827e2Smrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
11654b3a827e2Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
11655b3a827e2Smrg      # Make sure the directory exists.
11656b3a827e2Smrg      test -f "$dirpart/$file" && continue
11657b3a827e2Smrg      fdir=`AS_DIRNAME(["$file"])`
11658b3a827e2Smrg      AS_MKDIR_P([$dirpart/$fdir])
11659b3a827e2Smrg      # echo "creating $dirpart/$file"
11660b3a827e2Smrg      echo '# dummy' > "$dirpart/$file"
11661b3a827e2Smrg    done
11662b3a827e2Smrg  done
11663b3a827e2Smrg}
11664b3a827e2Smrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
11665b3a827e2Smrg
11666b3a827e2Smrg
11667b3a827e2Smrg# AM_OUTPUT_DEPENDENCY_COMMANDS
11668b3a827e2Smrg# -----------------------------
11669b3a827e2Smrg# This macro should only be invoked once -- use via AC_REQUIRE.
11670b3a827e2Smrg#
11671b3a827e2Smrg# This code is only required when automatic dependency tracking
11672b3a827e2Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
11673b3a827e2Smrg# need in order to bootstrap the dependency handling code.
11674b3a827e2SmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
11675b3a827e2Smrg[AC_CONFIG_COMMANDS([depfiles],
11676b3a827e2Smrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
11677b3a827e2Smrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
11678b3a827e2Smrg])
11679b3a827e2Smrg
11680b3a827e2Smrg# Do all the work for Automake.                             -*- Autoconf -*-
11681b3a827e2Smrg
11682b3a827e2Smrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
11683b3a827e2Smrg#
11684b3a827e2Smrg# This file is free software; the Free Software Foundation
11685b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11686b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11687b3a827e2Smrg
11688b3a827e2Smrg# This macro actually does too much.  Some checks are only needed if
11689b3a827e2Smrg# your package does certain things.  But this isn't really a big deal.
11690b3a827e2Smrg
11691b3a827e2Smrgdnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
11692b3a827e2Smrgm4_define([AC_PROG_CC],
11693b3a827e2Smrgm4_defn([AC_PROG_CC])
11694b3a827e2Smrg[_AM_PROG_CC_C_O
11695b3a827e2Smrg])
11696b3a827e2Smrg
11697b3a827e2Smrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
11698b3a827e2Smrg# AM_INIT_AUTOMAKE([OPTIONS])
11699b3a827e2Smrg# -----------------------------------------------
11700b3a827e2Smrg# The call with PACKAGE and VERSION arguments is the old style
11701b3a827e2Smrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
11702b3a827e2Smrg# and VERSION should now be passed to AC_INIT and removed from
11703b3a827e2Smrg# the call to AM_INIT_AUTOMAKE.
11704b3a827e2Smrg# We support both call styles for the transition.  After
11705b3a827e2Smrg# the next Automake release, Autoconf can make the AC_INIT
11706b3a827e2Smrg# arguments mandatory, and then we can depend on a new Autoconf
11707b3a827e2Smrg# release and drop the old call support.
11708b3a827e2SmrgAC_DEFUN([AM_INIT_AUTOMAKE],
11709b3a827e2Smrg[AC_PREREQ([2.65])dnl
11710b3a827e2Smrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
11711b3a827e2Smrgdnl the ones we care about.
11712b3a827e2Smrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
11713b3a827e2SmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
11714b3a827e2SmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
11715b3a827e2Smrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
11716b3a827e2Smrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
11717b3a827e2Smrg  # is not polluted with repeated "-I."
11718b3a827e2Smrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
11719b3a827e2Smrg  # test to see if srcdir already configured
11720b3a827e2Smrg  if test -f $srcdir/config.status; then
11721b3a827e2Smrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
11722b3a827e2Smrg  fi
11723b3a827e2Smrgfi
11724b3a827e2Smrg
11725b3a827e2Smrg# test whether we have cygpath
11726b3a827e2Smrgif test -z "$CYGPATH_W"; then
11727b3a827e2Smrg  if (cygpath --version) >/dev/null 2>/dev/null; then
11728b3a827e2Smrg    CYGPATH_W='cygpath -w'
11729b3a827e2Smrg  else
11730b3a827e2Smrg    CYGPATH_W=echo
11731b3a827e2Smrg  fi
11732b3a827e2Smrgfi
11733b3a827e2SmrgAC_SUBST([CYGPATH_W])
11734b3a827e2Smrg
11735b3a827e2Smrg# Define the identity of the package.
11736b3a827e2Smrgdnl Distinguish between old-style and new-style calls.
11737b3a827e2Smrgm4_ifval([$2],
11738b3a827e2Smrg[AC_DIAGNOSE([obsolete],
11739b3a827e2Smrg             [$0: two- and three-arguments forms are deprecated.])
11740b3a827e2Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
11741b3a827e2Smrg AC_SUBST([PACKAGE], [$1])dnl
11742b3a827e2Smrg AC_SUBST([VERSION], [$2])],
11743b3a827e2Smrg[_AM_SET_OPTIONS([$1])dnl
11744b3a827e2Smrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
11745b3a827e2Smrgm4_if(
11746b3a827e2Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
11747b3a827e2Smrg  [ok:ok],,
11748b3a827e2Smrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
11749b3a827e2Smrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
11750b3a827e2Smrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
11751e0963edeSmrg
11752b3a827e2Smrg_AM_IF_OPTION([no-define],,
11753b3a827e2Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
11754b3a827e2Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
11755e0963edeSmrg
11756b3a827e2Smrg# Some tools Automake needs.
11757b3a827e2SmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
11758b3a827e2SmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
11759b3a827e2SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
11760b3a827e2SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
11761b3a827e2SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
11762b3a827e2SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
11763b3a827e2SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
11764b3a827e2SmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
11765b3a827e2SmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
11766b3a827e2SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
11767b3a827e2Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
11768b3a827e2Smrg# dies out for good.  For more background, see:
11769b3a827e2Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
11770b3a827e2Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
11771b3a827e2SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
11772b3a827e2Smrg# We need awk for the "check" target (and possibly the TAP driver).  The
11773b3a827e2Smrg# system "awk" is bad on some platforms.
11774b3a827e2SmrgAC_REQUIRE([AC_PROG_AWK])dnl
11775b3a827e2SmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
11776b3a827e2SmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
11777b3a827e2Smrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
11778b3a827e2Smrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
11779b3a827e2Smrg			     [_AM_PROG_TAR([v7])])])
11780b3a827e2Smrg_AM_IF_OPTION([no-dependencies],,
11781b3a827e2Smrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
11782b3a827e2Smrg		  [_AM_DEPENDENCIES([CC])],
11783b3a827e2Smrg		  [m4_define([AC_PROG_CC],
11784b3a827e2Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
11785b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
11786b3a827e2Smrg		  [_AM_DEPENDENCIES([CXX])],
11787b3a827e2Smrg		  [m4_define([AC_PROG_CXX],
11788b3a827e2Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
11789b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
11790b3a827e2Smrg		  [_AM_DEPENDENCIES([OBJC])],
11791b3a827e2Smrg		  [m4_define([AC_PROG_OBJC],
11792b3a827e2Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
11793b3a827e2SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
11794b3a827e2Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
11795b3a827e2Smrg		  [m4_define([AC_PROG_OBJCXX],
11796b3a827e2Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
11797b3a827e2Smrg])
11798b3a827e2SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
11799b3a827e2Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
11800b3a827e2Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
11801b3a827e2Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
11802b3a827e2SmrgAC_CONFIG_COMMANDS_PRE(dnl
11803b3a827e2Smrg[m4_provide_if([_AM_COMPILER_EXEEXT],
11804b3a827e2Smrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
11805e0963edeSmrg
11806b3a827e2Smrg# POSIX will say in a future version that running "rm -f" with no argument
11807b3a827e2Smrg# is OK; and we want to be able to make that assumption in our Makefile
11808b3a827e2Smrg# recipes.  So use an aggressive probe to check that the usage we want is
11809b3a827e2Smrg# actually supported "in the wild" to an acceptable degree.
11810b3a827e2Smrg# See automake bug#10828.
11811b3a827e2Smrg# To make any issue more visible, cause the running configure to be aborted
11812b3a827e2Smrg# by default if the 'rm' program in use doesn't match our expectations; the
11813b3a827e2Smrg# user can still override this though.
11814b3a827e2Smrgif rm -f && rm -fr && rm -rf; then : OK; else
11815b3a827e2Smrg  cat >&2 <<'END'
11816b3a827e2SmrgOops!
11817b3a827e2Smrg
11818b3a827e2SmrgYour 'rm' program seems unable to run without file operands specified
11819b3a827e2Smrgon the command line, even when the '-f' option is present.  This is contrary
11820b3a827e2Smrgto the behaviour of most rm programs out there, and not conforming with
11821b3a827e2Smrgthe upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
11822b3a827e2Smrg
11823b3a827e2SmrgPlease tell bug-automake@gnu.org about your system, including the value
11824b3a827e2Smrgof your $PATH and any error possibly output before this message.  This
11825b3a827e2Smrgcan help us improve future automake versions.
11826e0963edeSmrg
11827b3a827e2SmrgEND
11828b3a827e2Smrg  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
11829b3a827e2Smrg    echo 'Configuration will proceed anyway, since you have set the' >&2
11830b3a827e2Smrg    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
11831b3a827e2Smrg    echo >&2
11832b3a827e2Smrg  else
11833b3a827e2Smrg    cat >&2 <<'END'
11834b3a827e2SmrgAborting the configuration process, to ensure you take notice of the issue.
11835e0963edeSmrg
11836b3a827e2SmrgYou can download and install GNU coreutils to get an 'rm' implementation
11837b3a827e2Smrgthat behaves properly: <http://www.gnu.org/software/coreutils/>.
11838e0963edeSmrg
11839b3a827e2SmrgIf you want to complete the configuration process using your problematic
11840b3a827e2Smrg'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
11841b3a827e2Smrgto "yes", and re-run configure.
11842f05b35a2Smrg
11843b3a827e2SmrgEND
11844b3a827e2Smrg    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
11845b3a827e2Smrg  fi
1184667ab2ff2Smrgfi
11847b3a827e2Smrgdnl The trailing newline in this macro's definition is deliberate, for
11848b3a827e2Smrgdnl backward compatibility and to allow trailing 'dnl'-style comments
11849b3a827e2Smrgdnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
11850b3a827e2Smrg])
11851f05b35a2Smrg
11852b3a827e2Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
11853b3a827e2Smrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
11854b3a827e2Smrgdnl mangled by Autoconf and run in a shell conditional statement.
11855b3a827e2Smrgm4_define([_AC_COMPILER_EXEEXT],
11856b3a827e2Smrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
11857e0963edeSmrg
11858b3a827e2Smrg# When config.status generates a header, we must update the stamp-h file.
11859b3a827e2Smrg# This file resides in the same directory as the config header
11860b3a827e2Smrg# that is generated.  The stamp files are numbered to have different names.
11861e0963edeSmrg
11862b3a827e2Smrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
11863b3a827e2Smrg# loop where config.status creates the headers, so we can generate
11864b3a827e2Smrg# our stamp files there.
11865b3a827e2SmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
11866b3a827e2Smrg[# Compute $1's index in $config_headers.
11867b3a827e2Smrg_am_arg=$1
11868b3a827e2Smrg_am_stamp_count=1
11869b3a827e2Smrgfor _am_header in $config_headers :; do
11870b3a827e2Smrg  case $_am_header in
11871b3a827e2Smrg    $_am_arg | $_am_arg:* )
11872b3a827e2Smrg      break ;;
11873b3a827e2Smrg    * )
11874b3a827e2Smrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
11875b3a827e2Smrg  esac
11876b3a827e2Smrgdone
11877b3a827e2Smrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
11878e0963edeSmrg
11879b3a827e2Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1188067ab2ff2Smrg#
11881b3a827e2Smrg# This file is free software; the Free Software Foundation
11882b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11883b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11884f05b35a2Smrg
11885b3a827e2Smrg# AM_PROG_INSTALL_SH
11886b3a827e2Smrg# ------------------
11887b3a827e2Smrg# Define $install_sh.
11888b3a827e2SmrgAC_DEFUN([AM_PROG_INSTALL_SH],
11889b3a827e2Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11890b3a827e2Smrgif test x"${install_sh+set}" != xset; then
11891b3a827e2Smrg  case $am_aux_dir in
11892b3a827e2Smrg  *\ * | *\	*)
11893b3a827e2Smrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
11894b3a827e2Smrg  *)
11895b3a827e2Smrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
11896b3a827e2Smrg  esac
11897b3a827e2Smrgfi
11898b3a827e2SmrgAC_SUBST([install_sh])])
11899e0963edeSmrg
11900b3a827e2Smrg# Copyright (C) 2003-2017 Free Software Foundation, Inc.
11901b3a827e2Smrg#
11902b3a827e2Smrg# This file is free software; the Free Software Foundation
11903b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11904b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11905b3a827e2Smrg
11906b3a827e2Smrg# Check whether the underlying file-system supports filenames
11907b3a827e2Smrg# with a leading dot.  For instance MS-DOS doesn't.
11908b3a827e2SmrgAC_DEFUN([AM_SET_LEADING_DOT],
11909b3a827e2Smrg[rm -rf .tst 2>/dev/null
11910b3a827e2Smrgmkdir .tst 2>/dev/null
11911b3a827e2Smrgif test -d .tst; then
11912b3a827e2Smrg  am__leading_dot=.
11913b3a827e2Smrgelse
11914b3a827e2Smrg  am__leading_dot=_
1191567ab2ff2Smrgfi
11916b3a827e2Smrgrmdir .tst 2>/dev/null
11917b3a827e2SmrgAC_SUBST([am__leading_dot])])
1191849e108a1Smrg
11919b3a827e2Smrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
1192067ab2ff2Smrg
11921b3a827e2Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1192267ab2ff2Smrg#
11923b3a827e2Smrg# This file is free software; the Free Software Foundation
11924b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11925b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
1192649e108a1Smrg
11927b3a827e2Smrg# AM_MAKE_INCLUDE()
11928b3a827e2Smrg# -----------------
11929b3a827e2Smrg# Check to see how make treats includes.
11930b3a827e2SmrgAC_DEFUN([AM_MAKE_INCLUDE],
11931b3a827e2Smrg[am_make=${MAKE-make}
11932b3a827e2Smrgcat > confinc << 'END'
11933b3a827e2Smrgam__doit:
11934b3a827e2Smrg	@echo this is the am__doit target
11935b3a827e2Smrg.PHONY: am__doit
11936b3a827e2SmrgEND
11937b3a827e2Smrg# If we don't find an include directive, just comment out the code.
11938b3a827e2SmrgAC_MSG_CHECKING([for style of include used by $am_make])
11939b3a827e2Smrgam__include="#"
11940b3a827e2Smrgam__quote=
11941b3a827e2Smrg_am_result=none
11942b3a827e2Smrg# First try GNU make style include.
11943b3a827e2Smrgecho "include confinc" > confmf
11944b3a827e2Smrg# Ignore all kinds of additional output from 'make'.
11945b3a827e2Smrgcase `$am_make -s -f confmf 2> /dev/null` in #(
11946b3a827e2Smrg*the\ am__doit\ target*)
11947b3a827e2Smrg  am__include=include
11948b3a827e2Smrg  am__quote=
11949b3a827e2Smrg  _am_result=GNU
11950b3a827e2Smrg  ;;
11951b3a827e2Smrgesac
11952b3a827e2Smrg# Now try BSD make style include.
11953b3a827e2Smrgif test "$am__include" = "#"; then
11954b3a827e2Smrg   echo '.include "confinc"' > confmf
11955b3a827e2Smrg   case `$am_make -s -f confmf 2> /dev/null` in #(
11956b3a827e2Smrg   *the\ am__doit\ target*)
11957b3a827e2Smrg     am__include=.include
11958b3a827e2Smrg     am__quote="\""
11959b3a827e2Smrg     _am_result=BSD
11960b3a827e2Smrg     ;;
11961b3a827e2Smrg   esac
11962b3a827e2Smrgfi
11963b3a827e2SmrgAC_SUBST([am__include])
11964b3a827e2SmrgAC_SUBST([am__quote])
11965b3a827e2SmrgAC_MSG_RESULT([$_am_result])
11966b3a827e2Smrgrm -f confinc confmf
11967b3a827e2Smrg])
1196867ab2ff2Smrg
11969b3a827e2Smrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1197067ab2ff2Smrg
11971b3a827e2Smrg# Copyright (C) 1997-2017 Free Software Foundation, Inc.
11972b3a827e2Smrg#
11973b3a827e2Smrg# This file is free software; the Free Software Foundation
11974b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
11975b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
11976e0963edeSmrg
11977b3a827e2Smrg# AM_MISSING_PROG(NAME, PROGRAM)
11978b3a827e2Smrg# ------------------------------
11979b3a827e2SmrgAC_DEFUN([AM_MISSING_PROG],
11980b3a827e2Smrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
11981b3a827e2Smrg$1=${$1-"${am_missing_run}$2"}
11982b3a827e2SmrgAC_SUBST($1)])
1198367ab2ff2Smrg
11984b3a827e2Smrg# AM_MISSING_HAS_RUN
11985b3a827e2Smrg# ------------------
11986b3a827e2Smrg# Define MISSING if not defined so far and test if it is modern enough.
11987b3a827e2Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
11988b3a827e2SmrgAC_DEFUN([AM_MISSING_HAS_RUN],
11989b3a827e2Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
11990b3a827e2SmrgAC_REQUIRE_AUX_FILE([missing])dnl
11991b3a827e2Smrgif test x"${MISSING+set}" != xset; then
11992b3a827e2Smrg  case $am_aux_dir in
11993b3a827e2Smrg  *\ * | *\	*)
11994b3a827e2Smrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
11995b3a827e2Smrg  *)
11996b3a827e2Smrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
11997b3a827e2Smrg  esac
1199867ab2ff2Smrgfi
11999b3a827e2Smrg# Use eval to expand $SHELL
12000b3a827e2Smrgif eval "$MISSING --is-lightweight"; then
12001b3a827e2Smrg  am_missing_run="$MISSING "
12002b3a827e2Smrgelse
12003b3a827e2Smrg  am_missing_run=
12004b3a827e2Smrg  AC_MSG_WARN(['missing' script is too old or missing])
1200567ab2ff2Smrgfi
12006b3a827e2Smrg])
12007e0963edeSmrg
12008b3a827e2Smrg# Helper functions for option handling.                     -*- Autoconf -*-
1200967ab2ff2Smrg
12010b3a827e2Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12011b3a827e2Smrg#
12012b3a827e2Smrg# This file is free software; the Free Software Foundation
12013b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12014b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
1201567ab2ff2Smrg
12016b3a827e2Smrg# _AM_MANGLE_OPTION(NAME)
12017b3a827e2Smrg# -----------------------
12018b3a827e2SmrgAC_DEFUN([_AM_MANGLE_OPTION],
12019b3a827e2Smrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
1202067ab2ff2Smrg
12021b3a827e2Smrg# _AM_SET_OPTION(NAME)
12022b3a827e2Smrg# --------------------
12023b3a827e2Smrg# Set option NAME.  Presently that only means defining a flag for this option.
12024b3a827e2SmrgAC_DEFUN([_AM_SET_OPTION],
12025b3a827e2Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
1202667ab2ff2Smrg
12027b3a827e2Smrg# _AM_SET_OPTIONS(OPTIONS)
12028b3a827e2Smrg# ------------------------
12029b3a827e2Smrg# OPTIONS is a space-separated list of Automake options.
12030b3a827e2SmrgAC_DEFUN([_AM_SET_OPTIONS],
12031b3a827e2Smrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
1203267ab2ff2Smrg
12033b3a827e2Smrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
12034b3a827e2Smrg# -------------------------------------------
12035b3a827e2Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
12036b3a827e2SmrgAC_DEFUN([_AM_IF_OPTION],
12037b3a827e2Smrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12038e0963edeSmrg
12039b3a827e2Smrg# Copyright (C) 1999-2017 Free Software Foundation, Inc.
1204067ab2ff2Smrg#
12041b3a827e2Smrg# This file is free software; the Free Software Foundation
12042b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12043b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
1204467ab2ff2Smrg
12045b3a827e2Smrg# _AM_PROG_CC_C_O
12046b3a827e2Smrg# ---------------
12047b3a827e2Smrg# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
12048b3a827e2Smrg# to automatically call this.
12049b3a827e2SmrgAC_DEFUN([_AM_PROG_CC_C_O],
12050b3a827e2Smrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12051b3a827e2SmrgAC_REQUIRE_AUX_FILE([compile])dnl
12052b3a827e2SmrgAC_LANG_PUSH([C])dnl
12053b3a827e2SmrgAC_CACHE_CHECK(
12054b3a827e2Smrg  [whether $CC understands -c and -o together],
12055b3a827e2Smrg  [am_cv_prog_cc_c_o],
12056b3a827e2Smrg  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
12057b3a827e2Smrg  # Make sure it works both with $CC and with simple cc.
12058b3a827e2Smrg  # Following AC_PROG_CC_C_O, we do the test twice because some
12059b3a827e2Smrg  # compilers refuse to overwrite an existing .o file with -o,
12060b3a827e2Smrg  # though they will create one.
12061b3a827e2Smrg  am_cv_prog_cc_c_o=yes
12062b3a827e2Smrg  for am_i in 1 2; do
12063b3a827e2Smrg    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
12064b3a827e2Smrg         && test -f conftest2.$ac_objext; then
12065b3a827e2Smrg      : OK
12066b3a827e2Smrg    else
12067b3a827e2Smrg      am_cv_prog_cc_c_o=no
12068b3a827e2Smrg      break
12069b3a827e2Smrg    fi
12070b3a827e2Smrg  done
12071b3a827e2Smrg  rm -f core conftest*
12072b3a827e2Smrg  unset am_i])
12073b3a827e2Smrgif test "$am_cv_prog_cc_c_o" != yes; then
12074b3a827e2Smrg   # Losing compiler, so override with the script.
12075b3a827e2Smrg   # FIXME: It is wrong to rewrite CC.
12076b3a827e2Smrg   # But if we don't then we get into trouble of one sort or another.
12077b3a827e2Smrg   # A longer-term fix would be to have automake use am__CC in this case,
12078b3a827e2Smrg   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
12079b3a827e2Smrg   CC="$am_aux_dir/compile $CC"
1208067ab2ff2Smrgfi
12081b3a827e2SmrgAC_LANG_POP([C])])
12082b3a827e2Smrg
12083b3a827e2Smrg# For backward compatibility.
12084b3a827e2SmrgAC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
12085b3a827e2Smrg
12086b3a827e2Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
12087b3a827e2Smrg#
12088b3a827e2Smrg# This file is free software; the Free Software Foundation
12089b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12090b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
12091e0963edeSmrg
12092b3a827e2Smrg# AM_RUN_LOG(COMMAND)
12093b3a827e2Smrg# -------------------
12094b3a827e2Smrg# Run COMMAND, save the exit status in ac_status, and log it.
12095b3a827e2Smrg# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
12096b3a827e2SmrgAC_DEFUN([AM_RUN_LOG],
12097b3a827e2Smrg[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
12098b3a827e2Smrg   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
12099b3a827e2Smrg   ac_status=$?
12100b3a827e2Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
12101b3a827e2Smrg   (exit $ac_status); }])
1210267ab2ff2Smrg
12103b3a827e2Smrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
12104e0963edeSmrg
12105b3a827e2Smrg# Copyright (C) 1996-2017 Free Software Foundation, Inc.
12106b3a827e2Smrg#
12107b3a827e2Smrg# This file is free software; the Free Software Foundation
12108b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12109b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
1211067ab2ff2Smrg
12111b3a827e2Smrg# AM_SANITY_CHECK
12112b3a827e2Smrg# ---------------
12113b3a827e2SmrgAC_DEFUN([AM_SANITY_CHECK],
12114b3a827e2Smrg[AC_MSG_CHECKING([whether build environment is sane])
12115b3a827e2Smrg# Reject unsafe characters in $srcdir or the absolute working directory
12116b3a827e2Smrg# name.  Accept space and tab only in the latter.
12117b3a827e2Smrgam_lf='
12118b3a827e2Smrg'
12119b3a827e2Smrgcase `pwd` in
12120b3a827e2Smrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
12121b3a827e2Smrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
12122b3a827e2Smrgesac
12123b3a827e2Smrgcase $srcdir in
12124b3a827e2Smrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
12125b3a827e2Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
12126b3a827e2Smrgesac
1212767ab2ff2Smrg
12128b3a827e2Smrg# Do 'set' in a subshell so we don't clobber the current shell's
12129b3a827e2Smrg# arguments.  Must try -L first in case configure is actually a
12130b3a827e2Smrg# symlink; some systems play weird games with the mod time of symlinks
12131b3a827e2Smrg# (eg FreeBSD returns the mod time of the symlink's containing
12132b3a827e2Smrg# directory).
12133b3a827e2Smrgif (
12134b3a827e2Smrg   am_has_slept=no
12135b3a827e2Smrg   for am_try in 1 2; do
12136b3a827e2Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
12137b3a827e2Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
12138b3a827e2Smrg     if test "$[*]" = "X"; then
12139b3a827e2Smrg	# -L didn't work.
12140b3a827e2Smrg	set X `ls -t "$srcdir/configure" conftest.file`
12141b3a827e2Smrg     fi
12142b3a827e2Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
12143b3a827e2Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
1214467ab2ff2Smrg
12145b3a827e2Smrg	# If neither matched, then we have a broken ls.  This can happen
12146b3a827e2Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
12147b3a827e2Smrg	# broken ls alias from the environment.  This has actually
12148b3a827e2Smrg	# happened.  Such a system could not be considered "sane".
12149b3a827e2Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
12150b3a827e2Smrg  alias in your environment])
12151b3a827e2Smrg     fi
12152b3a827e2Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
12153b3a827e2Smrg       break
12154b3a827e2Smrg     fi
12155b3a827e2Smrg     # Just in case.
12156b3a827e2Smrg     sleep 1
12157b3a827e2Smrg     am_has_slept=yes
12158b3a827e2Smrg   done
12159b3a827e2Smrg   test "$[2]" = conftest.file
12160b3a827e2Smrg   )
12161b3a827e2Smrgthen
12162b3a827e2Smrg   # Ok.
12163b3a827e2Smrg   :
1216467ab2ff2Smrgelse
12165b3a827e2Smrg   AC_MSG_ERROR([newly created file is older than distributed files!
12166b3a827e2SmrgCheck your system clock])
1216767ab2ff2Smrgfi
12168b3a827e2SmrgAC_MSG_RESULT([yes])
12169b3a827e2Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
12170b3a827e2Smrg# generated files are strictly newer.
12171b3a827e2Smrgam_sleep_pid=
12172b3a827e2Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
12173b3a827e2Smrg  ( sleep 1 ) &
12174b3a827e2Smrg  am_sleep_pid=$!
12175b3a827e2Smrgfi
12176b3a827e2SmrgAC_CONFIG_COMMANDS_PRE(
12177b3a827e2Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
12178b3a827e2Smrg   if test -n "$am_sleep_pid"; then
12179b3a827e2Smrg     # Hide warnings about reused PIDs.
12180b3a827e2Smrg     wait $am_sleep_pid 2>/dev/null
12181b3a827e2Smrg   fi
12182b3a827e2Smrg   AC_MSG_RESULT([done])])
12183b3a827e2Smrgrm -f conftest.file
12184b3a827e2Smrg])
1218549e108a1Smrg
12186b3a827e2Smrg# Copyright (C) 2009-2017 Free Software Foundation, Inc.
1218767ab2ff2Smrg#
12188b3a827e2Smrg# This file is free software; the Free Software Foundation
12189b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12190b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
12191e0963edeSmrg
12192b3a827e2Smrg# AM_SILENT_RULES([DEFAULT])
12193b3a827e2Smrg# --------------------------
12194b3a827e2Smrg# Enable less verbose build rules; with the default set to DEFAULT
12195b3a827e2Smrg# ("yes" being less verbose, "no" or empty being verbose).
12196b3a827e2SmrgAC_DEFUN([AM_SILENT_RULES],
12197b3a827e2Smrg[AC_ARG_ENABLE([silent-rules], [dnl
12198b3a827e2SmrgAS_HELP_STRING(
12199b3a827e2Smrg  [--enable-silent-rules],
12200b3a827e2Smrg  [less verbose build output (undo: "make V=1")])
12201b3a827e2SmrgAS_HELP_STRING(
12202b3a827e2Smrg  [--disable-silent-rules],
12203b3a827e2Smrg  [verbose build output (undo: "make V=0")])dnl
12204b3a827e2Smrg])
12205b3a827e2Smrgcase $enable_silent_rules in @%:@ (((
12206b3a827e2Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
12207b3a827e2Smrg   no) AM_DEFAULT_VERBOSITY=1;;
12208b3a827e2Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
12209b3a827e2Smrgesac
12210b3a827e2Smrgdnl
12211b3a827e2Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
12212b3a827e2Smrgdnl do not support nested variable expansions.
12213b3a827e2Smrgdnl See automake bug#9928 and bug#10237.
12214b3a827e2Smrgam_make=${MAKE-make}
12215b3a827e2SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
12216b3a827e2Smrg   [am_cv_make_support_nested_variables],
12217b3a827e2Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
12218b3a827e2SmrgBAR0=false
12219b3a827e2SmrgBAR1=true
12220b3a827e2SmrgV=1
12221b3a827e2Smrgam__doit:
12222b3a827e2Smrg	@$(TRUE)
12223b3a827e2Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
12224b3a827e2Smrg  am_cv_make_support_nested_variables=yes
12225b3a827e2Smrgelse
12226b3a827e2Smrg  am_cv_make_support_nested_variables=no
12227b3a827e2Smrgfi])
12228b3a827e2Smrgif test $am_cv_make_support_nested_variables = yes; then
12229b3a827e2Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
12230b3a827e2Smrg  AM_V='$(V)'
12231b3a827e2Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
12232b3a827e2Smrgelse
12233b3a827e2Smrg  AM_V=$AM_DEFAULT_VERBOSITY
12234b3a827e2Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
12235b3a827e2Smrgfi
12236b3a827e2SmrgAC_SUBST([AM_V])dnl
12237b3a827e2SmrgAM_SUBST_NOTMAKE([AM_V])dnl
12238b3a827e2SmrgAC_SUBST([AM_DEFAULT_V])dnl
12239b3a827e2SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
12240b3a827e2SmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
12241b3a827e2SmrgAM_BACKSLASH='\'
12242b3a827e2SmrgAC_SUBST([AM_BACKSLASH])dnl
12243b3a827e2Smrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
12244b3a827e2Smrg])
12245b3a827e2Smrg
12246b3a827e2Smrg# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1224767ab2ff2Smrg#
12248b3a827e2Smrg# This file is free software; the Free Software Foundation
12249b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12250b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
12251b3a827e2Smrg
12252b3a827e2Smrg# AM_PROG_INSTALL_STRIP
12253b3a827e2Smrg# ---------------------
12254b3a827e2Smrg# One issue with vendor 'install' (even GNU) is that you can't
12255b3a827e2Smrg# specify the program used to strip binaries.  This is especially
12256b3a827e2Smrg# annoying in cross-compiling environments, where the build's strip
12257b3a827e2Smrg# is unlikely to handle the host's binaries.
12258b3a827e2Smrg# Fortunately install-sh will honor a STRIPPROG variable, so we
12259b3a827e2Smrg# always use install-sh in "make install-strip", and initialize
12260b3a827e2Smrg# STRIPPROG with the value of the STRIP variable (set by the user).
12261b3a827e2SmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
12262b3a827e2Smrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12263b3a827e2Smrg# Installed binaries are usually stripped using 'strip' when the user
12264b3a827e2Smrg# run "make install-strip".  However 'strip' might not be the right
12265b3a827e2Smrg# tool to use in cross-compilation environments, therefore Automake
12266b3a827e2Smrg# will honor the 'STRIP' environment variable to overrule this program.
12267b3a827e2Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
12268b3a827e2Smrgif test "$cross_compiling" != no; then
12269b3a827e2Smrg  AC_CHECK_TOOL([STRIP], [strip], :)
12270b3a827e2Smrgfi
12271b3a827e2SmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
12272b3a827e2SmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
12273f05b35a2Smrg
12274b3a827e2Smrg# Copyright (C) 2006-2017 Free Software Foundation, Inc.
12275b3a827e2Smrg#
12276b3a827e2Smrg# This file is free software; the Free Software Foundation
12277b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12278b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
12279e0963edeSmrg
12280b3a827e2Smrg# _AM_SUBST_NOTMAKE(VARIABLE)
12281b3a827e2Smrg# ---------------------------
12282b3a827e2Smrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
12283b3a827e2Smrg# This macro is traced by Automake.
12284b3a827e2SmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
1228549e108a1Smrg
12286b3a827e2Smrg# AM_SUBST_NOTMAKE(VARIABLE)
12287b3a827e2Smrg# --------------------------
12288b3a827e2Smrg# Public sister of _AM_SUBST_NOTMAKE.
12289b3a827e2SmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1229049e108a1Smrg
12291b3a827e2Smrg# Check how to create a tarball.                            -*- Autoconf -*-
12292e0963edeSmrg
12293b3a827e2Smrg# Copyright (C) 2004-2017 Free Software Foundation, Inc.
12294b3a827e2Smrg#
12295b3a827e2Smrg# This file is free software; the Free Software Foundation
12296b3a827e2Smrg# gives unlimited permission to copy and/or distribute it,
12297b3a827e2Smrg# with or without modifications, as long as this notice is preserved.
12298e0963edeSmrg
12299b3a827e2Smrg# _AM_PROG_TAR(FORMAT)
1230067ab2ff2Smrg# --------------------
12301b3a827e2Smrg# Check how to create a tarball in format FORMAT.
12302b3a827e2Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
12303f05b35a2Smrg#
12304b3a827e2Smrg# Substitute a variable $(am__tar) that is a command
12305b3a827e2Smrg# writing to stdout a FORMAT-tarball containing the directory
12306b3a827e2Smrg# $tardir.
12307b3a827e2Smrg#     tardir=directory && $(am__tar) > result.tar
12308f05b35a2Smrg#
12309b3a827e2Smrg# Substitute a variable $(am__untar) that extract such
12310b3a827e2Smrg# a tarball read from stdin.
12311b3a827e2Smrg#     $(am__untar) < result.tar
1231249e108a1Smrg#
12313b3a827e2SmrgAC_DEFUN([_AM_PROG_TAR],
12314b3a827e2Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
12315b3a827e2Smrg# in the wild :-(  We should find a proper way to deprecate it ...
12316b3a827e2SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
1231749e108a1Smrg
12318b3a827e2Smrg# We'll loop over all known methods to create a tar archive until one works.
12319b3a827e2Smrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
1232049e108a1Smrg
12321b3a827e2Smrgm4_if([$1], [v7],
12322b3a827e2Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
12323b3a827e2Smrg
12324b3a827e2Smrg  [m4_case([$1],
12325b3a827e2Smrg    [ustar],
12326b3a827e2Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
12327b3a827e2Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
12328b3a827e2Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
12329b3a827e2Smrg      # and bug#13588).
12330b3a827e2Smrg      am_max_uid=2097151 # 2^21 - 1
12331b3a827e2Smrg      am_max_gid=$am_max_uid
12332b3a827e2Smrg      # The $UID and $GID variables are not portable, so we need to resort
12333b3a827e2Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
12334b3a827e2Smrg      # below are definitely unexpected, so allow the users to see them
12335b3a827e2Smrg      # (that is, avoid stderr redirection).
12336b3a827e2Smrg      am_uid=`id -u || echo unknown`
12337b3a827e2Smrg      am_gid=`id -g || echo unknown`
12338b3a827e2Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
12339b3a827e2Smrg      if test $am_uid -le $am_max_uid; then
12340b3a827e2Smrg         AC_MSG_RESULT([yes])
12341b3a827e2Smrg      else
12342b3a827e2Smrg         AC_MSG_RESULT([no])
12343b3a827e2Smrg         _am_tools=none
12344b3a827e2Smrg      fi
12345b3a827e2Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
12346b3a827e2Smrg      if test $am_gid -le $am_max_gid; then
12347b3a827e2Smrg         AC_MSG_RESULT([yes])
12348b3a827e2Smrg      else
12349b3a827e2Smrg        AC_MSG_RESULT([no])
12350b3a827e2Smrg        _am_tools=none
12351b3a827e2Smrg      fi],
12352b3a827e2Smrg
12353b3a827e2Smrg  [pax],
12354b3a827e2Smrg    [],
12355b3a827e2Smrg
12356b3a827e2Smrg  [m4_fatal([Unknown tar format])])
12357b3a827e2Smrg
12358b3a827e2Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
12359b3a827e2Smrg
12360b3a827e2Smrg  # Go ahead even if we have the value already cached.  We do so because we
12361b3a827e2Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
12362b3a827e2Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
12363b3a827e2Smrg
12364b3a827e2Smrg  for _am_tool in $_am_tools; do
12365b3a827e2Smrg    case $_am_tool in
12366b3a827e2Smrg    gnutar)
12367b3a827e2Smrg      for _am_tar in tar gnutar gtar; do
12368b3a827e2Smrg        AM_RUN_LOG([$_am_tar --version]) && break
12369b3a827e2Smrg      done
12370b3a827e2Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12371b3a827e2Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12372b3a827e2Smrg      am__untar="$_am_tar -xf -"
12373b3a827e2Smrg      ;;
12374b3a827e2Smrg    plaintar)
12375b3a827e2Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
12376b3a827e2Smrg      # ustar tarball either.
12377b3a827e2Smrg      (tar --version) >/dev/null 2>&1 && continue
12378b3a827e2Smrg      am__tar='tar chf - "$$tardir"'
12379b3a827e2Smrg      am__tar_='tar chf - "$tardir"'
12380b3a827e2Smrg      am__untar='tar xf -'
12381b3a827e2Smrg      ;;
12382b3a827e2Smrg    pax)
12383b3a827e2Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
12384b3a827e2Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
12385b3a827e2Smrg      am__untar='pax -r'
12386b3a827e2Smrg      ;;
12387b3a827e2Smrg    cpio)
12388b3a827e2Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12389b3a827e2Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12390b3a827e2Smrg      am__untar='cpio -i -H $1 -d'
12391b3a827e2Smrg      ;;
12392b3a827e2Smrg    none)
12393b3a827e2Smrg      am__tar=false
12394b3a827e2Smrg      am__tar_=false
12395b3a827e2Smrg      am__untar=false
12396b3a827e2Smrg      ;;
12397b3a827e2Smrg    esac
12398b3a827e2Smrg
12399b3a827e2Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
12400b3a827e2Smrg    # and am__untar set.
12401b3a827e2Smrg    test -n "${am_cv_prog_tar_$1}" && break
12402b3a827e2Smrg
12403b3a827e2Smrg    # tar/untar a dummy directory, and stop if the command works.
12404b3a827e2Smrg    rm -rf conftest.dir
12405b3a827e2Smrg    mkdir conftest.dir
12406b3a827e2Smrg    echo GrepMe > conftest.dir/file
12407b3a827e2Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12408b3a827e2Smrg    rm -rf conftest.dir
12409b3a827e2Smrg    if test -s conftest.tar; then
12410b3a827e2Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
12411b3a827e2Smrg      AM_RUN_LOG([cat conftest.dir/file])
12412b3a827e2Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12413b3a827e2Smrg    fi
12414b3a827e2Smrg  done
12415b3a827e2Smrg  rm -rf conftest.dir
12416b3a827e2Smrg
12417b3a827e2Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12418b3a827e2Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12419b3a827e2Smrg
12420b3a827e2SmrgAC_SUBST([am__tar])
12421b3a827e2SmrgAC_SUBST([am__untar])
12422b3a827e2Smrg]) # _AM_PROG_TAR
12423e0963edeSmrg
12424