aclocal.m4 revision cf503b78
1cf503b78Smrg# generated automatically by aclocal 1.13.2 -*- Autoconf -*-
2cf503b78Smrg
3cf503b78Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
415fb4814Smrg
515fb4814Smrg# This file is free software; the Free Software Foundation
615fb4814Smrg# gives unlimited permission to copy and/or distribute it,
715fb4814Smrg# with or without modifications, as long as this notice is preserved.
815fb4814Smrg
915fb4814Smrg# This program is distributed in the hope that it will be useful,
1015fb4814Smrg# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
1115fb4814Smrg# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
1215fb4814Smrg# PARTICULAR PURPOSE.
1315fb4814Smrg
14cf503b78Smrgm4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15b4d38c65Smrgm4_ifndef([AC_AUTOCONF_VERSION],
16b4d38c65Smrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
17cf503b78Smrgm4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
18cf503b78Smrg[m4_warning([this file was generated for autoconf 2.69.
19b4d38c65SmrgYou have another version of autoconf.  It may work, but is not guaranteed to.
20b4d38c65SmrgIf you have problems, you may need to regenerate the build system entirely.
21cf503b78SmrgTo do so, use the procedure documented by the package, typically 'autoreconf'.])])
22de78e416Smrg
2315fb4814Smrg# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
24b4d38c65Smrg#
25b4d38c65Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
26cf503b78Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
27cf503b78Smrg#                 Foundation, Inc.
28b4d38c65Smrg#   Written by Gordon Matzigkeit, 1996
29b4d38c65Smrg#
30b4d38c65Smrg# This file is free software; the Free Software Foundation gives
31b4d38c65Smrg# unlimited permission to copy and/or distribute it, with or without
32b4d38c65Smrg# modifications, as long as this notice is preserved.
33b4d38c65Smrg
34b4d38c65Smrgm4_define([_LT_COPYING], [dnl
35b4d38c65Smrg#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
36cf503b78Smrg#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
37cf503b78Smrg#                 Foundation, Inc.
38b4d38c65Smrg#   Written by Gordon Matzigkeit, 1996
39b4d38c65Smrg#
40b4d38c65Smrg#   This file is part of GNU Libtool.
41b4d38c65Smrg#
42b4d38c65Smrg# GNU Libtool is free software; you can redistribute it and/or
43b4d38c65Smrg# modify it under the terms of the GNU General Public License as
44b4d38c65Smrg# published by the Free Software Foundation; either version 2 of
45b4d38c65Smrg# the License, or (at your option) any later version.
46b4d38c65Smrg#
47b4d38c65Smrg# As a special exception to the GNU General Public License,
48b4d38c65Smrg# if you distribute this file as part of a program or library that
49b4d38c65Smrg# is built using GNU Libtool, you may include this file under the
50b4d38c65Smrg# same distribution terms that you use for the rest of that program.
51b4d38c65Smrg#
52b4d38c65Smrg# GNU Libtool is distributed in the hope that it will be useful,
53b4d38c65Smrg# but WITHOUT ANY WARRANTY; without even the implied warranty of
54b4d38c65Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
55b4d38c65Smrg# GNU General Public License for more details.
56b4d38c65Smrg#
57b4d38c65Smrg# You should have received a copy of the GNU General Public License
58b4d38c65Smrg# along with GNU Libtool; see the file COPYING.  If not, a copy
59b4d38c65Smrg# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
60b4d38c65Smrg# obtained by writing to the Free Software Foundation, Inc.,
61b4d38c65Smrg# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
62b4d38c65Smrg])
6315fb4814Smrg
64b4d38c65Smrg# serial 57 LT_INIT
6515fb4814Smrg
6615fb4814Smrg
67b4d38c65Smrg# LT_PREREQ(VERSION)
68b4d38c65Smrg# ------------------
69b4d38c65Smrg# Complain and exit if this libtool version is less that VERSION.
70b4d38c65Smrgm4_defun([LT_PREREQ],
71b4d38c65Smrg[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
72b4d38c65Smrg       [m4_default([$3],
73b4d38c65Smrg		   [m4_fatal([Libtool version $1 or higher is required],
74b4d38c65Smrg		             63)])],
75b4d38c65Smrg       [$2])])
76b410ddbeSmrg
77b410ddbeSmrg
78b4d38c65Smrg# _LT_CHECK_BUILDDIR
79b4d38c65Smrg# ------------------
80b4d38c65Smrg# Complain if the absolute build directory name contains unusual characters
81b4d38c65Smrgm4_defun([_LT_CHECK_BUILDDIR],
82b4d38c65Smrg[case `pwd` in
83b4d38c65Smrg  *\ * | *\	*)
84b4d38c65Smrg    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
85b4d38c65Smrgesac
86b4d38c65Smrg])
87b4d38c65Smrg
88b4d38c65Smrg
89b4d38c65Smrg# LT_INIT([OPTIONS])
90b4d38c65Smrg# ------------------
91b4d38c65SmrgAC_DEFUN([LT_INIT],
92b4d38c65Smrg[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
93b4d38c65SmrgAC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
94b4d38c65SmrgAC_BEFORE([$0], [LT_LANG])dnl
95b4d38c65SmrgAC_BEFORE([$0], [LT_OUTPUT])dnl
96b4d38c65SmrgAC_BEFORE([$0], [LTDL_INIT])dnl
97b4d38c65Smrgm4_require([_LT_CHECK_BUILDDIR])dnl
98b4d38c65Smrg
99b4d38c65Smrgdnl Autoconf doesn't catch unexpanded LT_ macros by default:
100b4d38c65Smrgm4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
101b4d38c65Smrgm4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
102b4d38c65Smrgdnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
103b4d38c65Smrgdnl unless we require an AC_DEFUNed macro:
104b4d38c65SmrgAC_REQUIRE([LTOPTIONS_VERSION])dnl
105b4d38c65SmrgAC_REQUIRE([LTSUGAR_VERSION])dnl
106b4d38c65SmrgAC_REQUIRE([LTVERSION_VERSION])dnl
107b4d38c65SmrgAC_REQUIRE([LTOBSOLETE_VERSION])dnl
108b4d38c65Smrgm4_require([_LT_PROG_LTMAIN])dnl
109b4d38c65Smrg
110b4d38c65Smrg_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
111b4d38c65Smrg
112b4d38c65Smrgdnl Parse OPTIONS
113b4d38c65Smrg_LT_SET_OPTIONS([$0], [$1])
11415fb4814Smrg
11515fb4814Smrg# This can be used to rebuild libtool when needed
116b4d38c65SmrgLIBTOOL_DEPS="$ltmain"
11715fb4814Smrg
11815fb4814Smrg# Always use our own libtool.
11915fb4814SmrgLIBTOOL='$(SHELL) $(top_builddir)/libtool'
12015fb4814SmrgAC_SUBST(LIBTOOL)dnl
12115fb4814Smrg
122b4d38c65Smrg_LT_SETUP
123b410ddbeSmrg
124b4d38c65Smrg# Only expand once:
125b4d38c65Smrgm4_define([LT_INIT])
126b4d38c65Smrg])# LT_INIT
127b410ddbeSmrg
128b4d38c65Smrg# Old names:
129b4d38c65SmrgAU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
130b4d38c65SmrgAU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
131b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
132b4d38c65Smrgdnl AC_DEFUN([AC_PROG_LIBTOOL], [])
133b4d38c65Smrgdnl AC_DEFUN([AM_PROG_LIBTOOL], [])
134b4d38c65Smrg
135b4d38c65Smrg
136b4d38c65Smrg# _LT_CC_BASENAME(CC)
137b4d38c65Smrg# -------------------
138b4d38c65Smrg# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
139b4d38c65Smrgm4_defun([_LT_CC_BASENAME],
140b4d38c65Smrg[for cc_temp in $1""; do
141b4d38c65Smrg  case $cc_temp in
142b4d38c65Smrg    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
143b4d38c65Smrg    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
144b4d38c65Smrg    \-*) ;;
145b4d38c65Smrg    *) break;;
146b4d38c65Smrg  esac
147b4d38c65Smrgdone
148b4d38c65Smrgcc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
149b4d38c65Smrg])
150b4d38c65Smrg
151b4d38c65Smrg
152b4d38c65Smrg# _LT_FILEUTILS_DEFAULTS
153b4d38c65Smrg# ----------------------
154b4d38c65Smrg# It is okay to use these file commands and assume they have been set
155b4d38c65Smrg# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
156b4d38c65Smrgm4_defun([_LT_FILEUTILS_DEFAULTS],
157b4d38c65Smrg[: ${CP="cp -f"}
158b4d38c65Smrg: ${MV="mv -f"}
159b4d38c65Smrg: ${RM="rm -f"}
160b4d38c65Smrg])# _LT_FILEUTILS_DEFAULTS
161b4d38c65Smrg
162b4d38c65Smrg
163b4d38c65Smrg# _LT_SETUP
164b4d38c65Smrg# ---------
165b4d38c65Smrgm4_defun([_LT_SETUP],
166b4d38c65Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
16715fb4814SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
168b4d38c65SmrgAC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
169b4d38c65SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
170b534f209Smrg
171cf503b78Smrg_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
172cf503b78Smrgdnl
173b4d38c65Smrg_LT_DECL([], [host_alias], [0], [The host system])dnl
174b4d38c65Smrg_LT_DECL([], [host], [0])dnl
175b4d38c65Smrg_LT_DECL([], [host_os], [0])dnl
176b4d38c65Smrgdnl
177b4d38c65Smrg_LT_DECL([], [build_alias], [0], [The build system])dnl
178b4d38c65Smrg_LT_DECL([], [build], [0])dnl
179b4d38c65Smrg_LT_DECL([], [build_os], [0])dnl
180b4d38c65Smrgdnl
181b4d38c65SmrgAC_REQUIRE([AC_PROG_CC])dnl
182b4d38c65SmrgAC_REQUIRE([LT_PATH_LD])dnl
183b4d38c65SmrgAC_REQUIRE([LT_PATH_NM])dnl
184b4d38c65Smrgdnl
18515fb4814SmrgAC_REQUIRE([AC_PROG_LN_S])dnl
186b4d38c65Smrgtest -z "$LN_S" && LN_S="ln -s"
187b4d38c65Smrg_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
18815fb4814Smrgdnl
189b4d38c65SmrgAC_REQUIRE([LT_CMD_MAX_LEN])dnl
190b4d38c65Smrg_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
191b4d38c65Smrg_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
192b4d38c65Smrgdnl
193b4d38c65Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
194b4d38c65Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
195b4d38c65Smrgm4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
196b4d38c65Smrgm4_require([_LT_CMD_RELOAD])dnl
197b4d38c65Smrgm4_require([_LT_CHECK_MAGIC_METHOD])dnl
198b4d38c65Smrgm4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
199b4d38c65Smrgm4_require([_LT_CMD_OLD_ARCHIVE])dnl
200b4d38c65Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
201b4d38c65Smrgm4_require([_LT_WITH_SYSROOT])dnl
202b4d38c65Smrg
203b4d38c65Smrg_LT_CONFIG_LIBTOOL_INIT([
204b4d38c65Smrg# See if we are running on zsh, and set the options which allow our
205b4d38c65Smrg# commands through without removal of \ escapes INIT.
206b4d38c65Smrgif test -n "\${ZSH_VERSION+set}" ; then
207b4d38c65Smrg   setopt NO_GLOB_SUBST
208b4d38c65Smrgfi
209b4d38c65Smrg])
210b4d38c65Smrgif test -n "${ZSH_VERSION+set}" ; then
211b4d38c65Smrg   setopt NO_GLOB_SUBST
212b4d38c65Smrgfi
21315fb4814Smrg
214b4d38c65Smrg_LT_CHECK_OBJDIR
215b410ddbeSmrg
216b4d38c65Smrgm4_require([_LT_TAG_COMPILER])dnl
21715fb4814Smrg
21815fb4814Smrgcase $host_os in
21915fb4814Smrgaix3*)
22015fb4814Smrg  # AIX sometimes has problems with the GCC collect2 program.  For some
22115fb4814Smrg  # reason, if we set the COLLECT_NAMES environment variable, the problems
22215fb4814Smrg  # vanish in a puff of smoke.
22315fb4814Smrg  if test "X${COLLECT_NAMES+set}" != Xset; then
22415fb4814Smrg    COLLECT_NAMES=
22515fb4814Smrg    export COLLECT_NAMES
22615fb4814Smrg  fi
22715fb4814Smrg  ;;
22815fb4814Smrgesac
22915fb4814Smrg
23015fb4814Smrg# Global variables:
231b4d38c65Smrgofile=libtool
23215fb4814Smrgcan_build_shared=yes
23315fb4814Smrg
23415fb4814Smrg# All known linkers require a `.a' archive for static linking (except MSVC,
23515fb4814Smrg# which needs '.lib').
23615fb4814Smrglibext=a
23715fb4814Smrg
238b4d38c65Smrgwith_gnu_ld="$lt_cv_prog_gnu_ld"
239b534f209Smrg
24015fb4814Smrgold_CC="$CC"
24115fb4814Smrgold_CFLAGS="$CFLAGS"
24215fb4814Smrg
24315fb4814Smrg# Set sane defaults for various variables
24415fb4814Smrgtest -z "$CC" && CC=cc
24515fb4814Smrgtest -z "$LTCC" && LTCC=$CC
24615fb4814Smrgtest -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
24715fb4814Smrgtest -z "$LD" && LD=ld
24815fb4814Smrgtest -z "$ac_objext" && ac_objext=o
24915fb4814Smrg
25015fb4814Smrg_LT_CC_BASENAME([$compiler])
25115fb4814Smrg
25215fb4814Smrg# Only perform the check for file, if the check method requires it
253b4d38c65Smrgtest -z "$MAGIC_CMD" && MAGIC_CMD=file
25415fb4814Smrgcase $deplibs_check_method in
25515fb4814Smrgfile_magic*)
25615fb4814Smrg  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
257b4d38c65Smrg    _LT_PATH_MAGIC
25815fb4814Smrg  fi
25915fb4814Smrg  ;;
26015fb4814Smrgesac
26115fb4814Smrg
262b4d38c65Smrg# Use C for the default configuration in the libtool script
263b4d38c65SmrgLT_SUPPORTED_TAG([CC])
264b4d38c65Smrg_LT_LANG_C_CONFIG
265b4d38c65Smrg_LT_LANG_DEFAULT_CONFIG
266b4d38c65Smrg_LT_CONFIG_COMMANDS
267b4d38c65Smrg])# _LT_SETUP
268b410ddbeSmrg
26915fb4814Smrg
270b4d38c65Smrg# _LT_PREPARE_SED_QUOTE_VARS
271b4d38c65Smrg# --------------------------
272b4d38c65Smrg# Define a few sed substitution that help us do robust quoting.
273b4d38c65Smrgm4_defun([_LT_PREPARE_SED_QUOTE_VARS],
274b4d38c65Smrg[# Backslashify metacharacters that are still active within
275b4d38c65Smrg# double-quoted strings.
276b4d38c65Smrgsed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
27715fb4814Smrg
278b4d38c65Smrg# Same as above, but do not quote variable references.
279b4d38c65Smrgdouble_quote_subst='s/\([["`\\]]\)/\\\1/g'
280b410ddbeSmrg
281b4d38c65Smrg# Sed substitution to delay expansion of an escaped shell variable in a
282b4d38c65Smrg# double_quote_subst'ed string.
283b4d38c65Smrgdelay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
284b410ddbeSmrg
285b4d38c65Smrg# Sed substitution to delay expansion of an escaped single quote.
286b4d38c65Smrgdelay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
28715fb4814Smrg
288b4d38c65Smrg# Sed substitution to avoid accidental globbing in evaled expressions
289b4d38c65Smrgno_glob_subst='s/\*/\\\*/g'
290b4d38c65Smrg])
29115fb4814Smrg
292b4d38c65Smrg# _LT_PROG_LTMAIN
293b4d38c65Smrg# ---------------
294b4d38c65Smrg# Note that this code is called both from `configure', and `config.status'
295b4d38c65Smrg# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
296b4d38c65Smrg# `config.status' has no value for ac_aux_dir unless we are using Automake,
297b4d38c65Smrg# so we pass a copy along to make sure it has a sensible value anyway.
298b4d38c65Smrgm4_defun([_LT_PROG_LTMAIN],
299b4d38c65Smrg[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
300b4d38c65Smrg_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
301b4d38c65Smrgltmain="$ac_aux_dir/ltmain.sh"
302b4d38c65Smrg])# _LT_PROG_LTMAIN
30315fb4814Smrg
304b534f209Smrg
305b534f209Smrg
306b4d38c65Smrg# So that we can recreate a full libtool script including additional
307b4d38c65Smrg# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
308b4d38c65Smrg# in macros and then make a single call at the end using the `libtool'
309b4d38c65Smrg# label.
310b4d38c65Smrg
311b4d38c65Smrg
312b4d38c65Smrg# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
313b4d38c65Smrg# ----------------------------------------
314b4d38c65Smrg# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
315b4d38c65Smrgm4_define([_LT_CONFIG_LIBTOOL_INIT],
316b4d38c65Smrg[m4_ifval([$1],
317b4d38c65Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
318b4d38c65Smrg                     [$1
319b4d38c65Smrg])])])
320b4d38c65Smrg
321b4d38c65Smrg# Initialize.
322b4d38c65Smrgm4_define([_LT_OUTPUT_LIBTOOL_INIT])
323b4d38c65Smrg
324b4d38c65Smrg
325b4d38c65Smrg# _LT_CONFIG_LIBTOOL([COMMANDS])
326b4d38c65Smrg# ------------------------------
327b4d38c65Smrg# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
328b4d38c65Smrgm4_define([_LT_CONFIG_LIBTOOL],
329b4d38c65Smrg[m4_ifval([$1],
330b4d38c65Smrg          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
331b4d38c65Smrg                     [$1
332b4d38c65Smrg])])])
333b4d38c65Smrg
334b4d38c65Smrg# Initialize.
335b4d38c65Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
336b4d38c65Smrg
337b4d38c65Smrg
338b4d38c65Smrg# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
339b4d38c65Smrg# -----------------------------------------------------
340b4d38c65Smrgm4_defun([_LT_CONFIG_SAVE_COMMANDS],
341b4d38c65Smrg[_LT_CONFIG_LIBTOOL([$1])
342b4d38c65Smrg_LT_CONFIG_LIBTOOL_INIT([$2])
343b534f209Smrg])
34415fb4814Smrg
34515fb4814Smrg
346b4d38c65Smrg# _LT_FORMAT_COMMENT([COMMENT])
347b4d38c65Smrg# -----------------------------
348b4d38c65Smrg# Add leading comment marks to the start of each line, and a trailing
349b4d38c65Smrg# full-stop to the whole comment if one is not present already.
350b4d38c65Smrgm4_define([_LT_FORMAT_COMMENT],
351b4d38c65Smrg[m4_ifval([$1], [
352b4d38c65Smrgm4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
353b4d38c65Smrg              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
354b4d38c65Smrg)])
355b4d38c65Smrg
356b4d38c65Smrg
357b4d38c65Smrg
358b4d38c65Smrg
359b4d38c65Smrg
360b4d38c65Smrg# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
361b4d38c65Smrg# -------------------------------------------------------------------
362b4d38c65Smrg# CONFIGNAME is the name given to the value in the libtool script.
363b4d38c65Smrg# VARNAME is the (base) name used in the configure script.
364b4d38c65Smrg# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
365b4d38c65Smrg# VARNAME.  Any other value will be used directly.
366b4d38c65Smrgm4_define([_LT_DECL],
367b4d38c65Smrg[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
368b4d38c65Smrg    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
369b4d38c65Smrg	[m4_ifval([$1], [$1], [$2])])
370b4d38c65Smrg    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
371b4d38c65Smrg    m4_ifval([$4],
372b4d38c65Smrg	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
373b4d38c65Smrg    lt_dict_add_subkey([lt_decl_dict], [$2],
374b4d38c65Smrg	[tagged?], [m4_ifval([$5], [yes], [no])])])
375b4d38c65Smrg])
37615fb4814Smrg
37715fb4814Smrg
378b4d38c65Smrg# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
379b4d38c65Smrg# --------------------------------------------------------
380b4d38c65Smrgm4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
38115fb4814Smrg
38215fb4814Smrg
383b4d38c65Smrg# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
384b4d38c65Smrg# ------------------------------------------------
385b4d38c65Smrgm4_define([lt_decl_tag_varnames],
386b4d38c65Smrg[_lt_decl_filter([tagged?], [yes], $@)])
38715fb4814Smrg
38815fb4814Smrg
389b4d38c65Smrg# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
390b4d38c65Smrg# ---------------------------------------------------------
391b4d38c65Smrgm4_define([_lt_decl_filter],
392b4d38c65Smrg[m4_case([$#],
393b4d38c65Smrg  [0], [m4_fatal([$0: too few arguments: $#])],
394b4d38c65Smrg  [1], [m4_fatal([$0: too few arguments: $#: $1])],
395b4d38c65Smrg  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
396b4d38c65Smrg  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
397b4d38c65Smrg  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
398b4d38c65Smrg])
39915fb4814Smrg
40015fb4814Smrg
401b4d38c65Smrg# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
402b4d38c65Smrg# --------------------------------------------------
403b4d38c65Smrgm4_define([lt_decl_quote_varnames],
404b4d38c65Smrg[_lt_decl_filter([value], [1], $@)])
40515fb4814Smrg
40615fb4814Smrg
407b4d38c65Smrg# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
408b4d38c65Smrg# ---------------------------------------------------
409b4d38c65Smrgm4_define([lt_decl_dquote_varnames],
410b4d38c65Smrg[_lt_decl_filter([value], [2], $@)])
41115fb4814Smrg
41215fb4814Smrg
413b4d38c65Smrg# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
414b4d38c65Smrg# ---------------------------------------------------
415b4d38c65Smrgm4_define([lt_decl_varnames_tagged],
416b4d38c65Smrg[m4_assert([$# <= 2])dnl
417b4d38c65Smrg_$0(m4_quote(m4_default([$1], [[, ]])),
418b4d38c65Smrg    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
419b4d38c65Smrg    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
420b4d38c65Smrgm4_define([_lt_decl_varnames_tagged],
421b4d38c65Smrg[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
42215fb4814Smrg
42315fb4814Smrg
424b4d38c65Smrg# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
425b4d38c65Smrg# ------------------------------------------------
426b4d38c65Smrgm4_define([lt_decl_all_varnames],
427b4d38c65Smrg[_$0(m4_quote(m4_default([$1], [[, ]])),
428b4d38c65Smrg     m4_if([$2], [],
429b4d38c65Smrg	   m4_quote(lt_decl_varnames),
430b4d38c65Smrg	m4_quote(m4_shift($@))))[]dnl
431b4d38c65Smrg])
432b4d38c65Smrgm4_define([_lt_decl_all_varnames],
433b4d38c65Smrg[lt_join($@, lt_decl_varnames_tagged([$1],
434b4d38c65Smrg			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
435b4d38c65Smrg])
43615fb4814Smrg
43715fb4814Smrg
438b4d38c65Smrg# _LT_CONFIG_STATUS_DECLARE([VARNAME])
439b4d38c65Smrg# ------------------------------------
440b4d38c65Smrg# Quote a variable value, and forward it to `config.status' so that its
441b4d38c65Smrg# declaration there will have the same value as in `configure'.  VARNAME
442b4d38c65Smrg# must have a single quote delimited value for this to work.
443b4d38c65Smrgm4_define([_LT_CONFIG_STATUS_DECLARE],
444b4d38c65Smrg[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
445b534f209Smrg
44615fb4814Smrg
447b4d38c65Smrg# _LT_CONFIG_STATUS_DECLARATIONS
448b4d38c65Smrg# ------------------------------
449b4d38c65Smrg# We delimit libtool config variables with single quotes, so when
450b4d38c65Smrg# we write them to config.status, we have to be sure to quote all
451b4d38c65Smrg# embedded single quotes properly.  In configure, this macro expands
452b4d38c65Smrg# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
453b4d38c65Smrg#
454b4d38c65Smrg#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
455b4d38c65Smrgm4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
456b4d38c65Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
457b4d38c65Smrg    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
458b4d38c65Smrg
459b4d38c65Smrg
460b4d38c65Smrg# _LT_LIBTOOL_TAGS
461b4d38c65Smrg# ----------------
462b4d38c65Smrg# Output comment and list of tags supported by the script
463b4d38c65Smrgm4_defun([_LT_LIBTOOL_TAGS],
464b4d38c65Smrg[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
465b4d38c65Smrgavailable_tags="_LT_TAGS"dnl
466b4d38c65Smrg])
46715fb4814Smrg
46815fb4814Smrg
469b4d38c65Smrg# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
470b4d38c65Smrg# -----------------------------------
471b4d38c65Smrg# Extract the dictionary values for VARNAME (optionally with TAG) and
472b4d38c65Smrg# expand to a commented shell variable setting:
473b4d38c65Smrg#
474b4d38c65Smrg#    # Some comment about what VAR is for.
475b4d38c65Smrg#    visible_name=$lt_internal_name
476b4d38c65Smrgm4_define([_LT_LIBTOOL_DECLARE],
477b4d38c65Smrg[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
478b4d38c65Smrg					   [description])))[]dnl
479b4d38c65Smrgm4_pushdef([_libtool_name],
480b4d38c65Smrg    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
481b4d38c65Smrgm4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
482b4d38c65Smrg    [0], [_libtool_name=[$]$1],
483b4d38c65Smrg    [1], [_libtool_name=$lt_[]$1],
484b4d38c65Smrg    [2], [_libtool_name=$lt_[]$1],
485b4d38c65Smrg    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
486b4d38c65Smrgm4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
487b4d38c65Smrg])
48815fb4814Smrg
48915fb4814Smrg
490b4d38c65Smrg# _LT_LIBTOOL_CONFIG_VARS
491b4d38c65Smrg# -----------------------
492b4d38c65Smrg# Produce commented declarations of non-tagged libtool config variables
493b4d38c65Smrg# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
494b4d38c65Smrg# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
495b4d38c65Smrg# section) are produced by _LT_LIBTOOL_TAG_VARS.
496b4d38c65Smrgm4_defun([_LT_LIBTOOL_CONFIG_VARS],
497b4d38c65Smrg[m4_foreach([_lt_var],
498b4d38c65Smrg    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
499b4d38c65Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
500b4d38c65Smrg
501b4d38c65Smrg
502b4d38c65Smrg# _LT_LIBTOOL_TAG_VARS(TAG)
503b4d38c65Smrg# -------------------------
504b4d38c65Smrgm4_define([_LT_LIBTOOL_TAG_VARS],
505b4d38c65Smrg[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
506b4d38c65Smrg    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
507b4d38c65Smrg
508b4d38c65Smrg
509b4d38c65Smrg# _LT_TAGVAR(VARNAME, [TAGNAME])
510b4d38c65Smrg# ------------------------------
511b4d38c65Smrgm4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
512b4d38c65Smrg
513b4d38c65Smrg
514b4d38c65Smrg# _LT_CONFIG_COMMANDS
515b4d38c65Smrg# -------------------
516b4d38c65Smrg# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
517b4d38c65Smrg# variables for single and double quote escaping we saved from calls
518b4d38c65Smrg# to _LT_DECL, we can put quote escaped variables declarations
519b4d38c65Smrg# into `config.status', and then the shell code to quote escape them in
520b4d38c65Smrg# for loops in `config.status'.  Finally, any additional code accumulated
521b4d38c65Smrg# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
522b4d38c65Smrgm4_defun([_LT_CONFIG_COMMANDS],
523b4d38c65Smrg[AC_PROVIDE_IFELSE([LT_OUTPUT],
524b4d38c65Smrg	dnl If the libtool generation code has been placed in $CONFIG_LT,
525b4d38c65Smrg	dnl instead of duplicating it all over again into config.status,
526b4d38c65Smrg	dnl then we will have config.status run $CONFIG_LT later, so it
527b4d38c65Smrg	dnl needs to know what name is stored there:
528b4d38c65Smrg        [AC_CONFIG_COMMANDS([libtool],
529b4d38c65Smrg            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
530b4d38c65Smrg    dnl If the libtool generation code is destined for config.status,
531b4d38c65Smrg    dnl expand the accumulated commands and init code now:
532b4d38c65Smrg    [AC_CONFIG_COMMANDS([libtool],
533b4d38c65Smrg        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
534b4d38c65Smrg])#_LT_CONFIG_COMMANDS
535b4d38c65Smrg
536b4d38c65Smrg
537b4d38c65Smrg# Initialize.
538b4d38c65Smrgm4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
539b4d38c65Smrg[
540b4d38c65Smrg
541b4d38c65Smrg# The HP-UX ksh and POSIX shell print the target directory to stdout
542b4d38c65Smrg# if CDPATH is set.
543b4d38c65Smrg(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
544b4d38c65Smrg
545b4d38c65Smrgsed_quote_subst='$sed_quote_subst'
546b4d38c65Smrgdouble_quote_subst='$double_quote_subst'
547b4d38c65Smrgdelay_variable_subst='$delay_variable_subst'
548b4d38c65Smrg_LT_CONFIG_STATUS_DECLARATIONS
549b4d38c65SmrgLTCC='$LTCC'
550b4d38c65SmrgLTCFLAGS='$LTCFLAGS'
551b4d38c65Smrgcompiler='$compiler_DEFAULT'
552b4d38c65Smrg
553b4d38c65Smrg# A function that is used when there is no print builtin or printf.
554b4d38c65Smrgfunc_fallback_echo ()
555b4d38c65Smrg{
556b4d38c65Smrg  eval 'cat <<_LTECHO_EOF
557b4d38c65Smrg\$[]1
558b4d38c65Smrg_LTECHO_EOF'
559b4d38c65Smrg}
560b4d38c65Smrg
561b4d38c65Smrg# Quote evaled strings.
562b4d38c65Smrgfor var in lt_decl_all_varnames([[ \
563b4d38c65Smrg]], lt_decl_quote_varnames); do
564b4d38c65Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
565b4d38c65Smrg    *[[\\\\\\\`\\"\\\$]]*)
566b4d38c65Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
567b534f209Smrg      ;;
568b4d38c65Smrg    *)
569b4d38c65Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
570b534f209Smrg      ;;
57115fb4814Smrg    esac
572b4d38c65Smrgdone
573b4d38c65Smrg
574b4d38c65Smrg# Double-quote double-evaled strings.
575b4d38c65Smrgfor var in lt_decl_all_varnames([[ \
576b4d38c65Smrg]], lt_decl_dquote_varnames); do
577b4d38c65Smrg    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
578b4d38c65Smrg    *[[\\\\\\\`\\"\\\$]]*)
579b4d38c65Smrg      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
580b534f209Smrg      ;;
581b4d38c65Smrg    *)
582b4d38c65Smrg      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
583b534f209Smrg      ;;
584b534f209Smrg    esac
585b4d38c65Smrgdone
586b4d38c65Smrg
587b4d38c65Smrg_LT_OUTPUT_LIBTOOL_INIT
588b4d38c65Smrg])
589b4d38c65Smrg
590b4d38c65Smrg# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
591b4d38c65Smrg# ------------------------------------
592b4d38c65Smrg# Generate a child script FILE with all initialization necessary to
593b4d38c65Smrg# reuse the environment learned by the parent script, and make the
594b4d38c65Smrg# file executable.  If COMMENT is supplied, it is inserted after the
595b4d38c65Smrg# `#!' sequence but before initialization text begins.  After this
596b4d38c65Smrg# macro, additional text can be appended to FILE to form the body of
597b4d38c65Smrg# the child script.  The macro ends with non-zero status if the
598b4d38c65Smrg# file could not be fully written (such as if the disk is full).
599b4d38c65Smrgm4_ifdef([AS_INIT_GENERATED],
600b4d38c65Smrg[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
601b4d38c65Smrg[m4_defun([_LT_GENERATED_FILE_INIT],
602b4d38c65Smrg[m4_require([AS_PREPARE])]dnl
603b4d38c65Smrg[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
604b4d38c65Smrg[lt_write_fail=0
605b4d38c65Smrgcat >$1 <<_ASEOF || lt_write_fail=1
606b4d38c65Smrg#! $SHELL
607b4d38c65Smrg# Generated by $as_me.
608b4d38c65Smrg$2
609b4d38c65SmrgSHELL=\${CONFIG_SHELL-$SHELL}
610b4d38c65Smrgexport SHELL
611b4d38c65Smrg_ASEOF
612b4d38c65Smrgcat >>$1 <<\_ASEOF || lt_write_fail=1
613b4d38c65SmrgAS_SHELL_SANITIZE
614b4d38c65Smrg_AS_PREPARE
615b4d38c65Smrgexec AS_MESSAGE_FD>&1
616b4d38c65Smrg_ASEOF
617b4d38c65Smrgtest $lt_write_fail = 0 && chmod +x $1[]dnl
618b4d38c65Smrgm4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
619b4d38c65Smrg
620b4d38c65Smrg# LT_OUTPUT
621b4d38c65Smrg# ---------
622b4d38c65Smrg# This macro allows early generation of the libtool script (before
623b4d38c65Smrg# AC_OUTPUT is called), incase it is used in configure for compilation
624b4d38c65Smrg# tests.
625b4d38c65SmrgAC_DEFUN([LT_OUTPUT],
626b4d38c65Smrg[: ${CONFIG_LT=./config.lt}
627b4d38c65SmrgAC_MSG_NOTICE([creating $CONFIG_LT])
628b4d38c65Smrg_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
629b4d38c65Smrg[# Run this file to recreate a libtool stub with the current configuration.])
630b4d38c65Smrg
631b4d38c65Smrgcat >>"$CONFIG_LT" <<\_LTEOF
632b4d38c65Smrglt_cl_silent=false
633b4d38c65Smrgexec AS_MESSAGE_LOG_FD>>config.log
634b4d38c65Smrg{
635b4d38c65Smrg  echo
636b4d38c65Smrg  AS_BOX([Running $as_me.])
637b4d38c65Smrg} >&AS_MESSAGE_LOG_FD
638b4d38c65Smrg
639b4d38c65Smrglt_cl_help="\
640b4d38c65Smrg\`$as_me' creates a local libtool stub from the current configuration,
641b4d38c65Smrgfor use in further configure time tests before the real libtool is
642b4d38c65Smrggenerated.
643b4d38c65Smrg
644b4d38c65SmrgUsage: $[0] [[OPTIONS]]
645b4d38c65Smrg
646b4d38c65Smrg  -h, --help      print this help, then exit
647b4d38c65Smrg  -V, --version   print version number, then exit
648b4d38c65Smrg  -q, --quiet     do not print progress messages
649b4d38c65Smrg  -d, --debug     don't remove temporary files
650b4d38c65Smrg
651b4d38c65SmrgReport bugs to <bug-libtool@gnu.org>."
652b4d38c65Smrg
653b4d38c65Smrglt_cl_version="\
654b4d38c65Smrgm4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
655b4d38c65Smrgm4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
656b4d38c65Smrgconfigured by $[0], generated by m4_PACKAGE_STRING.
657b4d38c65Smrg
658cf503b78SmrgCopyright (C) 2011 Free Software Foundation, Inc.
659b4d38c65SmrgThis config.lt script is free software; the Free Software Foundation
660b4d38c65Smrggives unlimited permision to copy, distribute and modify it."
661b4d38c65Smrg
662b4d38c65Smrgwhile test $[#] != 0
663b4d38c65Smrgdo
664b4d38c65Smrg  case $[1] in
665b4d38c65Smrg    --version | --v* | -V )
666b4d38c65Smrg      echo "$lt_cl_version"; exit 0 ;;
667b4d38c65Smrg    --help | --h* | -h )
668b4d38c65Smrg      echo "$lt_cl_help"; exit 0 ;;
669b4d38c65Smrg    --debug | --d* | -d )
670b4d38c65Smrg      debug=: ;;
671b4d38c65Smrg    --quiet | --q* | --silent | --s* | -q )
672b4d38c65Smrg      lt_cl_silent=: ;;
673b4d38c65Smrg
674b4d38c65Smrg    -*) AC_MSG_ERROR([unrecognized option: $[1]
675b4d38c65SmrgTry \`$[0] --help' for more information.]) ;;
676b4d38c65Smrg
677b4d38c65Smrg    *) AC_MSG_ERROR([unrecognized argument: $[1]
678b4d38c65SmrgTry \`$[0] --help' for more information.]) ;;
679b4d38c65Smrg  esac
680b4d38c65Smrg  shift
681b4d38c65Smrgdone
682b4d38c65Smrg
683b4d38c65Smrgif $lt_cl_silent; then
684b4d38c65Smrg  exec AS_MESSAGE_FD>/dev/null
685b4d38c65Smrgfi
686b4d38c65Smrg_LTEOF
687b4d38c65Smrg
688b4d38c65Smrgcat >>"$CONFIG_LT" <<_LTEOF
689b4d38c65Smrg_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
690b4d38c65Smrg_LTEOF
691b4d38c65Smrg
692b4d38c65Smrgcat >>"$CONFIG_LT" <<\_LTEOF
693b4d38c65SmrgAC_MSG_NOTICE([creating $ofile])
694b4d38c65Smrg_LT_OUTPUT_LIBTOOL_COMMANDS
695b4d38c65SmrgAS_EXIT(0)
696b4d38c65Smrg_LTEOF
697b4d38c65Smrgchmod +x "$CONFIG_LT"
698b4d38c65Smrg
699b4d38c65Smrg# configure is writing to config.log, but config.lt does its own redirection,
700b4d38c65Smrg# appending to config.log, which fails on DOS, as config.log is still kept
701b4d38c65Smrg# open by configure.  Here we exec the FD to /dev/null, effectively closing
702b4d38c65Smrg# config.log, so it can be properly (re)opened and appended to by config.lt.
703b4d38c65Smrglt_cl_success=:
704b4d38c65Smrgtest "$silent" = yes &&
705b4d38c65Smrg  lt_config_lt_args="$lt_config_lt_args --quiet"
706b4d38c65Smrgexec AS_MESSAGE_LOG_FD>/dev/null
707b4d38c65Smrg$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
708b4d38c65Smrgexec AS_MESSAGE_LOG_FD>>config.log
709b4d38c65Smrg$lt_cl_success || AS_EXIT(1)
710b4d38c65Smrg])# LT_OUTPUT
711b4d38c65Smrg
712b4d38c65Smrg
713b4d38c65Smrg# _LT_CONFIG(TAG)
714b4d38c65Smrg# ---------------
715b4d38c65Smrg# If TAG is the built-in tag, create an initial libtool script with a
716b4d38c65Smrg# default configuration from the untagged config vars.  Otherwise add code
717b4d38c65Smrg# to config.status for appending the configuration named by TAG from the
718b4d38c65Smrg# matching tagged config vars.
719b4d38c65Smrgm4_defun([_LT_CONFIG],
720b4d38c65Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
721b4d38c65Smrg_LT_CONFIG_SAVE_COMMANDS([
722b4d38c65Smrg  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
723b4d38c65Smrg  m4_if(_LT_TAG, [C], [
724b4d38c65Smrg    # See if we are running on zsh, and set the options which allow our
725b4d38c65Smrg    # commands through without removal of \ escapes.
726b4d38c65Smrg    if test -n "${ZSH_VERSION+set}" ; then
727b4d38c65Smrg      setopt NO_GLOB_SUBST
728b4d38c65Smrg    fi
729b4d38c65Smrg
730b4d38c65Smrg    cfgfile="${ofile}T"
731b4d38c65Smrg    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
732b4d38c65Smrg    $RM "$cfgfile"
733b4d38c65Smrg
734b4d38c65Smrg    cat <<_LT_EOF >> "$cfgfile"
735b4d38c65Smrg#! $SHELL
736b4d38c65Smrg
737b4d38c65Smrg# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
738b4d38c65Smrg# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
739b4d38c65Smrg# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
740b4d38c65Smrg# NOTE: Changes made to this file will be lost: look at ltmain.sh.
741b4d38c65Smrg#
742b4d38c65Smrg_LT_COPYING
743b4d38c65Smrg_LT_LIBTOOL_TAGS
744b4d38c65Smrg
745b4d38c65Smrg# ### BEGIN LIBTOOL CONFIG
746b4d38c65Smrg_LT_LIBTOOL_CONFIG_VARS
747b4d38c65Smrg_LT_LIBTOOL_TAG_VARS
748b4d38c65Smrg# ### END LIBTOOL CONFIG
749b4d38c65Smrg
750b4d38c65Smrg_LT_EOF
751b4d38c65Smrg
752b4d38c65Smrg  case $host_os in
753b4d38c65Smrg  aix3*)
754b4d38c65Smrg    cat <<\_LT_EOF >> "$cfgfile"
755b4d38c65Smrg# AIX sometimes has problems with the GCC collect2 program.  For some
756b4d38c65Smrg# reason, if we set the COLLECT_NAMES environment variable, the problems
757b4d38c65Smrg# vanish in a puff of smoke.
758b4d38c65Smrgif test "X${COLLECT_NAMES+set}" != Xset; then
759b4d38c65Smrg  COLLECT_NAMES=
760b4d38c65Smrg  export COLLECT_NAMES
761b4d38c65Smrgfi
762b4d38c65Smrg_LT_EOF
763b4d38c65Smrg    ;;
764b4d38c65Smrg  esac
765b4d38c65Smrg
766b4d38c65Smrg  _LT_PROG_LTMAIN
767b4d38c65Smrg
768b4d38c65Smrg  # We use sed instead of cat because bash on DJGPP gets confused if
769b4d38c65Smrg  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
770b4d38c65Smrg  # text mode, it properly converts lines to CR/LF.  This bash problem
771b4d38c65Smrg  # is reportedly fixed, but why not run on old versions too?
772b4d38c65Smrg  sed '$q' "$ltmain" >> "$cfgfile" \
773b4d38c65Smrg     || (rm -f "$cfgfile"; exit 1)
774b4d38c65Smrg
775b4d38c65Smrg  _LT_PROG_REPLACE_SHELLFNS
776b4d38c65Smrg
777b4d38c65Smrg   mv -f "$cfgfile" "$ofile" ||
778b4d38c65Smrg    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
779b4d38c65Smrg  chmod +x "$ofile"
780b4d38c65Smrg],
781b4d38c65Smrg[cat <<_LT_EOF >> "$ofile"
782b4d38c65Smrg
783b4d38c65Smrgdnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
784b4d38c65Smrgdnl in a comment (ie after a #).
785b4d38c65Smrg# ### BEGIN LIBTOOL TAG CONFIG: $1
786b4d38c65Smrg_LT_LIBTOOL_TAG_VARS(_LT_TAG)
787b4d38c65Smrg# ### END LIBTOOL TAG CONFIG: $1
788b4d38c65Smrg_LT_EOF
789b4d38c65Smrg])dnl /m4_if
790b4d38c65Smrg],
791b4d38c65Smrg[m4_if([$1], [], [
792b4d38c65Smrg    PACKAGE='$PACKAGE'
793b4d38c65Smrg    VERSION='$VERSION'
794b4d38c65Smrg    TIMESTAMP='$TIMESTAMP'
795b4d38c65Smrg    RM='$RM'
796b4d38c65Smrg    ofile='$ofile'], [])
797b4d38c65Smrg])dnl /_LT_CONFIG_SAVE_COMMANDS
798b4d38c65Smrg])# _LT_CONFIG
799b4d38c65Smrg
800b4d38c65Smrg
801b4d38c65Smrg# LT_SUPPORTED_TAG(TAG)
802b4d38c65Smrg# ---------------------
803b4d38c65Smrg# Trace this macro to discover what tags are supported by the libtool
804b4d38c65Smrg# --tag option, using:
805b4d38c65Smrg#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
806b4d38c65SmrgAC_DEFUN([LT_SUPPORTED_TAG], [])
807b4d38c65Smrg
808b4d38c65Smrg
809b4d38c65Smrg# C support is built-in for now
810b4d38c65Smrgm4_define([_LT_LANG_C_enabled], [])
811b4d38c65Smrgm4_define([_LT_TAGS], [])
812b4d38c65Smrg
813b4d38c65Smrg
814b4d38c65Smrg# LT_LANG(LANG)
815b4d38c65Smrg# -------------
816b4d38c65Smrg# Enable libtool support for the given language if not already enabled.
817b4d38c65SmrgAC_DEFUN([LT_LANG],
818b4d38c65Smrg[AC_BEFORE([$0], [LT_OUTPUT])dnl
819b4d38c65Smrgm4_case([$1],
820b4d38c65Smrg  [C],			[_LT_LANG(C)],
821b4d38c65Smrg  [C++],		[_LT_LANG(CXX)],
822cf503b78Smrg  [Go],			[_LT_LANG(GO)],
823b4d38c65Smrg  [Java],		[_LT_LANG(GCJ)],
824b4d38c65Smrg  [Fortran 77],		[_LT_LANG(F77)],
825b4d38c65Smrg  [Fortran],		[_LT_LANG(FC)],
826b4d38c65Smrg  [Windows Resource],	[_LT_LANG(RC)],
827b4d38c65Smrg  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
828b4d38c65Smrg    [_LT_LANG($1)],
829b4d38c65Smrg    [m4_fatal([$0: unsupported language: "$1"])])])dnl
830b4d38c65Smrg])# LT_LANG
831b4d38c65Smrg
832b4d38c65Smrg
833b4d38c65Smrg# _LT_LANG(LANGNAME)
834b4d38c65Smrg# ------------------
835b4d38c65Smrgm4_defun([_LT_LANG],
836b4d38c65Smrg[m4_ifdef([_LT_LANG_]$1[_enabled], [],
837b4d38c65Smrg  [LT_SUPPORTED_TAG([$1])dnl
838b4d38c65Smrg  m4_append([_LT_TAGS], [$1 ])dnl
839b4d38c65Smrg  m4_define([_LT_LANG_]$1[_enabled], [])dnl
840b4d38c65Smrg  _LT_LANG_$1_CONFIG($1)])dnl
841b4d38c65Smrg])# _LT_LANG
842b4d38c65Smrg
843b4d38c65Smrg
844cf503b78Smrgm4_ifndef([AC_PROG_GO], [
845cf503b78Smrg# NOTE: This macro has been submitted for inclusion into   #
846cf503b78Smrg#  GNU Autoconf as AC_PROG_GO.  When it is available in    #
847cf503b78Smrg#  a released version of Autoconf we should remove this    #
848cf503b78Smrg#  macro and use it instead.                               #
849cf503b78Smrgm4_defun([AC_PROG_GO],
850cf503b78Smrg[AC_LANG_PUSH(Go)dnl
851cf503b78SmrgAC_ARG_VAR([GOC],     [Go compiler command])dnl
852cf503b78SmrgAC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
853cf503b78Smrg_AC_ARG_VAR_LDFLAGS()dnl
854cf503b78SmrgAC_CHECK_TOOL(GOC, gccgo)
855cf503b78Smrgif test -z "$GOC"; then
856cf503b78Smrg  if test -n "$ac_tool_prefix"; then
857cf503b78Smrg    AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
858cf503b78Smrg  fi
859cf503b78Smrgfi
860cf503b78Smrgif test -z "$GOC"; then
861cf503b78Smrg  AC_CHECK_PROG(GOC, gccgo, gccgo, false)
862cf503b78Smrgfi
863cf503b78Smrg])#m4_defun
864cf503b78Smrg])#m4_ifndef
865cf503b78Smrg
866cf503b78Smrg
867b4d38c65Smrg# _LT_LANG_DEFAULT_CONFIG
868b4d38c65Smrg# -----------------------
869b4d38c65Smrgm4_defun([_LT_LANG_DEFAULT_CONFIG],
870b4d38c65Smrg[AC_PROVIDE_IFELSE([AC_PROG_CXX],
871b4d38c65Smrg  [LT_LANG(CXX)],
872b4d38c65Smrg  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
873b4d38c65Smrg
874b4d38c65SmrgAC_PROVIDE_IFELSE([AC_PROG_F77],
875b4d38c65Smrg  [LT_LANG(F77)],
876b4d38c65Smrg  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
877b4d38c65Smrg
878b4d38c65SmrgAC_PROVIDE_IFELSE([AC_PROG_FC],
879b4d38c65Smrg  [LT_LANG(FC)],
880b4d38c65Smrg  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
881b4d38c65Smrg
882b4d38c65Smrgdnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
883b4d38c65Smrgdnl pulling things in needlessly.
884b4d38c65SmrgAC_PROVIDE_IFELSE([AC_PROG_GCJ],
885b4d38c65Smrg  [LT_LANG(GCJ)],
886b4d38c65Smrg  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
887b4d38c65Smrg    [LT_LANG(GCJ)],
888b4d38c65Smrg    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
889b4d38c65Smrg      [LT_LANG(GCJ)],
890b4d38c65Smrg      [m4_ifdef([AC_PROG_GCJ],
891b4d38c65Smrg	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
892b4d38c65Smrg       m4_ifdef([A][M_PROG_GCJ],
893b4d38c65Smrg	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
894b4d38c65Smrg       m4_ifdef([LT_PROG_GCJ],
895b4d38c65Smrg	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
896b4d38c65Smrg
897cf503b78SmrgAC_PROVIDE_IFELSE([AC_PROG_GO],
898cf503b78Smrg  [LT_LANG(GO)],
899cf503b78Smrg  [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
900cf503b78Smrg
901b4d38c65SmrgAC_PROVIDE_IFELSE([LT_PROG_RC],
902b4d38c65Smrg  [LT_LANG(RC)],
903b4d38c65Smrg  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
904b4d38c65Smrg])# _LT_LANG_DEFAULT_CONFIG
905b4d38c65Smrg
906b4d38c65Smrg# Obsolete macros:
907b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
908b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
909b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
910b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
911b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
912b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
913b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_CXX], [])
914b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_F77], [])
915b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_FC], [])
916b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
917b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_RC], [])
918b4d38c65Smrg
919b4d38c65Smrg
920b4d38c65Smrg# _LT_TAG_COMPILER
921b4d38c65Smrg# ----------------
922b4d38c65Smrgm4_defun([_LT_TAG_COMPILER],
923b4d38c65Smrg[AC_REQUIRE([AC_PROG_CC])dnl
924b4d38c65Smrg
925b4d38c65Smrg_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
926b4d38c65Smrg_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
927b4d38c65Smrg_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
928b4d38c65Smrg_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
929b4d38c65Smrg
930b4d38c65Smrg# If no C compiler was specified, use CC.
931b4d38c65SmrgLTCC=${LTCC-"$CC"}
932b4d38c65Smrg
933b4d38c65Smrg# If no C compiler flags were specified, use CFLAGS.
934b4d38c65SmrgLTCFLAGS=${LTCFLAGS-"$CFLAGS"}
935b4d38c65Smrg
936b4d38c65Smrg# Allow CC to be a program name with arguments.
937b4d38c65Smrgcompiler=$CC
938b4d38c65Smrg])# _LT_TAG_COMPILER
939b4d38c65Smrg
940b4d38c65Smrg
941b4d38c65Smrg# _LT_COMPILER_BOILERPLATE
942b4d38c65Smrg# ------------------------
943b4d38c65Smrg# Check for compiler boilerplate output or warnings with
944b4d38c65Smrg# the simple compiler test code.
945b4d38c65Smrgm4_defun([_LT_COMPILER_BOILERPLATE],
946b4d38c65Smrg[m4_require([_LT_DECL_SED])dnl
947b4d38c65Smrgac_outfile=conftest.$ac_objext
948b4d38c65Smrgecho "$lt_simple_compile_test_code" >conftest.$ac_ext
949b4d38c65Smrgeval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
950b4d38c65Smrg_lt_compiler_boilerplate=`cat conftest.err`
951b4d38c65Smrg$RM conftest*
952b4d38c65Smrg])# _LT_COMPILER_BOILERPLATE
953b4d38c65Smrg
954b4d38c65Smrg
955b4d38c65Smrg# _LT_LINKER_BOILERPLATE
956b4d38c65Smrg# ----------------------
957b4d38c65Smrg# Check for linker boilerplate output or warnings with
958b4d38c65Smrg# the simple link test code.
959b4d38c65Smrgm4_defun([_LT_LINKER_BOILERPLATE],
960b4d38c65Smrg[m4_require([_LT_DECL_SED])dnl
961b4d38c65Smrgac_outfile=conftest.$ac_objext
962b4d38c65Smrgecho "$lt_simple_link_test_code" >conftest.$ac_ext
963b4d38c65Smrgeval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
964b4d38c65Smrg_lt_linker_boilerplate=`cat conftest.err`
965b4d38c65Smrg$RM -r conftest*
966b4d38c65Smrg])# _LT_LINKER_BOILERPLATE
967b4d38c65Smrg
968b4d38c65Smrg# _LT_REQUIRED_DARWIN_CHECKS
969b4d38c65Smrg# -------------------------
970b4d38c65Smrgm4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
971b4d38c65Smrg  case $host_os in
972b4d38c65Smrg    rhapsody* | darwin*)
973b4d38c65Smrg    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
974b4d38c65Smrg    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
975b4d38c65Smrg    AC_CHECK_TOOL([LIPO], [lipo], [:])
976b4d38c65Smrg    AC_CHECK_TOOL([OTOOL], [otool], [:])
977b4d38c65Smrg    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
978b4d38c65Smrg    _LT_DECL([], [DSYMUTIL], [1],
979b4d38c65Smrg      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
980b4d38c65Smrg    _LT_DECL([], [NMEDIT], [1],
981b4d38c65Smrg      [Tool to change global to local symbols on Mac OS X])
982b4d38c65Smrg    _LT_DECL([], [LIPO], [1],
983b4d38c65Smrg      [Tool to manipulate fat objects and archives on Mac OS X])
984b4d38c65Smrg    _LT_DECL([], [OTOOL], [1],
985b4d38c65Smrg      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
986b4d38c65Smrg    _LT_DECL([], [OTOOL64], [1],
987b4d38c65Smrg      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
988b4d38c65Smrg
989b4d38c65Smrg    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
990b4d38c65Smrg      [lt_cv_apple_cc_single_mod=no
991b4d38c65Smrg      if test -z "${LT_MULTI_MODULE}"; then
992b4d38c65Smrg	# By default we will add the -single_module flag. You can override
993b4d38c65Smrg	# by either setting the environment variable LT_MULTI_MODULE
994b4d38c65Smrg	# non-empty at configure time, or by adding -multi_module to the
995b4d38c65Smrg	# link flags.
996b4d38c65Smrg	rm -rf libconftest.dylib*
997b4d38c65Smrg	echo "int foo(void){return 1;}" > conftest.c
998b4d38c65Smrg	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
999b4d38c65Smrg-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
1000b4d38c65Smrg	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
1001b4d38c65Smrg	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
1002b4d38c65Smrg        _lt_result=$?
1003cf503b78Smrg	# If there is a non-empty error log, and "single_module"
1004cf503b78Smrg	# appears in it, assume the flag caused a linker warning
1005cf503b78Smrg        if test -s conftest.err && $GREP single_module conftest.err; then
1006cf503b78Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1007cf503b78Smrg	# Otherwise, if the output was created with a 0 exit code from
1008cf503b78Smrg	# the compiler, it worked.
1009cf503b78Smrg	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
1010b4d38c65Smrg	  lt_cv_apple_cc_single_mod=yes
1011b4d38c65Smrg	else
1012b4d38c65Smrg	  cat conftest.err >&AS_MESSAGE_LOG_FD
1013b4d38c65Smrg	fi
1014b4d38c65Smrg	rm -rf libconftest.dylib*
1015b4d38c65Smrg	rm -f conftest.*
1016b4d38c65Smrg      fi])
1017cf503b78Smrg
1018b4d38c65Smrg    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
1019b4d38c65Smrg      [lt_cv_ld_exported_symbols_list],
1020b4d38c65Smrg      [lt_cv_ld_exported_symbols_list=no
1021b4d38c65Smrg      save_LDFLAGS=$LDFLAGS
1022b4d38c65Smrg      echo "_main" > conftest.sym
1023b4d38c65Smrg      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
1024b4d38c65Smrg      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
1025b4d38c65Smrg	[lt_cv_ld_exported_symbols_list=yes],
1026b4d38c65Smrg	[lt_cv_ld_exported_symbols_list=no])
1027b4d38c65Smrg	LDFLAGS="$save_LDFLAGS"
1028b4d38c65Smrg    ])
1029cf503b78Smrg
1030b4d38c65Smrg    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
1031b4d38c65Smrg      [lt_cv_ld_force_load=no
1032b4d38c65Smrg      cat > conftest.c << _LT_EOF
1033b4d38c65Smrgint forced_loaded() { return 2;}
1034b4d38c65Smrg_LT_EOF
1035b4d38c65Smrg      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
1036b4d38c65Smrg      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
1037b4d38c65Smrg      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
1038b4d38c65Smrg      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
1039b4d38c65Smrg      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
1040b4d38c65Smrg      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
1041b4d38c65Smrg      cat > conftest.c << _LT_EOF
1042b4d38c65Smrgint main() { return 0;}
1043b4d38c65Smrg_LT_EOF
1044b4d38c65Smrg      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
1045b4d38c65Smrg      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
1046b4d38c65Smrg      _lt_result=$?
1047cf503b78Smrg      if test -s conftest.err && $GREP force_load conftest.err; then
1048cf503b78Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1049cf503b78Smrg      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
1050b4d38c65Smrg	lt_cv_ld_force_load=yes
1051b4d38c65Smrg      else
1052b4d38c65Smrg	cat conftest.err >&AS_MESSAGE_LOG_FD
1053b4d38c65Smrg      fi
1054b4d38c65Smrg        rm -f conftest.err libconftest.a conftest conftest.c
1055b4d38c65Smrg        rm -rf conftest.dSYM
1056b4d38c65Smrg    ])
1057b4d38c65Smrg    case $host_os in
1058b4d38c65Smrg    rhapsody* | darwin1.[[012]])
1059b4d38c65Smrg      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
1060b4d38c65Smrg    darwin1.*)
1061b4d38c65Smrg      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1062b4d38c65Smrg    darwin*) # darwin 5.x on
1063b4d38c65Smrg      # if running on 10.5 or later, the deployment target defaults
1064b4d38c65Smrg      # to the OS version, if on x86, and 10.4, the deployment
1065b4d38c65Smrg      # target defaults to 10.4. Don't you love it?
1066b4d38c65Smrg      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
1067b4d38c65Smrg	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
1068b4d38c65Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1069b4d38c65Smrg	10.[[012]]*)
1070b4d38c65Smrg	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
1071b4d38c65Smrg	10.*)
1072b4d38c65Smrg	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
1073b4d38c65Smrg      esac
1074b4d38c65Smrg    ;;
1075b4d38c65Smrg  esac
1076b4d38c65Smrg    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
1077b4d38c65Smrg      _lt_dar_single_mod='$single_module'
1078b4d38c65Smrg    fi
1079b4d38c65Smrg    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
1080b4d38c65Smrg      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
1081b4d38c65Smrg    else
1082b4d38c65Smrg      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
1083b4d38c65Smrg    fi
1084b4d38c65Smrg    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
1085b4d38c65Smrg      _lt_dsymutil='~$DSYMUTIL $lib || :'
1086b4d38c65Smrg    else
1087b4d38c65Smrg      _lt_dsymutil=
1088b4d38c65Smrg    fi
1089b4d38c65Smrg    ;;
1090b4d38c65Smrg  esac
1091b4d38c65Smrg])
1092b4d38c65Smrg
1093b4d38c65Smrg
1094cf503b78Smrg# _LT_DARWIN_LINKER_FEATURES([TAG])
1095cf503b78Smrg# ---------------------------------
1096b4d38c65Smrg# Checks for linker and compiler features on darwin
1097b4d38c65Smrgm4_defun([_LT_DARWIN_LINKER_FEATURES],
1098b4d38c65Smrg[
1099b4d38c65Smrg  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
1100b4d38c65Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
1101b4d38c65Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
1102b4d38c65Smrg  _LT_TAGVAR(hardcode_automatic, $1)=yes
1103b4d38c65Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
1104b4d38c65Smrg  if test "$lt_cv_ld_force_load" = "yes"; then
1105b4d38c65Smrg    _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\"`'
1106cf503b78Smrg    m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
1107cf503b78Smrg                  [FC],  [_LT_TAGVAR(compiler_needs_object, $1)=yes])
1108b4d38c65Smrg  else
1109b4d38c65Smrg    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
1110b4d38c65Smrg  fi
1111b4d38c65Smrg  _LT_TAGVAR(link_all_deplibs, $1)=yes
1112b4d38c65Smrg  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
1113b4d38c65Smrg  case $cc_basename in
1114b4d38c65Smrg     ifort*) _lt_dar_can_shared=yes ;;
1115b4d38c65Smrg     *) _lt_dar_can_shared=$GCC ;;
1116b4d38c65Smrg  esac
1117b4d38c65Smrg  if test "$_lt_dar_can_shared" = "yes"; then
1118b4d38c65Smrg    output_verbose_link_cmd=func_echo_all
1119b4d38c65Smrg    _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}"
1120b4d38c65Smrg    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
1121b4d38c65Smrg    _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}"
1122b4d38c65Smrg    _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}"
1123b4d38c65Smrg    m4_if([$1], [CXX],
1124b4d38c65Smrg[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
1125b4d38c65Smrg      _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}"
1126b4d38c65Smrg      _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}"
1127b4d38c65Smrg    fi
1128b4d38c65Smrg],[])
1129b4d38c65Smrg  else
1130b4d38c65Smrg  _LT_TAGVAR(ld_shlibs, $1)=no
1131b4d38c65Smrg  fi
1132b4d38c65Smrg])
1133b4d38c65Smrg
1134b4d38c65Smrg# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
1135b4d38c65Smrg# ----------------------------------
1136b4d38c65Smrg# Links a minimal program and checks the executable
1137b4d38c65Smrg# for the system default hardcoded library path. In most cases,
1138b4d38c65Smrg# this is /usr/lib:/lib, but when the MPI compilers are used
1139b4d38c65Smrg# the location of the communication and MPI libs are included too.
1140b4d38c65Smrg# If we don't find anything, use the default library path according
1141b4d38c65Smrg# to the aix ld manual.
1142b4d38c65Smrg# Store the results from the different compilers for each TAGNAME.
1143b4d38c65Smrg# Allow to override them for all tags through lt_cv_aix_libpath.
1144b4d38c65Smrgm4_defun([_LT_SYS_MODULE_PATH_AIX],
1145b4d38c65Smrg[m4_require([_LT_DECL_SED])dnl
1146b4d38c65Smrgif test "${lt_cv_aix_libpath+set}" = set; then
1147b4d38c65Smrg  aix_libpath=$lt_cv_aix_libpath
1148b4d38c65Smrgelse
1149b4d38c65Smrg  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
1150b4d38c65Smrg  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
1151b4d38c65Smrg  lt_aix_libpath_sed='[
1152b4d38c65Smrg      /Import File Strings/,/^$/ {
1153b4d38c65Smrg	  /^0/ {
1154b4d38c65Smrg	      s/^0  *\([^ ]*\) *$/\1/
1155b4d38c65Smrg	      p
1156b4d38c65Smrg	  }
1157b4d38c65Smrg      }]'
1158b4d38c65Smrg  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1159b4d38c65Smrg  # Check for a 64-bit object if we didn't find anything.
1160b4d38c65Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1161b4d38c65Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
1162b4d38c65Smrg  fi],[])
1163b4d38c65Smrg  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
1164b4d38c65Smrg    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
1165b4d38c65Smrg  fi
1166b4d38c65Smrg  ])
1167b4d38c65Smrg  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
1168b4d38c65Smrgfi
1169b4d38c65Smrg])# _LT_SYS_MODULE_PATH_AIX
1170b4d38c65Smrg
1171b4d38c65Smrg
1172b4d38c65Smrg# _LT_SHELL_INIT(ARG)
1173b4d38c65Smrg# -------------------
1174b4d38c65Smrgm4_define([_LT_SHELL_INIT],
1175b4d38c65Smrg[m4_divert_text([M4SH-INIT], [$1
1176b4d38c65Smrg])])# _LT_SHELL_INIT
1177b4d38c65Smrg
1178b4d38c65Smrg
1179b4d38c65Smrg
1180b4d38c65Smrg# _LT_PROG_ECHO_BACKSLASH
1181b4d38c65Smrg# -----------------------
1182b4d38c65Smrg# Find how we can fake an echo command that does not interpret backslash.
1183b4d38c65Smrg# In particular, with Autoconf 2.60 or later we add some code to the start
1184b4d38c65Smrg# of the generated configure script which will find a shell with a builtin
1185b4d38c65Smrg# printf (which we can use as an echo command).
1186b4d38c65Smrgm4_defun([_LT_PROG_ECHO_BACKSLASH],
1187b4d38c65Smrg[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1188b4d38c65SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1189b4d38c65SmrgECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1190b4d38c65Smrg
1191b4d38c65SmrgAC_MSG_CHECKING([how to print strings])
1192b4d38c65Smrg# Test print first, because it will be a builtin if present.
1193b4d38c65Smrgif test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
1194b4d38c65Smrg   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
1195b4d38c65Smrg  ECHO='print -r --'
1196b4d38c65Smrgelif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
1197b4d38c65Smrg  ECHO='printf %s\n'
1198b4d38c65Smrgelse
1199b4d38c65Smrg  # Use this function as a fallback that always works.
1200b4d38c65Smrg  func_fallback_echo ()
1201b4d38c65Smrg  {
1202b4d38c65Smrg    eval 'cat <<_LTECHO_EOF
1203b4d38c65Smrg$[]1
1204b4d38c65Smrg_LTECHO_EOF'
1205b4d38c65Smrg  }
1206b4d38c65Smrg  ECHO='func_fallback_echo'
1207b4d38c65Smrgfi
1208b4d38c65Smrg
1209b4d38c65Smrg# func_echo_all arg...
1210b4d38c65Smrg# Invoke $ECHO with all args, space-separated.
1211b4d38c65Smrgfunc_echo_all ()
1212b4d38c65Smrg{
1213b4d38c65Smrg    $ECHO "$*" 
1214b4d38c65Smrg}
1215b4d38c65Smrg
1216b4d38c65Smrgcase "$ECHO" in
1217b4d38c65Smrg  printf*) AC_MSG_RESULT([printf]) ;;
1218b4d38c65Smrg  print*) AC_MSG_RESULT([print -r]) ;;
1219b4d38c65Smrg  *) AC_MSG_RESULT([cat]) ;;
1220b4d38c65Smrgesac
1221b4d38c65Smrg
1222b4d38c65Smrgm4_ifdef([_AS_DETECT_SUGGESTED],
1223b4d38c65Smrg[_AS_DETECT_SUGGESTED([
1224b4d38c65Smrg  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
1225b4d38c65Smrg    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
1226b4d38c65Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
1227b4d38c65Smrg    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
1228b4d38c65Smrg    PATH=/empty FPATH=/empty; export PATH FPATH
1229b4d38c65Smrg    test "X`printf %s $ECHO`" = "X$ECHO" \
1230b4d38c65Smrg      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
1231b4d38c65Smrg
1232b4d38c65Smrg_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
1233b4d38c65Smrg_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
1234b4d38c65Smrg])# _LT_PROG_ECHO_BACKSLASH
1235b4d38c65Smrg
1236b4d38c65Smrg
1237b4d38c65Smrg# _LT_WITH_SYSROOT
1238b4d38c65Smrg# ----------------
1239b4d38c65SmrgAC_DEFUN([_LT_WITH_SYSROOT],
1240b4d38c65Smrg[AC_MSG_CHECKING([for sysroot])
1241b4d38c65SmrgAC_ARG_WITH([sysroot],
1242b4d38c65Smrg[  --with-sysroot[=DIR] Search for dependent libraries within DIR
1243b4d38c65Smrg                        (or the compiler's sysroot if not specified).],
1244b4d38c65Smrg[], [with_sysroot=no])
1245b4d38c65Smrg
1246b4d38c65Smrgdnl lt_sysroot will always be passed unquoted.  We quote it here
1247b4d38c65Smrgdnl in case the user passed a directory name.
1248b4d38c65Smrglt_sysroot=
1249b4d38c65Smrgcase ${with_sysroot} in #(
1250b4d38c65Smrg yes)
1251b4d38c65Smrg   if test "$GCC" = yes; then
1252b4d38c65Smrg     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
1253b4d38c65Smrg   fi
1254b4d38c65Smrg   ;; #(
1255b4d38c65Smrg /*)
1256b4d38c65Smrg   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
1257b4d38c65Smrg   ;; #(
1258b4d38c65Smrg no|'')
1259b4d38c65Smrg   ;; #(
1260b4d38c65Smrg *)
1261b4d38c65Smrg   AC_MSG_RESULT([${with_sysroot}])
1262b4d38c65Smrg   AC_MSG_ERROR([The sysroot must be an absolute path.])
1263b4d38c65Smrg   ;;
1264b4d38c65Smrgesac
1265b4d38c65Smrg
1266b4d38c65Smrg AC_MSG_RESULT([${lt_sysroot:-no}])
1267b4d38c65Smrg_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
1268b4d38c65Smrg[dependent libraries, and in which our libraries should be installed.])])
1269b4d38c65Smrg
1270b4d38c65Smrg# _LT_ENABLE_LOCK
1271b4d38c65Smrg# ---------------
1272b4d38c65Smrgm4_defun([_LT_ENABLE_LOCK],
1273b4d38c65Smrg[AC_ARG_ENABLE([libtool-lock],
1274b4d38c65Smrg  [AS_HELP_STRING([--disable-libtool-lock],
1275b4d38c65Smrg    [avoid locking (might break parallel builds)])])
1276b4d38c65Smrgtest "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
1277b4d38c65Smrg
1278b4d38c65Smrg# Some flags need to be propagated to the compiler or linker for good
1279b4d38c65Smrg# libtool support.
1280b4d38c65Smrgcase $host in
1281b4d38c65Smrgia64-*-hpux*)
1282b4d38c65Smrg  # Find out which ABI we are using.
1283b4d38c65Smrg  echo 'int i;' > conftest.$ac_ext
1284b4d38c65Smrg  if AC_TRY_EVAL(ac_compile); then
1285b534f209Smrg    case `/usr/bin/file conftest.$ac_objext` in
1286b4d38c65Smrg      *ELF-32*)
1287b4d38c65Smrg	HPUX_IA64_MODE="32"
1288b4d38c65Smrg	;;
1289b4d38c65Smrg      *ELF-64*)
1290b4d38c65Smrg	HPUX_IA64_MODE="64"
1291b4d38c65Smrg	;;
1292b534f209Smrg    esac
1293b4d38c65Smrg  fi
1294b4d38c65Smrg  rm -rf conftest*
1295b4d38c65Smrg  ;;
1296b4d38c65Smrg*-*-irix6*)
1297b4d38c65Smrg  # Find out which ABI we are using.
1298b4d38c65Smrg  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
1299b4d38c65Smrg  if AC_TRY_EVAL(ac_compile); then
1300b4d38c65Smrg    if test "$lt_cv_prog_gnu_ld" = yes; then
1301b4d38c65Smrg      case `/usr/bin/file conftest.$ac_objext` in
1302b4d38c65Smrg	*32-bit*)
1303b4d38c65Smrg	  LD="${LD-ld} -melf32bsmip"
1304b4d38c65Smrg	  ;;
1305b4d38c65Smrg	*N32*)
1306b4d38c65Smrg	  LD="${LD-ld} -melf32bmipn32"
1307b4d38c65Smrg	  ;;
1308b4d38c65Smrg	*64-bit*)
1309b4d38c65Smrg	  LD="${LD-ld} -melf64bmip"
1310b4d38c65Smrg	;;
1311b4d38c65Smrg      esac
1312b4d38c65Smrg    else
1313b4d38c65Smrg      case `/usr/bin/file conftest.$ac_objext` in
1314b4d38c65Smrg	*32-bit*)
1315b4d38c65Smrg	  LD="${LD-ld} -32"
1316b4d38c65Smrg	  ;;
1317b4d38c65Smrg	*N32*)
1318b4d38c65Smrg	  LD="${LD-ld} -n32"
1319b4d38c65Smrg	  ;;
1320b4d38c65Smrg	*64-bit*)
1321b4d38c65Smrg	  LD="${LD-ld} -64"
1322b4d38c65Smrg	  ;;
1323b4d38c65Smrg      esac
1324b4d38c65Smrg    fi
132515fb4814Smrg  fi
132615fb4814Smrg  rm -rf conftest*
132715fb4814Smrg  ;;
132815fb4814Smrg
1329de78e416Smrgx86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
1330b4d38c65Smrgs390*-*linux*|s390*-*tpf*|sparc*-*linux*)
133115fb4814Smrg  # Find out which ABI we are using.
133215fb4814Smrg  echo 'int i;' > conftest.$ac_ext
133315fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
133415fb4814Smrg    case `/usr/bin/file conftest.o` in
1335b4d38c65Smrg      *32-bit*)
1336b4d38c65Smrg	case $host in
1337b4d38c65Smrg	  x86_64-*kfreebsd*-gnu)
1338b4d38c65Smrg	    LD="${LD-ld} -m elf_i386_fbsd"
1339b4d38c65Smrg	    ;;
1340b4d38c65Smrg	  x86_64-*linux*)
1341b4d38c65Smrg	    LD="${LD-ld} -m elf_i386"
1342b4d38c65Smrg	    ;;
1343b4d38c65Smrg	  ppc64-*linux*|powerpc64-*linux*)
1344b4d38c65Smrg	    LD="${LD-ld} -m elf32ppclinux"
1345b4d38c65Smrg	    ;;
1346b4d38c65Smrg	  s390x-*linux*)
1347b4d38c65Smrg	    LD="${LD-ld} -m elf_s390"
1348b4d38c65Smrg	    ;;
1349b4d38c65Smrg	  sparc64-*linux*)
1350b4d38c65Smrg	    LD="${LD-ld} -m elf32_sparc"
1351b4d38c65Smrg	    ;;
1352b4d38c65Smrg	esac
1353b4d38c65Smrg	;;
1354b4d38c65Smrg      *64-bit*)
1355b4d38c65Smrg	case $host in
1356b4d38c65Smrg	  x86_64-*kfreebsd*-gnu)
1357b4d38c65Smrg	    LD="${LD-ld} -m elf_x86_64_fbsd"
1358b4d38c65Smrg	    ;;
1359b4d38c65Smrg	  x86_64-*linux*)
1360b4d38c65Smrg	    LD="${LD-ld} -m elf_x86_64"
1361b4d38c65Smrg	    ;;
1362b4d38c65Smrg	  ppc*-*linux*|powerpc*-*linux*)
1363b4d38c65Smrg	    LD="${LD-ld} -m elf64ppc"
1364b4d38c65Smrg	    ;;
1365b4d38c65Smrg	  s390*-*linux*|s390*-*tpf*)
1366b4d38c65Smrg	    LD="${LD-ld} -m elf64_s390"
1367b4d38c65Smrg	    ;;
1368b4d38c65Smrg	  sparc*-*linux*)
1369b4d38c65Smrg	    LD="${LD-ld} -m elf64_sparc"
1370b4d38c65Smrg	    ;;
1371b4d38c65Smrg	esac
1372b4d38c65Smrg	;;
137315fb4814Smrg    esac
137415fb4814Smrg  fi
137515fb4814Smrg  rm -rf conftest*
137615fb4814Smrg  ;;
137715fb4814Smrg
137815fb4814Smrg*-*-sco3.2v5*)
137915fb4814Smrg  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
138015fb4814Smrg  SAVE_CFLAGS="$CFLAGS"
138115fb4814Smrg  CFLAGS="$CFLAGS -belf"
138215fb4814Smrg  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
138315fb4814Smrg    [AC_LANG_PUSH(C)
1384b4d38c65Smrg     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
138515fb4814Smrg     AC_LANG_POP])
138615fb4814Smrg  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
138715fb4814Smrg    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
138815fb4814Smrg    CFLAGS="$SAVE_CFLAGS"
138915fb4814Smrg  fi
139015fb4814Smrg  ;;
1391cf503b78Smrg*-*solaris*)
139215fb4814Smrg  # Find out which ABI we are using.
139315fb4814Smrg  echo 'int i;' > conftest.$ac_ext
139415fb4814Smrg  if AC_TRY_EVAL(ac_compile); then
139515fb4814Smrg    case `/usr/bin/file conftest.o` in
139615fb4814Smrg    *64-bit*)
139715fb4814Smrg      case $lt_cv_prog_gnu_ld in
1398cf503b78Smrg      yes*)
1399cf503b78Smrg        case $host in
1400cf503b78Smrg        i?86-*-solaris*)
1401cf503b78Smrg          LD="${LD-ld} -m elf_x86_64"
1402cf503b78Smrg          ;;
1403cf503b78Smrg        sparc*-*-solaris*)
1404cf503b78Smrg          LD="${LD-ld} -m elf64_sparc"
1405cf503b78Smrg          ;;
1406cf503b78Smrg        esac
1407cf503b78Smrg        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
1408cf503b78Smrg        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
1409cf503b78Smrg          LD="${LD-ld}_sol2"
1410cf503b78Smrg        fi
1411cf503b78Smrg        ;;
1412b4d38c65Smrg      *)
1413b4d38c65Smrg	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
1414b4d38c65Smrg	  LD="${LD-ld} -64"
1415b4d38c65Smrg	fi
1416b4d38c65Smrg	;;
1417b4d38c65Smrg      esac
1418b4d38c65Smrg      ;;
1419b4d38c65Smrg    esac
142015fb4814Smrg  fi
142115fb4814Smrg  rm -rf conftest*
142215fb4814Smrg  ;;
142315fb4814Smrgesac
142415fb4814Smrg
142515fb4814Smrgneed_locks="$enable_libtool_lock"
1426b4d38c65Smrg])# _LT_ENABLE_LOCK
1427b4d38c65Smrg
1428b4d38c65Smrg
1429b4d38c65Smrg# _LT_PROG_AR
1430b4d38c65Smrg# -----------
1431b4d38c65Smrgm4_defun([_LT_PROG_AR],
1432b4d38c65Smrg[AC_CHECK_TOOLS(AR, [ar], false)
1433b4d38c65Smrg: ${AR=ar}
1434b4d38c65Smrg: ${AR_FLAGS=cru}
1435b4d38c65Smrg_LT_DECL([], [AR], [1], [The archiver])
1436b4d38c65Smrg_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
1437b4d38c65Smrg
1438b4d38c65SmrgAC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
1439b4d38c65Smrg  [lt_cv_ar_at_file=no
1440b4d38c65Smrg   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
1441b4d38c65Smrg     [echo conftest.$ac_objext > conftest.lst
1442b4d38c65Smrg      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
1443b4d38c65Smrg      AC_TRY_EVAL([lt_ar_try])
1444b4d38c65Smrg      if test "$ac_status" -eq 0; then
1445b4d38c65Smrg	# Ensure the archiver fails upon bogus file names.
1446b4d38c65Smrg	rm -f conftest.$ac_objext libconftest.a
1447b4d38c65Smrg	AC_TRY_EVAL([lt_ar_try])
1448b4d38c65Smrg	if test "$ac_status" -ne 0; then
1449b4d38c65Smrg          lt_cv_ar_at_file=@
1450b4d38c65Smrg        fi
1451b4d38c65Smrg      fi
1452b4d38c65Smrg      rm -f conftest.* libconftest.a
1453b4d38c65Smrg     ])
1454b4d38c65Smrg  ])
1455b4d38c65Smrg
1456b4d38c65Smrgif test "x$lt_cv_ar_at_file" = xno; then
1457b4d38c65Smrg  archiver_list_spec=
1458b4d38c65Smrgelse
1459b4d38c65Smrg  archiver_list_spec=$lt_cv_ar_at_file
1460b4d38c65Smrgfi
1461b4d38c65Smrg_LT_DECL([], [archiver_list_spec], [1],
1462b4d38c65Smrg  [How to feed a file listing to the archiver])
1463b4d38c65Smrg])# _LT_PROG_AR
1464b4d38c65Smrg
1465b4d38c65Smrg
1466b4d38c65Smrg# _LT_CMD_OLD_ARCHIVE
1467b4d38c65Smrg# -------------------
1468b4d38c65Smrgm4_defun([_LT_CMD_OLD_ARCHIVE],
1469b4d38c65Smrg[_LT_PROG_AR
1470b4d38c65Smrg
1471b4d38c65SmrgAC_CHECK_TOOL(STRIP, strip, :)
1472b4d38c65Smrgtest -z "$STRIP" && STRIP=:
1473b4d38c65Smrg_LT_DECL([], [STRIP], [1], [A symbol stripping program])
1474b4d38c65Smrg
1475b4d38c65SmrgAC_CHECK_TOOL(RANLIB, ranlib, :)
1476b4d38c65Smrgtest -z "$RANLIB" && RANLIB=:
1477b4d38c65Smrg_LT_DECL([], [RANLIB], [1],
1478b4d38c65Smrg    [Commands used to install an old-style archive])
1479b4d38c65Smrg
1480b4d38c65Smrg# Determine commands to create old-style static archives.
1481b4d38c65Smrgold_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
1482b4d38c65Smrgold_postinstall_cmds='chmod 644 $oldlib'
1483b4d38c65Smrgold_postuninstall_cmds=
1484b4d38c65Smrg
1485b4d38c65Smrgif test -n "$RANLIB"; then
1486b4d38c65Smrg  case $host_os in
1487b4d38c65Smrg  openbsd*)
1488cf503b78Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
1489b4d38c65Smrg    ;;
1490b4d38c65Smrg  *)
1491cf503b78Smrg    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
1492b4d38c65Smrg    ;;
1493b4d38c65Smrg  esac
1494cf503b78Smrg  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
1495b4d38c65Smrgfi
149615fb4814Smrg
1497b4d38c65Smrgcase $host_os in
1498b4d38c65Smrg  darwin*)
1499b4d38c65Smrg    lock_old_archive_extraction=yes ;;
1500b4d38c65Smrg  *)
1501b4d38c65Smrg    lock_old_archive_extraction=no ;;
1502b4d38c65Smrgesac
1503b4d38c65Smrg_LT_DECL([], [old_postinstall_cmds], [2])
1504b4d38c65Smrg_LT_DECL([], [old_postuninstall_cmds], [2])
1505b4d38c65Smrg_LT_TAGDECL([], [old_archive_cmds], [2],
1506b4d38c65Smrg    [Commands used to build an old-style archive])
1507b4d38c65Smrg_LT_DECL([], [lock_old_archive_extraction], [0],
1508b4d38c65Smrg    [Whether to use a lock for old archive extraction])
1509b4d38c65Smrg])# _LT_CMD_OLD_ARCHIVE
151015fb4814Smrg
151115fb4814Smrg
1512b4d38c65Smrg# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
151315fb4814Smrg#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
151415fb4814Smrg# ----------------------------------------------------------------
151515fb4814Smrg# Check whether the given compiler option works
1516b4d38c65SmrgAC_DEFUN([_LT_COMPILER_OPTION],
1517b4d38c65Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1518b4d38c65Smrgm4_require([_LT_DECL_SED])dnl
151915fb4814SmrgAC_CACHE_CHECK([$1], [$2],
152015fb4814Smrg  [$2=no
1521b4d38c65Smrg   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
1522de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
152315fb4814Smrg   lt_compiler_flag="$3"
152415fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
152515fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
152615fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
152715fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
152815fb4814Smrg   # The option is referenced via a variable to avoid confusing sed.
152915fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
153015fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
153115fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
153215fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
1533b4d38c65Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
153415fb4814Smrg   (eval "$lt_compile" 2>conftest.err)
153515fb4814Smrg   ac_status=$?
153615fb4814Smrg   cat conftest.err >&AS_MESSAGE_LOG_FD
1537b4d38c65Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
153815fb4814Smrg   if (exit $ac_status) && test -s "$ac_outfile"; then
153915fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
154015fb4814Smrg     # So say no if there are warnings other than the usual output.
1541b4d38c65Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
154215fb4814Smrg     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
154315fb4814Smrg     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
154415fb4814Smrg       $2=yes
154515fb4814Smrg     fi
154615fb4814Smrg   fi
1547b4d38c65Smrg   $RM conftest*
154815fb4814Smrg])
154915fb4814Smrg
155015fb4814Smrgif test x"[$]$2" = xyes; then
1551b4d38c65Smrg    m4_if([$5], , :, [$5])
155215fb4814Smrgelse
1553b4d38c65Smrg    m4_if([$6], , :, [$6])
155415fb4814Smrgfi
1555b4d38c65Smrg])# _LT_COMPILER_OPTION
155615fb4814Smrg
1557b4d38c65Smrg# Old name:
1558b4d38c65SmrgAU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
1559b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
1560b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
156115fb4814Smrg
1562b4d38c65Smrg
1563b4d38c65Smrg# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
1564b4d38c65Smrg#                  [ACTION-SUCCESS], [ACTION-FAILURE])
1565b4d38c65Smrg# ----------------------------------------------------
1566b4d38c65Smrg# Check whether the given linker option works
1567b4d38c65SmrgAC_DEFUN([_LT_LINKER_OPTION],
1568b4d38c65Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1569b4d38c65Smrgm4_require([_LT_DECL_SED])dnl
1570de78e416SmrgAC_CACHE_CHECK([$1], [$2],
157115fb4814Smrg  [$2=no
157215fb4814Smrg   save_LDFLAGS="$LDFLAGS"
157315fb4814Smrg   LDFLAGS="$LDFLAGS $3"
1574de78e416Smrg   echo "$lt_simple_link_test_code" > conftest.$ac_ext
157515fb4814Smrg   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
157615fb4814Smrg     # The linker can only warn and ignore the option if not recognized
157715fb4814Smrg     # So say no if there are warnings
157815fb4814Smrg     if test -s conftest.err; then
157915fb4814Smrg       # Append any errors to the config.log.
158015fb4814Smrg       cat conftest.err 1>&AS_MESSAGE_LOG_FD
1581b4d38c65Smrg       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
158215fb4814Smrg       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
158315fb4814Smrg       if diff conftest.exp conftest.er2 >/dev/null; then
158415fb4814Smrg         $2=yes
158515fb4814Smrg       fi
158615fb4814Smrg     else
158715fb4814Smrg       $2=yes
158815fb4814Smrg     fi
158915fb4814Smrg   fi
1590b4d38c65Smrg   $RM -r conftest*
159115fb4814Smrg   LDFLAGS="$save_LDFLAGS"
159215fb4814Smrg])
159315fb4814Smrg
159415fb4814Smrgif test x"[$]$2" = xyes; then
1595b4d38c65Smrg    m4_if([$4], , :, [$4])
159615fb4814Smrgelse
1597b4d38c65Smrg    m4_if([$5], , :, [$5])
159815fb4814Smrgfi
1599b4d38c65Smrg])# _LT_LINKER_OPTION
160015fb4814Smrg
1601b4d38c65Smrg# Old name:
1602b4d38c65SmrgAU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
1603b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
1604b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
1605b410ddbeSmrg
1606b4d38c65Smrg
1607b4d38c65Smrg# LT_CMD_MAX_LEN
1608b4d38c65Smrg#---------------
1609b4d38c65SmrgAC_DEFUN([LT_CMD_MAX_LEN],
1610b4d38c65Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
1611b4d38c65Smrg# find the maximum length of command line arguments
161215fb4814SmrgAC_MSG_CHECKING([the maximum length of command line arguments])
161315fb4814SmrgAC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
161415fb4814Smrg  i=0
161515fb4814Smrg  teststring="ABCD"
161615fb4814Smrg
161715fb4814Smrg  case $build_os in
161815fb4814Smrg  msdosdjgpp*)
161915fb4814Smrg    # On DJGPP, this test can blow up pretty badly due to problems in libc
162015fb4814Smrg    # (any single argument exceeding 2000 bytes causes a buffer overrun
162115fb4814Smrg    # during glob expansion).  Even if it were fixed, the result of this
162215fb4814Smrg    # check would be larger than it should be.
162315fb4814Smrg    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
162415fb4814Smrg    ;;
162515fb4814Smrg
162615fb4814Smrg  gnu*)
162715fb4814Smrg    # Under GNU Hurd, this test is not required because there is
162815fb4814Smrg    # no limit to the length of command line arguments.
162915fb4814Smrg    # Libtool will interpret -1 as no limit whatsoever
163015fb4814Smrg    lt_cv_sys_max_cmd_len=-1;
163115fb4814Smrg    ;;
163215fb4814Smrg
1633b4d38c65Smrg  cygwin* | mingw* | cegcc*)
163415fb4814Smrg    # On Win9x/ME, this test blows up -- it succeeds, but takes
163515fb4814Smrg    # about 5 minutes as the teststring grows exponentially.
163615fb4814Smrg    # Worse, since 9x/ME are not pre-emptively multitasking,
163715fb4814Smrg    # you end up with a "frozen" computer, even though with patience
163815fb4814Smrg    # the test eventually succeeds (with a max line length of 256k).
163915fb4814Smrg    # Instead, let's just punt: use the minimum linelength reported by
164015fb4814Smrg    # all of the supported platforms: 8192 (on NT/2K/XP).
164115fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
164215fb4814Smrg    ;;
164315fb4814Smrg
1644b4d38c65Smrg  mint*)
1645b4d38c65Smrg    # On MiNT this can take a long time and run out of memory.
1646b4d38c65Smrg    lt_cv_sys_max_cmd_len=8192;
1647b4d38c65Smrg    ;;
1648b4d38c65Smrg
164915fb4814Smrg  amigaos*)
165015fb4814Smrg    # On AmigaOS with pdksh, this test takes hours, literally.
165115fb4814Smrg    # So we just punt and use a minimum line length of 8192.
165215fb4814Smrg    lt_cv_sys_max_cmd_len=8192;
165315fb4814Smrg    ;;
165415fb4814Smrg
165515fb4814Smrg  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
165615fb4814Smrg    # This has been around since 386BSD, at least.  Likely further.
165715fb4814Smrg    if test -x /sbin/sysctl; then
165815fb4814Smrg      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
165915fb4814Smrg    elif test -x /usr/sbin/sysctl; then
166015fb4814Smrg      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
166115fb4814Smrg    else
166215fb4814Smrg      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
166315fb4814Smrg    fi
166415fb4814Smrg    # And add a safety zone
166515fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
166615fb4814Smrg    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
166715fb4814Smrg    ;;
166815fb4814Smrg
166915fb4814Smrg  interix*)
167015fb4814Smrg    # We know the value 262144 and hardcode it with a safety zone (like BSD)
167115fb4814Smrg    lt_cv_sys_max_cmd_len=196608
167215fb4814Smrg    ;;
167315fb4814Smrg
1674cf503b78Smrg  os2*)
1675cf503b78Smrg    # The test takes a long time on OS/2.
1676cf503b78Smrg    lt_cv_sys_max_cmd_len=8192
1677cf503b78Smrg    ;;
1678cf503b78Smrg
167915fb4814Smrg  osf*)
168015fb4814Smrg    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
168115fb4814Smrg    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
168215fb4814Smrg    # nice to cause kernel panics so lets avoid the loop below.
168315fb4814Smrg    # First set a reasonable default.
168415fb4814Smrg    lt_cv_sys_max_cmd_len=16384
168515fb4814Smrg    #
168615fb4814Smrg    if test -x /sbin/sysconfig; then
168715fb4814Smrg      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
168815fb4814Smrg        *1*) lt_cv_sys_max_cmd_len=-1 ;;
168915fb4814Smrg      esac
169015fb4814Smrg    fi
169115fb4814Smrg    ;;
169215fb4814Smrg  sco3.2v5*)
169315fb4814Smrg    lt_cv_sys_max_cmd_len=102400
169415fb4814Smrg    ;;
169515fb4814Smrg  sysv5* | sco5v6* | sysv4.2uw2*)
169615fb4814Smrg    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
169715fb4814Smrg    if test -n "$kargmax"; then
1698b4d38c65Smrg      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
169915fb4814Smrg    else
170015fb4814Smrg      lt_cv_sys_max_cmd_len=32768
170115fb4814Smrg    fi
170215fb4814Smrg    ;;
170315fb4814Smrg  *)
1704de78e416Smrg    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
1705de78e416Smrg    if test -n "$lt_cv_sys_max_cmd_len"; then
1706de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
1707de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
1708de78e416Smrg    else
1709b4d38c65Smrg      # Make teststring a little bigger before we do anything with it.
1710b4d38c65Smrg      # a 1K string should be a reasonable start.
1711b4d38c65Smrg      for i in 1 2 3 4 5 6 7 8 ; do
1712b4d38c65Smrg        teststring=$teststring$teststring
1713b4d38c65Smrg      done
1714de78e416Smrg      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
1715b4d38c65Smrg      # If test is not a shell built-in, we'll probably end up computing a
1716b4d38c65Smrg      # maximum length that is only half of the actual maximum length, but
1717b4d38c65Smrg      # we can't tell.
1718cf503b78Smrg      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
1719b4d38c65Smrg	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
1720de78e416Smrg	      test $i != 17 # 1/2 MB should be enough
1721de78e416Smrg      do
1722de78e416Smrg        i=`expr $i + 1`
1723de78e416Smrg        teststring=$teststring$teststring
1724de78e416Smrg      done
1725b4d38c65Smrg      # Only check the string length outside the loop.
1726b4d38c65Smrg      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
1727de78e416Smrg      teststring=
1728b4d38c65Smrg      # Add a significant safety factor because C++ compilers can tack on
1729b4d38c65Smrg      # massive amounts of additional arguments before passing them to the
1730b4d38c65Smrg      # linker.  It appears as though 1/2 is a usable value.
1731de78e416Smrg      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
1732de78e416Smrg    fi
173315fb4814Smrg    ;;
173415fb4814Smrg  esac
173515fb4814Smrg])
173615fb4814Smrgif test -n $lt_cv_sys_max_cmd_len ; then
173715fb4814Smrg  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
173815fb4814Smrgelse
173915fb4814Smrg  AC_MSG_RESULT(none)
174015fb4814Smrgfi
1741b4d38c65Smrgmax_cmd_len=$lt_cv_sys_max_cmd_len
1742b4d38c65Smrg_LT_DECL([], [max_cmd_len], [0],
1743b4d38c65Smrg    [What is the maximum length of a command?])
1744b4d38c65Smrg])# LT_CMD_MAX_LEN
174515fb4814Smrg
1746b4d38c65Smrg# Old name:
1747b4d38c65SmrgAU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
1748b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
1749b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
1750b410ddbeSmrg
1751b4d38c65Smrg
1752b4d38c65Smrg# _LT_HEADER_DLFCN
1753b4d38c65Smrg# ----------------
1754b4d38c65Smrgm4_defun([_LT_HEADER_DLFCN],
1755b4d38c65Smrg[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
1756b4d38c65Smrg])# _LT_HEADER_DLFCN
175715fb4814Smrg
175815fb4814Smrg
1759b4d38c65Smrg# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
1760b4d38c65Smrg#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
1761b4d38c65Smrg# ----------------------------------------------------------------
1762b4d38c65Smrgm4_defun([_LT_TRY_DLOPEN_SELF],
1763b4d38c65Smrg[m4_require([_LT_HEADER_DLFCN])dnl
176415fb4814Smrgif test "$cross_compiling" = yes; then :
176515fb4814Smrg  [$4]
176615fb4814Smrgelse
176715fb4814Smrg  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
176815fb4814Smrg  lt_status=$lt_dlunknown
1769b4d38c65Smrg  cat > conftest.$ac_ext <<_LT_EOF
1770b4d38c65Smrg[#line $LINENO "configure"
177115fb4814Smrg#include "confdefs.h"
177215fb4814Smrg
177315fb4814Smrg#if HAVE_DLFCN_H
177415fb4814Smrg#include <dlfcn.h>
177515fb4814Smrg#endif
177615fb4814Smrg
177715fb4814Smrg#include <stdio.h>
177815fb4814Smrg
177915fb4814Smrg#ifdef RTLD_GLOBAL
178015fb4814Smrg#  define LT_DLGLOBAL		RTLD_GLOBAL
178115fb4814Smrg#else
178215fb4814Smrg#  ifdef DL_GLOBAL
178315fb4814Smrg#    define LT_DLGLOBAL		DL_GLOBAL
178415fb4814Smrg#  else
178515fb4814Smrg#    define LT_DLGLOBAL		0
178615fb4814Smrg#  endif
178715fb4814Smrg#endif
178815fb4814Smrg
178915fb4814Smrg/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
179015fb4814Smrg   find out it does not work in some platform. */
179115fb4814Smrg#ifndef LT_DLLAZY_OR_NOW
179215fb4814Smrg#  ifdef RTLD_LAZY
179315fb4814Smrg#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
179415fb4814Smrg#  else
179515fb4814Smrg#    ifdef DL_LAZY
179615fb4814Smrg#      define LT_DLLAZY_OR_NOW		DL_LAZY
179715fb4814Smrg#    else
179815fb4814Smrg#      ifdef RTLD_NOW
179915fb4814Smrg#        define LT_DLLAZY_OR_NOW	RTLD_NOW
180015fb4814Smrg#      else
180115fb4814Smrg#        ifdef DL_NOW
180215fb4814Smrg#          define LT_DLLAZY_OR_NOW	DL_NOW
180315fb4814Smrg#        else
180415fb4814Smrg#          define LT_DLLAZY_OR_NOW	0
180515fb4814Smrg#        endif
180615fb4814Smrg#      endif
180715fb4814Smrg#    endif
180815fb4814Smrg#  endif
180915fb4814Smrg#endif
181015fb4814Smrg
1811b4d38c65Smrg/* When -fvisbility=hidden is used, assume the code has been annotated
1812b4d38c65Smrg   correspondingly for the symbols needed.  */
1813b4d38c65Smrg#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
1814b4d38c65Smrgint fnord () __attribute__((visibility("default")));
1815b534f209Smrg#endif
1816b534f209Smrg
1817b4d38c65Smrgint fnord () { return 42; }
181815fb4814Smrgint main ()
181915fb4814Smrg{
182015fb4814Smrg  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
182115fb4814Smrg  int status = $lt_dlunknown;
182215fb4814Smrg
182315fb4814Smrg  if (self)
182415fb4814Smrg    {
182515fb4814Smrg      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
1826b4d38c65Smrg      else
1827b4d38c65Smrg        {
1828b4d38c65Smrg	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
1829b4d38c65Smrg          else puts (dlerror ());
1830b4d38c65Smrg	}
183115fb4814Smrg      /* dlclose (self); */
183215fb4814Smrg    }
183315fb4814Smrg  else
183415fb4814Smrg    puts (dlerror ());
183515fb4814Smrg
1836b4d38c65Smrg  return status;
183715fb4814Smrg}]
1838b4d38c65Smrg_LT_EOF
183915fb4814Smrg  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
184015fb4814Smrg    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
184115fb4814Smrg    lt_status=$?
184215fb4814Smrg    case x$lt_status in
184315fb4814Smrg      x$lt_dlno_uscore) $1 ;;
184415fb4814Smrg      x$lt_dlneed_uscore) $2 ;;
184515fb4814Smrg      x$lt_dlunknown|x*) $3 ;;
184615fb4814Smrg    esac
184715fb4814Smrg  else :
184815fb4814Smrg    # compilation failed
184915fb4814Smrg    $3
185015fb4814Smrg  fi
185115fb4814Smrgfi
185215fb4814Smrgrm -fr conftest*
1853b4d38c65Smrg])# _LT_TRY_DLOPEN_SELF
185415fb4814Smrg
185515fb4814Smrg
1856b4d38c65Smrg# LT_SYS_DLOPEN_SELF
1857b4d38c65Smrg# ------------------
1858b4d38c65SmrgAC_DEFUN([LT_SYS_DLOPEN_SELF],
1859b4d38c65Smrg[m4_require([_LT_HEADER_DLFCN])dnl
186015fb4814Smrgif test "x$enable_dlopen" != xyes; then
186115fb4814Smrg  enable_dlopen=unknown
186215fb4814Smrg  enable_dlopen_self=unknown
186315fb4814Smrg  enable_dlopen_self_static=unknown
186415fb4814Smrgelse
186515fb4814Smrg  lt_cv_dlopen=no
186615fb4814Smrg  lt_cv_dlopen_libs=
186715fb4814Smrg
186815fb4814Smrg  case $host_os in
186915fb4814Smrg  beos*)
187015fb4814Smrg    lt_cv_dlopen="load_add_on"
187115fb4814Smrg    lt_cv_dlopen_libs=
187215fb4814Smrg    lt_cv_dlopen_self=yes
187315fb4814Smrg    ;;
187415fb4814Smrg
1875b4d38c65Smrg  mingw* | pw32* | cegcc*)
187615fb4814Smrg    lt_cv_dlopen="LoadLibrary"
187715fb4814Smrg    lt_cv_dlopen_libs=
1878b4d38c65Smrg    ;;
187915fb4814Smrg
188015fb4814Smrg  cygwin*)
188115fb4814Smrg    lt_cv_dlopen="dlopen"
188215fb4814Smrg    lt_cv_dlopen_libs=
1883b4d38c65Smrg    ;;
188415fb4814Smrg
188515fb4814Smrg  darwin*)
188615fb4814Smrg  # if libdl is installed we need to link against it
188715fb4814Smrg    AC_CHECK_LIB([dl], [dlopen],
188815fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
188915fb4814Smrg    lt_cv_dlopen="dyld"
189015fb4814Smrg    lt_cv_dlopen_libs=
189115fb4814Smrg    lt_cv_dlopen_self=yes
189215fb4814Smrg    ])
1893b4d38c65Smrg    ;;
189415fb4814Smrg
189515fb4814Smrg  *)
189615fb4814Smrg    AC_CHECK_FUNC([shl_load],
189715fb4814Smrg	  [lt_cv_dlopen="shl_load"],
189815fb4814Smrg      [AC_CHECK_LIB([dld], [shl_load],
1899b4d38c65Smrg	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
190015fb4814Smrg	[AC_CHECK_FUNC([dlopen],
190115fb4814Smrg	      [lt_cv_dlopen="dlopen"],
190215fb4814Smrg	  [AC_CHECK_LIB([dl], [dlopen],
190315fb4814Smrg		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
190415fb4814Smrg	    [AC_CHECK_LIB([svld], [dlopen],
190515fb4814Smrg		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
190615fb4814Smrg	      [AC_CHECK_LIB([dld], [dld_link],
1907b4d38c65Smrg		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
190815fb4814Smrg	      ])
190915fb4814Smrg	    ])
191015fb4814Smrg	  ])
191115fb4814Smrg	])
191215fb4814Smrg      ])
191315fb4814Smrg    ;;
191415fb4814Smrg  esac
191515fb4814Smrg
191615fb4814Smrg  if test "x$lt_cv_dlopen" != xno; then
191715fb4814Smrg    enable_dlopen=yes
191815fb4814Smrg  else
191915fb4814Smrg    enable_dlopen=no
192015fb4814Smrg  fi
192115fb4814Smrg
192215fb4814Smrg  case $lt_cv_dlopen in
192315fb4814Smrg  dlopen)
192415fb4814Smrg    save_CPPFLAGS="$CPPFLAGS"
192515fb4814Smrg    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
192615fb4814Smrg
192715fb4814Smrg    save_LDFLAGS="$LDFLAGS"
192815fb4814Smrg    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
192915fb4814Smrg
193015fb4814Smrg    save_LIBS="$LIBS"
193115fb4814Smrg    LIBS="$lt_cv_dlopen_libs $LIBS"
193215fb4814Smrg
193315fb4814Smrg    AC_CACHE_CHECK([whether a program can dlopen itself],
193415fb4814Smrg	  lt_cv_dlopen_self, [dnl
1935b4d38c65Smrg	  _LT_TRY_DLOPEN_SELF(
193615fb4814Smrg	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
193715fb4814Smrg	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
193815fb4814Smrg    ])
193915fb4814Smrg
194015fb4814Smrg    if test "x$lt_cv_dlopen_self" = xyes; then
194115fb4814Smrg      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
194215fb4814Smrg      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
1943b4d38c65Smrg	  lt_cv_dlopen_self_static, [dnl
1944b4d38c65Smrg	  _LT_TRY_DLOPEN_SELF(
194515fb4814Smrg	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
194615fb4814Smrg	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
194715fb4814Smrg      ])
194815fb4814Smrg    fi
194915fb4814Smrg
195015fb4814Smrg    CPPFLAGS="$save_CPPFLAGS"
195115fb4814Smrg    LDFLAGS="$save_LDFLAGS"
195215fb4814Smrg    LIBS="$save_LIBS"
195315fb4814Smrg    ;;
195415fb4814Smrg  esac
195515fb4814Smrg
195615fb4814Smrg  case $lt_cv_dlopen_self in
195715fb4814Smrg  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
195815fb4814Smrg  *) enable_dlopen_self=unknown ;;
195915fb4814Smrg  esac
196015fb4814Smrg
196115fb4814Smrg  case $lt_cv_dlopen_self_static in
196215fb4814Smrg  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
196315fb4814Smrg  *) enable_dlopen_self_static=unknown ;;
196415fb4814Smrg  esac
196515fb4814Smrgfi
1966b4d38c65Smrg_LT_DECL([dlopen_support], [enable_dlopen], [0],
1967b4d38c65Smrg	 [Whether dlopen is supported])
1968b4d38c65Smrg_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
1969b4d38c65Smrg	 [Whether dlopen of programs is supported])
1970b4d38c65Smrg_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
1971b4d38c65Smrg	 [Whether dlopen of statically linked programs is supported])
1972b4d38c65Smrg])# LT_SYS_DLOPEN_SELF
197315fb4814Smrg
1974b4d38c65Smrg# Old name:
1975b4d38c65SmrgAU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
1976b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
1977b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
1978b410ddbeSmrg
1979b4d38c65Smrg
1980b4d38c65Smrg# _LT_COMPILER_C_O([TAGNAME])
1981b4d38c65Smrg# ---------------------------
1982b4d38c65Smrg# Check to see if options -c and -o are simultaneously supported by compiler.
1983b4d38c65Smrg# This macro does not hard code the compiler like AC_PROG_CC_C_O.
1984b4d38c65Smrgm4_defun([_LT_COMPILER_C_O],
1985b4d38c65Smrg[m4_require([_LT_DECL_SED])dnl
1986b4d38c65Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
1987b4d38c65Smrgm4_require([_LT_TAG_COMPILER])dnl
198815fb4814SmrgAC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
1989b4d38c65Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
1990b4d38c65Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
1991b4d38c65Smrg   $RM -r conftest 2>/dev/null
199215fb4814Smrg   mkdir conftest
199315fb4814Smrg   cd conftest
199415fb4814Smrg   mkdir out
1995de78e416Smrg   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
199615fb4814Smrg
199715fb4814Smrg   lt_compiler_flag="-o out/conftest2.$ac_objext"
199815fb4814Smrg   # Insert the option either (1) after the last *FLAGS variable, or
199915fb4814Smrg   # (2) before a word containing "conftest.", or (3) at the end.
200015fb4814Smrg   # Note that $ac_compile itself does not contain backslashes and begins
200115fb4814Smrg   # with a dollar sign (not a hyphen), so the echo should work correctly.
200215fb4814Smrg   lt_compile=`echo "$ac_compile" | $SED \
200315fb4814Smrg   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
200415fb4814Smrg   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
200515fb4814Smrg   -e 's:$: $lt_compiler_flag:'`
2006b4d38c65Smrg   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
200715fb4814Smrg   (eval "$lt_compile" 2>out/conftest.err)
200815fb4814Smrg   ac_status=$?
200915fb4814Smrg   cat out/conftest.err >&AS_MESSAGE_LOG_FD
2010b4d38c65Smrg   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
201115fb4814Smrg   if (exit $ac_status) && test -s out/conftest2.$ac_objext
201215fb4814Smrg   then
201315fb4814Smrg     # The compiler can only warn and ignore the option if not recognized
201415fb4814Smrg     # So say no if there are warnings
2015b4d38c65Smrg     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
201615fb4814Smrg     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
201715fb4814Smrg     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
2018b4d38c65Smrg       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
201915fb4814Smrg     fi
202015fb4814Smrg   fi
202115fb4814Smrg   chmod u+w . 2>&AS_MESSAGE_LOG_FD
2022b4d38c65Smrg   $RM conftest*
202315fb4814Smrg   # SGI C++ compiler will create directory out/ii_files/ for
202415fb4814Smrg   # template instantiation
2025b4d38c65Smrg   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
2026b4d38c65Smrg   $RM out/* && rmdir out
202715fb4814Smrg   cd ..
2028b4d38c65Smrg   $RM -r conftest
2029b4d38c65Smrg   $RM conftest*
203015fb4814Smrg])
2031b4d38c65Smrg_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
2032b4d38c65Smrg	[Does compiler simultaneously support -c and -o options?])
2033b4d38c65Smrg])# _LT_COMPILER_C_O
203415fb4814Smrg
203515fb4814Smrg
2036b4d38c65Smrg# _LT_COMPILER_FILE_LOCKS([TAGNAME])
2037b4d38c65Smrg# ----------------------------------
203815fb4814Smrg# Check to see if we can do hard links to lock some files if needed
2039b4d38c65Smrgm4_defun([_LT_COMPILER_FILE_LOCKS],
2040b4d38c65Smrg[m4_require([_LT_ENABLE_LOCK])dnl
2041b4d38c65Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2042b4d38c65Smrg_LT_COMPILER_C_O([$1])
204315fb4814Smrg
204415fb4814Smrghard_links="nottested"
2045b4d38c65Smrgif test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
204615fb4814Smrg  # do not overwrite the value of need_locks provided by the user
204715fb4814Smrg  AC_MSG_CHECKING([if we can lock with hard links])
204815fb4814Smrg  hard_links=yes
2049b4d38c65Smrg  $RM conftest*
205015fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
205115fb4814Smrg  touch conftest.a
205215fb4814Smrg  ln conftest.a conftest.b 2>&5 || hard_links=no
205315fb4814Smrg  ln conftest.a conftest.b 2>/dev/null && hard_links=no
205415fb4814Smrg  AC_MSG_RESULT([$hard_links])
205515fb4814Smrg  if test "$hard_links" = no; then
205615fb4814Smrg    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
205715fb4814Smrg    need_locks=warn
205815fb4814Smrg  fi
205915fb4814Smrgelse
206015fb4814Smrg  need_locks=no
206115fb4814Smrgfi
2062b4d38c65Smrg_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
2063b4d38c65Smrg])# _LT_COMPILER_FILE_LOCKS
206415fb4814Smrg
206515fb4814Smrg
2066b4d38c65Smrg# _LT_CHECK_OBJDIR
2067b4d38c65Smrg# ----------------
2068b4d38c65Smrgm4_defun([_LT_CHECK_OBJDIR],
206915fb4814Smrg[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
207015fb4814Smrg[rm -f .libs 2>/dev/null
207115fb4814Smrgmkdir .libs 2>/dev/null
207215fb4814Smrgif test -d .libs; then
207315fb4814Smrg  lt_cv_objdir=.libs
207415fb4814Smrgelse
207515fb4814Smrg  # MS-DOS does not allow filenames that begin with a dot.
207615fb4814Smrg  lt_cv_objdir=_libs
207715fb4814Smrgfi
207815fb4814Smrgrmdir .libs 2>/dev/null])
207915fb4814Smrgobjdir=$lt_cv_objdir
2080b4d38c65Smrg_LT_DECL([], [objdir], [0],
2081b4d38c65Smrg         [The name of the directory that contains temporary libtool files])dnl
2082b4d38c65Smrgm4_pattern_allow([LT_OBJDIR])dnl
2083b4d38c65SmrgAC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
2084b4d38c65Smrg  [Define to the sub-directory in which libtool stores uninstalled libraries.])
2085b4d38c65Smrg])# _LT_CHECK_OBJDIR
208615fb4814Smrg
208715fb4814Smrg
2088b4d38c65Smrg# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
2089b4d38c65Smrg# --------------------------------------
209015fb4814Smrg# Check hardcoding attributes.
2091b4d38c65Smrgm4_defun([_LT_LINKER_HARDCODE_LIBPATH],
209215fb4814Smrg[AC_MSG_CHECKING([how to hardcode library paths into programs])
2093b4d38c65Smrg_LT_TAGVAR(hardcode_action, $1)=
2094b4d38c65Smrgif test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
2095b4d38c65Smrg   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
2096b4d38c65Smrg   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
209715fb4814Smrg
2098b4d38c65Smrg  # We can hardcode non-existent directories.
2099b4d38c65Smrg  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
210015fb4814Smrg     # If the only mechanism to avoid hardcoding is shlibpath_var, we
210115fb4814Smrg     # have to relink, otherwise we might link with an installed library
210215fb4814Smrg     # when we should be linking with a yet-to-be-installed one
2103b4d38c65Smrg     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
2104b4d38c65Smrg     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
210515fb4814Smrg    # Linking always hardcodes the temporary library directory.
2106b4d38c65Smrg    _LT_TAGVAR(hardcode_action, $1)=relink
210715fb4814Smrg  else
210815fb4814Smrg    # We can link without hardcoding, and we can hardcode nonexisting dirs.
2109b4d38c65Smrg    _LT_TAGVAR(hardcode_action, $1)=immediate
211015fb4814Smrg  fi
211115fb4814Smrgelse
211215fb4814Smrg  # We cannot hardcode anything, or else we can only hardcode existing
211315fb4814Smrg  # directories.
2114b4d38c65Smrg  _LT_TAGVAR(hardcode_action, $1)=unsupported
211515fb4814Smrgfi
2116b4d38c65SmrgAC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
211715fb4814Smrg
2118b4d38c65Smrgif test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
2119b4d38c65Smrg   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
212015fb4814Smrg  # Fast installation is not supported
212115fb4814Smrg  enable_fast_install=no
212215fb4814Smrgelif test "$shlibpath_overrides_runpath" = yes ||
212315fb4814Smrg     test "$enable_shared" = no; then
212415fb4814Smrg  # Fast installation is not necessary
212515fb4814Smrg  enable_fast_install=needless
212615fb4814Smrgfi
2127b4d38c65Smrg_LT_TAGDECL([], [hardcode_action], [0],
2128b4d38c65Smrg    [How to hardcode a shared library path into an executable])
2129b4d38c65Smrg])# _LT_LINKER_HARDCODE_LIBPATH
213015fb4814Smrg
213115fb4814Smrg
2132b4d38c65Smrg# _LT_CMD_STRIPLIB
2133b4d38c65Smrg# ----------------
2134b4d38c65Smrgm4_defun([_LT_CMD_STRIPLIB],
2135b4d38c65Smrg[m4_require([_LT_DECL_EGREP])
2136b4d38c65Smrgstriplib=
213715fb4814Smrgold_striplib=
213815fb4814SmrgAC_MSG_CHECKING([whether stripping libraries is possible])
2139b4d38c65Smrgif test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
214015fb4814Smrg  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
214115fb4814Smrg  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
214215fb4814Smrg  AC_MSG_RESULT([yes])
214315fb4814Smrgelse
214415fb4814Smrg# FIXME - insert some real tests, host_os isn't really good enough
214515fb4814Smrg  case $host_os in
2146b4d38c65Smrg  darwin*)
2147b4d38c65Smrg    if test -n "$STRIP" ; then
2148b4d38c65Smrg      striplib="$STRIP -x"
2149b4d38c65Smrg      old_striplib="$STRIP -S"
2150b4d38c65Smrg      AC_MSG_RESULT([yes])
2151b4d38c65Smrg    else
2152b4d38c65Smrg      AC_MSG_RESULT([no])
2153b4d38c65Smrg    fi
2154b4d38c65Smrg    ;;
2155b4d38c65Smrg  *)
2156b4d38c65Smrg    AC_MSG_RESULT([no])
215715fb4814Smrg    ;;
215815fb4814Smrg  esac
215915fb4814Smrgfi
2160b4d38c65Smrg_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
2161b4d38c65Smrg_LT_DECL([], [striplib], [1])
2162b4d38c65Smrg])# _LT_CMD_STRIPLIB
216315fb4814Smrg
216415fb4814Smrg
2165b4d38c65Smrg# _LT_SYS_DYNAMIC_LINKER([TAG])
216615fb4814Smrg# -----------------------------
216715fb4814Smrg# PORTME Fill in your ld.so characteristics
2168b4d38c65Smrgm4_defun([_LT_SYS_DYNAMIC_LINKER],
2169b4d38c65Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
2170b4d38c65Smrgm4_require([_LT_DECL_EGREP])dnl
2171b4d38c65Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
2172b4d38c65Smrgm4_require([_LT_DECL_OBJDUMP])dnl
2173b4d38c65Smrgm4_require([_LT_DECL_SED])dnl
2174b4d38c65Smrgm4_require([_LT_CHECK_SHELL_FEATURES])dnl
2175de78e416SmrgAC_MSG_CHECKING([dynamic linker characteristics])
2176b4d38c65Smrgm4_if([$1],
2177b4d38c65Smrg	[], [
217815fb4814Smrgif test "$GCC" = yes; then
2179de78e416Smrg  case $host_os in
2180de78e416Smrg    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
2181de78e416Smrg    *) lt_awk_arg="/^libraries:/" ;;
2182de78e416Smrg  esac
2183b4d38c65Smrg  case $host_os in
2184b4d38c65Smrg    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
2185b4d38c65Smrg    *) lt_sed_strip_eq="s,=/,/,g" ;;
2186b4d38c65Smrg  esac
2187b4d38c65Smrg  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
2188b4d38c65Smrg  case $lt_search_path_spec in
2189b4d38c65Smrg  *\;*)
219015fb4814Smrg    # if the path contains ";" then we assume it to be the separator
219115fb4814Smrg    # otherwise default to the standard path separator (i.e. ":") - it is
219215fb4814Smrg    # assumed that no part of a normal pathname contains ";" but that should
219315fb4814Smrg    # okay in the real world where ";" in dirpaths is itself problematic.
2194b4d38c65Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
2195b4d38c65Smrg    ;;
2196b4d38c65Smrg  *)
2197b4d38c65Smrg    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
2198b4d38c65Smrg    ;;
2199b4d38c65Smrg  esac
2200de78e416Smrg  # Ok, now we have the path, separated by spaces, we can step through it
2201de78e416Smrg  # and add multilib dir if necessary.
2202de78e416Smrg  lt_tmp_lt_search_path_spec=
2203de78e416Smrg  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
2204de78e416Smrg  for lt_sys_path in $lt_search_path_spec; do
2205de78e416Smrg    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
2206de78e416Smrg      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
2207de78e416Smrg    else
2208de78e416Smrg      test -d "$lt_sys_path" && \
2209de78e416Smrg	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
2210de78e416Smrg    fi
2211de78e416Smrg  done
2212b4d38c65Smrg  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
2213de78e416SmrgBEGIN {RS=" "; FS="/|\n";} {
2214de78e416Smrg  lt_foo="";
2215de78e416Smrg  lt_count=0;
2216de78e416Smrg  for (lt_i = NF; lt_i > 0; lt_i--) {
2217de78e416Smrg    if ($lt_i != "" && $lt_i != ".") {
2218de78e416Smrg      if ($lt_i == "..") {
2219de78e416Smrg        lt_count++;
2220de78e416Smrg      } else {
2221de78e416Smrg        if (lt_count == 0) {
2222de78e416Smrg          lt_foo="/" $lt_i lt_foo;
2223de78e416Smrg        } else {
2224de78e416Smrg          lt_count--;
2225de78e416Smrg        }
2226de78e416Smrg      }
2227de78e416Smrg    }
2228de78e416Smrg  }
2229de78e416Smrg  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
2230de78e416Smrg  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
2231de78e416Smrg}'`
2232b4d38c65Smrg  # AWK program above erroneously prepends '/' to C:/dos/paths
2233b4d38c65Smrg  # for these hosts.
2234b4d38c65Smrg  case $host_os in
2235b4d38c65Smrg    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
2236b4d38c65Smrg      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
2237b4d38c65Smrg  esac
2238b4d38c65Smrg  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
223915fb4814Smrgelse
224015fb4814Smrg  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
2241de78e416Smrgfi])
2242b4d38c65Smrglibrary_names_spec=
2243b4d38c65Smrglibname_spec='lib$name'
2244b4d38c65Smrgsoname_spec=
2245b4d38c65Smrgshrext_cmds=".so"
2246b4d38c65Smrgpostinstall_cmds=
2247b4d38c65Smrgpostuninstall_cmds=
2248b4d38c65Smrgfinish_cmds=
2249b4d38c65Smrgfinish_eval=
2250b4d38c65Smrgshlibpath_var=
2251b4d38c65Smrgshlibpath_overrides_runpath=unknown
2252b4d38c65Smrgversion_type=none
2253b4d38c65Smrgdynamic_linker="$host_os ld.so"
2254b4d38c65Smrgsys_lib_dlsearch_path_spec="/lib /usr/lib"
225515fb4814Smrgneed_lib_prefix=unknown
225615fb4814Smrghardcode_into_libs=no
225715fb4814Smrg
225815fb4814Smrg# when you set need_version to no, make sure it does not cause -set_version
225915fb4814Smrg# flags to be left without arguments
226015fb4814Smrgneed_version=unknown
226115fb4814Smrg
226215fb4814Smrgcase $host_os in
226315fb4814Smrgaix3*)
2264cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
226515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
226615fb4814Smrg  shlibpath_var=LIBPATH
226715fb4814Smrg
226815fb4814Smrg  # AIX 3 has no versioning support, so we append a major version to the name.
226915fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
227015fb4814Smrg  ;;
227115fb4814Smrg
2272b4d38c65Smrgaix[[4-9]]*)
2273cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
227415fb4814Smrg  need_lib_prefix=no
227515fb4814Smrg  need_version=no
227615fb4814Smrg  hardcode_into_libs=yes
227715fb4814Smrg  if test "$host_cpu" = ia64; then
227815fb4814Smrg    # AIX 5 supports IA64
227915fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
228015fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
228115fb4814Smrg  else
228215fb4814Smrg    # With GCC up to 2.95.x, collect2 would create an import file
228315fb4814Smrg    # for dependence libraries.  The import file would start with
228415fb4814Smrg    # the line `#! .'.  This would cause the generated library to
228515fb4814Smrg    # depend on `.', always an invalid library.  This was fixed in
228615fb4814Smrg    # development snapshots of GCC prior to 3.0.
228715fb4814Smrg    case $host_os in
228815fb4814Smrg      aix4 | aix4.[[01]] | aix4.[[01]].*)
228915fb4814Smrg      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
229015fb4814Smrg	   echo ' yes '
2291b4d38c65Smrg	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
229215fb4814Smrg	:
229315fb4814Smrg      else
229415fb4814Smrg	can_build_shared=no
229515fb4814Smrg      fi
229615fb4814Smrg      ;;
229715fb4814Smrg    esac
229815fb4814Smrg    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
229915fb4814Smrg    # soname into executable. Probably we can add versioning support to
230015fb4814Smrg    # collect2, so additional links can be useful in future.
230115fb4814Smrg    if test "$aix_use_runtimelinking" = yes; then
230215fb4814Smrg      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
230315fb4814Smrg      # instead of lib<name>.a to let people know that these are not
230415fb4814Smrg      # typical AIX shared libraries.
230515fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
230615fb4814Smrg    else
230715fb4814Smrg      # We preserve .a as extension for shared libraries through AIX4.2
230815fb4814Smrg      # and later when we are not doing run time linking.
230915fb4814Smrg      library_names_spec='${libname}${release}.a $libname.a'
231015fb4814Smrg      soname_spec='${libname}${release}${shared_ext}$major'
231115fb4814Smrg    fi
231215fb4814Smrg    shlibpath_var=LIBPATH
231315fb4814Smrg  fi
231415fb4814Smrg  ;;
231515fb4814Smrg
231615fb4814Smrgamigaos*)
2317b4d38c65Smrg  case $host_cpu in
2318b4d38c65Smrg  powerpc)
2319b4d38c65Smrg    # Since July 2007 AmigaOS4 officially supports .so libraries.
2320b4d38c65Smrg    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
2321b4d38c65Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2322b4d38c65Smrg    ;;
2323b4d38c65Smrg  m68k)
2324b4d38c65Smrg    library_names_spec='$libname.ixlibrary $libname.a'
2325b4d38c65Smrg    # Create ${libname}_ixlibrary.a entries in /sys/libs.
2326b4d38c65Smrg    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $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'
2327b4d38c65Smrg    ;;
2328b4d38c65Smrg  esac
232915fb4814Smrg  ;;
233015fb4814Smrg
233115fb4814Smrgbeos*)
233215fb4814Smrg  library_names_spec='${libname}${shared_ext}'
233315fb4814Smrg  dynamic_linker="$host_os ld.so"
233415fb4814Smrg  shlibpath_var=LIBRARY_PATH
233515fb4814Smrg  ;;
233615fb4814Smrg
233715fb4814Smrgbsdi[[45]]*)
2338cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
233915fb4814Smrg  need_version=no
234015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
234115fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
234215fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
234315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
234415fb4814Smrg  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
234515fb4814Smrg  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
234615fb4814Smrg  # the default ld.so.conf also contains /usr/contrib/lib and
234715fb4814Smrg  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
234815fb4814Smrg  # libtool to hard-code these into programs
234915fb4814Smrg  ;;
235015fb4814Smrg
2351b4d38c65Smrgcygwin* | mingw* | pw32* | cegcc*)
235215fb4814Smrg  version_type=windows
235315fb4814Smrg  shrext_cmds=".dll"
235415fb4814Smrg  need_version=no
235515fb4814Smrg  need_lib_prefix=no
235615fb4814Smrg
2357b4d38c65Smrg  case $GCC,$cc_basename in
2358b4d38c65Smrg  yes,*)
2359b4d38c65Smrg    # gcc
236015fb4814Smrg    library_names_spec='$libname.dll.a'
236115fb4814Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
236215fb4814Smrg    postinstall_cmds='base_file=`basename \${file}`~
2363b4d38c65Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
236415fb4814Smrg      dldir=$destdir/`dirname \$dlpath`~
236515fb4814Smrg      test -d \$dldir || mkdir -p \$dldir~
236615fb4814Smrg      $install_prog $dir/$dlname \$dldir/$dlname~
2367b4d38c65Smrg      chmod a+x \$dldir/$dlname~
2368b4d38c65Smrg      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
2369b4d38c65Smrg        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
2370b4d38c65Smrg      fi'
237115fb4814Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
237215fb4814Smrg      dlpath=$dir/\$dldll~
2373b4d38c65Smrg       $RM \$dlpath'
237415fb4814Smrg    shlibpath_overrides_runpath=yes
237515fb4814Smrg
237615fb4814Smrg    case $host_os in
237715fb4814Smrg    cygwin*)
237815fb4814Smrg      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
237915fb4814Smrg      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2380b4d38c65Smrgm4_if([$1], [],[
2381b4d38c65Smrg      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
238215fb4814Smrg      ;;
2383b4d38c65Smrg    mingw* | cegcc*)
238415fb4814Smrg      # MinGW DLLs use traditional 'lib' prefix
238515fb4814Smrg      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
238615fb4814Smrg      ;;
238715fb4814Smrg    pw32*)
238815fb4814Smrg      # pw32 DLLs use 'pw' prefix rather than 'lib'
238915fb4814Smrg      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
239015fb4814Smrg      ;;
239115fb4814Smrg    esac
2392b4d38c65Smrg    dynamic_linker='Win32 ld.exe'
2393b4d38c65Smrg    ;;
2394b4d38c65Smrg
2395b4d38c65Smrg  *,cl*)
2396b4d38c65Smrg    # Native MSVC
2397b4d38c65Smrg    libname_spec='$name'
2398b4d38c65Smrg    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
2399b4d38c65Smrg    library_names_spec='${libname}.dll.lib'
2400b4d38c65Smrg
2401b4d38c65Smrg    case $build_os in
2402b4d38c65Smrg    mingw*)
2403b4d38c65Smrg      sys_lib_search_path_spec=
2404b4d38c65Smrg      lt_save_ifs=$IFS
2405b4d38c65Smrg      IFS=';'
2406b4d38c65Smrg      for lt_path in $LIB
2407b4d38c65Smrg      do
2408b4d38c65Smrg        IFS=$lt_save_ifs
2409b4d38c65Smrg        # Let DOS variable expansion print the short 8.3 style file name.
2410b4d38c65Smrg        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
2411b4d38c65Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
2412b4d38c65Smrg      done
2413b4d38c65Smrg      IFS=$lt_save_ifs
2414b4d38c65Smrg      # Convert to MSYS style.
2415b4d38c65Smrg      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
2416b4d38c65Smrg      ;;
2417b4d38c65Smrg    cygwin*)
2418b4d38c65Smrg      # Convert to unix form, then to dos form, then back to unix form
2419b4d38c65Smrg      # but this time dos style (no spaces!) so that the unix form looks
2420b4d38c65Smrg      # like /cygdrive/c/PROGRA~1:/cygdr...
2421b4d38c65Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
2422b4d38c65Smrg      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
2423b4d38c65Smrg      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2424b4d38c65Smrg      ;;
2425b4d38c65Smrg    *)
2426b4d38c65Smrg      sys_lib_search_path_spec="$LIB"
2427b4d38c65Smrg      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
2428b4d38c65Smrg        # It is most probably a Windows format PATH.
2429b4d38c65Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
2430b4d38c65Smrg      else
2431b4d38c65Smrg        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
2432b4d38c65Smrg      fi
2433b4d38c65Smrg      # FIXME: find the short name or the path components, as spaces are
2434b4d38c65Smrg      # common. (e.g. "Program Files" -> "PROGRA~1")
2435b4d38c65Smrg      ;;
2436b4d38c65Smrg    esac
2437b4d38c65Smrg
2438b4d38c65Smrg    # DLL is installed to $(libdir)/../bin by postinstall_cmds
2439b4d38c65Smrg    postinstall_cmds='base_file=`basename \${file}`~
2440b4d38c65Smrg      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
2441b4d38c65Smrg      dldir=$destdir/`dirname \$dlpath`~
2442b4d38c65Smrg      test -d \$dldir || mkdir -p \$dldir~
2443b4d38c65Smrg      $install_prog $dir/$dlname \$dldir/$dlname'
2444b4d38c65Smrg    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
2445b4d38c65Smrg      dlpath=$dir/\$dldll~
2446b4d38c65Smrg       $RM \$dlpath'
2447b4d38c65Smrg    shlibpath_overrides_runpath=yes
2448b4d38c65Smrg    dynamic_linker='Win32 link.exe'
244915fb4814Smrg    ;;
245015fb4814Smrg
245115fb4814Smrg  *)
2452b4d38c65Smrg    # Assume MSVC wrapper
245315fb4814Smrg    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
2454b4d38c65Smrg    dynamic_linker='Win32 ld.exe'
245515fb4814Smrg    ;;
245615fb4814Smrg  esac
245715fb4814Smrg  # FIXME: first we should search . and the directory the executable is in
245815fb4814Smrg  shlibpath_var=PATH
245915fb4814Smrg  ;;
246015fb4814Smrg
246115fb4814Smrgdarwin* | rhapsody*)
246215fb4814Smrg  dynamic_linker="$host_os dyld"
246315fb4814Smrg  version_type=darwin
246415fb4814Smrg  need_lib_prefix=no
246515fb4814Smrg  need_version=no
2466b4d38c65Smrg  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
246715fb4814Smrg  soname_spec='${libname}${release}${major}$shared_ext'
246815fb4814Smrg  shlibpath_overrides_runpath=yes
246915fb4814Smrg  shlibpath_var=DYLD_LIBRARY_PATH
247015fb4814Smrg  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
2471b4d38c65Smrgm4_if([$1], [],[
2472b4d38c65Smrg  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
247315fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
247415fb4814Smrg  ;;
247515fb4814Smrg
247615fb4814Smrgdgux*)
2477cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
247815fb4814Smrg  need_lib_prefix=no
247915fb4814Smrg  need_version=no
248015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
248115fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
248215fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
248315fb4814Smrg  ;;
248415fb4814Smrg
248515fb4814Smrgfreebsd* | dragonfly*)
248615fb4814Smrg  # DragonFly does not have aout.  When/if they implement a new
248715fb4814Smrg  # versioning mechanism, adjust this.
248815fb4814Smrg  if test -x /usr/bin/objformat; then
248915fb4814Smrg    objformat=`/usr/bin/objformat`
249015fb4814Smrg  else
249115fb4814Smrg    case $host_os in
2492cf503b78Smrg    freebsd[[23]].*) objformat=aout ;;
249315fb4814Smrg    *) objformat=elf ;;
249415fb4814Smrg    esac
249515fb4814Smrg  fi
249615fb4814Smrg  version_type=freebsd-$objformat
249715fb4814Smrg  case $version_type in
249815fb4814Smrg    freebsd-elf*)
249915fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
250015fb4814Smrg      need_version=no
250115fb4814Smrg      need_lib_prefix=no
250215fb4814Smrg      ;;
250315fb4814Smrg    freebsd-*)
250415fb4814Smrg      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
250515fb4814Smrg      need_version=yes
250615fb4814Smrg      ;;
250715fb4814Smrg  esac
250815fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
250915fb4814Smrg  case $host_os in
2510cf503b78Smrg  freebsd2.*)
251115fb4814Smrg    shlibpath_overrides_runpath=yes
251215fb4814Smrg    ;;
251315fb4814Smrg  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
251415fb4814Smrg    shlibpath_overrides_runpath=yes
251515fb4814Smrg    hardcode_into_libs=yes
251615fb4814Smrg    ;;
251715fb4814Smrg  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
251815fb4814Smrg  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
251915fb4814Smrg    shlibpath_overrides_runpath=no
252015fb4814Smrg    hardcode_into_libs=yes
252115fb4814Smrg    ;;
2522de78e416Smrg  *) # from 4.6 on, and DragonFly
252315fb4814Smrg    shlibpath_overrides_runpath=yes
252415fb4814Smrg    hardcode_into_libs=yes
252515fb4814Smrg    ;;
252615fb4814Smrg  esac
252715fb4814Smrg  ;;
252815fb4814Smrg
252915fb4814Smrggnu*)
2530cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
253115fb4814Smrg  need_lib_prefix=no
253215fb4814Smrg  need_version=no
253315fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
253415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
253515fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
2536cf503b78Smrg  shlibpath_overrides_runpath=no
2537b4d38c65Smrg  hardcode_into_libs=yes
2538b4d38c65Smrg  ;;
2539b4d38c65Smrg
2540b4d38c65Smrghaiku*)
2541cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2542b4d38c65Smrg  need_lib_prefix=no
2543b4d38c65Smrg  need_version=no
2544b4d38c65Smrg  dynamic_linker="$host_os runtime_loader"
2545b4d38c65Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
2546b4d38c65Smrg  soname_spec='${libname}${release}${shared_ext}$major'
2547b4d38c65Smrg  shlibpath_var=LIBRARY_PATH
2548b4d38c65Smrg  shlibpath_overrides_runpath=yes
2549b4d38c65Smrg  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
255015fb4814Smrg  hardcode_into_libs=yes
255115fb4814Smrg  ;;
255215fb4814Smrg
255315fb4814Smrghpux9* | hpux10* | hpux11*)
255415fb4814Smrg  # Give a soname corresponding to the major version so that dld.sl refuses to
255515fb4814Smrg  # link against other versions.
255615fb4814Smrg  version_type=sunos
255715fb4814Smrg  need_lib_prefix=no
255815fb4814Smrg  need_version=no
255915fb4814Smrg  case $host_cpu in
256015fb4814Smrg  ia64*)
256115fb4814Smrg    shrext_cmds='.so'
256215fb4814Smrg    hardcode_into_libs=yes
256315fb4814Smrg    dynamic_linker="$host_os dld.so"
256415fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
256515fb4814Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
256615fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
256715fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
256815fb4814Smrg    if test "X$HPUX_IA64_MODE" = X32; then
256915fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
257015fb4814Smrg    else
257115fb4814Smrg      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
257215fb4814Smrg    fi
257315fb4814Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
257415fb4814Smrg    ;;
2575b4d38c65Smrg  hppa*64*)
2576b4d38c65Smrg    shrext_cmds='.sl'
2577b4d38c65Smrg    hardcode_into_libs=yes
2578b4d38c65Smrg    dynamic_linker="$host_os dld.sl"
2579b4d38c65Smrg    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
2580b4d38c65Smrg    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
2581b4d38c65Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2582b4d38c65Smrg    soname_spec='${libname}${release}${shared_ext}$major'
2583b4d38c65Smrg    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
2584b4d38c65Smrg    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
2585b4d38c65Smrg    ;;
2586b4d38c65Smrg  *)
258715fb4814Smrg    shrext_cmds='.sl'
258815fb4814Smrg    dynamic_linker="$host_os dld.sl"
258915fb4814Smrg    shlibpath_var=SHLIB_PATH
259015fb4814Smrg    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
259115fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
259215fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
259315fb4814Smrg    ;;
259415fb4814Smrg  esac
2595b4d38c65Smrg  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
259615fb4814Smrg  postinstall_cmds='chmod 555 $lib'
2597b4d38c65Smrg  # or fails outright, so override atomically:
2598b4d38c65Smrg  install_override_mode=555
259915fb4814Smrg  ;;
260015fb4814Smrg
2601de78e416Smrginterix[[3-9]]*)
2602cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
260315fb4814Smrg  need_lib_prefix=no
260415fb4814Smrg  need_version=no
260515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
260615fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
260715fb4814Smrg  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
260815fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
260915fb4814Smrg  shlibpath_overrides_runpath=no
261015fb4814Smrg  hardcode_into_libs=yes
261115fb4814Smrg  ;;
261215fb4814Smrg
261315fb4814Smrgirix5* | irix6* | nonstopux*)
261415fb4814Smrg  case $host_os in
261515fb4814Smrg    nonstopux*) version_type=nonstopux ;;
261615fb4814Smrg    *)
261715fb4814Smrg	if test "$lt_cv_prog_gnu_ld" = yes; then
2618cf503b78Smrg		version_type=linux # correct to gnu/linux during the next big refactor
261915fb4814Smrg	else
262015fb4814Smrg		version_type=irix
262115fb4814Smrg	fi ;;
262215fb4814Smrg  esac
262315fb4814Smrg  need_lib_prefix=no
262415fb4814Smrg  need_version=no
262515fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
262615fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
262715fb4814Smrg  case $host_os in
262815fb4814Smrg  irix5* | nonstopux*)
262915fb4814Smrg    libsuff= shlibsuff=
263015fb4814Smrg    ;;
263115fb4814Smrg  *)
263215fb4814Smrg    case $LD in # libtool.m4 will add one of these switches to LD
263315fb4814Smrg    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
263415fb4814Smrg      libsuff= shlibsuff= libmagic=32-bit;;
263515fb4814Smrg    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
263615fb4814Smrg      libsuff=32 shlibsuff=N32 libmagic=N32;;
263715fb4814Smrg    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
263815fb4814Smrg      libsuff=64 shlibsuff=64 libmagic=64-bit;;
263915fb4814Smrg    *) libsuff= shlibsuff= libmagic=never-match;;
264015fb4814Smrg    esac
264115fb4814Smrg    ;;
264215fb4814Smrg  esac
264315fb4814Smrg  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
264415fb4814Smrg  shlibpath_overrides_runpath=no
264515fb4814Smrg  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
264615fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
264715fb4814Smrg  hardcode_into_libs=yes
264815fb4814Smrg  ;;
264915fb4814Smrg
265015fb4814Smrg# No shared lib support for Linux oldld, aout, or coff.
265115fb4814Smrglinux*oldld* | linux*aout* | linux*coff*)
265215fb4814Smrg  dynamic_linker=no
265315fb4814Smrg  ;;
265415fb4814Smrg
2655cf503b78Smrg# This must be glibc/ELF.
2656b4d38c65Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
2657cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
265815fb4814Smrg  need_lib_prefix=no
265915fb4814Smrg  need_version=no
266015fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
266115fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
266215fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
266315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
266415fb4814Smrg  shlibpath_overrides_runpath=no
2665b4d38c65Smrg
2666b4d38c65Smrg  # Some binutils ld are patched to set DT_RUNPATH
2667b4d38c65Smrg  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
2668b4d38c65Smrg    [lt_cv_shlibpath_overrides_runpath=no
2669b4d38c65Smrg    save_LDFLAGS=$LDFLAGS
2670b4d38c65Smrg    save_libdir=$libdir
2671b4d38c65Smrg    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
2672b4d38c65Smrg	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
2673b4d38c65Smrg    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
2674b4d38c65Smrg      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
2675b4d38c65Smrg	 [lt_cv_shlibpath_overrides_runpath=yes])])
2676b4d38c65Smrg    LDFLAGS=$save_LDFLAGS
2677b4d38c65Smrg    libdir=$save_libdir
2678b4d38c65Smrg    ])
2679b4d38c65Smrg  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
2680b4d38c65Smrg
268115fb4814Smrg  # This implies no fast_install, which is unacceptable.
268215fb4814Smrg  # Some rework will be needed to allow for fast_install
268315fb4814Smrg  # before this can be enabled.
268415fb4814Smrg  hardcode_into_libs=yes
2685b4d38c65Smrg
2686b4d38c65Smrg  # Add ABI-specific directories to the system library path.
2687b4d38c65Smrg  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
268815fb4814Smrg
268915fb4814Smrg  # Append ld.so.conf contents to the search path
269015fb4814Smrg  if test -f /etc/ld.so.conf; then
2691b4d38c65Smrg    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' ' '`
2692de78e416Smrg    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
2693b4d38c65Smrg
269415fb4814Smrg  fi
269515fb4814Smrg
269615fb4814Smrg  # We used to test for /lib/ld.so.1 and disable shared libraries on
269715fb4814Smrg  # powerpc, because MkLinux only supported shared libraries with the
269815fb4814Smrg  # GNU dynamic linker.  Since this was broken with cross compilers,
269915fb4814Smrg  # most powerpc-linux boxes support dynamic linking these days and
270015fb4814Smrg  # people can always --disable-shared, the test was removed, and we
270115fb4814Smrg  # assume the GNU/Linux dynamic linker is in use.
270215fb4814Smrg  dynamic_linker='GNU/Linux ld.so'
270315fb4814Smrg  ;;
270415fb4814Smrg
270515fb4814Smrgnetbsd*)
270615fb4814Smrg  version_type=sunos
270715fb4814Smrg  need_lib_prefix=no
270815fb4814Smrg  need_version=no
2709b4d38c65Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
271015fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
271115fb4814Smrg    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
271215fb4814Smrg    dynamic_linker='NetBSD (a.out) ld.so'
271315fb4814Smrg  else
271415fb4814Smrg    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
271515fb4814Smrg    soname_spec='${libname}${release}${shared_ext}$major'
271615fb4814Smrg    dynamic_linker='NetBSD ld.elf_so'
271715fb4814Smrg  fi
271815fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
271915fb4814Smrg  shlibpath_overrides_runpath=yes
272015fb4814Smrg  hardcode_into_libs=yes
272115fb4814Smrg  ;;
272215fb4814Smrg
272315fb4814Smrgnewsos6)
2724cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
272515fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
272615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
272715fb4814Smrg  shlibpath_overrides_runpath=yes
272815fb4814Smrg  ;;
272915fb4814Smrg
2730b4d38c65Smrg*nto* | *qnx*)
2731b4d38c65Smrg  version_type=qnx
273215fb4814Smrg  need_lib_prefix=no
273315fb4814Smrg  need_version=no
273415fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
273515fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
273615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
2737b4d38c65Smrg  shlibpath_overrides_runpath=no
2738b4d38c65Smrg  hardcode_into_libs=yes
2739b4d38c65Smrg  dynamic_linker='ldqnx.so'
274015fb4814Smrg  ;;
274115fb4814Smrg
274215fb4814Smrgopenbsd*)
274315fb4814Smrg  version_type=sunos
274415fb4814Smrg  sys_lib_dlsearch_path_spec="/usr/lib"
274515fb4814Smrg  need_lib_prefix=no
274615fb4814Smrg  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
274715fb4814Smrg  case $host_os in
2748b4d38c65Smrg    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
2749b4d38c65Smrg    *)				need_version=no  ;;
275015fb4814Smrg  esac
275115fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
275215fb4814Smrg  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
275315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
2754b4d38c65Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
275515fb4814Smrg    case $host_os in
275615fb4814Smrg      openbsd2.[[89]] | openbsd2.[[89]].*)
275715fb4814Smrg	shlibpath_overrides_runpath=no
275815fb4814Smrg	;;
275915fb4814Smrg      *)
276015fb4814Smrg	shlibpath_overrides_runpath=yes
276115fb4814Smrg	;;
276215fb4814Smrg      esac
276315fb4814Smrg  else
276415fb4814Smrg    shlibpath_overrides_runpath=yes
276515fb4814Smrg  fi
276615fb4814Smrg  ;;
276715fb4814Smrg
276815fb4814Smrgos2*)
276915fb4814Smrg  libname_spec='$name'
277015fb4814Smrg  shrext_cmds=".dll"
277115fb4814Smrg  need_lib_prefix=no
277215fb4814Smrg  library_names_spec='$libname${shared_ext} $libname.a'
277315fb4814Smrg  dynamic_linker='OS/2 ld.exe'
277415fb4814Smrg  shlibpath_var=LIBPATH
277515fb4814Smrg  ;;
277615fb4814Smrg
277715fb4814Smrgosf3* | osf4* | osf5*)
277815fb4814Smrg  version_type=osf
277915fb4814Smrg  need_lib_prefix=no
278015fb4814Smrg  need_version=no
278115fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
278215fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
278315fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
278415fb4814Smrg  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
278515fb4814Smrg  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
278615fb4814Smrg  ;;
278715fb4814Smrg
2788de78e416Smrgrdos*)
2789de78e416Smrg  dynamic_linker=no
2790de78e416Smrg  ;;
2791de78e416Smrg
279215fb4814Smrgsolaris*)
2793cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
279415fb4814Smrg  need_lib_prefix=no
279515fb4814Smrg  need_version=no
279615fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
279715fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
279815fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
279915fb4814Smrg  shlibpath_overrides_runpath=yes
280015fb4814Smrg  hardcode_into_libs=yes
280115fb4814Smrg  # ldd complains unless libraries are executable
280215fb4814Smrg  postinstall_cmds='chmod +x $lib'
280315fb4814Smrg  ;;
280415fb4814Smrg
280515fb4814Smrgsunos4*)
280615fb4814Smrg  version_type=sunos
280715fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
280815fb4814Smrg  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
280915fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
281015fb4814Smrg  shlibpath_overrides_runpath=yes
281115fb4814Smrg  if test "$with_gnu_ld" = yes; then
281215fb4814Smrg    need_lib_prefix=no
281315fb4814Smrg  fi
281415fb4814Smrg  need_version=yes
281515fb4814Smrg  ;;
281615fb4814Smrg
281715fb4814Smrgsysv4 | sysv4.3*)
2818cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
281915fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
282015fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
282115fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
282215fb4814Smrg  case $host_vendor in
282315fb4814Smrg    sni)
282415fb4814Smrg      shlibpath_overrides_runpath=no
282515fb4814Smrg      need_lib_prefix=no
282615fb4814Smrg      runpath_var=LD_RUN_PATH
282715fb4814Smrg      ;;
282815fb4814Smrg    siemens)
282915fb4814Smrg      need_lib_prefix=no
283015fb4814Smrg      ;;
283115fb4814Smrg    motorola)
283215fb4814Smrg      need_lib_prefix=no
283315fb4814Smrg      need_version=no
283415fb4814Smrg      shlibpath_overrides_runpath=no
283515fb4814Smrg      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
283615fb4814Smrg      ;;
283715fb4814Smrg  esac
283815fb4814Smrg  ;;
283915fb4814Smrg
284015fb4814Smrgsysv4*MP*)
284115fb4814Smrg  if test -d /usr/nec ;then
2842cf503b78Smrg    version_type=linux # correct to gnu/linux during the next big refactor
284315fb4814Smrg    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
284415fb4814Smrg    soname_spec='$libname${shared_ext}.$major'
284515fb4814Smrg    shlibpath_var=LD_LIBRARY_PATH
284615fb4814Smrg  fi
284715fb4814Smrg  ;;
284815fb4814Smrg
284915fb4814Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
285015fb4814Smrg  version_type=freebsd-elf
285115fb4814Smrg  need_lib_prefix=no
285215fb4814Smrg  need_version=no
285315fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
285415fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
285515fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
2856b4d38c65Smrg  shlibpath_overrides_runpath=yes
285715fb4814Smrg  hardcode_into_libs=yes
285815fb4814Smrg  if test "$with_gnu_ld" = yes; then
285915fb4814Smrg    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
286015fb4814Smrg  else
286115fb4814Smrg    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
286215fb4814Smrg    case $host_os in
286315fb4814Smrg      sco3.2v5*)
286415fb4814Smrg        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
286515fb4814Smrg	;;
286615fb4814Smrg    esac
286715fb4814Smrg  fi
286815fb4814Smrg  sys_lib_dlsearch_path_spec='/usr/lib'
286915fb4814Smrg  ;;
287015fb4814Smrg
2871b4d38c65Smrgtpf*)
2872b4d38c65Smrg  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
2873cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
2874b4d38c65Smrg  need_lib_prefix=no
2875b4d38c65Smrg  need_version=no
2876b4d38c65Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
2877b4d38c65Smrg  shlibpath_var=LD_LIBRARY_PATH
2878b4d38c65Smrg  shlibpath_overrides_runpath=no
2879b4d38c65Smrg  hardcode_into_libs=yes
2880b4d38c65Smrg  ;;
2881b4d38c65Smrg
288215fb4814Smrguts4*)
2883cf503b78Smrg  version_type=linux # correct to gnu/linux during the next big refactor
288415fb4814Smrg  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
288515fb4814Smrg  soname_spec='${libname}${release}${shared_ext}$major'
288615fb4814Smrg  shlibpath_var=LD_LIBRARY_PATH
288715fb4814Smrg  ;;
288815fb4814Smrg
288915fb4814Smrg*)
289015fb4814Smrg  dynamic_linker=no
289115fb4814Smrg  ;;
289215fb4814Smrgesac
289315fb4814SmrgAC_MSG_RESULT([$dynamic_linker])
289415fb4814Smrgtest "$dynamic_linker" = no && can_build_shared=no
289515fb4814Smrg
289615fb4814Smrgvariables_saved_for_relink="PATH $shlibpath_var $runpath_var"
289715fb4814Smrgif test "$GCC" = yes; then
289815fb4814Smrg  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
289915fb4814Smrgfi
2900b534f209Smrg
2901b4d38c65Smrgif test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
2902b4d38c65Smrg  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
2903b4d38c65Smrgfi
2904b4d38c65Smrgif test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
2905b4d38c65Smrg  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
2906b4d38c65Smrgfi
2907b534f209Smrg
2908b4d38c65Smrg_LT_DECL([], [variables_saved_for_relink], [1],
2909b4d38c65Smrg    [Variables whose values should be saved in libtool wrapper scripts and
2910b4d38c65Smrg    restored at link time])
2911b4d38c65Smrg_LT_DECL([], [need_lib_prefix], [0],
2912b4d38c65Smrg    [Do we need the "lib" prefix for modules?])
2913b4d38c65Smrg_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
2914b4d38c65Smrg_LT_DECL([], [version_type], [0], [Library versioning type])
2915b4d38c65Smrg_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
2916b4d38c65Smrg_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
2917b4d38c65Smrg_LT_DECL([], [shlibpath_overrides_runpath], [0],
2918b4d38c65Smrg    [Is shlibpath searched before the hard-coded library search path?])
2919b4d38c65Smrg_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
2920b4d38c65Smrg_LT_DECL([], [library_names_spec], [1],
2921b4d38c65Smrg    [[List of archive names.  First name is the real one, the rest are links.
2922b4d38c65Smrg    The last name is the one that the linker finds with -lNAME]])
2923b4d38c65Smrg_LT_DECL([], [soname_spec], [1],
2924b4d38c65Smrg    [[The coded name of the library, if different from the real name]])
2925b4d38c65Smrg_LT_DECL([], [install_override_mode], [1],
2926b4d38c65Smrg    [Permission mode override for installation of shared libraries])
2927b4d38c65Smrg_LT_DECL([], [postinstall_cmds], [2],
2928b4d38c65Smrg    [Command to use after installation of a shared archive])
2929b4d38c65Smrg_LT_DECL([], [postuninstall_cmds], [2],
2930b4d38c65Smrg    [Command to use after uninstallation of a shared archive])
2931b4d38c65Smrg_LT_DECL([], [finish_cmds], [2],
2932b4d38c65Smrg    [Commands used to finish a libtool library installation in a directory])
2933b4d38c65Smrg_LT_DECL([], [finish_eval], [1],
2934b4d38c65Smrg    [[As "finish_cmds", except a single script fragment to be evaled but
2935b4d38c65Smrg    not shown]])
2936b4d38c65Smrg_LT_DECL([], [hardcode_into_libs], [0],
2937b4d38c65Smrg    [Whether we should hardcode library paths into libraries])
2938b4d38c65Smrg_LT_DECL([], [sys_lib_search_path_spec], [2],
2939b4d38c65Smrg    [Compile-time system search path for libraries])
2940b4d38c65Smrg_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
2941b4d38c65Smrg    [Run-time system search path for libraries])
2942b4d38c65Smrg])# _LT_SYS_DYNAMIC_LINKER
2943b4d38c65Smrg
2944b4d38c65Smrg
2945b4d38c65Smrg# _LT_PATH_TOOL_PREFIX(TOOL)
2946b4d38c65Smrg# --------------------------
2947b4d38c65Smrg# find a file program which can recognize shared library
2948b4d38c65SmrgAC_DEFUN([_LT_PATH_TOOL_PREFIX],
2949b4d38c65Smrg[m4_require([_LT_DECL_EGREP])dnl
2950b4d38c65SmrgAC_MSG_CHECKING([for $1])
2951b4d38c65SmrgAC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
2952b4d38c65Smrg[case $MAGIC_CMD in
2953b4d38c65Smrg[[\\/*] |  ?:[\\/]*])
2954b4d38c65Smrg  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
2955b4d38c65Smrg  ;;
2956b4d38c65Smrg*)
2957b4d38c65Smrg  lt_save_MAGIC_CMD="$MAGIC_CMD"
2958b4d38c65Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
2959b4d38c65Smrgdnl $ac_dummy forces splitting on constant user-supplied paths.
2960b4d38c65Smrgdnl POSIX.2 word splitting is done only on the output of word expansions,
2961b4d38c65Smrgdnl not every word.  This closes a longstanding sh security hole.
2962b4d38c65Smrg  ac_dummy="m4_if([$2], , $PATH, [$2])"
2963b4d38c65Smrg  for ac_dir in $ac_dummy; do
296415fb4814Smrg    IFS="$lt_save_ifs"
296515fb4814Smrg    test -z "$ac_dir" && ac_dir=.
296615fb4814Smrg    if test -f $ac_dir/$1; then
296715fb4814Smrg      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
296815fb4814Smrg      if test -n "$file_magic_test_file"; then
296915fb4814Smrg	case $deplibs_check_method in
297015fb4814Smrg	"file_magic "*)
297115fb4814Smrg	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
297215fb4814Smrg	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
297315fb4814Smrg	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
297415fb4814Smrg	    $EGREP "$file_magic_regex" > /dev/null; then
297515fb4814Smrg	    :
297615fb4814Smrg	  else
2977b4d38c65Smrg	    cat <<_LT_EOF 1>&2
297815fb4814Smrg
297915fb4814Smrg*** Warning: the command libtool uses to detect shared libraries,
298015fb4814Smrg*** $file_magic_cmd, produces output that libtool cannot recognize.
298115fb4814Smrg*** The result is that libtool may fail to recognize shared libraries
298215fb4814Smrg*** as such.  This will affect the creation of libtool libraries that
298315fb4814Smrg*** depend on shared libraries, but programs linked with such libtool
298415fb4814Smrg*** libraries will work regardless of this problem.  Nevertheless, you
298515fb4814Smrg*** may want to report the problem to your system manager and/or to
298615fb4814Smrg*** bug-libtool@gnu.org
298715fb4814Smrg
2988b4d38c65Smrg_LT_EOF
298915fb4814Smrg	  fi ;;
299015fb4814Smrg	esac
299115fb4814Smrg      fi
299215fb4814Smrg      break
299315fb4814Smrg    fi
299415fb4814Smrg  done
299515fb4814Smrg  IFS="$lt_save_ifs"
299615fb4814Smrg  MAGIC_CMD="$lt_save_MAGIC_CMD"
299715fb4814Smrg  ;;
299815fb4814Smrgesac])
299915fb4814SmrgMAGIC_CMD="$lt_cv_path_MAGIC_CMD"
300015fb4814Smrgif test -n "$MAGIC_CMD"; then
300115fb4814Smrg  AC_MSG_RESULT($MAGIC_CMD)
300215fb4814Smrgelse
300315fb4814Smrg  AC_MSG_RESULT(no)
300415fb4814Smrgfi
3005b4d38c65Smrg_LT_DECL([], [MAGIC_CMD], [0],
3006b4d38c65Smrg	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
3007b4d38c65Smrg])# _LT_PATH_TOOL_PREFIX
300815fb4814Smrg
3009b4d38c65Smrg# Old name:
3010b4d38c65SmrgAU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
3011b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
3012b4d38c65Smrgdnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
301315fb4814Smrg
3014b4d38c65Smrg
3015b4d38c65Smrg# _LT_PATH_MAGIC
3016b4d38c65Smrg# --------------
3017de78e416Smrg# find a file program which can recognize a shared library
3018b4d38c65Smrgm4_defun([_LT_PATH_MAGIC],
3019b4d38c65Smrg[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
302015fb4814Smrgif test -z "$lt_cv_path_MAGIC_CMD"; then
302115fb4814Smrg  if test -n "$ac_tool_prefix"; then
3022b4d38c65Smrg    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
302315fb4814Smrg  else
302415fb4814Smrg    MAGIC_CMD=:
302515fb4814Smrg  fi
302615fb4814Smrgfi
3027b4d38c65Smrg])# _LT_PATH_MAGIC
302815fb4814Smrg
302915fb4814Smrg
3030b4d38c65Smrg# LT_PATH_LD
303115fb4814Smrg# ----------
303215fb4814Smrg# find the pathname to the GNU or non-GNU linker
3033b4d38c65SmrgAC_DEFUN([LT_PATH_LD],
3034b4d38c65Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3035b534f209SmrgAC_REQUIRE([AC_CANONICAL_HOST])dnl
3036b534f209SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
3037b4d38c65Smrgm4_require([_LT_DECL_SED])dnl
3038b4d38c65Smrgm4_require([_LT_DECL_EGREP])dnl
3039b4d38c65Smrgm4_require([_LT_PROG_ECHO_BACKSLASH])dnl
3040b4d38c65Smrg
3041b4d38c65SmrgAC_ARG_WITH([gnu-ld],
3042b4d38c65Smrg    [AS_HELP_STRING([--with-gnu-ld],
3043b4d38c65Smrg	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
3044b4d38c65Smrg    [test "$withval" = no || with_gnu_ld=yes],
3045b4d38c65Smrg    [with_gnu_ld=no])dnl
3046b4d38c65Smrg
304715fb4814Smrgac_prog=ld
304815fb4814Smrgif test "$GCC" = yes; then
304915fb4814Smrg  # Check if gcc -print-prog-name=ld gives a path.
305015fb4814Smrg  AC_MSG_CHECKING([for ld used by $CC])
305115fb4814Smrg  case $host in
305215fb4814Smrg  *-*-mingw*)
305315fb4814Smrg    # gcc leaves a trailing carriage return which upsets mingw
305415fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
305515fb4814Smrg  *)
305615fb4814Smrg    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
305715fb4814Smrg  esac
305815fb4814Smrg  case $ac_prog in
305915fb4814Smrg    # Accept absolute paths.
306015fb4814Smrg    [[\\/]]* | ?:[[\\/]]*)
306115fb4814Smrg      re_direlt='/[[^/]][[^/]]*/\.\./'
306215fb4814Smrg      # Canonicalize the pathname of ld
3063b4d38c65Smrg      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
3064b4d38c65Smrg      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
3065b4d38c65Smrg	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
306615fb4814Smrg      done
306715fb4814Smrg      test -z "$LD" && LD="$ac_prog"
306815fb4814Smrg      ;;
306915fb4814Smrg  "")
307015fb4814Smrg    # If it fails, then pretend we aren't using GCC.
307115fb4814Smrg    ac_prog=ld
307215fb4814Smrg    ;;
307315fb4814Smrg  *)
307415fb4814Smrg    # If it is relative, then search for the first ld in PATH.
307515fb4814Smrg    with_gnu_ld=unknown
307615fb4814Smrg    ;;
307715fb4814Smrg  esac
307815fb4814Smrgelif test "$with_gnu_ld" = yes; then
307915fb4814Smrg  AC_MSG_CHECKING([for GNU ld])
308015fb4814Smrgelse
308115fb4814Smrg  AC_MSG_CHECKING([for non-GNU ld])
308215fb4814Smrgfi
308315fb4814SmrgAC_CACHE_VAL(lt_cv_path_LD,
308415fb4814Smrg[if test -z "$LD"; then
308515fb4814Smrg  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
308615fb4814Smrg  for ac_dir in $PATH; do
308715fb4814Smrg    IFS="$lt_save_ifs"
308815fb4814Smrg    test -z "$ac_dir" && ac_dir=.
308915fb4814Smrg    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
309015fb4814Smrg      lt_cv_path_LD="$ac_dir/$ac_prog"
309115fb4814Smrg      # Check to see if the program is GNU ld.  I'd rather use --version,
309215fb4814Smrg      # but apparently some variants of GNU ld only accept -v.
309315fb4814Smrg      # Break only if it was the GNU/non-GNU ld that we prefer.
309415fb4814Smrg      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
309515fb4814Smrg      *GNU* | *'with BFD'*)
309615fb4814Smrg	test "$with_gnu_ld" != no && break
309715fb4814Smrg	;;
309815fb4814Smrg      *)
309915fb4814Smrg	test "$with_gnu_ld" != yes && break
310015fb4814Smrg	;;
310115fb4814Smrg      esac
310215fb4814Smrg    fi
310315fb4814Smrg  done
310415fb4814Smrg  IFS="$lt_save_ifs"
310515fb4814Smrgelse
310615fb4814Smrg  lt_cv_path_LD="$LD" # Let the user override the test with a path.
310715fb4814Smrgfi])
310815fb4814SmrgLD="$lt_cv_path_LD"
310915fb4814Smrgif test -n "$LD"; then
311015fb4814Smrg  AC_MSG_RESULT($LD)
311115fb4814Smrgelse
311215fb4814Smrg  AC_MSG_RESULT(no)
311315fb4814Smrgfi
311415fb4814Smrgtest -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3115b4d38c65Smrg_LT_PATH_LD_GNU
3116b4d38c65SmrgAC_SUBST([LD])
311715fb4814Smrg
3118b4d38c65Smrg_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
3119b4d38c65Smrg])# LT_PATH_LD
3120b410ddbeSmrg
3121b4d38c65Smrg# Old names:
3122b4d38c65SmrgAU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
3123b4d38c65SmrgAU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
3124b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
3125b4d38c65Smrgdnl AC_DEFUN([AM_PROG_LD], [])
3126b4d38c65Smrgdnl AC_DEFUN([AC_PROG_LD], [])
3127b4d38c65Smrg
3128b4d38c65Smrg
3129b4d38c65Smrg# _LT_PATH_LD_GNU
3130b4d38c65Smrg#- --------------
3131b4d38c65Smrgm4_defun([_LT_PATH_LD_GNU],
3132b4d38c65Smrg[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
313315fb4814Smrg[# I'd rather use --version here, but apparently some GNU lds only accept -v.
313415fb4814Smrgcase `$LD -v 2>&1 </dev/null` in
313515fb4814Smrg*GNU* | *'with BFD'*)
313615fb4814Smrg  lt_cv_prog_gnu_ld=yes
313715fb4814Smrg  ;;
313815fb4814Smrg*)
313915fb4814Smrg  lt_cv_prog_gnu_ld=no
314015fb4814Smrg  ;;
314115fb4814Smrgesac])
314215fb4814Smrgwith_gnu_ld=$lt_cv_prog_gnu_ld
3143b4d38c65Smrg])# _LT_PATH_LD_GNU
314415fb4814Smrg
314515fb4814Smrg
3146b4d38c65Smrg# _LT_CMD_RELOAD
3147b4d38c65Smrg# --------------
314815fb4814Smrg# find reload flag for linker
314915fb4814Smrg#   -- PORTME Some linkers may need a different reload flag.
3150b4d38c65Smrgm4_defun([_LT_CMD_RELOAD],
315115fb4814Smrg[AC_CACHE_CHECK([for $LD option to reload object files],
315215fb4814Smrg  lt_cv_ld_reload_flag,
315315fb4814Smrg  [lt_cv_ld_reload_flag='-r'])
315415fb4814Smrgreload_flag=$lt_cv_ld_reload_flag
315515fb4814Smrgcase $reload_flag in
315615fb4814Smrg"" | " "*) ;;
315715fb4814Smrg*) reload_flag=" $reload_flag" ;;
315815fb4814Smrgesac
315915fb4814Smrgreload_cmds='$LD$reload_flag -o $output$reload_objs'
316015fb4814Smrgcase $host_os in
3161b4d38c65Smrg  cygwin* | mingw* | pw32* | cegcc*)
3162b4d38c65Smrg    if test "$GCC" != yes; then
3163b4d38c65Smrg      reload_cmds=false
3164b4d38c65Smrg    fi
3165b4d38c65Smrg    ;;
316615fb4814Smrg  darwin*)
316715fb4814Smrg    if test "$GCC" = yes; then
316815fb4814Smrg      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
316915fb4814Smrg    else
317015fb4814Smrg      reload_cmds='$LD$reload_flag -o $output$reload_objs'
317115fb4814Smrg    fi
317215fb4814Smrg    ;;
317315fb4814Smrgesac
3174b4d38c65Smrg_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
3175b4d38c65Smrg_LT_TAGDECL([], [reload_cmds], [2])dnl
3176b4d38c65Smrg])# _LT_CMD_RELOAD
317715fb4814Smrg
317815fb4814Smrg
3179b4d38c65Smrg# _LT_CHECK_MAGIC_METHOD
3180b4d38c65Smrg# ----------------------
318115fb4814Smrg# how to check for library dependencies
318215fb4814Smrg#  -- PORTME fill in with the dynamic library characteristics
3183b4d38c65Smrgm4_defun([_LT_CHECK_MAGIC_METHOD],
3184b4d38c65Smrg[m4_require([_LT_DECL_EGREP])
3185b4d38c65Smrgm4_require([_LT_DECL_OBJDUMP])
3186b4d38c65SmrgAC_CACHE_CHECK([how to recognize dependent libraries],
318715fb4814Smrglt_cv_deplibs_check_method,
318815fb4814Smrg[lt_cv_file_magic_cmd='$MAGIC_CMD'
318915fb4814Smrglt_cv_file_magic_test_file=
319015fb4814Smrglt_cv_deplibs_check_method='unknown'
319115fb4814Smrg# Need to set the preceding variable on all platforms that support
319215fb4814Smrg# interlibrary dependencies.
319315fb4814Smrg# 'none' -- dependencies not supported.
319415fb4814Smrg# `unknown' -- same as none, but documents that we really don't know.
319515fb4814Smrg# 'pass_all' -- all dependencies passed with no checks.
319615fb4814Smrg# 'test_compile' -- check by making test program.
319715fb4814Smrg# 'file_magic [[regex]]' -- check by looking for files in library path
319815fb4814Smrg# which responds to the $file_magic_cmd with a given extended regex.
319915fb4814Smrg# If you have `file' or equivalent on your system and you're not sure
320015fb4814Smrg# whether `pass_all' will *always* work, you probably want this one.
320115fb4814Smrg
320215fb4814Smrgcase $host_os in
3203b4d38c65Smrgaix[[4-9]]*)
320415fb4814Smrg  lt_cv_deplibs_check_method=pass_all
320515fb4814Smrg  ;;
320615fb4814Smrg
320715fb4814Smrgbeos*)
320815fb4814Smrg  lt_cv_deplibs_check_method=pass_all
320915fb4814Smrg  ;;
321015fb4814Smrg
321115fb4814Smrgbsdi[[45]]*)
321215fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
321315fb4814Smrg  lt_cv_file_magic_cmd='/usr/bin/file -L'
321415fb4814Smrg  lt_cv_file_magic_test_file=/shlib/libc.so
321515fb4814Smrg  ;;
321615fb4814Smrg
321715fb4814Smrgcygwin*)
321815fb4814Smrg  # func_win32_libid is a shell function defined in ltmain.sh
321915fb4814Smrg  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
322015fb4814Smrg  lt_cv_file_magic_cmd='func_win32_libid'
322115fb4814Smrg  ;;
322215fb4814Smrg
322315fb4814Smrgmingw* | pw32*)
322415fb4814Smrg  # Base MSYS/MinGW do not provide the 'file' command needed by
3225de78e416Smrg  # func_win32_libid shell function, so use a weaker test based on 'objdump',
3226de78e416Smrg  # unless we find 'file', for example because we are cross-compiling.
3227b4d38c65Smrg  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
3228b4d38c65Smrg  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
3229de78e416Smrg    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
3230de78e416Smrg    lt_cv_file_magic_cmd='func_win32_libid'
3231de78e416Smrg  else
3232b4d38c65Smrg    # Keep this pattern in sync with the one in func_win32_libid.
3233b4d38c65Smrg    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
3234de78e416Smrg    lt_cv_file_magic_cmd='$OBJDUMP -f'
3235de78e416Smrg  fi
323615fb4814Smrg  ;;
323715fb4814Smrg
3238b4d38c65Smrgcegcc*)
3239b4d38c65Smrg  # use the weaker test based on 'objdump'. See mingw*.
3240b4d38c65Smrg  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
3241b4d38c65Smrg  lt_cv_file_magic_cmd='$OBJDUMP -f'
3242b4d38c65Smrg  ;;
3243b4d38c65Smrg
324415fb4814Smrgdarwin* | rhapsody*)
324515fb4814Smrg  lt_cv_deplibs_check_method=pass_all
324615fb4814Smrg  ;;
324715fb4814Smrg
3248de78e416Smrgfreebsd* | dragonfly*)
3249b4d38c65Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
325015fb4814Smrg    case $host_cpu in
325115fb4814Smrg    i*86 )
325215fb4814Smrg      # Not sure whether the presence of OpenBSD here was a mistake.
325315fb4814Smrg      # Let's accept both of them until this is cleared up.
325415fb4814Smrg      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
325515fb4814Smrg      lt_cv_file_magic_cmd=/usr/bin/file
325615fb4814Smrg      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
325715fb4814Smrg      ;;
325815fb4814Smrg    esac
325915fb4814Smrg  else
326015fb4814Smrg    lt_cv_deplibs_check_method=pass_all
326115fb4814Smrg  fi
326215fb4814Smrg  ;;
326315fb4814Smrg
326415fb4814Smrggnu*)
326515fb4814Smrg  lt_cv_deplibs_check_method=pass_all
326615fb4814Smrg  ;;
326715fb4814Smrg
3268b4d38c65Smrghaiku*)
3269b4d38c65Smrg  lt_cv_deplibs_check_method=pass_all
3270b4d38c65Smrg  ;;
3271b4d38c65Smrg
327215fb4814Smrghpux10.20* | hpux11*)
327315fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
327415fb4814Smrg  case $host_cpu in
327515fb4814Smrg  ia64*)
327615fb4814Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
327715fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
327815fb4814Smrg    ;;
327915fb4814Smrg  hppa*64*)
3280b4d38c65Smrg    [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]']
328115fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
328215fb4814Smrg    ;;
328315fb4814Smrg  *)
3284b4d38c65Smrg    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
328515fb4814Smrg    lt_cv_file_magic_test_file=/usr/lib/libc.sl
328615fb4814Smrg    ;;
328715fb4814Smrg  esac
328815fb4814Smrg  ;;
328915fb4814Smrg
3290de78e416Smrginterix[[3-9]]*)
329115fb4814Smrg  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
329215fb4814Smrg  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
329315fb4814Smrg  ;;
329415fb4814Smrg
329515fb4814Smrgirix5* | irix6* | nonstopux*)
329615fb4814Smrg  case $LD in
329715fb4814Smrg  *-32|*"-32 ") libmagic=32-bit;;
329815fb4814Smrg  *-n32|*"-n32 ") libmagic=N32;;
329915fb4814Smrg  *-64|*"-64 ") libmagic=64-bit;;
330015fb4814Smrg  *) libmagic=never-match;;
330115fb4814Smrg  esac
330215fb4814Smrg  lt_cv_deplibs_check_method=pass_all
330315fb4814Smrg  ;;
330415fb4814Smrg
3305cf503b78Smrg# This must be glibc/ELF.
3306b4d38c65Smrglinux* | k*bsd*-gnu | kopensolaris*-gnu)
330715fb4814Smrg  lt_cv_deplibs_check_method=pass_all
330815fb4814Smrg  ;;
330915fb4814Smrg
331015fb4814Smrgnetbsd*)
3311b4d38c65Smrg  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
331215fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
331315fb4814Smrg  else
331415fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
331515fb4814Smrg  fi
331615fb4814Smrg  ;;
331715fb4814Smrg
331815fb4814Smrgnewos6*)
331915fb4814Smrg  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
332015fb4814Smrg  lt_cv_file_magic_cmd=/usr/bin/file
332115fb4814Smrg  lt_cv_file_magic_test_file=/usr/lib/libnls.so
332215fb4814Smrg  ;;
332315fb4814Smrg
3324b4d38c65Smrg*nto* | *qnx*)
3325b4d38c65Smrg  lt_cv_deplibs_check_method=pass_all
332615fb4814Smrg  ;;
332715fb4814Smrg
332815fb4814Smrgopenbsd*)
3329b4d38c65Smrg  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
333015fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
333115fb4814Smrg  else
333215fb4814Smrg    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
333315fb4814Smrg  fi
333415fb4814Smrg  ;;
333515fb4814Smrg
333615fb4814Smrgosf3* | osf4* | osf5*)
333715fb4814Smrg  lt_cv_deplibs_check_method=pass_all
333815fb4814Smrg  ;;
333915fb4814Smrg
3340de78e416Smrgrdos*)
3341de78e416Smrg  lt_cv_deplibs_check_method=pass_all
3342de78e416Smrg  ;;
3343de78e416Smrg
334415fb4814Smrgsolaris*)
334515fb4814Smrg  lt_cv_deplibs_check_method=pass_all
334615fb4814Smrg  ;;
334715fb4814Smrg
3348b4d38c65Smrgsysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
3349b4d38c65Smrg  lt_cv_deplibs_check_method=pass_all
3350b4d38c65Smrg  ;;
3351b4d38c65Smrg
335215fb4814Smrgsysv4 | sysv4.3*)
335315fb4814Smrg  case $host_vendor in
335415fb4814Smrg  motorola)
335515fb4814Smrg    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]]'
335615fb4814Smrg    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
335715fb4814Smrg    ;;
335815fb4814Smrg  ncr)
335915fb4814Smrg    lt_cv_deplibs_check_method=pass_all
336015fb4814Smrg    ;;
336115fb4814Smrg  sequent)
336215fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
336315fb4814Smrg    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
336415fb4814Smrg    ;;
336515fb4814Smrg  sni)
336615fb4814Smrg    lt_cv_file_magic_cmd='/bin/file'
336715fb4814Smrg    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
336815fb4814Smrg    lt_cv_file_magic_test_file=/lib/libc.so
336915fb4814Smrg    ;;
337015fb4814Smrg  siemens)
337115fb4814Smrg    lt_cv_deplibs_check_method=pass_all
337215fb4814Smrg    ;;
337315fb4814Smrg  pc)
337415fb4814Smrg    lt_cv_deplibs_check_method=pass_all
337515fb4814Smrg    ;;
337615fb4814Smrg  esac
337715fb4814Smrg  ;;
337815fb4814Smrg
3379b4d38c65Smrgtpf*)
338015fb4814Smrg  lt_cv_deplibs_check_method=pass_all
338115fb4814Smrg  ;;
338215fb4814Smrgesac
338315fb4814Smrg])
3384b4d38c65Smrg
3385b4d38c65Smrgfile_magic_glob=
3386b4d38c65Smrgwant_nocaseglob=no
3387b4d38c65Smrgif test "$build" = "$host"; then
3388b4d38c65Smrg  case $host_os in
3389b4d38c65Smrg  mingw* | pw32*)
3390b4d38c65Smrg    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
3391b4d38c65Smrg      want_nocaseglob=yes
3392b4d38c65Smrg    else
3393b4d38c65Smrg      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
3394b4d38c65Smrg    fi
3395b4d38c65Smrg    ;;
3396b4d38c65Smrg  esac
3397b4d38c65Smrgfi
3398b4d38c65Smrg
339915fb4814Smrgfile_magic_cmd=$lt_cv_file_magic_cmd
340015fb4814Smrgdeplibs_check_method=$lt_cv_deplibs_check_method
340115fb4814Smrgtest -z "$deplibs_check_method" && deplibs_check_method=unknown
340215fb4814Smrg
3403b4d38c65Smrg_LT_DECL([], [deplibs_check_method], [1],
3404b4d38c65Smrg    [Method to check whether dependent libraries are shared objects])
3405b4d38c65Smrg_LT_DECL([], [file_magic_cmd], [1],
3406b4d38c65Smrg    [Command to use when deplibs_check_method = "file_magic"])
3407b4d38c65Smrg_LT_DECL([], [file_magic_glob], [1],
3408b4d38c65Smrg    [How to find potential files when deplibs_check_method = "file_magic"])
3409b4d38c65Smrg_LT_DECL([], [want_nocaseglob], [1],
3410b4d38c65Smrg    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
3411b4d38c65Smrg])# _LT_CHECK_MAGIC_METHOD
341215fb4814Smrg
3413b4d38c65Smrg
3414b4d38c65Smrg# LT_PATH_NM
341515fb4814Smrg# ----------
3416b4d38c65Smrg# find the pathname to a BSD- or MS-compatible name lister
3417b4d38c65SmrgAC_DEFUN([LT_PATH_NM],
3418b4d38c65Smrg[AC_REQUIRE([AC_PROG_CC])dnl
3419b4d38c65SmrgAC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
342015fb4814Smrg[if test -n "$NM"; then
342115fb4814Smrg  # Let the user override the test.
342215fb4814Smrg  lt_cv_path_NM="$NM"
342315fb4814Smrgelse
342415fb4814Smrg  lt_nm_to_check="${ac_tool_prefix}nm"
3425de78e416Smrg  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
342615fb4814Smrg    lt_nm_to_check="$lt_nm_to_check nm"
342715fb4814Smrg  fi
342815fb4814Smrg  for lt_tmp_nm in $lt_nm_to_check; do
342915fb4814Smrg    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
343015fb4814Smrg    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
343115fb4814Smrg      IFS="$lt_save_ifs"
343215fb4814Smrg      test -z "$ac_dir" && ac_dir=.
343315fb4814Smrg      tmp_nm="$ac_dir/$lt_tmp_nm"
343415fb4814Smrg      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
343515fb4814Smrg	# Check to see if the nm accepts a BSD-compat flag.
343615fb4814Smrg	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
343715fb4814Smrg	#   nm: unknown option "B" ignored
343815fb4814Smrg	# Tru64's nm complains that /dev/null is an invalid object file
343915fb4814Smrg	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
344015fb4814Smrg	*/dev/null* | *'Invalid file or object type'*)
344115fb4814Smrg	  lt_cv_path_NM="$tmp_nm -B"
344215fb4814Smrg	  break
344315fb4814Smrg	  ;;
344415fb4814Smrg	*)
344515fb4814Smrg	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
344615fb4814Smrg	  */dev/null*)
344715fb4814Smrg	    lt_cv_path_NM="$tmp_nm -p"
344815fb4814Smrg	    break
344915fb4814Smrg	    ;;
345015fb4814Smrg	  *)
345115fb4814Smrg	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
345215fb4814Smrg	    continue # so that we can try to find one that supports BSD flags
345315fb4814Smrg	    ;;
345415fb4814Smrg	  esac
345515fb4814Smrg	  ;;
345615fb4814Smrg	esac
345715fb4814Smrg      fi
345815fb4814Smrg    done
345915fb4814Smrg    IFS="$lt_save_ifs"
346015fb4814Smrg  done
3461b4d38c65Smrg  : ${lt_cv_path_NM=no}
346215fb4814Smrgfi])
3463b4d38c65Smrgif test "$lt_cv_path_NM" != "no"; then
3464b4d38c65Smrg  NM="$lt_cv_path_NM"
3465b4d38c65Smrgelse
3466b4d38c65Smrg  # Didn't find any BSD compatible name lister, look for dumpbin.
3467b4d38c65Smrg  if test -n "$DUMPBIN"; then :
3468b4d38c65Smrg    # Let the user override the test.
3469b4d38c65Smrg  else
3470b4d38c65Smrg    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
3471b4d38c65Smrg    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
3472b4d38c65Smrg    *COFF*)
3473b4d38c65Smrg      DUMPBIN="$DUMPBIN -symbols"
3474b4d38c65Smrg      ;;
3475b4d38c65Smrg    *)
3476b4d38c65Smrg      DUMPBIN=:
3477b4d38c65Smrg      ;;
3478b4d38c65Smrg    esac
3479b4d38c65Smrg  fi
3480b4d38c65Smrg  AC_SUBST([DUMPBIN])
3481b4d38c65Smrg  if test "$DUMPBIN" != ":"; then
3482b4d38c65Smrg    NM="$DUMPBIN"
3483b4d38c65Smrg  fi
3484b4d38c65Smrgfi
3485b4d38c65Smrgtest -z "$NM" && NM=nm
3486b4d38c65SmrgAC_SUBST([NM])
3487b4d38c65Smrg_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
3488b4d38c65Smrg
3489b4d38c65SmrgAC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
3490b4d38c65Smrg  [lt_cv_nm_interface="BSD nm"
3491b4d38c65Smrg  echo "int some_variable = 0;" > conftest.$ac_ext
3492b4d38c65Smrg  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
3493b4d38c65Smrg  (eval "$ac_compile" 2>conftest.err)
3494b4d38c65Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3495b4d38c65Smrg  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
3496b4d38c65Smrg  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
3497b4d38c65Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3498b4d38c65Smrg  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
3499b4d38c65Smrg  cat conftest.out >&AS_MESSAGE_LOG_FD
3500b4d38c65Smrg  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
3501b4d38c65Smrg    lt_cv_nm_interface="MS dumpbin"
3502b4d38c65Smrg  fi
3503b4d38c65Smrg  rm -f conftest*])
3504b4d38c65Smrg])# LT_PATH_NM
350515fb4814Smrg
3506b4d38c65Smrg# Old names:
3507b4d38c65SmrgAU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
3508b4d38c65SmrgAU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
3509b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
3510b4d38c65Smrgdnl AC_DEFUN([AM_PROG_NM], [])
3511b4d38c65Smrgdnl AC_DEFUN([AC_PROG_NM], [])
351215fb4814Smrg
3513b4d38c65Smrg# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3514b4d38c65Smrg# --------------------------------
3515b4d38c65Smrg# how to determine the name of the shared library
3516b4d38c65Smrg# associated with a specific link library.
3517b4d38c65Smrg#  -- PORTME fill in with the dynamic library characteristics
3518b4d38c65Smrgm4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
3519b4d38c65Smrg[m4_require([_LT_DECL_EGREP])
3520b4d38c65Smrgm4_require([_LT_DECL_OBJDUMP])
3521b4d38c65Smrgm4_require([_LT_DECL_DLLTOOL])
3522b4d38c65SmrgAC_CACHE_CHECK([how to associate runtime and link libraries],
3523b4d38c65Smrglt_cv_sharedlib_from_linklib_cmd,
3524b4d38c65Smrg[lt_cv_sharedlib_from_linklib_cmd='unknown'
3525b4d38c65Smrg
3526b4d38c65Smrgcase $host_os in
3527b4d38c65Smrgcygwin* | mingw* | pw32* | cegcc*)
3528b4d38c65Smrg  # two different shell functions defined in ltmain.sh
3529b4d38c65Smrg  # decide which to use based on capabilities of $DLLTOOL
3530b4d38c65Smrg  case `$DLLTOOL --help 2>&1` in
3531b4d38c65Smrg  *--identify-strict*)
3532b4d38c65Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
3533b4d38c65Smrg    ;;
3534b4d38c65Smrg  *)
3535b4d38c65Smrg    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
3536b4d38c65Smrg    ;;
3537b4d38c65Smrg  esac
3538b4d38c65Smrg  ;;
3539b4d38c65Smrg*)
3540b4d38c65Smrg  # fallback: assume linklib IS sharedlib
3541b4d38c65Smrg  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
3542b4d38c65Smrg  ;;
3543b4d38c65Smrgesac
3544b4d38c65Smrg])
3545b4d38c65Smrgsharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
3546b4d38c65Smrgtest -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
3547b4d38c65Smrg
3548b4d38c65Smrg_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
3549b4d38c65Smrg    [Command to associate shared and link libraries])
3550b4d38c65Smrg])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
3551b4d38c65Smrg
3552b4d38c65Smrg
3553b4d38c65Smrg# _LT_PATH_MANIFEST_TOOL
3554b4d38c65Smrg# ----------------------
3555b4d38c65Smrg# locate the manifest tool
3556b4d38c65Smrgm4_defun([_LT_PATH_MANIFEST_TOOL],
3557b4d38c65Smrg[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
3558b4d38c65Smrgtest -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
3559b4d38c65SmrgAC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
3560b4d38c65Smrg  [lt_cv_path_mainfest_tool=no
3561b4d38c65Smrg  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
3562b4d38c65Smrg  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
3563b4d38c65Smrg  cat conftest.err >&AS_MESSAGE_LOG_FD
3564b4d38c65Smrg  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
3565b4d38c65Smrg    lt_cv_path_mainfest_tool=yes
3566b4d38c65Smrg  fi
3567b4d38c65Smrg  rm -f conftest*])
3568b4d38c65Smrgif test "x$lt_cv_path_mainfest_tool" != xyes; then
3569b4d38c65Smrg  MANIFEST_TOOL=:
3570b4d38c65Smrgfi
3571b4d38c65Smrg_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
3572b4d38c65Smrg])# _LT_PATH_MANIFEST_TOOL
3573b4d38c65Smrg
3574b4d38c65Smrg
3575b4d38c65Smrg# LT_LIB_M
3576b4d38c65Smrg# --------
357715fb4814Smrg# check for math library
3578b4d38c65SmrgAC_DEFUN([LT_LIB_M],
357915fb4814Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
358015fb4814SmrgLIBM=
358115fb4814Smrgcase $host in
3582b4d38c65Smrg*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
358315fb4814Smrg  # These system don't have libm, or don't need it
358415fb4814Smrg  ;;
358515fb4814Smrg*-ncr-sysv4.3*)
358615fb4814Smrg  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
358715fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
358815fb4814Smrg  ;;
358915fb4814Smrg*)
359015fb4814Smrg  AC_CHECK_LIB(m, cos, LIBM="-lm")
359115fb4814Smrg  ;;
359215fb4814Smrgesac
3593b4d38c65SmrgAC_SUBST([LIBM])
3594b4d38c65Smrg])# LT_LIB_M
359515fb4814Smrg
3596b4d38c65Smrg# Old name:
3597b4d38c65SmrgAU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
3598b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
3599b4d38c65Smrgdnl AC_DEFUN([AC_CHECK_LIBM], [])
360015fb4814Smrg
360115fb4814Smrg
3602b4d38c65Smrg# _LT_COMPILER_NO_RTTI([TAGNAME])
3603b4d38c65Smrg# -------------------------------
3604b4d38c65Smrgm4_defun([_LT_COMPILER_NO_RTTI],
3605b4d38c65Smrg[m4_require([_LT_TAG_COMPILER])dnl
360615fb4814Smrg
3607b4d38c65Smrg_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
360815fb4814Smrg
3609b4d38c65Smrgif test "$GCC" = yes; then
3610b4d38c65Smrg  case $cc_basename in
3611b4d38c65Smrg  nvcc*)
3612b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
3613b4d38c65Smrg  *)
3614b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
3615b4d38c65Smrg  esac
361615fb4814Smrg
3617b4d38c65Smrg  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
3618b4d38c65Smrg    lt_cv_prog_compiler_rtti_exceptions,
3619b4d38c65Smrg    [-fno-rtti -fno-exceptions], [],
3620b4d38c65Smrg    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
3621b534f209Smrgfi
3622b4d38c65Smrg_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
3623b4d38c65Smrg	[Compiler flag to turn off builtin functions])
3624b4d38c65Smrg])# _LT_COMPILER_NO_RTTI
362515fb4814Smrg
362615fb4814Smrg
3627b4d38c65Smrg# _LT_CMD_GLOBAL_SYMBOLS
3628b4d38c65Smrg# ----------------------
3629b4d38c65Smrgm4_defun([_LT_CMD_GLOBAL_SYMBOLS],
3630b4d38c65Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
3631b4d38c65SmrgAC_REQUIRE([AC_PROG_CC])dnl
3632b4d38c65SmrgAC_REQUIRE([AC_PROG_AWK])dnl
3633b4d38c65SmrgAC_REQUIRE([LT_PATH_NM])dnl
3634b4d38c65SmrgAC_REQUIRE([LT_PATH_LD])dnl
3635b4d38c65Smrgm4_require([_LT_DECL_SED])dnl
3636b4d38c65Smrgm4_require([_LT_DECL_EGREP])dnl
3637b4d38c65Smrgm4_require([_LT_TAG_COMPILER])dnl
363815fb4814Smrg
3639b4d38c65Smrg# Check for command to grab the raw symbol name followed by C symbol from nm.
3640b4d38c65SmrgAC_MSG_CHECKING([command to parse $NM output from $compiler object])
3641b4d38c65SmrgAC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
3642b4d38c65Smrg[
3643b4d38c65Smrg# These are sane defaults that work on at least a few old systems.
3644b4d38c65Smrg# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
364515fb4814Smrg
3646b4d38c65Smrg# Character class describing NM global symbol codes.
3647b4d38c65Smrgsymcode='[[BCDEGRST]]'
3648b534f209Smrg
3649b4d38c65Smrg# Regexp to match symbols that can be accessed directly from C.
3650b4d38c65Smrgsympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
3651b534f209Smrg
3652b4d38c65Smrg# Define system-specific variables.
3653b534f209Smrgcase $host_os in
3654b4d38c65Smrgaix*)
3655b4d38c65Smrg  symcode='[[BCDT]]'
3656b410ddbeSmrg  ;;
3657b4d38c65Smrgcygwin* | mingw* | pw32* | cegcc*)
3658b4d38c65Smrg  symcode='[[ABCDGISTW]]'
3659b4d38c65Smrg  ;;
3660b4d38c65Smrghpux*)
3661b4d38c65Smrg  if test "$host_cpu" = ia64; then
3662b4d38c65Smrg    symcode='[[ABCDEGRST]]'
3663b534f209Smrg  fi
3664b4d38c65Smrg  ;;
3665b4d38c65Smrgirix* | nonstopux*)
3666b4d38c65Smrg  symcode='[[BCDEGRST]]'
3667b4d38c65Smrg  ;;
3668b4d38c65Smrgosf*)
3669b4d38c65Smrg  symcode='[[BCDEGQRST]]'
3670b4d38c65Smrg  ;;
3671b4d38c65Smrgsolaris*)
3672b4d38c65Smrg  symcode='[[BDRT]]'
3673b4d38c65Smrg  ;;
3674b4d38c65Smrgsco3.2v5*)
3675b4d38c65Smrg  symcode='[[DT]]'
3676b4d38c65Smrg  ;;
3677b4d38c65Smrgsysv4.2uw2*)
3678b4d38c65Smrg  symcode='[[DT]]'
3679b4d38c65Smrg  ;;
3680b4d38c65Smrgsysv5* | sco5v6* | unixware* | OpenUNIX*)
3681b4d38c65Smrg  symcode='[[ABDT]]'
3682b4d38c65Smrg  ;;
3683b4d38c65Smrgsysv4)
3684b4d38c65Smrg  symcode='[[DFNSTU]]'
3685b4d38c65Smrg  ;;
3686b410ddbeSmrgesac
368715fb4814Smrg
3688b4d38c65Smrg# If we're using GNU nm, then use its standard symbol codes.
3689b4d38c65Smrgcase `$NM -V 2>&1` in
3690b4d38c65Smrg*GNU* | *'with BFD'*)
3691b4d38c65Smrg  symcode='[[ABCDGIRSTW]]' ;;
3692b4d38c65Smrgesac
369315fb4814Smrg
3694b4d38c65Smrg# Transform an extracted symbol line into a proper C declaration.
3695b4d38c65Smrg# Some systems (esp. on ia64) link data and code symbols differently,
3696b4d38c65Smrg# so use this general approach.
3697b4d38c65Smrglt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
369815fb4814Smrg
3699b4d38c65Smrg# Transform an extracted symbol line into symbol name and symbol address
3700b4d38c65Smrglt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
3701b4d38c65Smrglt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
370215fb4814Smrg
3703b4d38c65Smrg# Handle CRLF in mingw tool chain
3704b4d38c65Smrgopt_cr=
3705b4d38c65Smrgcase $build_os in
3706b4d38c65Smrgmingw*)
3707b4d38c65Smrg  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
3708b4d38c65Smrg  ;;
3709b4d38c65Smrgesac
371015fb4814Smrg
3711b4d38c65Smrg# Try without a prefix underscore, then with it.
3712b4d38c65Smrgfor ac_symprfx in "" "_"; do
371315fb4814Smrg
3714b4d38c65Smrg  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
3715b4d38c65Smrg  symxfrm="\\1 $ac_symprfx\\2 \\2"
371615fb4814Smrg
3717b4d38c65Smrg  # Write the raw and C identifiers.
3718b4d38c65Smrg  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
3719b4d38c65Smrg    # Fake it for dumpbin and say T for any non-static function
3720b4d38c65Smrg    # and D for any global variable.
3721b4d38c65Smrg    # Also find C++ and __fastcall symbols from MSVC++,
3722b4d38c65Smrg    # which start with @ or ?.
3723b4d38c65Smrg    lt_cv_sys_global_symbol_pipe="$AWK ['"\
3724b4d38c65Smrg"     {last_section=section; section=\$ 3};"\
3725cf503b78Smrg"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
3726b4d38c65Smrg"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
3727b4d38c65Smrg"     \$ 0!~/External *\|/{next};"\
3728b4d38c65Smrg"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
3729b4d38c65Smrg"     {if(hide[section]) next};"\
3730b4d38c65Smrg"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
3731b4d38c65Smrg"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
3732b4d38c65Smrg"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
3733b4d38c65Smrg"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
3734b4d38c65Smrg"     ' prfx=^$ac_symprfx]"
3735b4d38c65Smrg  else
3736b4d38c65Smrg    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
3737b4d38c65Smrg  fi
3738b4d38c65Smrg  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
373915fb4814Smrg
3740b4d38c65Smrg  # Check to see that the pipe works correctly.
3741b4d38c65Smrg  pipe_works=no
374215fb4814Smrg
3743b4d38c65Smrg  rm -f conftest*
3744b4d38c65Smrg  cat > conftest.$ac_ext <<_LT_EOF
3745b4d38c65Smrg#ifdef __cplusplus
3746b4d38c65Smrgextern "C" {
3747b4d38c65Smrg#endif
3748b4d38c65Smrgchar nm_test_var;
3749b4d38c65Smrgvoid nm_test_func(void);
3750b4d38c65Smrgvoid nm_test_func(void){}
3751b4d38c65Smrg#ifdef __cplusplus
3752b4d38c65Smrg}
3753b4d38c65Smrg#endif
3754b4d38c65Smrgint main(){nm_test_var='a';nm_test_func();return(0);}
3755b4d38c65Smrg_LT_EOF
3756b534f209Smrg
3757b4d38c65Smrg  if AC_TRY_EVAL(ac_compile); then
3758b4d38c65Smrg    # Now try to grab the symbols.
3759b4d38c65Smrg    nlist=conftest.nm
3760b4d38c65Smrg    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
3761b4d38c65Smrg      # Try sorting and uniquifying the output.
3762b4d38c65Smrg      if sort "$nlist" | uniq > "$nlist"T; then
3763b4d38c65Smrg	mv -f "$nlist"T "$nlist"
3764b4d38c65Smrg      else
3765b4d38c65Smrg	rm -f "$nlist"T
3766b4d38c65Smrg      fi
3767b534f209Smrg
3768b4d38c65Smrg      # Make sure that we snagged all the symbols we need.
3769b4d38c65Smrg      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
3770b4d38c65Smrg	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
3771b4d38c65Smrg	  cat <<_LT_EOF > conftest.$ac_ext
3772b4d38c65Smrg/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
3773b4d38c65Smrg#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
3774b4d38c65Smrg/* DATA imports from DLLs on WIN32 con't be const, because runtime
3775b4d38c65Smrg   relocations are performed -- see ld's documentation on pseudo-relocs.  */
3776b4d38c65Smrg# define LT@&t@_DLSYM_CONST
3777b4d38c65Smrg#elif defined(__osf__)
3778b4d38c65Smrg/* This system does not cope well with relocations in const data.  */
3779b4d38c65Smrg# define LT@&t@_DLSYM_CONST
3780b4d38c65Smrg#else
3781b4d38c65Smrg# define LT@&t@_DLSYM_CONST const
3782b4d38c65Smrg#endif
3783b534f209Smrg
3784b4d38c65Smrg#ifdef __cplusplus
3785b4d38c65Smrgextern "C" {
3786b4d38c65Smrg#endif
3787b534f209Smrg
3788b4d38c65Smrg_LT_EOF
3789b4d38c65Smrg	  # Now generate the symbol file.
3790b4d38c65Smrg	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
3791b534f209Smrg
3792b4d38c65Smrg	  cat <<_LT_EOF >> conftest.$ac_ext
3793b534f209Smrg
3794b4d38c65Smrg/* The mapping between symbol names and symbols.  */
3795b4d38c65SmrgLT@&t@_DLSYM_CONST struct {
3796b4d38c65Smrg  const char *name;
3797b4d38c65Smrg  void       *address;
3798b4d38c65Smrg}
3799b4d38c65Smrglt__PROGRAM__LTX_preloaded_symbols[[]] =
3800b4d38c65Smrg{
3801b4d38c65Smrg  { "@PROGRAM@", (void *) 0 },
3802b4d38c65Smrg_LT_EOF
3803b4d38c65Smrg	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
3804b4d38c65Smrg	  cat <<\_LT_EOF >> conftest.$ac_ext
3805b4d38c65Smrg  {0, (void *) 0}
3806b4d38c65Smrg};
3807b534f209Smrg
3808b4d38c65Smrg/* This works around a problem in FreeBSD linker */
3809b4d38c65Smrg#ifdef FREEBSD_WORKAROUND
3810b4d38c65Smrgstatic const void *lt_preloaded_setup() {
3811b4d38c65Smrg  return lt__PROGRAM__LTX_preloaded_symbols;
3812b4d38c65Smrg}
3813b4d38c65Smrg#endif
3814b534f209Smrg
3815b4d38c65Smrg#ifdef __cplusplus
3816b4d38c65Smrg}
3817b4d38c65Smrg#endif
3818b4d38c65Smrg_LT_EOF
3819b4d38c65Smrg	  # Now try linking the two files.
3820b4d38c65Smrg	  mv conftest.$ac_objext conftstm.$ac_objext
3821b4d38c65Smrg	  lt_globsym_save_LIBS=$LIBS
3822b4d38c65Smrg	  lt_globsym_save_CFLAGS=$CFLAGS
3823b4d38c65Smrg	  LIBS="conftstm.$ac_objext"
3824b4d38c65Smrg	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
3825b4d38c65Smrg	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
3826b4d38c65Smrg	    pipe_works=yes
3827b4d38c65Smrg	  fi
3828b4d38c65Smrg	  LIBS=$lt_globsym_save_LIBS
3829b4d38c65Smrg	  CFLAGS=$lt_globsym_save_CFLAGS
3830b4d38c65Smrg	else
3831b4d38c65Smrg	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
3832b4d38c65Smrg	fi
3833b4d38c65Smrg      else
3834b4d38c65Smrg	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
3835b4d38c65Smrg      fi
383615fb4814Smrg    else
3837b4d38c65Smrg      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
383815fb4814Smrg    fi
383915fb4814Smrg  else
3840b4d38c65Smrg    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
3841b4d38c65Smrg    cat conftest.$ac_ext >&5
384215fb4814Smrg  fi
3843b4d38c65Smrg  rm -rf conftest* conftst*
384415fb4814Smrg
3845b4d38c65Smrg  # Do not use the global_symbol_pipe unless it works.
3846b4d38c65Smrg  if test "$pipe_works" = yes; then
3847b4d38c65Smrg    break
3848b4d38c65Smrg  else
3849b4d38c65Smrg    lt_cv_sys_global_symbol_pipe=
3850b4d38c65Smrg  fi
3851b4d38c65Smrgdone
3852b4d38c65Smrg])
3853b4d38c65Smrgif test -z "$lt_cv_sys_global_symbol_pipe"; then
3854b4d38c65Smrg  lt_cv_sys_global_symbol_to_cdecl=
3855b4d38c65Smrgfi
3856b4d38c65Smrgif test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
3857b4d38c65Smrg  AC_MSG_RESULT(failed)
385815fb4814Smrgelse
3859b4d38c65Smrg  AC_MSG_RESULT(ok)
386015fb4814Smrgfi
386115fb4814Smrg
3862b4d38c65Smrg# Response file support.
3863b4d38c65Smrgif test "$lt_cv_nm_interface" = "MS dumpbin"; then
3864b4d38c65Smrg  nm_file_list_spec='@'
3865b4d38c65Smrgelif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
3866b4d38c65Smrg  nm_file_list_spec='@'
3867b4d38c65Smrgfi
386815fb4814Smrg
3869b4d38c65Smrg_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
3870b4d38c65Smrg    [Take the output of nm and produce a listing of raw symbols and C names])
3871b4d38c65Smrg_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
3872b4d38c65Smrg    [Transform the output of nm in a proper C declaration])
3873b4d38c65Smrg_LT_DECL([global_symbol_to_c_name_address],
3874b4d38c65Smrg    [lt_cv_sys_global_symbol_to_c_name_address], [1],
3875b4d38c65Smrg    [Transform the output of nm in a C name address pair])
3876b4d38c65Smrg_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
3877b4d38c65Smrg    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
3878b4d38c65Smrg    [Transform the output of nm in a C name address pair when lib prefix is needed])
3879b4d38c65Smrg_LT_DECL([], [nm_file_list_spec], [1],
3880b4d38c65Smrg    [Specify filename containing input files for $NM])
3881b4d38c65Smrg]) # _LT_CMD_GLOBAL_SYMBOLS
3882b4d38c65Smrg
3883b4d38c65Smrg
3884b4d38c65Smrg# _LT_COMPILER_PIC([TAGNAME])
3885b4d38c65Smrg# ---------------------------
3886b4d38c65Smrgm4_defun([_LT_COMPILER_PIC],
3887b4d38c65Smrg[m4_require([_LT_TAG_COMPILER])dnl
3888b4d38c65Smrg_LT_TAGVAR(lt_prog_compiler_wl, $1)=
3889b4d38c65Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=
3890b4d38c65Smrg_LT_TAGVAR(lt_prog_compiler_static, $1)=
389115fb4814Smrg
3892b4d38c65Smrgm4_if([$1], [CXX], [
3893b4d38c65Smrg  # C++ specific cases for pic, static, wl, etc.
3894b4d38c65Smrg  if test "$GXX" = yes; then
3895b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
3896b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
389715fb4814Smrg
3898b4d38c65Smrg    case $host_os in
3899b4d38c65Smrg    aix*)
3900b4d38c65Smrg      # All AIX code is PIC.
3901b534f209Smrg      if test "$host_cpu" = ia64; then
3902b4d38c65Smrg	# AIX 5 now supports IA64 processor
3903b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3904b410ddbeSmrg      fi
3905b4d38c65Smrg      ;;
3906b534f209Smrg
3907b4d38c65Smrg    amigaos*)
3908b4d38c65Smrg      case $host_cpu in
3909b4d38c65Smrg      powerpc)
3910b4d38c65Smrg            # see comment about AmigaOS4 .so support
3911b4d38c65Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3912b4d38c65Smrg        ;;
3913b4d38c65Smrg      m68k)
3914b4d38c65Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
3915b4d38c65Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
3916b4d38c65Smrg            # like `-m68040'.
3917b4d38c65Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
3918b4d38c65Smrg        ;;
3919b4d38c65Smrg      esac
3920b4d38c65Smrg      ;;
3921b534f209Smrg
3922b4d38c65Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
3923b4d38c65Smrg      # PIC is the default for these OSes.
3924b534f209Smrg      ;;
3925b4d38c65Smrg    mingw* | cygwin* | os2* | pw32* | cegcc*)
3926b4d38c65Smrg      # This hack is so that the source file can tell whether it is being
3927b4d38c65Smrg      # built for inclusion in a dll (and should export symbols for example).
3928b4d38c65Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
3929b4d38c65Smrg      # (--disable-auto-import) libraries
3930b4d38c65Smrg      m4_if([$1], [GCJ], [],
3931b4d38c65Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
3932b534f209Smrg      ;;
3933b4d38c65Smrg    darwin* | rhapsody*)
3934b4d38c65Smrg      # PIC is the default on this platform
3935b4d38c65Smrg      # Common symbols not allowed in MH_DYLIB files
3936b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
3937b4d38c65Smrg      ;;
3938b4d38c65Smrg    *djgpp*)
3939b4d38c65Smrg      # DJGPP does not support shared libraries at all
3940b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
3941b4d38c65Smrg      ;;
3942b4d38c65Smrg    haiku*)
3943b4d38c65Smrg      # PIC is the default for Haiku.
3944b4d38c65Smrg      # The "-static" flag exists, but is broken.
3945b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
3946b4d38c65Smrg      ;;
3947b4d38c65Smrg    interix[[3-9]]*)
3948b4d38c65Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
3949b4d38c65Smrg      # Instead, we relocate shared libraries at runtime.
3950b4d38c65Smrg      ;;
3951b4d38c65Smrg    sysv4*MP*)
3952b4d38c65Smrg      if test -d /usr/nec; then
3953b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
3954b534f209Smrg      fi
3955b534f209Smrg      ;;
3956b4d38c65Smrg    hpux*)
3957b4d38c65Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
3958b4d38c65Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
3959b4d38c65Smrg      # sets the default TLS model and affects inlining.
3960b534f209Smrg      case $host_cpu in
3961b4d38c65Smrg      hppa*64*)
3962b4d38c65Smrg	;;
3963b534f209Smrg      *)
3964b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3965b4d38c65Smrg	;;
3966b534f209Smrg      esac
3967b4d38c65Smrg      ;;
3968b4d38c65Smrg    *qnx* | *nto*)
3969b4d38c65Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
3970b4d38c65Smrg      # it will coredump.
3971b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
3972b534f209Smrg      ;;
3973b534f209Smrg    *)
3974b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
3975b534f209Smrg      ;;
3976b534f209Smrg    esac
3977b4d38c65Smrg  else
3978b4d38c65Smrg    case $host_os in
3979b4d38c65Smrg      aix[[4-9]]*)
3980b4d38c65Smrg	# All AIX code is PIC.
3981b4d38c65Smrg	if test "$host_cpu" = ia64; then
3982b4d38c65Smrg	  # AIX 5 now supports IA64 processor
3983b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
3984b4d38c65Smrg	else
3985b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
3986b4d38c65Smrg	fi
3987b534f209Smrg	;;
3988b4d38c65Smrg      chorus*)
3989b4d38c65Smrg	case $cc_basename in
3990b4d38c65Smrg	cxch68*)
3991b4d38c65Smrg	  # Green Hills C++ Compiler
3992b4d38c65Smrg	  # _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"
3993b534f209Smrg	  ;;
3994b534f209Smrg	esac
3995b534f209Smrg	;;
3996b4d38c65Smrg      mingw* | cygwin* | os2* | pw32* | cegcc*)
3997b4d38c65Smrg	# This hack is so that the source file can tell whether it is being
3998b4d38c65Smrg	# built for inclusion in a dll (and should export symbols for example).
3999b4d38c65Smrg	m4_if([$1], [GCJ], [],
4000b4d38c65Smrg	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4001b4d38c65Smrg	;;
4002b4d38c65Smrg      dgux*)
4003b4d38c65Smrg	case $cc_basename in
4004b4d38c65Smrg	  ec++*)
4005b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4006b4d38c65Smrg	    ;;
4007b4d38c65Smrg	  ghcx*)
4008b4d38c65Smrg	    # Green Hills C++ Compiler
4009b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4010b4d38c65Smrg	    ;;
4011b4d38c65Smrg	  *)
4012b4d38c65Smrg	    ;;
4013b4d38c65Smrg	esac
4014b4d38c65Smrg	;;
4015b4d38c65Smrg      freebsd* | dragonfly*)
4016b4d38c65Smrg	# FreeBSD uses GNU C++
4017b4d38c65Smrg	;;
4018b4d38c65Smrg      hpux9* | hpux10* | hpux11*)
4019b4d38c65Smrg	case $cc_basename in
4020b4d38c65Smrg	  CC*)
4021b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4022b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4023b4d38c65Smrg	    if test "$host_cpu" != ia64; then
4024b4d38c65Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4025b4d38c65Smrg	    fi
4026b4d38c65Smrg	    ;;
4027b4d38c65Smrg	  aCC*)
4028b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4029b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4030b410ddbeSmrg	    case $host_cpu in
4031b4d38c65Smrg	    hppa*64*|ia64*)
4032b4d38c65Smrg	      # +Z the default
4033b410ddbeSmrg	      ;;
4034b410ddbeSmrg	    *)
4035b4d38c65Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
4036b410ddbeSmrg	      ;;
4037b410ddbeSmrg	    esac
4038b4d38c65Smrg	    ;;
4039b4d38c65Smrg	  *)
4040b4d38c65Smrg	    ;;
4041b4d38c65Smrg	esac
404215fb4814Smrg	;;
4043b4d38c65Smrg      interix*)
4044b4d38c65Smrg	# This is c89, which is MS Visual C++ (no shared libs)
4045b4d38c65Smrg	# Anyone wants to do a port?
404615fb4814Smrg	;;
4047b4d38c65Smrg      irix5* | irix6* | nonstopux*)
4048b4d38c65Smrg	case $cc_basename in
4049b4d38c65Smrg	  CC*)
4050b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4051b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4052b4d38c65Smrg	    # CC pic flag -KPIC is the default.
4053b4d38c65Smrg	    ;;
4054b4d38c65Smrg	  *)
4055b4d38c65Smrg	    ;;
4056b4d38c65Smrg	esac
4057b534f209Smrg	;;
4058b4d38c65Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
4059b4d38c65Smrg	case $cc_basename in
4060b4d38c65Smrg	  KCC*)
4061b4d38c65Smrg	    # KAI C++ Compiler
4062b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4063b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4064b4d38c65Smrg	    ;;
4065b4d38c65Smrg	  ecpc* )
4066b4d38c65Smrg	    # old Intel C++ for x86_64 which still supported -KPIC.
4067b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4068b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4069b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4070b4d38c65Smrg	    ;;
4071b4d38c65Smrg	  icpc* )
4072b4d38c65Smrg	    # Intel C++, used to be incompatible with GCC.
4073b4d38c65Smrg	    # ICC 10 doesn't accept -KPIC any more.
4074b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4075b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4076b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4077b4d38c65Smrg	    ;;
4078b4d38c65Smrg	  pgCC* | pgcpp*)
4079b4d38c65Smrg	    # Portland Group C++ compiler
4080b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4081b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4082b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4083b4d38c65Smrg	    ;;
4084b4d38c65Smrg	  cxx*)
4085b4d38c65Smrg	    # Compaq C++
4086b4d38c65Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4087b4d38c65Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4088b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4089b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4090b4d38c65Smrg	    ;;
4091b4d38c65Smrg	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
4092b4d38c65Smrg	    # IBM XL 8.0, 9.0 on PPC and BlueGene
4093b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4094b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4095b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
4096b4d38c65Smrg	    ;;
4097b4d38c65Smrg	  *)
4098b4d38c65Smrg	    case `$CC -V 2>&1 | sed 5q` in
4099b4d38c65Smrg	    *Sun\ C*)
4100b4d38c65Smrg	      # Sun C++ 5.9
4101b4d38c65Smrg	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4102b4d38c65Smrg	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4103b4d38c65Smrg	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4104b4d38c65Smrg	      ;;
4105b4d38c65Smrg	    esac
4106b4d38c65Smrg	    ;;
4107b4d38c65Smrg	esac
4108b534f209Smrg	;;
4109b4d38c65Smrg      lynxos*)
4110b4d38c65Smrg	;;
4111b4d38c65Smrg      m88k*)
4112b4d38c65Smrg	;;
4113b4d38c65Smrg      mvs*)
4114b4d38c65Smrg	case $cc_basename in
4115b4d38c65Smrg	  cxx*)
4116b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
4117b4d38c65Smrg	    ;;
4118b4d38c65Smrg	  *)
4119b4d38c65Smrg	    ;;
4120b410ddbeSmrg	esac
412115fb4814Smrg	;;
4122b4d38c65Smrg      netbsd*)
4123b534f209Smrg	;;
4124b4d38c65Smrg      *qnx* | *nto*)
4125b4d38c65Smrg        # QNX uses GNU C++, but need to define -shared option too, otherwise
4126b4d38c65Smrg        # it will coredump.
4127b4d38c65Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4128b4d38c65Smrg        ;;
4129b4d38c65Smrg      osf3* | osf4* | osf5*)
4130b4d38c65Smrg	case $cc_basename in
4131b4d38c65Smrg	  KCC*)
4132b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
4133b4d38c65Smrg	    ;;
4134b4d38c65Smrg	  RCC*)
4135b4d38c65Smrg	    # Rational C++ 2.4.1
4136b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4137b4d38c65Smrg	    ;;
4138b4d38c65Smrg	  cxx*)
4139b4d38c65Smrg	    # Digital/Compaq C++
4140b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4141b4d38c65Smrg	    # Make sure the PIC flag is empty.  It appears that all Alpha
4142b4d38c65Smrg	    # Linux and Compaq Tru64 Unix objects are PIC.
4143b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4144b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4145b4d38c65Smrg	    ;;
4146b4d38c65Smrg	  *)
4147b4d38c65Smrg	    ;;
4148b410ddbeSmrg	esac
414915fb4814Smrg	;;
4150b4d38c65Smrg      psos*)
415115fb4814Smrg	;;
4152b4d38c65Smrg      solaris*)
4153b4d38c65Smrg	case $cc_basename in
4154b4d38c65Smrg	  CC* | sunCC*)
4155b4d38c65Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
4156b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4157b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4158b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4159b4d38c65Smrg	    ;;
4160b4d38c65Smrg	  gcx*)
4161b4d38c65Smrg	    # Green Hills C++ Compiler
4162b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4163b4d38c65Smrg	    ;;
4164b4d38c65Smrg	  *)
4165b4d38c65Smrg	    ;;
4166b4d38c65Smrg	esac
416715fb4814Smrg	;;
4168b4d38c65Smrg      sunos4*)
4169b4d38c65Smrg	case $cc_basename in
4170b4d38c65Smrg	  CC*)
4171b4d38c65Smrg	    # Sun C++ 4.x
4172b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4173b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4174b4d38c65Smrg	    ;;
4175b4d38c65Smrg	  lcc*)
4176b4d38c65Smrg	    # Lucid
4177b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4178b4d38c65Smrg	    ;;
4179b4d38c65Smrg	  *)
4180b4d38c65Smrg	    ;;
4181b4d38c65Smrg	esac
4182b4d38c65Smrg	;;
4183b4d38c65Smrg      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4184b4d38c65Smrg	case $cc_basename in
4185b4d38c65Smrg	  CC*)
4186b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4187b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4188b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4189b4d38c65Smrg	    ;;
4190b4d38c65Smrg	esac
419115fb4814Smrg	;;
4192b4d38c65Smrg      tandem*)
4193b4d38c65Smrg	case $cc_basename in
4194b4d38c65Smrg	  NCC*)
4195b4d38c65Smrg	    # NonStop-UX NCC 3.20
4196b4d38c65Smrg	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4197b4d38c65Smrg	    ;;
4198b4d38c65Smrg	  *)
4199b4d38c65Smrg	    ;;
4200b4d38c65Smrg	esac
420115fb4814Smrg	;;
4202b4d38c65Smrg      vxworks*)
420315fb4814Smrg	;;
4204b534f209Smrg      *)
4205b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
420615fb4814Smrg	;;
4207b534f209Smrg    esac
4208b4d38c65Smrg  fi
4209b4d38c65Smrg],
4210b4d38c65Smrg[
4211b4d38c65Smrg  if test "$GCC" = yes; then
4212b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4213b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4214b4d38c65Smrg
4215b4d38c65Smrg    case $host_os in
4216b4d38c65Smrg      aix*)
4217b4d38c65Smrg      # All AIX code is PIC.
4218b4d38c65Smrg      if test "$host_cpu" = ia64; then
4219b4d38c65Smrg	# AIX 5 now supports IA64 processor
4220b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4221b4d38c65Smrg      fi
4222b4d38c65Smrg      ;;
4223b534f209Smrg
4224b4d38c65Smrg    amigaos*)
4225b4d38c65Smrg      case $host_cpu in
4226b4d38c65Smrg      powerpc)
4227b4d38c65Smrg            # see comment about AmigaOS4 .so support
4228b4d38c65Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4229b4d38c65Smrg        ;;
4230b4d38c65Smrg      m68k)
4231b4d38c65Smrg            # FIXME: we need at least 68020 code to build shared libraries, but
4232b4d38c65Smrg            # adding the `-m68020' flag to GCC prevents building anything better,
4233b4d38c65Smrg            # like `-m68040'.
4234b4d38c65Smrg            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
4235b4d38c65Smrg        ;;
4236b4d38c65Smrg      esac
4237b4d38c65Smrg      ;;
4238b534f209Smrg
4239b4d38c65Smrg    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
4240b4d38c65Smrg      # PIC is the default for these OSes.
4241b4d38c65Smrg      ;;
4242b534f209Smrg
4243b4d38c65Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4244b4d38c65Smrg      # This hack is so that the source file can tell whether it is being
4245b4d38c65Smrg      # built for inclusion in a dll (and should export symbols for example).
4246b4d38c65Smrg      # Although the cygwin gcc ignores -fPIC, still need this for old-style
4247b4d38c65Smrg      # (--disable-auto-import) libraries
4248b4d38c65Smrg      m4_if([$1], [GCJ], [],
4249b4d38c65Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4250b4d38c65Smrg      ;;
4251b534f209Smrg
4252b4d38c65Smrg    darwin* | rhapsody*)
4253b4d38c65Smrg      # PIC is the default on this platform
4254b4d38c65Smrg      # Common symbols not allowed in MH_DYLIB files
4255b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
4256b4d38c65Smrg      ;;
4257b534f209Smrg
4258b4d38c65Smrg    haiku*)
4259b4d38c65Smrg      # PIC is the default for Haiku.
4260b4d38c65Smrg      # The "-static" flag exists, but is broken.
4261b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)=
4262b4d38c65Smrg      ;;
4263b534f209Smrg
4264b4d38c65Smrg    hpux*)
4265b4d38c65Smrg      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
4266b4d38c65Smrg      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
4267b4d38c65Smrg      # sets the default TLS model and affects inlining.
4268b4d38c65Smrg      case $host_cpu in
4269b4d38c65Smrg      hppa*64*)
4270b4d38c65Smrg	# +Z the default
427115fb4814Smrg	;;
427215fb4814Smrg      *)
4273b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4274b410ddbeSmrg	;;
4275b4d38c65Smrg      esac
4276b4d38c65Smrg      ;;
4277b410ddbeSmrg
4278b4d38c65Smrg    interix[[3-9]]*)
4279b4d38c65Smrg      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
4280b4d38c65Smrg      # Instead, we relocate shared libraries at runtime.
4281b4d38c65Smrg      ;;
4282b410ddbeSmrg
4283b4d38c65Smrg    msdosdjgpp*)
4284b4d38c65Smrg      # Just because we use GCC doesn't mean we suddenly get shared libraries
4285b4d38c65Smrg      # on systems that don't support them.
4286b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4287b4d38c65Smrg      enable_shared=no
4288b4d38c65Smrg      ;;
4289b410ddbeSmrg
4290b4d38c65Smrg    *nto* | *qnx*)
4291b4d38c65Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4292b4d38c65Smrg      # it will coredump.
4293b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4294b4d38c65Smrg      ;;
4295b410ddbeSmrg
4296b4d38c65Smrg    sysv4*MP*)
4297b4d38c65Smrg      if test -d /usr/nec; then
4298b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
4299b4d38c65Smrg      fi
4300b4d38c65Smrg      ;;
4301b410ddbeSmrg
4302b4d38c65Smrg    *)
4303b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4304b4d38c65Smrg      ;;
430515fb4814Smrg    esac
4306b534f209Smrg
4307b534f209Smrg    case $cc_basename in
4308b4d38c65Smrg    nvcc*) # Cuda Compiler Driver 2.2
4309b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
4310cf503b78Smrg      if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4311cf503b78Smrg        _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
4312cf503b78Smrg      fi
4313b4d38c65Smrg      ;;
4314b4d38c65Smrg    esac
4315b4d38c65Smrg  else
4316b4d38c65Smrg    # PORTME Check for flag to pass linker flags through the system compiler.
4317b4d38c65Smrg    case $host_os in
4318b4d38c65Smrg    aix*)
4319b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4320b4d38c65Smrg      if test "$host_cpu" = ia64; then
4321b4d38c65Smrg	# AIX 5 now supports IA64 processor
4322b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4323b4d38c65Smrg      else
4324b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
4325b4d38c65Smrg      fi
4326b4d38c65Smrg      ;;
4327b4d38c65Smrg
4328b4d38c65Smrg    mingw* | cygwin* | pw32* | os2* | cegcc*)
4329b4d38c65Smrg      # This hack is so that the source file can tell whether it is being
4330b4d38c65Smrg      # built for inclusion in a dll (and should export symbols for example).
4331b4d38c65Smrg      m4_if([$1], [GCJ], [],
4332b4d38c65Smrg	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
4333b4d38c65Smrg      ;;
4334b4d38c65Smrg
4335b4d38c65Smrg    hpux9* | hpux10* | hpux11*)
4336b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4337b4d38c65Smrg      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
4338b4d38c65Smrg      # not for PA HP-UX.
4339b4d38c65Smrg      case $host_cpu in
4340b4d38c65Smrg      hppa*64*|ia64*)
4341b4d38c65Smrg	# +Z the default
434215fb4814Smrg	;;
434315fb4814Smrg      *)
4344b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
434515fb4814Smrg	;;
4346b4d38c65Smrg      esac
4347b4d38c65Smrg      # Is there a better lt_prog_compiler_static that works with the bundled CC?
4348b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
4349b4d38c65Smrg      ;;
4350b534f209Smrg
4351b4d38c65Smrg    irix5* | irix6* | nonstopux*)
4352b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4353b4d38c65Smrg      # PIC (with -KPIC) is the default.
4354b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4355b4d38c65Smrg      ;;
4356b4d38c65Smrg
4357b4d38c65Smrg    linux* | k*bsd*-gnu | kopensolaris*-gnu)
4358b4d38c65Smrg      case $cc_basename in
4359b4d38c65Smrg      # old Intel for x86_64 which still supported -KPIC.
4360b4d38c65Smrg      ecc*)
4361b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4362b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4363b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4364b4d38c65Smrg        ;;
4365b4d38c65Smrg      # icc used to be incompatible with GCC.
4366b4d38c65Smrg      # ICC 10 doesn't accept -KPIC any more.
4367b4d38c65Smrg      icc* | ifort*)
4368b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4369b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4370b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4371b4d38c65Smrg        ;;
4372b4d38c65Smrg      # Lahey Fortran 8.1.
4373b4d38c65Smrg      lf95*)
4374b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4375b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
4376b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
4377b410ddbeSmrg	;;
4378b4d38c65Smrg      nagfor*)
4379b4d38c65Smrg	# NAG Fortran compiler
4380b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
4381b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4382b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4383b534f209Smrg	;;
4384b4d38c65Smrg      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
4385b4d38c65Smrg        # Portland Group compilers (*not* the Pentium gcc compiler,
4386b4d38c65Smrg	# which looks to be a dead project)
4387b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4388b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4389b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4390b4d38c65Smrg        ;;
4391b4d38c65Smrg      ccc*)
4392b4d38c65Smrg        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4393b4d38c65Smrg        # All Alpha code is PIC.
4394b4d38c65Smrg        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4395b4d38c65Smrg        ;;
4396b4d38c65Smrg      xl* | bgxl* | bgf* | mpixl*)
4397b4d38c65Smrg	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
4398b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4399b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
4400b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
440115fb4814Smrg	;;
440215fb4814Smrg      *)
4403b4d38c65Smrg	case `$CC -V 2>&1 | sed 5q` in
4404cf503b78Smrg	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
4405b4d38c65Smrg	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
4406b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4407b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4408b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
4409b4d38c65Smrg	  ;;
4410cf503b78Smrg	*Sun\ F* | *Sun*Fortran*)
4411cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4412cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4413cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4414cf503b78Smrg	  ;;
4415b4d38c65Smrg	*Sun\ C*)
4416b4d38c65Smrg	  # Sun C 5.9
4417b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4418b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4419b4d38c65Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4420b4d38c65Smrg	  ;;
4421cf503b78Smrg        *Intel*\ [[CF]]*Compiler*)
4422cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4423cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
4424cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
4425cf503b78Smrg	  ;;
4426cf503b78Smrg	*Portland\ Group*)
4427cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4428cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
4429cf503b78Smrg	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4430cf503b78Smrg	  ;;
4431b4d38c65Smrg	esac
443215fb4814Smrg	;;
4433b4d38c65Smrg      esac
4434b4d38c65Smrg      ;;
443515fb4814Smrg
4436b4d38c65Smrg    newsos6)
4437b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4438b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4439b4d38c65Smrg      ;;
444015fb4814Smrg
4441b4d38c65Smrg    *nto* | *qnx*)
4442b4d38c65Smrg      # QNX uses GNU C++, but need to define -shared option too, otherwise
4443b4d38c65Smrg      # it will coredump.
4444b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
4445b4d38c65Smrg      ;;
444615fb4814Smrg
4447b4d38c65Smrg    osf3* | osf4* | osf5*)
4448b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4449b4d38c65Smrg      # All OSF/1 code is PIC.
4450b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4451b4d38c65Smrg      ;;
445215fb4814Smrg
4453b4d38c65Smrg    rdos*)
4454b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
4455b4d38c65Smrg      ;;
445615fb4814Smrg
4457b4d38c65Smrg    solaris*)
4458b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4459b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4460b4d38c65Smrg      case $cc_basename in
4461b4d38c65Smrg      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
4462b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
4463b4d38c65Smrg      *)
4464b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
4465b4d38c65Smrg      esac
4466b4d38c65Smrg      ;;
446715fb4814Smrg
4468b4d38c65Smrg    sunos4*)
4469b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
4470b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
4471b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4472b4d38c65Smrg      ;;
447315fb4814Smrg
4474b4d38c65Smrg    sysv4 | sysv4.2uw2* | sysv4.3*)
4475b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4476b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4477b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4478b4d38c65Smrg      ;;
447915fb4814Smrg
4480b4d38c65Smrg    sysv4*MP*)
4481b4d38c65Smrg      if test -d /usr/nec ;then
4482b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
4483b4d38c65Smrg	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4484b4d38c65Smrg      fi
4485b4d38c65Smrg      ;;
448615fb4814Smrg
4487b4d38c65Smrg    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
4488b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4489b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
4490b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4491b4d38c65Smrg      ;;
449215fb4814Smrg
4493b4d38c65Smrg    unicos*)
4494b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
4495b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4496b4d38c65Smrg      ;;
449715fb4814Smrg
4498b4d38c65Smrg    uts4*)
4499b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
4500b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
4501b4d38c65Smrg      ;;
450215fb4814Smrg
4503b4d38c65Smrg    *)
4504b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
4505b4d38c65Smrg      ;;
450615fb4814Smrg    esac
4507b4d38c65Smrg  fi
4508b4d38c65Smrg])
4509b4d38c65Smrgcase $host_os in
4510b4d38c65Smrg  # For platforms which do not support PIC, -DPIC is meaningless:
4511b4d38c65Smrg  *djgpp*)
4512b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
4513b4d38c65Smrg    ;;
4514b4d38c65Smrg  *)
4515b4d38c65Smrg    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
4516b4d38c65Smrg    ;;
4517b4d38c65Smrgesac
451815fb4814Smrg
4519b4d38c65SmrgAC_CACHE_CHECK([for $compiler option to produce PIC],
4520b4d38c65Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
4521b4d38c65Smrg  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
4522b4d38c65Smrg_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
4523b4d38c65Smrg
4524b4d38c65Smrg#
4525b4d38c65Smrg# Check to make sure the PIC flag actually works.
4526b4d38c65Smrg#
4527b4d38c65Smrgif test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
4528b4d38c65Smrg  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
4529b4d38c65Smrg    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
4530b4d38c65Smrg    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
4531b4d38c65Smrg    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
4532b4d38c65Smrg     "" | " "*) ;;
4533b4d38c65Smrg     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
4534b4d38c65Smrg     esac],
4535b4d38c65Smrg    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
4536b4d38c65Smrg     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
453715fb4814Smrgfi
4538b4d38c65Smrg_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
4539b4d38c65Smrg	[Additional compiler flags for building library objects])
454015fb4814Smrg
4541b4d38c65Smrg_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
4542b4d38c65Smrg	[How to pass a linker flag through the compiler])
4543b4d38c65Smrg#
4544b4d38c65Smrg# Check to make sure the static flag actually works.
4545b4d38c65Smrg#
4546b4d38c65Smrgwl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
4547b4d38c65Smrg_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
4548b4d38c65Smrg  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
4549b4d38c65Smrg  $lt_tmp_static_flag,
4550b4d38c65Smrg  [],
4551b4d38c65Smrg  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
4552b4d38c65Smrg_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
4553b4d38c65Smrg	[Compiler flag to prevent dynamic linking])
4554b4d38c65Smrg])# _LT_COMPILER_PIC
455583cab373Smrg
455615fb4814Smrg
4557b4d38c65Smrg# _LT_LINKER_SHLIBS([TAGNAME])
4558b4d38c65Smrg# ----------------------------
4559b4d38c65Smrg# See if the linker supports building shared libraries.
4560b4d38c65Smrgm4_defun([_LT_LINKER_SHLIBS],
4561b4d38c65Smrg[AC_REQUIRE([LT_PATH_LD])dnl
4562b4d38c65SmrgAC_REQUIRE([LT_PATH_NM])dnl
4563b4d38c65Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
4564b4d38c65Smrgm4_require([_LT_FILEUTILS_DEFAULTS])dnl
4565b4d38c65Smrgm4_require([_LT_DECL_EGREP])dnl
4566b4d38c65Smrgm4_require([_LT_DECL_SED])dnl
4567b4d38c65Smrgm4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
4568b4d38c65Smrgm4_require([_LT_TAG_COMPILER])dnl
4569b4d38c65SmrgAC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
4570b4d38c65Smrgm4_if([$1], [CXX], [
4571b4d38c65Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4572b4d38c65Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4573b4d38c65Smrg  case $host_os in
4574b4d38c65Smrg  aix[[4-9]]*)
4575b4d38c65Smrg    # If we're using GNU nm, then we don't want the "-C" option.
4576b4d38c65Smrg    # -C means demangle to AIX nm, but means don't demangle with GNU nm
4577b4d38c65Smrg    # Also, AIX nm treats weak defined symbols like other global defined
4578b4d38c65Smrg    # symbols, whereas GNU nm marks them as "W".
4579b4d38c65Smrg    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4580b4d38c65Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4581b4d38c65Smrg    else
4582b4d38c65Smrg      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4583de78e416Smrg    fi
4584de78e416Smrg    ;;
4585b4d38c65Smrg  pw32*)
4586b4d38c65Smrg    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
4587b4d38c65Smrg    ;;
4588b4d38c65Smrg  cygwin* | mingw* | cegcc*)
4589b4d38c65Smrg    case $cc_basename in
4590cf503b78Smrg    cl*)
4591cf503b78Smrg      _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
4592cf503b78Smrg      ;;
4593b4d38c65Smrg    *)
4594b4d38c65Smrg      _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'
4595b4d38c65Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4596b534f209Smrg      ;;
4597b534f209Smrg    esac
4598b4d38c65Smrg    ;;
4599b4d38c65Smrg  *)
4600b4d38c65Smrg    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4601b4d38c65Smrg    ;;
4602b4d38c65Smrg  esac
4603b4d38c65Smrg], [
4604b4d38c65Smrg  runpath_var=
4605b4d38c65Smrg  _LT_TAGVAR(allow_undefined_flag, $1)=
4606b4d38c65Smrg  _LT_TAGVAR(always_export_symbols, $1)=no
4607b4d38c65Smrg  _LT_TAGVAR(archive_cmds, $1)=
4608b4d38c65Smrg  _LT_TAGVAR(archive_expsym_cmds, $1)=
4609b4d38c65Smrg  _LT_TAGVAR(compiler_needs_object, $1)=no
4610b4d38c65Smrg  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
4611b4d38c65Smrg  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4612b4d38c65Smrg  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
4613b4d38c65Smrg  _LT_TAGVAR(hardcode_automatic, $1)=no
4614b4d38c65Smrg  _LT_TAGVAR(hardcode_direct, $1)=no
4615b4d38c65Smrg  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
4616b4d38c65Smrg  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4617b4d38c65Smrg  _LT_TAGVAR(hardcode_libdir_separator, $1)=
4618b4d38c65Smrg  _LT_TAGVAR(hardcode_minus_L, $1)=no
4619b4d38c65Smrg  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
4620b4d38c65Smrg  _LT_TAGVAR(inherit_rpath, $1)=no
4621b4d38c65Smrg  _LT_TAGVAR(link_all_deplibs, $1)=unknown
4622b4d38c65Smrg  _LT_TAGVAR(module_cmds, $1)=
4623b4d38c65Smrg  _LT_TAGVAR(module_expsym_cmds, $1)=
4624b4d38c65Smrg  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
4625b4d38c65Smrg  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
4626b4d38c65Smrg  _LT_TAGVAR(thread_safe_flag_spec, $1)=
4627b4d38c65Smrg  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4628b4d38c65Smrg  # include_expsyms should be a list of space-separated symbols to be *always*
4629b4d38c65Smrg  # included in the symbol list
4630b4d38c65Smrg  _LT_TAGVAR(include_expsyms, $1)=
4631b4d38c65Smrg  # exclude_expsyms can be an extended regexp of symbols to exclude
4632b4d38c65Smrg  # it will be wrapped by ` (' and `)$', so one must not match beginning or
4633b4d38c65Smrg  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
4634b4d38c65Smrg  # as well as any symbol that contains `d'.
4635b4d38c65Smrg  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
4636b4d38c65Smrg  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
4637b4d38c65Smrg  # platforms (ab)use it in PIC code, but their linkers get confused if
4638b4d38c65Smrg  # the symbol is explicitly referenced.  Since portable code cannot
4639b4d38c65Smrg  # rely on this symbol name, it's probably fine to never include it in
4640b4d38c65Smrg  # preloaded symbol tables.
4641b4d38c65Smrg  # Exclude shared library initialization/finalization symbols.
4642b4d38c65Smrgdnl Note also adjust exclude_expsyms for C++ above.
4643b4d38c65Smrg  extract_expsyms_cmds=
4644b534f209Smrg
4645b4d38c65Smrg  case $host_os in
4646b4d38c65Smrg  cygwin* | mingw* | pw32* | cegcc*)
4647b4d38c65Smrg    # FIXME: the MSVC++ port hasn't been tested in a loooong time
4648b4d38c65Smrg    # When not using gcc, we currently assume that we are using
4649b4d38c65Smrg    # Microsoft Visual C++.
4650b4d38c65Smrg    if test "$GCC" != yes; then
4651b4d38c65Smrg      with_gnu_ld=no
4652de78e416Smrg    fi
465315fb4814Smrg    ;;
4654b4d38c65Smrg  interix*)
4655b4d38c65Smrg    # we just hope/assume this is gcc and not c89 (= MSVC++)
4656b4d38c65Smrg    with_gnu_ld=yes
4657b4d38c65Smrg    ;;
4658b4d38c65Smrg  openbsd*)
4659b4d38c65Smrg    with_gnu_ld=no
4660b4d38c65Smrg    ;;
466115fb4814Smrg  esac
466215fb4814Smrg
4663b4d38c65Smrg  _LT_TAGVAR(ld_shlibs, $1)=yes
466415fb4814Smrg
4665b4d38c65Smrg  # On some targets, GNU ld is compatible enough with the native linker
4666b4d38c65Smrg  # that we're better off using the native interface for both.
4667b4d38c65Smrg  lt_use_gnu_ld_interface=no
4668b4d38c65Smrg  if test "$with_gnu_ld" = yes; then
4669b4d38c65Smrg    case $host_os in
4670b4d38c65Smrg      aix*)
4671b4d38c65Smrg	# The AIX port of GNU ld has always aspired to compatibility
4672b4d38c65Smrg	# with the native linker.  However, as the warning in the GNU ld
4673b4d38c65Smrg	# block says, versions before 2.19.5* couldn't really create working
4674b4d38c65Smrg	# shared libraries, regardless of the interface used.
4675b4d38c65Smrg	case `$LD -v 2>&1` in
4676b4d38c65Smrg	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
4677b4d38c65Smrg	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
4678b4d38c65Smrg	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
4679b4d38c65Smrg	  *)
4680b4d38c65Smrg	    lt_use_gnu_ld_interface=yes
4681b4d38c65Smrg	    ;;
4682b4d38c65Smrg	esac
4683b4d38c65Smrg	;;
4684b4d38c65Smrg      *)
4685b4d38c65Smrg	lt_use_gnu_ld_interface=yes
4686b4d38c65Smrg	;;
4687b4d38c65Smrg    esac
4688b4d38c65Smrg  fi
468915fb4814Smrg
4690b4d38c65Smrg  if test "$lt_use_gnu_ld_interface" = yes; then
4691b4d38c65Smrg    # If archive_cmds runs LD, not CC, wlarc should be empty
4692b4d38c65Smrg    wlarc='${wl}'
469315fb4814Smrg
4694b4d38c65Smrg    # Set some defaults for GNU ld with shared library support. These
4695b4d38c65Smrg    # are reset later if shared libraries are not supported. Putting them
4696b4d38c65Smrg    # here allows them to be overridden if necessary.
4697b4d38c65Smrg    runpath_var=LD_RUN_PATH
4698b4d38c65Smrg    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4699b4d38c65Smrg    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
4700b4d38c65Smrg    # ancient GNU ld didn't support --whole-archive et. al.
4701b4d38c65Smrg    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
4702b4d38c65Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
4703b4d38c65Smrg    else
4704b4d38c65Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4705b4d38c65Smrg    fi
4706b4d38c65Smrg    supports_anon_versioning=no
4707b4d38c65Smrg    case `$LD -v 2>&1` in
4708b4d38c65Smrg      *GNU\ gold*) supports_anon_versioning=yes ;;
4709b4d38c65Smrg      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
4710b4d38c65Smrg      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
4711b4d38c65Smrg      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
4712b4d38c65Smrg      *\ 2.11.*) ;; # other 2.11 versions
4713b4d38c65Smrg      *) supports_anon_versioning=yes ;;
4714b4d38c65Smrg    esac
471515fb4814Smrg
4716b4d38c65Smrg    # See if GNU ld supports shared libraries.
4717b4d38c65Smrg    case $host_os in
4718b4d38c65Smrg    aix[[3-9]]*)
4719b4d38c65Smrg      # On AIX/PPC, the GNU linker is very broken
4720b4d38c65Smrg      if test "$host_cpu" != ia64; then
4721b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4722b4d38c65Smrg	cat <<_LT_EOF 1>&2
472315fb4814Smrg
4724b4d38c65Smrg*** Warning: the GNU linker, at least up to release 2.19, is reported
4725b4d38c65Smrg*** to be unable to reliably create shared libraries on AIX.
4726b4d38c65Smrg*** Therefore, libtool is disabling shared libraries support.  If you
4727b4d38c65Smrg*** really care for shared libraries, you may want to install binutils
4728b4d38c65Smrg*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
4729b4d38c65Smrg*** You will then need to restart the configuration process.
473015fb4814Smrg
4731b4d38c65Smrg_LT_EOF
4732b4d38c65Smrg      fi
4733b4d38c65Smrg      ;;
473415fb4814Smrg
4735b4d38c65Smrg    amigaos*)
4736b4d38c65Smrg      case $host_cpu in
4737b4d38c65Smrg      powerpc)
4738b4d38c65Smrg            # see comment about AmigaOS4 .so support
4739b4d38c65Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4740b4d38c65Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
4741b4d38c65Smrg        ;;
4742b4d38c65Smrg      m68k)
4743b4d38c65Smrg            _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)'
4744b4d38c65Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4745b4d38c65Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
4746b4d38c65Smrg        ;;
4747b4d38c65Smrg      esac
4748b4d38c65Smrg      ;;
474915fb4814Smrg
4750b4d38c65Smrg    beos*)
4751b4d38c65Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4752b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4753b4d38c65Smrg	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
4754b4d38c65Smrg	# support --undefined.  This deserves some investigation.  FIXME
4755b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4756b4d38c65Smrg      else
4757b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4758b4d38c65Smrg      fi
4759b4d38c65Smrg      ;;
476015fb4814Smrg
4761b4d38c65Smrg    cygwin* | mingw* | pw32* | cegcc*)
4762b4d38c65Smrg      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
4763b4d38c65Smrg      # as there is no search path for DLLs.
4764b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
4765b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
4766b4d38c65Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4767b4d38c65Smrg      _LT_TAGVAR(always_export_symbols, $1)=no
4768b4d38c65Smrg      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
4769b4d38c65Smrg      _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'
4770b4d38c65Smrg      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
4771b4d38c65Smrg
4772b4d38c65Smrg      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
4773b4d38c65Smrg        _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'
4774b4d38c65Smrg	# If the export-symbols file already is a .def file (1st line
4775b4d38c65Smrg	# is EXPORTS), use it as is; otherwise, prepend...
4776b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
4777b4d38c65Smrg	  cp $export_symbols $output_objdir/$soname.def;
4778b4d38c65Smrg	else
4779b4d38c65Smrg	  echo EXPORTS > $output_objdir/$soname.def;
4780b4d38c65Smrg	  cat $export_symbols >> $output_objdir/$soname.def;
4781b4d38c65Smrg	fi~
4782b4d38c65Smrg	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
4783b4d38c65Smrg      else
4784b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4785b4d38c65Smrg      fi
4786b4d38c65Smrg      ;;
478715fb4814Smrg
4788b4d38c65Smrg    haiku*)
4789b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4790b4d38c65Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
4791b4d38c65Smrg      ;;
479215fb4814Smrg
4793b4d38c65Smrg    interix[[3-9]]*)
4794b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=no
4795b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4796b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
4797b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
4798b4d38c65Smrg      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
4799b4d38c65Smrg      # Instead, shared libraries are loaded at an image base (0x10000000 by
4800b4d38c65Smrg      # default) and relocated if they conflict, which is a slow very memory
4801b4d38c65Smrg      # consuming and fragmenting process.  To avoid this, we pick a random,
4802b4d38c65Smrg      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
4803b4d38c65Smrg      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
4804b4d38c65Smrg      _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'
4805b4d38c65Smrg      _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'
4806b4d38c65Smrg      ;;
480715fb4814Smrg
4808b4d38c65Smrg    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
4809b4d38c65Smrg      tmp_diet=no
4810b4d38c65Smrg      if test "$host_os" = linux-dietlibc; then
4811b4d38c65Smrg	case $cc_basename in
4812b4d38c65Smrg	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
4813b4d38c65Smrg	esac
4814b4d38c65Smrg      fi
4815b4d38c65Smrg      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
4816b4d38c65Smrg	 && test "$tmp_diet" = no
4817b4d38c65Smrg      then
4818b4d38c65Smrg	tmp_addflag=' $pic_flag'
4819b4d38c65Smrg	tmp_sharedflag='-shared'
4820b4d38c65Smrg	case $cc_basename,$host_cpu in
4821b4d38c65Smrg        pgcc*)				# Portland Group C compiler
4822b4d38c65Smrg	  _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'
4823b4d38c65Smrg	  tmp_addflag=' $pic_flag'
4824b4d38c65Smrg	  ;;
4825b4d38c65Smrg	pgf77* | pgf90* | pgf95* | pgfortran*)
4826b4d38c65Smrg					# Portland Group f77 and f90 compilers
4827b4d38c65Smrg	  _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'
4828b4d38c65Smrg	  tmp_addflag=' $pic_flag -Mnomain' ;;
4829b4d38c65Smrg	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
4830b4d38c65Smrg	  tmp_addflag=' -i_dynamic' ;;
4831b4d38c65Smrg	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
4832b4d38c65Smrg	  tmp_addflag=' -i_dynamic -nofor_main' ;;
4833b4d38c65Smrg	ifc* | ifort*)			# Intel Fortran compiler
4834b4d38c65Smrg	  tmp_addflag=' -nofor_main' ;;
4835b4d38c65Smrg	lf95*)				# Lahey Fortran 8.1
4836b4d38c65Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
4837b4d38c65Smrg	  tmp_sharedflag='--shared' ;;
4838b4d38c65Smrg	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
4839b4d38c65Smrg	  tmp_sharedflag='-qmkshrobj'
4840b4d38c65Smrg	  tmp_addflag= ;;
4841b4d38c65Smrg	nvcc*)	# Cuda Compiler Driver 2.2
4842b4d38c65Smrg	  _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'
4843b4d38c65Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4844b4d38c65Smrg	  ;;
4845b4d38c65Smrg	esac
4846b4d38c65Smrg	case `$CC -V 2>&1 | sed 5q` in
4847b4d38c65Smrg	*Sun\ C*)			# Sun C 5.9
4848b4d38c65Smrg	  _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'
4849b4d38c65Smrg	  _LT_TAGVAR(compiler_needs_object, $1)=yes
4850b4d38c65Smrg	  tmp_sharedflag='-G' ;;
4851b4d38c65Smrg	*Sun\ F*)			# Sun Fortran 8.3
4852b4d38c65Smrg	  tmp_sharedflag='-G' ;;
4853b4d38c65Smrg	esac
4854b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
485515fb4814Smrg
4856b4d38c65Smrg        if test "x$supports_anon_versioning" = xyes; then
4857b4d38c65Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4858b4d38c65Smrg	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4859b4d38c65Smrg	    echo "local: *; };" >> $output_objdir/$libname.ver~
4860b4d38c65Smrg	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
4861b4d38c65Smrg        fi
486215fb4814Smrg
4863b4d38c65Smrg	case $cc_basename in
4864b4d38c65Smrg	xlf* | bgf* | bgxlf* | mpixlf*)
4865b4d38c65Smrg	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
4866b4d38c65Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
4867cf503b78Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4868b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
4869b4d38c65Smrg	  if test "x$supports_anon_versioning" = xyes; then
4870b4d38c65Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
4871b4d38c65Smrg	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
4872b4d38c65Smrg	      echo "local: *; };" >> $output_objdir/$libname.ver~
4873b4d38c65Smrg	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
4874b4d38c65Smrg	  fi
4875b4d38c65Smrg	  ;;
4876b4d38c65Smrg	esac
4877b4d38c65Smrg      else
4878b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
4879b4d38c65Smrg      fi
4880b4d38c65Smrg      ;;
488115fb4814Smrg
4882b4d38c65Smrg    netbsd*)
4883b4d38c65Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
4884b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
4885b4d38c65Smrg	wlarc=
4886b4d38c65Smrg      else
4887b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4888b4d38c65Smrg	_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'
4889b4d38c65Smrg      fi
4890b4d38c65Smrg      ;;
489115fb4814Smrg
4892b4d38c65Smrg    solaris*)
4893b4d38c65Smrg      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
4894b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4895b4d38c65Smrg	cat <<_LT_EOF 1>&2
489615fb4814Smrg
4897b4d38c65Smrg*** Warning: The releases 2.8.* of the GNU linker cannot reliably
4898b4d38c65Smrg*** create shared libraries on Solaris systems.  Therefore, libtool
4899b4d38c65Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4900b4d38c65Smrg*** binutils to release 2.9.1 or newer.  Another option is to modify
4901b4d38c65Smrg*** your PATH or compiler configuration so that the native linker is
4902b4d38c65Smrg*** used, and then restart.
490315fb4814Smrg
4904b4d38c65Smrg_LT_EOF
4905b4d38c65Smrg      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4906b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4907b4d38c65Smrg	_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'
4908b4d38c65Smrg      else
4909b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4910b4d38c65Smrg      fi
4911b4d38c65Smrg      ;;
491215fb4814Smrg
4913b4d38c65Smrg    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
4914b4d38c65Smrg      case `$LD -v 2>&1` in
4915b4d38c65Smrg        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
4916b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4917b4d38c65Smrg	cat <<_LT_EOF 1>&2
491815fb4814Smrg
4919b4d38c65Smrg*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
4920b4d38c65Smrg*** reliably create shared libraries on SCO systems.  Therefore, libtool
4921b4d38c65Smrg*** is disabling shared libraries support.  We urge you to upgrade GNU
4922b4d38c65Smrg*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
4923b4d38c65Smrg*** your PATH or compiler configuration so that the native linker is
4924b4d38c65Smrg*** used, and then restart.
492515fb4814Smrg
4926b4d38c65Smrg_LT_EOF
4927b4d38c65Smrg	;;
4928b4d38c65Smrg	*)
4929b4d38c65Smrg	  # For security reasons, it is highly recommended that you always
4930b4d38c65Smrg	  # use absolute paths for naming shared libraries, and exclude the
4931b4d38c65Smrg	  # DT_RUNPATH tag from executables and libraries.  But doing so
4932b4d38c65Smrg	  # requires that you compile everything twice, which is a pain.
4933b4d38c65Smrg	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4934b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
4935b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4936b4d38c65Smrg	    _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'
4937b4d38c65Smrg	  else
4938b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
4939b4d38c65Smrg	  fi
4940b4d38c65Smrg	;;
4941b4d38c65Smrg      esac
4942b4d38c65Smrg      ;;
494315fb4814Smrg
4944b4d38c65Smrg    sunos4*)
4945b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
4946b4d38c65Smrg      wlarc=
4947b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
4948b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
4949b4d38c65Smrg      ;;
495015fb4814Smrg
4951b4d38c65Smrg    *)
4952b4d38c65Smrg      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
4953b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
4954b4d38c65Smrg	_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'
4955b4d38c65Smrg      else
4956b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
4957b4d38c65Smrg      fi
4958b4d38c65Smrg      ;;
4959b4d38c65Smrg    esac
496015fb4814Smrg
4961b4d38c65Smrg    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
4962b4d38c65Smrg      runpath_var=
4963b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
4964b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
4965b4d38c65Smrg      _LT_TAGVAR(whole_archive_flag_spec, $1)=
4966b4d38c65Smrg    fi
4967b4d38c65Smrg  else
4968b4d38c65Smrg    # PORTME fill in a description of your system's linker (not GNU ld)
4969b4d38c65Smrg    case $host_os in
4970b4d38c65Smrg    aix3*)
4971b4d38c65Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
4972b4d38c65Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
4973b4d38c65Smrg      _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'
4974b4d38c65Smrg      # Note: this linker hardcodes the directories in LIBPATH if there
4975b4d38c65Smrg      # are no directories specified by -L.
4976b4d38c65Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
4977b4d38c65Smrg      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
4978b4d38c65Smrg	# Neither direct hardcoding nor static linking is supported with a
4979b4d38c65Smrg	# broken collect2.
4980b4d38c65Smrg	_LT_TAGVAR(hardcode_direct, $1)=unsupported
4981b4d38c65Smrg      fi
4982b4d38c65Smrg      ;;
498315fb4814Smrg
4984b4d38c65Smrg    aix[[4-9]]*)
4985b4d38c65Smrg      if test "$host_cpu" = ia64; then
4986b4d38c65Smrg	# On IA64, the linker does run time linking by default, so we don't
4987b4d38c65Smrg	# have to do anything special.
4988b4d38c65Smrg	aix_use_runtimelinking=no
4989b4d38c65Smrg	exp_sym_flag='-Bexport'
4990b4d38c65Smrg	no_entry_flag=""
4991b4d38c65Smrg      else
4992b4d38c65Smrg	# If we're using GNU nm, then we don't want the "-C" option.
4993b4d38c65Smrg	# -C means demangle to AIX nm, but means don't demangle with GNU nm
4994b4d38c65Smrg	# Also, AIX nm treats weak defined symbols like other global
4995b4d38c65Smrg	# defined symbols, whereas GNU nm marks them as "W".
4996b4d38c65Smrg	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
4997b4d38c65Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
4998b4d38c65Smrg	else
4999b4d38c65Smrg	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
5000b4d38c65Smrg	fi
5001b4d38c65Smrg	aix_use_runtimelinking=no
500215fb4814Smrg
5003b4d38c65Smrg	# Test if we are trying to use run time linking or normal
5004b4d38c65Smrg	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
5005b4d38c65Smrg	# need to do runtime linking.
5006b4d38c65Smrg	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5007b4d38c65Smrg	  for ld_flag in $LDFLAGS; do
5008b4d38c65Smrg	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
5009b4d38c65Smrg	    aix_use_runtimelinking=yes
5010b4d38c65Smrg	    break
5011b4d38c65Smrg	  fi
5012b4d38c65Smrg	  done
5013b4d38c65Smrg	  ;;
5014b4d38c65Smrg	esac
501515fb4814Smrg
5016b4d38c65Smrg	exp_sym_flag='-bexport'
5017b4d38c65Smrg	no_entry_flag='-bnoentry'
5018b4d38c65Smrg      fi
501915fb4814Smrg
5020b4d38c65Smrg      # When large executables or shared objects are built, AIX ld can
5021b4d38c65Smrg      # have problems creating the table of contents.  If linking a library
5022b4d38c65Smrg      # or program results in "error TOC overflow" add -mminimal-toc to
5023b4d38c65Smrg      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
5024b4d38c65Smrg      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
502515fb4814Smrg
5026b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)=''
5027b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5028b4d38c65Smrg      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5029b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5030b4d38c65Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5031b4d38c65Smrg      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
503215fb4814Smrg
5033b4d38c65Smrg      if test "$GCC" = yes; then
5034b4d38c65Smrg	case $host_os in aix4.[[012]]|aix4.[[012]].*)
5035b4d38c65Smrg	# We only want to do this on AIX 4.2 and lower, the check
5036b4d38c65Smrg	# below for broken collect2 doesn't work under 4.3+
5037b4d38c65Smrg	  collect2name=`${CC} -print-prog-name=collect2`
5038b4d38c65Smrg	  if test -f "$collect2name" &&
5039b4d38c65Smrg	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
5040b4d38c65Smrg	  then
5041b4d38c65Smrg	  # We have reworked collect2
5042b4d38c65Smrg	  :
5043b4d38c65Smrg	  else
5044b4d38c65Smrg	  # We have old collect2
5045b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
5046b4d38c65Smrg	  # It fails to find uninstalled libraries when the uninstalled
5047b4d38c65Smrg	  # path is not listed in the libpath.  Setting hardcode_minus_L
5048b4d38c65Smrg	  # to unsupported forces relinking
5049b4d38c65Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5050b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5051b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
5052b4d38c65Smrg	  fi
5053b4d38c65Smrg	  ;;
5054b4d38c65Smrg	esac
5055b4d38c65Smrg	shared_flag='-shared'
5056b4d38c65Smrg	if test "$aix_use_runtimelinking" = yes; then
5057b4d38c65Smrg	  shared_flag="$shared_flag "'${wl}-G'
5058b4d38c65Smrg	fi
5059b4d38c65Smrg      else
5060b4d38c65Smrg	# not using gcc
5061b4d38c65Smrg	if test "$host_cpu" = ia64; then
5062b4d38c65Smrg	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
5063b4d38c65Smrg	# chokes on -Wl,-G. The following line is correct:
5064b4d38c65Smrg	  shared_flag='-G'
5065b4d38c65Smrg	else
5066b4d38c65Smrg	  if test "$aix_use_runtimelinking" = yes; then
5067b4d38c65Smrg	    shared_flag='${wl}-G'
5068b4d38c65Smrg	  else
5069b4d38c65Smrg	    shared_flag='${wl}-bM:SRE'
5070b4d38c65Smrg	  fi
5071b4d38c65Smrg	fi
5072b4d38c65Smrg      fi
507315fb4814Smrg
5074b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
5075b4d38c65Smrg      # It seems that -bexpall does not export symbols beginning with
5076b4d38c65Smrg      # underscore (_), so it is better to generate a list of symbols to export.
5077b4d38c65Smrg      _LT_TAGVAR(always_export_symbols, $1)=yes
5078b4d38c65Smrg      if test "$aix_use_runtimelinking" = yes; then
5079b4d38c65Smrg	# Warning - without using the other runtime loading flags (-brtl),
5080b4d38c65Smrg	# -berok will link without error, but may produce a broken library.
5081b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
5082b4d38c65Smrg        # Determine the default libpath from the value encoded in an
5083b4d38c65Smrg        # empty executable.
5084b4d38c65Smrg        _LT_SYS_MODULE_PATH_AIX([$1])
5085b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5086b4d38c65Smrg        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
5087b4d38c65Smrg      else
5088b4d38c65Smrg	if test "$host_cpu" = ia64; then
5089b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
5090b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
5091b4d38c65Smrg	  _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"
5092b4d38c65Smrg	else
5093b4d38c65Smrg	 # Determine the default libpath from the value encoded in an
5094b4d38c65Smrg	 # empty executable.
5095b4d38c65Smrg	 _LT_SYS_MODULE_PATH_AIX([$1])
5096b4d38c65Smrg	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
5097b4d38c65Smrg	  # Warning - without using the other run time loading flags,
5098b4d38c65Smrg	  # -berok will link without error, but may produce a broken library.
5099b4d38c65Smrg	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
5100b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
5101b4d38c65Smrg	  if test "$with_gnu_ld" = yes; then
5102b4d38c65Smrg	    # We only use this code for GNU lds that support --whole-archive.
5103b4d38c65Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
5104b4d38c65Smrg	  else
5105b4d38c65Smrg	    # Exported symbols can be pulled into shared objects from archives
5106b4d38c65Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
5107b4d38c65Smrg	  fi
5108b4d38c65Smrg	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5109b4d38c65Smrg	  # This is similar to how AIX traditionally builds its shared libraries.
5110b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
5111b4d38c65Smrg	fi
5112b4d38c65Smrg      fi
5113b4d38c65Smrg      ;;
511415fb4814Smrg
5115b4d38c65Smrg    amigaos*)
5116b4d38c65Smrg      case $host_cpu in
5117b4d38c65Smrg      powerpc)
5118b4d38c65Smrg            # see comment about AmigaOS4 .so support
5119b4d38c65Smrg            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
5120b4d38c65Smrg            _LT_TAGVAR(archive_expsym_cmds, $1)=''
5121b4d38c65Smrg        ;;
5122b4d38c65Smrg      m68k)
5123b4d38c65Smrg            _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)'
5124b4d38c65Smrg            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5125b4d38c65Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes
5126b4d38c65Smrg        ;;
5127b4d38c65Smrg      esac
5128b4d38c65Smrg      ;;
512915fb4814Smrg
5130b4d38c65Smrg    bsdi[[45]]*)
5131b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
5132b4d38c65Smrg      ;;
513315fb4814Smrg
5134b4d38c65Smrg    cygwin* | mingw* | pw32* | cegcc*)
5135b4d38c65Smrg      # When not using gcc, we currently assume that we are using
5136b4d38c65Smrg      # Microsoft Visual C++.
5137b4d38c65Smrg      # hardcode_libdir_flag_spec is actually meaningless, as there is
5138b4d38c65Smrg      # no search path for DLLs.
5139b4d38c65Smrg      case $cc_basename in
5140b4d38c65Smrg      cl*)
5141b4d38c65Smrg	# Native MSVC
5142b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5143b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5144b4d38c65Smrg	_LT_TAGVAR(always_export_symbols, $1)=yes
5145b4d38c65Smrg	_LT_TAGVAR(file_list_spec, $1)='@'
5146b4d38c65Smrg	# Tell ltmain to make .lib files, not .a files.
5147b4d38c65Smrg	libext=lib
5148b4d38c65Smrg	# Tell ltmain to make .dll files, not .so files.
5149b4d38c65Smrg	shrext_cmds=".dll"
5150b4d38c65Smrg	# FIXME: Setting linknames here is a bad hack.
5151b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
5152b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
5153b4d38c65Smrg	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
5154b4d38c65Smrg	  else
5155b4d38c65Smrg	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
5156b4d38c65Smrg	  fi~
5157b4d38c65Smrg	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
5158b4d38c65Smrg	  linknames='
5159b4d38c65Smrg	# The linker will not automatically build a static lib if we build a DLL.
5160b4d38c65Smrg	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5161b4d38c65Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5162cf503b78Smrg	_LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
5163b4d38c65Smrg	_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'
5164b4d38c65Smrg	# Don't use ranlib
5165b4d38c65Smrg	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
5166b4d38c65Smrg	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
5167b4d38c65Smrg	  lt_tool_outputfile="@TOOL_OUTPUT@"~
5168b4d38c65Smrg	  case $lt_outputfile in
5169b4d38c65Smrg	    *.exe|*.EXE) ;;
5170b4d38c65Smrg	    *)
5171b4d38c65Smrg	      lt_outputfile="$lt_outputfile.exe"
5172b4d38c65Smrg	      lt_tool_outputfile="$lt_tool_outputfile.exe"
5173b4d38c65Smrg	      ;;
5174b4d38c65Smrg	  esac~
5175b4d38c65Smrg	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
5176b4d38c65Smrg	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
5177b4d38c65Smrg	    $RM "$lt_outputfile.manifest";
5178b4d38c65Smrg	  fi'
5179b4d38c65Smrg	;;
5180b4d38c65Smrg      *)
5181b4d38c65Smrg	# Assume MSVC wrapper
5182b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
5183b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5184b4d38c65Smrg	# Tell ltmain to make .lib files, not .a files.
5185b4d38c65Smrg	libext=lib
5186b4d38c65Smrg	# Tell ltmain to make .dll files, not .so files.
5187b4d38c65Smrg	shrext_cmds=".dll"
5188b4d38c65Smrg	# FIXME: Setting linknames here is a bad hack.
5189b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
5190b4d38c65Smrg	# The linker will automatically build a .lib file if we build a DLL.
5191b4d38c65Smrg	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
5192b4d38c65Smrg	# FIXME: Should let the user specify the lib program.
5193b4d38c65Smrg	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
5194b4d38c65Smrg	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
5195b4d38c65Smrg	;;
5196b4d38c65Smrg      esac
5197b4d38c65Smrg      ;;
519815fb4814Smrg
5199b4d38c65Smrg    darwin* | rhapsody*)
5200b4d38c65Smrg      _LT_DARWIN_LINKER_FEATURES($1)
5201b4d38c65Smrg      ;;
5202b410ddbeSmrg
5203b4d38c65Smrg    dgux*)
5204b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5205b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5206b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5207b4d38c65Smrg      ;;
520815fb4814Smrg
5209b4d38c65Smrg    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
5210b4d38c65Smrg    # support.  Future versions do this automatically, but an explicit c++rt0.o
5211b4d38c65Smrg    # does not break anything, and helps significantly (at the cost of a little
5212b4d38c65Smrg    # extra space).
5213b4d38c65Smrg    freebsd2.2*)
5214b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
5215b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5216b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5217b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5218b4d38c65Smrg      ;;
521915fb4814Smrg
5220b4d38c65Smrg    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
5221cf503b78Smrg    freebsd2.*)
5222b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5223b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5224b4d38c65Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5225b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5226b4d38c65Smrg      ;;
522715fb4814Smrg
5228b4d38c65Smrg    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
5229b4d38c65Smrg    freebsd* | dragonfly*)
5230b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5231b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5232b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5233b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5234b4d38c65Smrg      ;;
523515fb4814Smrg
5236b4d38c65Smrg    hpux9*)
5237b4d38c65Smrg      if test "$GCC" = yes; then
5238b4d38c65Smrg	_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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5239b4d38c65Smrg      else
5240b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
5241b4d38c65Smrg      fi
5242b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5243b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5244b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5245b410ddbeSmrg
5246b4d38c65Smrg      # hardcode_minus_L: Not really in the search PATH,
5247b4d38c65Smrg      # but as the default location of the library.
5248b4d38c65Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5249b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5250b410ddbeSmrg      ;;
525115fb4814Smrg
5252b4d38c65Smrg    hpux10*)
5253b4d38c65Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5254b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5255b4d38c65Smrg      else
5256b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
5257b4d38c65Smrg      fi
5258b4d38c65Smrg      if test "$with_gnu_ld" = no; then
5259b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5260b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
5261b4d38c65Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5262b4d38c65Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5263b4d38c65Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5264b4d38c65Smrg	# hardcode_minus_L: Not really in the search PATH,
5265b4d38c65Smrg	# but as the default location of the library.
5266b4d38c65Smrg	_LT_TAGVAR(hardcode_minus_L, $1)=yes
5267b4d38c65Smrg      fi
5268b4d38c65Smrg      ;;
526915fb4814Smrg
5270b4d38c65Smrg    hpux11*)
5271b4d38c65Smrg      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
5272b4d38c65Smrg	case $host_cpu in
5273b4d38c65Smrg	hppa*64*)
5274b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5275b4d38c65Smrg	  ;;
5276b4d38c65Smrg	ia64*)
5277b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5278b4d38c65Smrg	  ;;
5279b4d38c65Smrg	*)
5280b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
5281b4d38c65Smrg	  ;;
5282b4d38c65Smrg	esac
5283b4d38c65Smrg      else
5284b4d38c65Smrg	case $host_cpu in
5285b4d38c65Smrg	hppa*64*)
5286b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5287b4d38c65Smrg	  ;;
5288b4d38c65Smrg	ia64*)
5289b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
5290b4d38c65Smrg	  ;;
5291b4d38c65Smrg	*)
5292b4d38c65Smrg	m4_if($1, [], [
5293b4d38c65Smrg	  # Older versions of the 11.00 compiler do not understand -b yet
5294b4d38c65Smrg	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
5295b4d38c65Smrg	  _LT_LINKER_OPTION([if $CC understands -b],
5296b4d38c65Smrg	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
5297b4d38c65Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
5298b4d38c65Smrg	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
5299b4d38c65Smrg	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
5300b4d38c65Smrg	  ;;
5301b4d38c65Smrg	esac
5302b4d38c65Smrg      fi
5303b4d38c65Smrg      if test "$with_gnu_ld" = no; then
5304b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
5305b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
530615fb4814Smrg
5307b4d38c65Smrg	case $host_cpu in
5308b4d38c65Smrg	hppa*64*|ia64*)
5309b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5310b4d38c65Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5311b4d38c65Smrg	  ;;
5312b4d38c65Smrg	*)
5313b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
5314b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5315b4d38c65Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
531615fb4814Smrg
5317b4d38c65Smrg	  # hardcode_minus_L: Not really in the search PATH,
5318b4d38c65Smrg	  # but as the default location of the library.
5319b4d38c65Smrg	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
5320b4d38c65Smrg	  ;;
5321b4d38c65Smrg	esac
5322b4d38c65Smrg      fi
5323b4d38c65Smrg      ;;
532415fb4814Smrg
5325b4d38c65Smrg    irix5* | irix6* | nonstopux*)
5326b4d38c65Smrg      if test "$GCC" = yes; then
5327b4d38c65Smrg	_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'
5328b4d38c65Smrg	# Try to use the -exported_symbol ld option, if it does not
5329b4d38c65Smrg	# work, assume that -exports_file does not work either and
5330b4d38c65Smrg	# implicitly export all symbols.
5331b4d38c65Smrg	# This should be the same for all languages, so no per-tag cache variable.
5332b4d38c65Smrg	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
5333b4d38c65Smrg	  [lt_cv_irix_exported_symbol],
5334b4d38c65Smrg	  [save_LDFLAGS="$LDFLAGS"
5335b4d38c65Smrg	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
5336b4d38c65Smrg	   AC_LINK_IFELSE(
5337b4d38c65Smrg	     [AC_LANG_SOURCE(
5338b4d38c65Smrg	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
5339b4d38c65Smrg			      [C++], [[int foo (void) { return 0; }]],
5340b4d38c65Smrg			      [Fortran 77], [[
5341b4d38c65Smrg      subroutine foo
5342b4d38c65Smrg      end]],
5343b4d38c65Smrg			      [Fortran], [[
5344b4d38c65Smrg      subroutine foo
5345b4d38c65Smrg      end]])])],
5346b4d38c65Smrg	      [lt_cv_irix_exported_symbol=yes],
5347b4d38c65Smrg	      [lt_cv_irix_exported_symbol=no])
5348b4d38c65Smrg           LDFLAGS="$save_LDFLAGS"])
5349b4d38c65Smrg	if test "$lt_cv_irix_exported_symbol" = yes; then
5350b4d38c65Smrg          _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'
5351b4d38c65Smrg	fi
5352b4d38c65Smrg      else
5353b4d38c65Smrg	_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'
5354b4d38c65Smrg	_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'
5355b4d38c65Smrg      fi
5356b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5357b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5358b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5359b4d38c65Smrg      _LT_TAGVAR(inherit_rpath, $1)=yes
5360b4d38c65Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5361b4d38c65Smrg      ;;
536215fb4814Smrg
5363b4d38c65Smrg    netbsd*)
5364b4d38c65Smrg      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
5365b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
5366b4d38c65Smrg      else
5367b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
5368b4d38c65Smrg      fi
5369b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5370b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5371b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5372b4d38c65Smrg      ;;
537315fb4814Smrg
5374b4d38c65Smrg    newsos6)
5375b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5376b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5377b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5378b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5379b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5380b4d38c65Smrg      ;;
538115fb4814Smrg
5382b4d38c65Smrg    *nto* | *qnx*)
5383b4d38c65Smrg      ;;
538415fb4814Smrg
5385b4d38c65Smrg    openbsd*)
5386b4d38c65Smrg      if test -f /usr/libexec/ld.so; then
5387b4d38c65Smrg	_LT_TAGVAR(hardcode_direct, $1)=yes
5388b4d38c65Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5389b4d38c65Smrg	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
5390b4d38c65Smrg	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5391b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5392b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
5393b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5394b4d38c65Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
5395b4d38c65Smrg	else
5396b4d38c65Smrg	  case $host_os in
5397b4d38c65Smrg	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
5398b4d38c65Smrg	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
5399b4d38c65Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5400b4d38c65Smrg	     ;;
5401b4d38c65Smrg	   *)
5402b4d38c65Smrg	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
5403b4d38c65Smrg	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
5404b4d38c65Smrg	     ;;
5405b4d38c65Smrg	  esac
5406b4d38c65Smrg	fi
5407b4d38c65Smrg      else
5408b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
5409b4d38c65Smrg      fi
5410b4d38c65Smrg      ;;
541115fb4814Smrg
5412b4d38c65Smrg    os2*)
5413b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5414b4d38c65Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5415b4d38c65Smrg      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
5416b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
5417b4d38c65Smrg      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
5418b4d38c65Smrg      ;;
541915fb4814Smrg
5420b4d38c65Smrg    osf3*)
5421b4d38c65Smrg      if test "$GCC" = yes; then
5422b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5423b4d38c65Smrg	_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'
5424b4d38c65Smrg      else
5425b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5426b4d38c65Smrg	_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'
5427b4d38c65Smrg      fi
5428b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5429b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5430b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5431b4d38c65Smrg      ;;
543215fb4814Smrg
5433b4d38c65Smrg    osf4* | osf5*)	# as osf3* with the addition of -msym flag
5434b4d38c65Smrg      if test "$GCC" = yes; then
5435b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
5436b4d38c65Smrg	_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'
5437b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5438b4d38c65Smrg      else
5439b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
5440b4d38c65Smrg	_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'
5441b4d38c65Smrg	_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~
5442b4d38c65Smrg	$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'
544315fb4814Smrg
5444b4d38c65Smrg	# Both c and cxx compiler support -rpath directly
5445b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
5446b4d38c65Smrg      fi
5447b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
5448b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
5449b4d38c65Smrg      ;;
545015fb4814Smrg
5451b4d38c65Smrg    solaris*)
5452b4d38c65Smrg      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
5453b4d38c65Smrg      if test "$GCC" = yes; then
5454b4d38c65Smrg	wlarc='${wl}'
5455b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
5456b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5457b4d38c65Smrg	  $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'
5458b4d38c65Smrg      else
5459b4d38c65Smrg	case `$CC -V 2>&1` in
5460b4d38c65Smrg	*"Compilers 5.0"*)
5461b4d38c65Smrg	  wlarc=''
5462b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
5463b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5464b4d38c65Smrg	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
5465b4d38c65Smrg	  ;;
5466b4d38c65Smrg	*)
5467b4d38c65Smrg	  wlarc='${wl}'
5468b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
5469b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
5470b4d38c65Smrg	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
5471b4d38c65Smrg	  ;;
5472b4d38c65Smrg	esac
5473b4d38c65Smrg      fi
5474b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
5475b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5476b4d38c65Smrg      case $host_os in
5477b4d38c65Smrg      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
5478b4d38c65Smrg      *)
5479b4d38c65Smrg	# The compiler driver will combine and reorder linker options,
5480b4d38c65Smrg	# but understands `-z linker_flag'.  GCC discards it without `$wl',
5481b4d38c65Smrg	# but is careful enough not to reorder.
5482b4d38c65Smrg	# Supported since Solaris 2.6 (maybe 2.5.1?)
5483b4d38c65Smrg	if test "$GCC" = yes; then
5484b4d38c65Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
5485b4d38c65Smrg	else
5486b4d38c65Smrg	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
5487b4d38c65Smrg	fi
5488b4d38c65Smrg	;;
5489b4d38c65Smrg      esac
5490b4d38c65Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5491b4d38c65Smrg      ;;
549215fb4814Smrg
5493b4d38c65Smrg    sunos4*)
5494b4d38c65Smrg      if test "x$host_vendor" = xsequent; then
5495b4d38c65Smrg	# Use $CC to link under sequent, because it throws in some extra .o
5496b4d38c65Smrg	# files that make .init and .fini sections work.
5497b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
5498b4d38c65Smrg      else
5499b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
5500b4d38c65Smrg      fi
5501b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5502b4d38c65Smrg      _LT_TAGVAR(hardcode_direct, $1)=yes
5503b4d38c65Smrg      _LT_TAGVAR(hardcode_minus_L, $1)=yes
5504b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5505b4d38c65Smrg      ;;
550615fb4814Smrg
5507b4d38c65Smrg    sysv4)
5508b4d38c65Smrg      case $host_vendor in
5509b4d38c65Smrg	sni)
5510b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5511b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
5512b4d38c65Smrg	;;
5513b4d38c65Smrg	siemens)
5514b4d38c65Smrg	  ## LD is ld it makes a PLAMLIB
5515b4d38c65Smrg	  ## CC just makes a GrossModule.
5516b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
5517b4d38c65Smrg	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
5518b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no
5519b4d38c65Smrg        ;;
5520b4d38c65Smrg	motorola)
5521b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5522b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
5523b4d38c65Smrg	;;
5524b4d38c65Smrg      esac
5525b4d38c65Smrg      runpath_var='LD_RUN_PATH'
5526b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5527b4d38c65Smrg      ;;
552815fb4814Smrg
5529b4d38c65Smrg    sysv4.3*)
5530b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5531b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5532b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
5533b4d38c65Smrg      ;;
553415fb4814Smrg
5535b4d38c65Smrg    sysv4*MP*)
5536b4d38c65Smrg      if test -d /usr/nec; then
5537b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5538b4d38c65Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5539b4d38c65Smrg	runpath_var=LD_RUN_PATH
5540b4d38c65Smrg	hardcode_runpath_var=yes
5541b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=yes
5542b4d38c65Smrg      fi
5543b4d38c65Smrg      ;;
554415fb4814Smrg
5545b4d38c65Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
5546b4d38c65Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5547b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5548b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5549b4d38c65Smrg      runpath_var='LD_RUN_PATH'
555015fb4814Smrg
5551b4d38c65Smrg      if test "$GCC" = yes; then
5552b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5553b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5554b4d38c65Smrg      else
5555b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5556b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5557b4d38c65Smrg      fi
5558b4d38c65Smrg      ;;
555915fb4814Smrg
5560b4d38c65Smrg    sysv5* | sco3.2v5* | sco5v6*)
5561b4d38c65Smrg      # Note: We can NOT use -z defs as we might desire, because we do not
5562b4d38c65Smrg      # link with -lc, and that would cause any symbols used from libc to
5563b4d38c65Smrg      # always be unresolved, which means just about no library would
5564b4d38c65Smrg      # ever link correctly.  If we're not using GNU ld we use -z text
5565b4d38c65Smrg      # though, which does catch some bad symbols but isn't as heavy-handed
5566b4d38c65Smrg      # as -z defs.
5567b4d38c65Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
5568b4d38c65Smrg      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
5569b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
5570b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5571b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
5572b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
5573b4d38c65Smrg      _LT_TAGVAR(link_all_deplibs, $1)=yes
5574b4d38c65Smrg      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
5575b4d38c65Smrg      runpath_var='LD_RUN_PATH'
557615fb4814Smrg
5577b4d38c65Smrg      if test "$GCC" = yes; then
5578b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5579b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5580b4d38c65Smrg      else
5581b4d38c65Smrg	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5582b4d38c65Smrg	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
5583b4d38c65Smrg      fi
5584b4d38c65Smrg      ;;
558515fb4814Smrg
5586b4d38c65Smrg    uts4*)
5587b4d38c65Smrg      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
5588b4d38c65Smrg      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
5589b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
5590b4d38c65Smrg      ;;
559115fb4814Smrg
5592b4d38c65Smrg    *)
5593b4d38c65Smrg      _LT_TAGVAR(ld_shlibs, $1)=no
5594b4d38c65Smrg      ;;
5595b4d38c65Smrg    esac
559615fb4814Smrg
5597b4d38c65Smrg    if test x$host_vendor = xsni; then
5598b4d38c65Smrg      case $host in
5599b4d38c65Smrg      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
5600b4d38c65Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
5601b4d38c65Smrg	;;
5602b4d38c65Smrg      esac
5603b4d38c65Smrg    fi
5604b4d38c65Smrg  fi
5605b4d38c65Smrg])
5606b4d38c65SmrgAC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
5607b4d38c65Smrgtest "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
560815fb4814Smrg
5609b4d38c65Smrg_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
561015fb4814Smrg
5611b4d38c65Smrg_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
5612b4d38c65Smrg_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
5613b4d38c65Smrg_LT_DECL([], [extract_expsyms_cmds], [2],
5614b4d38c65Smrg    [The commands to extract the exported symbol list from a shared archive])
561515fb4814Smrg
5616b4d38c65Smrg#
5617b4d38c65Smrg# Do we need to explicitly link libc?
5618b4d38c65Smrg#
5619b4d38c65Smrgcase "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
5620b4d38c65Smrgx|xyes)
5621b4d38c65Smrg  # Assume -lc should be added
5622b4d38c65Smrg  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
562315fb4814Smrg
5624b4d38c65Smrg  if test "$enable_shared" = yes && test "$GCC" = yes; then
5625b4d38c65Smrg    case $_LT_TAGVAR(archive_cmds, $1) in
5626b4d38c65Smrg    *'~'*)
5627b4d38c65Smrg      # FIXME: we may have to deal with multi-command sequences.
5628b4d38c65Smrg      ;;
5629b4d38c65Smrg    '$CC '*)
5630b4d38c65Smrg      # Test whether the compiler implicitly links with -lc since on some
5631b4d38c65Smrg      # systems, -lgcc has to come before -lc. If gcc already passes -lc
5632b4d38c65Smrg      # to ld, don't add -lc before -lgcc.
5633b4d38c65Smrg      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
5634b4d38c65Smrg	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
5635b4d38c65Smrg	[$RM conftest*
5636b4d38c65Smrg	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
5637b4d38c65Smrg
5638b4d38c65Smrg	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
5639b4d38c65Smrg	  soname=conftest
5640b4d38c65Smrg	  lib=conftest
5641b4d38c65Smrg	  libobjs=conftest.$ac_objext
5642b4d38c65Smrg	  deplibs=
5643b4d38c65Smrg	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
5644b4d38c65Smrg	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
5645b4d38c65Smrg	  compiler_flags=-v
5646b4d38c65Smrg	  linker_flags=-v
5647b4d38c65Smrg	  verstring=
5648b4d38c65Smrg	  output_objdir=.
5649b4d38c65Smrg	  libname=conftest
5650b4d38c65Smrg	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
5651b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=
5652b4d38c65Smrg	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
5653b4d38c65Smrg	  then
5654b4d38c65Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5655b4d38c65Smrg	  else
5656b4d38c65Smrg	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
5657b4d38c65Smrg	  fi
5658b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
5659b4d38c65Smrg	else
5660b4d38c65Smrg	  cat conftest.err 1>&5
5661b4d38c65Smrg	fi
5662b4d38c65Smrg	$RM conftest*
5663b4d38c65Smrg	])
5664b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
5665b4d38c65Smrg      ;;
5666b4d38c65Smrg    esac
5667b4d38c65Smrg  fi
5668b4d38c65Smrg  ;;
5669b4d38c65Smrgesac
567015fb4814Smrg
5671b4d38c65Smrg_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
5672b4d38c65Smrg    [Whether or not to add -lc for building shared libraries])
5673b4d38c65Smrg_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
5674b4d38c65Smrg    [enable_shared_with_static_runtimes], [0],
5675b4d38c65Smrg    [Whether or not to disallow shared libs when runtime libs are static])
5676b4d38c65Smrg_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
5677b4d38c65Smrg    [Compiler flag to allow reflexive dlopens])
5678b4d38c65Smrg_LT_TAGDECL([], [whole_archive_flag_spec], [1],
5679b4d38c65Smrg    [Compiler flag to generate shared objects directly from archives])
5680b4d38c65Smrg_LT_TAGDECL([], [compiler_needs_object], [1],
5681b4d38c65Smrg    [Whether the compiler copes with passing no objects directly])
5682b4d38c65Smrg_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
5683b4d38c65Smrg    [Create an old-style archive from a shared archive])
5684b4d38c65Smrg_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
5685b4d38c65Smrg    [Create a temporary old-style archive to link instead of a shared archive])
5686b4d38c65Smrg_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
5687b4d38c65Smrg_LT_TAGDECL([], [archive_expsym_cmds], [2])
5688b4d38c65Smrg_LT_TAGDECL([], [module_cmds], [2],
5689b4d38c65Smrg    [Commands used to build a loadable module if different from building
5690b4d38c65Smrg    a shared archive.])
5691b4d38c65Smrg_LT_TAGDECL([], [module_expsym_cmds], [2])
5692b4d38c65Smrg_LT_TAGDECL([], [with_gnu_ld], [1],
5693b4d38c65Smrg    [Whether we are building with GNU ld or not])
5694b4d38c65Smrg_LT_TAGDECL([], [allow_undefined_flag], [1],
5695b4d38c65Smrg    [Flag that allows shared libraries with undefined symbols to be built])
5696b4d38c65Smrg_LT_TAGDECL([], [no_undefined_flag], [1],
5697b4d38c65Smrg    [Flag that enforces no undefined symbols])
5698b4d38c65Smrg_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
5699b4d38c65Smrg    [Flag to hardcode $libdir into a binary during linking.
5700b4d38c65Smrg    This must work even if $libdir does not exist])
5701b4d38c65Smrg_LT_TAGDECL([], [hardcode_libdir_separator], [1],
5702b4d38c65Smrg    [Whether we need a single "-rpath" flag with a separated argument])
5703b4d38c65Smrg_LT_TAGDECL([], [hardcode_direct], [0],
5704b4d38c65Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5705b4d38c65Smrg    DIR into the resulting binary])
5706b4d38c65Smrg_LT_TAGDECL([], [hardcode_direct_absolute], [0],
5707b4d38c65Smrg    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
5708b4d38c65Smrg    DIR into the resulting binary and the resulting library dependency is
5709b4d38c65Smrg    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
5710b4d38c65Smrg    library is relocated])
5711b4d38c65Smrg_LT_TAGDECL([], [hardcode_minus_L], [0],
5712b4d38c65Smrg    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
5713b4d38c65Smrg    into the resulting binary])
5714b4d38c65Smrg_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
5715b4d38c65Smrg    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
5716b4d38c65Smrg    into the resulting binary])
5717b4d38c65Smrg_LT_TAGDECL([], [hardcode_automatic], [0],
5718b4d38c65Smrg    [Set to "yes" if building a shared library automatically hardcodes DIR
5719b4d38c65Smrg    into the library and all subsequent libraries and executables linked
5720b4d38c65Smrg    against it])
5721b4d38c65Smrg_LT_TAGDECL([], [inherit_rpath], [0],
5722b4d38c65Smrg    [Set to yes if linker adds runtime paths of dependent libraries
5723b4d38c65Smrg    to runtime path list])
5724b4d38c65Smrg_LT_TAGDECL([], [link_all_deplibs], [0],
5725b4d38c65Smrg    [Whether libtool must link a program against all its dependency libraries])
5726b4d38c65Smrg_LT_TAGDECL([], [always_export_symbols], [0],
5727b4d38c65Smrg    [Set to "yes" if exported symbols are required])
5728b4d38c65Smrg_LT_TAGDECL([], [export_symbols_cmds], [2],
5729b4d38c65Smrg    [The commands to list exported symbols])
5730b4d38c65Smrg_LT_TAGDECL([], [exclude_expsyms], [1],
5731b4d38c65Smrg    [Symbols that should not be listed in the preloaded symbols])
5732b4d38c65Smrg_LT_TAGDECL([], [include_expsyms], [1],
5733b4d38c65Smrg    [Symbols that must always be exported])
5734b4d38c65Smrg_LT_TAGDECL([], [prelink_cmds], [2],
5735b4d38c65Smrg    [Commands necessary for linking programs (against libraries) with templates])
5736b4d38c65Smrg_LT_TAGDECL([], [postlink_cmds], [2],
5737b4d38c65Smrg    [Commands necessary for finishing linking programs])
5738b4d38c65Smrg_LT_TAGDECL([], [file_list_spec], [1],
5739b4d38c65Smrg    [Specify filename containing input files])
5740b4d38c65Smrgdnl FIXME: Not yet implemented
5741b4d38c65Smrgdnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
5742b4d38c65Smrgdnl    [Compiler flag to generate thread safe objects])
5743b4d38c65Smrg])# _LT_LINKER_SHLIBS
5744b4d38c65Smrg
5745b4d38c65Smrg
5746b4d38c65Smrg# _LT_LANG_C_CONFIG([TAG])
5747b4d38c65Smrg# ------------------------
5748b4d38c65Smrg# Ensure that the configuration variables for a C compiler are suitably
5749b4d38c65Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5750b4d38c65Smrg# the compiler configuration to `libtool'.
5751b4d38c65Smrgm4_defun([_LT_LANG_C_CONFIG],
5752b4d38c65Smrg[m4_require([_LT_DECL_EGREP])dnl
5753b4d38c65Smrglt_save_CC="$CC"
5754b4d38c65SmrgAC_LANG_PUSH(C)
575515fb4814Smrg
5756b4d38c65Smrg# Source file extension for C test sources.
5757b4d38c65Smrgac_ext=c
575815fb4814Smrg
5759b4d38c65Smrg# Object file extension for compiled C test sources.
5760b4d38c65Smrgobjext=o
5761b4d38c65Smrg_LT_TAGVAR(objext, $1)=$objext
576215fb4814Smrg
5763b4d38c65Smrg# Code to be used in simple compile tests
5764b4d38c65Smrglt_simple_compile_test_code="int some_variable = 0;"
576515fb4814Smrg
5766b4d38c65Smrg# Code to be used in simple link tests
5767b4d38c65Smrglt_simple_link_test_code='int main(){return(0);}'
576815fb4814Smrg
5769b4d38c65Smrg_LT_TAG_COMPILER
5770b4d38c65Smrg# Save the default compiler, since it gets overwritten when the other
5771b4d38c65Smrg# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
5772b4d38c65Smrgcompiler_DEFAULT=$CC
577315fb4814Smrg
5774b4d38c65Smrg# save warnings/boilerplate of simple test code
5775b4d38c65Smrg_LT_COMPILER_BOILERPLATE
5776b4d38c65Smrg_LT_LINKER_BOILERPLATE
577715fb4814Smrg
5778b4d38c65Smrgif test -n "$compiler"; then
5779b4d38c65Smrg  _LT_COMPILER_NO_RTTI($1)
5780b4d38c65Smrg  _LT_COMPILER_PIC($1)
5781b4d38c65Smrg  _LT_COMPILER_C_O($1)
5782b4d38c65Smrg  _LT_COMPILER_FILE_LOCKS($1)
5783b4d38c65Smrg  _LT_LINKER_SHLIBS($1)
5784b4d38c65Smrg  _LT_SYS_DYNAMIC_LINKER($1)
5785b4d38c65Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
5786b4d38c65Smrg  LT_SYS_DLOPEN_SELF
5787b4d38c65Smrg  _LT_CMD_STRIPLIB
5788b4d38c65Smrg
5789b4d38c65Smrg  # Report which library types will actually be built
5790b4d38c65Smrg  AC_MSG_CHECKING([if libtool supports shared libraries])
5791b4d38c65Smrg  AC_MSG_RESULT([$can_build_shared])
5792b4d38c65Smrg
5793b4d38c65Smrg  AC_MSG_CHECKING([whether to build shared libraries])
5794b4d38c65Smrg  test "$can_build_shared" = "no" && enable_shared=no
5795b4d38c65Smrg
5796b4d38c65Smrg  # On AIX, shared libraries and static libraries use the same namespace, and
5797b4d38c65Smrg  # are all built from PIC.
5798b4d38c65Smrg  case $host_os in
5799b4d38c65Smrg  aix3*)
5800b4d38c65Smrg    test "$enable_shared" = yes && enable_static=no
5801b4d38c65Smrg    if test -n "$RANLIB"; then
5802b4d38c65Smrg      archive_cmds="$archive_cmds~\$RANLIB \$lib"
5803b4d38c65Smrg      postinstall_cmds='$RANLIB $lib'
5804b4d38c65Smrg    fi
5805b4d38c65Smrg    ;;
580615fb4814Smrg
5807b4d38c65Smrg  aix[[4-9]]*)
5808b4d38c65Smrg    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
5809b4d38c65Smrg      test "$enable_shared" = yes && enable_static=no
5810b4d38c65Smrg    fi
5811b4d38c65Smrg    ;;
5812b4d38c65Smrg  esac
5813b4d38c65Smrg  AC_MSG_RESULT([$enable_shared])
581415fb4814Smrg
5815b4d38c65Smrg  AC_MSG_CHECKING([whether to build static libraries])
5816b4d38c65Smrg  # Make sure either enable_shared or enable_static is yes.
5817b4d38c65Smrg  test "$enable_shared" = yes || enable_static=yes
5818b4d38c65Smrg  AC_MSG_RESULT([$enable_static])
581915fb4814Smrg
5820b4d38c65Smrg  _LT_CONFIG($1)
5821b4d38c65Smrgfi
5822b4d38c65SmrgAC_LANG_POP
5823b4d38c65SmrgCC="$lt_save_CC"
5824b4d38c65Smrg])# _LT_LANG_C_CONFIG
582515fb4814Smrg
582615fb4814Smrg
5827b4d38c65Smrg# _LT_LANG_CXX_CONFIG([TAG])
5828b4d38c65Smrg# --------------------------
5829b4d38c65Smrg# Ensure that the configuration variables for a C++ compiler are suitably
5830b4d38c65Smrg# defined.  These variables are subsequently used by _LT_CONFIG to write
5831b4d38c65Smrg# the compiler configuration to `libtool'.
5832b4d38c65Smrgm4_defun([_LT_LANG_CXX_CONFIG],
5833b4d38c65Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
5834b4d38c65Smrgm4_require([_LT_DECL_EGREP])dnl
5835b4d38c65Smrgm4_require([_LT_PATH_MANIFEST_TOOL])dnl
5836b4d38c65Smrgif test -n "$CXX" && ( test "X$CXX" != "Xno" &&
5837b4d38c65Smrg    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
5838b4d38c65Smrg    (test "X$CXX" != "Xg++"))) ; then
5839b4d38c65Smrg  AC_PROG_CXXCPP
5840b4d38c65Smrgelse
5841b4d38c65Smrg  _lt_caught_CXX_error=yes
5842b4d38c65Smrgfi
584315fb4814Smrg
5844b4d38c65SmrgAC_LANG_PUSH(C++)
5845b4d38c65Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
5846b4d38c65Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
5847b4d38c65Smrg_LT_TAGVAR(always_export_symbols, $1)=no
5848b4d38c65Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
5849b4d38c65Smrg_LT_TAGVAR(compiler_needs_object, $1)=no
5850b4d38c65Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
5851b4d38c65Smrg_LT_TAGVAR(hardcode_direct, $1)=no
5852b4d38c65Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
5853b4d38c65Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
5854b4d38c65Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
5855b4d38c65Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
5856b4d38c65Smrg_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
5857b4d38c65Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
5858b4d38c65Smrg_LT_TAGVAR(inherit_rpath, $1)=no
5859b4d38c65Smrg_LT_TAGVAR(module_cmds, $1)=
5860b4d38c65Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
5861b4d38c65Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
5862b4d38c65Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
5863b4d38c65Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
5864b4d38c65Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
5865b4d38c65Smrg_LT_TAGVAR(no_undefined_flag, $1)=
5866b4d38c65Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
5867b4d38c65Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
586815fb4814Smrg
5869b4d38c65Smrg# Source file extension for C++ test sources.
5870b4d38c65Smrgac_ext=cpp
587115fb4814Smrg
5872b4d38c65Smrg# Object file extension for compiled C++ test sources.
5873b4d38c65Smrgobjext=o
5874b4d38c65Smrg_LT_TAGVAR(objext, $1)=$objext
5875b4d38c65Smrg
5876b4d38c65Smrg# No sense in running all these tests if we already determined that
5877b4d38c65Smrg# the CXX compiler isn't working.  Some variables (like enable_shared)
5878b4d38c65Smrg# are currently assumed to apply to all compilers on this platform,
5879b4d38c65Smrg# and will be corrupted by setting them based on a non-working compiler.
5880b4d38c65Smrgif test "$_lt_caught_CXX_error" != yes; then
5881b4d38c65Smrg  # Code to be used in simple compile tests
5882b4d38c65Smrg  lt_simple_compile_test_code="int some_variable = 0;"
5883b4d38c65Smrg
5884b4d38c65Smrg  # Code to be used in simple link tests
5885b4d38c65Smrg  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
5886b4d38c65Smrg
5887b4d38c65Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
5888b4d38c65Smrg  _LT_TAG_COMPILER
5889b4d38c65Smrg
5890b4d38c65Smrg  # save warnings/boilerplate of simple test code
5891b4d38c65Smrg  _LT_COMPILER_BOILERPLATE
5892b4d38c65Smrg  _LT_LINKER_BOILERPLATE
5893b4d38c65Smrg
5894b4d38c65Smrg  # Allow CC to be a program name with arguments.
5895b4d38c65Smrg  lt_save_CC=$CC
5896b4d38c65Smrg  lt_save_CFLAGS=$CFLAGS
5897b4d38c65Smrg  lt_save_LD=$LD
5898b4d38c65Smrg  lt_save_GCC=$GCC
5899b4d38c65Smrg  GCC=$GXX
5900b4d38c65Smrg  lt_save_with_gnu_ld=$with_gnu_ld
5901b4d38c65Smrg  lt_save_path_LD=$lt_cv_path_LD
5902b4d38c65Smrg  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
5903b4d38c65Smrg    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
5904b4d38c65Smrg  else
5905b4d38c65Smrg    $as_unset lt_cv_prog_gnu_ld
5906b4d38c65Smrg  fi
5907b4d38c65Smrg  if test -n "${lt_cv_path_LDCXX+set}"; then
5908b4d38c65Smrg    lt_cv_path_LD=$lt_cv_path_LDCXX
5909b4d38c65Smrg  else
5910b4d38c65Smrg    $as_unset lt_cv_path_LD
5911b4d38c65Smrg  fi
5912b4d38c65Smrg  test -z "${LDCXX+set}" || LD=$LDCXX
5913b4d38c65Smrg  CC=${CXX-"c++"}
5914b4d38c65Smrg  CFLAGS=$CXXFLAGS
5915b4d38c65Smrg  compiler=$CC
5916b4d38c65Smrg  _LT_TAGVAR(compiler, $1)=$CC
5917b4d38c65Smrg  _LT_CC_BASENAME([$compiler])
591815fb4814Smrg
5919b4d38c65Smrg  if test -n "$compiler"; then
5920b4d38c65Smrg    # We don't want -fno-exception when compiling C++ code, so set the
5921b4d38c65Smrg    # no_builtin_flag separately
5922b4d38c65Smrg    if test "$GXX" = yes; then
5923b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
5924b4d38c65Smrg    else
5925b4d38c65Smrg      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
5926b4d38c65Smrg    fi
592715fb4814Smrg
5928b4d38c65Smrg    if test "$GXX" = yes; then
5929b4d38c65Smrg      # Set up default GNU C++ configuration
593015fb4814Smrg
5931b4d38c65Smrg      LT_PATH_LD
593215fb4814Smrg
5933b4d38c65Smrg      # Check if GNU C++ uses GNU ld as the underlying linker, since the
5934b4d38c65Smrg      # archiving commands below assume that GNU ld is being used.
5935b4d38c65Smrg      if test "$with_gnu_ld" = yes; then
5936b4d38c65Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
5937b4d38c65Smrg        _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'
593815fb4814Smrg
5939b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
5940b4d38c65Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
594115fb4814Smrg
5942b4d38c65Smrg        # If archive_cmds runs LD, not CC, wlarc should be empty
5943b4d38c65Smrg        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
5944b4d38c65Smrg        #     investigate it a little bit more. (MM)
5945b4d38c65Smrg        wlarc='${wl}'
594615fb4814Smrg
5947b4d38c65Smrg        # ancient GNU ld didn't support --whole-archive et. al.
5948b4d38c65Smrg        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
5949b4d38c65Smrg	  $GREP 'no-whole-archive' > /dev/null; then
5950b4d38c65Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
5951b4d38c65Smrg        else
5952b4d38c65Smrg          _LT_TAGVAR(whole_archive_flag_spec, $1)=
5953b4d38c65Smrg        fi
5954b4d38c65Smrg      else
5955b4d38c65Smrg        with_gnu_ld=no
5956b4d38c65Smrg        wlarc=
5957b4d38c65Smrg
5958b4d38c65Smrg        # A generic and very simple default shared library creation
5959b4d38c65Smrg        # command for GNU C++ for the case where it uses the native
5960b4d38c65Smrg        # linker, instead of GNU ld.  If possible, this setting should
5961b4d38c65Smrg        # overridden to take advantage of the native linker features on
5962b4d38c65Smrg        # the platform it is being used on.
5963b4d38c65Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
5964b4d38c65Smrg      fi
596515fb4814Smrg
5966b4d38c65Smrg      # Commands to make compiler produce verbose output that lists
5967b4d38c65Smrg      # what "hidden" libraries, object files and flags are used when
5968b4d38c65Smrg      # linking a shared library.
5969b4d38c65Smrg      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
597015fb4814Smrg
5971b4d38c65Smrg    else
5972b4d38c65Smrg      GXX=no
5973b4d38c65Smrg      with_gnu_ld=no
5974b4d38c65Smrg      wlarc=
5975b4d38c65Smrg    fi
597615fb4814Smrg
5977b4d38c65Smrg    # PORTME: fill in a description of your system's C++ link characteristics
5978b4d38c65Smrg    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
5979b4d38c65Smrg    _LT_TAGVAR(ld_shlibs, $1)=yes
5980b4d38c65Smrg    case $host_os in
5981b4d38c65Smrg      aix3*)
5982b4d38c65Smrg        # FIXME: insert proper C++ library support
5983b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
5984b4d38c65Smrg        ;;
5985b4d38c65Smrg      aix[[4-9]]*)
5986b4d38c65Smrg        if test "$host_cpu" = ia64; then
5987b4d38c65Smrg          # On IA64, the linker does run time linking by default, so we don't
5988b4d38c65Smrg          # have to do anything special.
5989b4d38c65Smrg          aix_use_runtimelinking=no
5990b4d38c65Smrg          exp_sym_flag='-Bexport'
5991b4d38c65Smrg          no_entry_flag=""
5992b4d38c65Smrg        else
5993b4d38c65Smrg          aix_use_runtimelinking=no
5994b4d38c65Smrg
5995b4d38c65Smrg          # Test if we are trying to use run time linking or normal
5996b4d38c65Smrg          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
5997b4d38c65Smrg          # need to do runtime linking.
5998b4d38c65Smrg          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
5999b4d38c65Smrg	    for ld_flag in $LDFLAGS; do
6000b4d38c65Smrg	      case $ld_flag in
6001b4d38c65Smrg	      *-brtl*)
6002b4d38c65Smrg	        aix_use_runtimelinking=yes
6003b4d38c65Smrg	        break
6004b4d38c65Smrg	        ;;
6005b4d38c65Smrg	      esac
6006b4d38c65Smrg	    done
6007b4d38c65Smrg	    ;;
6008b4d38c65Smrg          esac
600983cab373Smrg
6010b4d38c65Smrg          exp_sym_flag='-bexport'
6011b4d38c65Smrg          no_entry_flag='-bnoentry'
6012b4d38c65Smrg        fi
601315fb4814Smrg
6014b4d38c65Smrg        # When large executables or shared objects are built, AIX ld can
6015b4d38c65Smrg        # have problems creating the table of contents.  If linking a library
6016b4d38c65Smrg        # or program results in "error TOC overflow" add -mminimal-toc to
6017b4d38c65Smrg        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
6018b4d38c65Smrg        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
6019b4d38c65Smrg
6020b4d38c65Smrg        _LT_TAGVAR(archive_cmds, $1)=''
6021b4d38c65Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6022b4d38c65Smrg        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6023b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6024b4d38c65Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6025b4d38c65Smrg        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
6026b4d38c65Smrg
6027b4d38c65Smrg        if test "$GXX" = yes; then
6028b4d38c65Smrg          case $host_os in aix4.[[012]]|aix4.[[012]].*)
6029b4d38c65Smrg          # We only want to do this on AIX 4.2 and lower, the check
6030b4d38c65Smrg          # below for broken collect2 doesn't work under 4.3+
6031b4d38c65Smrg	  collect2name=`${CC} -print-prog-name=collect2`
6032b4d38c65Smrg	  if test -f "$collect2name" &&
6033b4d38c65Smrg	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
6034b4d38c65Smrg	  then
6035b4d38c65Smrg	    # We have reworked collect2
6036b4d38c65Smrg	    :
6037b4d38c65Smrg	  else
6038b4d38c65Smrg	    # We have old collect2
6039b4d38c65Smrg	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
6040b4d38c65Smrg	    # It fails to find uninstalled libraries when the uninstalled
6041b4d38c65Smrg	    # path is not listed in the libpath.  Setting hardcode_minus_L
6042b4d38c65Smrg	    # to unsupported forces relinking
6043b4d38c65Smrg	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
6044b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6045b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
6046b4d38c65Smrg	  fi
6047b4d38c65Smrg          esac
6048b4d38c65Smrg          shared_flag='-shared'
6049b4d38c65Smrg	  if test "$aix_use_runtimelinking" = yes; then
6050b4d38c65Smrg	    shared_flag="$shared_flag "'${wl}-G'
6051b4d38c65Smrg	  fi
6052b4d38c65Smrg        else
6053b4d38c65Smrg          # not using gcc
6054b4d38c65Smrg          if test "$host_cpu" = ia64; then
6055b4d38c65Smrg	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
6056b4d38c65Smrg	  # chokes on -Wl,-G. The following line is correct:
6057b4d38c65Smrg	  shared_flag='-G'
6058b4d38c65Smrg          else
6059b4d38c65Smrg	    if test "$aix_use_runtimelinking" = yes; then
6060b4d38c65Smrg	      shared_flag='${wl}-G'
6061b4d38c65Smrg	    else
6062b4d38c65Smrg	      shared_flag='${wl}-bM:SRE'
6063b4d38c65Smrg	    fi
6064b4d38c65Smrg          fi
6065b4d38c65Smrg        fi
606615fb4814Smrg
6067b4d38c65Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
6068b4d38c65Smrg        # It seems that -bexpall does not export symbols beginning with
6069b4d38c65Smrg        # underscore (_), so it is better to generate a list of symbols to
6070b4d38c65Smrg	# export.
6071b4d38c65Smrg        _LT_TAGVAR(always_export_symbols, $1)=yes
6072b4d38c65Smrg        if test "$aix_use_runtimelinking" = yes; then
6073b4d38c65Smrg          # Warning - without using the other runtime loading flags (-brtl),
6074b4d38c65Smrg          # -berok will link without error, but may produce a broken library.
6075b4d38c65Smrg          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
6076b4d38c65Smrg          # Determine the default libpath from the value encoded in an empty
6077b4d38c65Smrg          # executable.
6078b4d38c65Smrg          _LT_SYS_MODULE_PATH_AIX([$1])
6079b4d38c65Smrg          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6080b4d38c65Smrg
6081b4d38c65Smrg          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
6082b4d38c65Smrg        else
6083b4d38c65Smrg          if test "$host_cpu" = ia64; then
6084b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
6085b4d38c65Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
6086b4d38c65Smrg	    _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"
6087b4d38c65Smrg          else
6088b4d38c65Smrg	    # Determine the default libpath from the value encoded in an
6089b4d38c65Smrg	    # empty executable.
6090b4d38c65Smrg	    _LT_SYS_MODULE_PATH_AIX([$1])
6091b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
6092b4d38c65Smrg	    # Warning - without using the other run time loading flags,
6093b4d38c65Smrg	    # -berok will link without error, but may produce a broken library.
6094b4d38c65Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
6095b4d38c65Smrg	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
6096b4d38c65Smrg	    if test "$with_gnu_ld" = yes; then
6097b4d38c65Smrg	      # We only use this code for GNU lds that support --whole-archive.
6098b4d38c65Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6099b4d38c65Smrg	    else
6100b4d38c65Smrg	      # Exported symbols can be pulled into shared objects from archives
6101b4d38c65Smrg	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
6102b4d38c65Smrg	    fi
6103b4d38c65Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
6104b4d38c65Smrg	    # This is similar to how AIX traditionally builds its shared
6105b4d38c65Smrg	    # libraries.
6106b4d38c65Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
6107b4d38c65Smrg          fi
6108b4d38c65Smrg        fi
6109b4d38c65Smrg        ;;
6110b4d38c65Smrg
6111b4d38c65Smrg      beos*)
6112b4d38c65Smrg	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
6113b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6114b4d38c65Smrg	  # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
6115b4d38c65Smrg	  # support --undefined.  This deserves some investigation.  FIXME
6116b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6117b4d38c65Smrg	else
6118b4d38c65Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6119b4d38c65Smrg	fi
6120b4d38c65Smrg	;;
6121b4d38c65Smrg
6122b4d38c65Smrg      chorus*)
6123b4d38c65Smrg        case $cc_basename in
6124b4d38c65Smrg          *)
6125b4d38c65Smrg	  # FIXME: insert proper C++ library support
6126b4d38c65Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6127b4d38c65Smrg	  ;;
6128b4d38c65Smrg        esac
6129b4d38c65Smrg        ;;
613015fb4814Smrg
6131b4d38c65Smrg      cygwin* | mingw* | pw32* | cegcc*)
6132b4d38c65Smrg	case $GXX,$cc_basename in
6133b4d38c65Smrg	,cl* | no,cl*)
6134b4d38c65Smrg	  # Native MSVC
6135b4d38c65Smrg	  # hardcode_libdir_flag_spec is actually meaningless, as there is
6136b4d38c65Smrg	  # no search path for DLLs.
6137b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
6138b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6139b4d38c65Smrg	  _LT_TAGVAR(always_export_symbols, $1)=yes
6140b4d38c65Smrg	  _LT_TAGVAR(file_list_spec, $1)='@'
6141b4d38c65Smrg	  # Tell ltmain to make .lib files, not .a files.
6142b4d38c65Smrg	  libext=lib
6143b4d38c65Smrg	  # Tell ltmain to make .dll files, not .so files.
6144b4d38c65Smrg	  shrext_cmds=".dll"
6145b4d38c65Smrg	  # FIXME: Setting linknames here is a bad hack.
6146b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
6147b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6148b4d38c65Smrg	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
6149b4d38c65Smrg	    else
6150b4d38c65Smrg	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
6151b4d38c65Smrg	    fi~
6152b4d38c65Smrg	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
6153b4d38c65Smrg	    linknames='
6154b4d38c65Smrg	  # The linker will not automatically build a static lib if we build a DLL.
6155b4d38c65Smrg	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
6156b4d38c65Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6157b4d38c65Smrg	  # Don't use ranlib
6158b4d38c65Smrg	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
6159b4d38c65Smrg	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
6160b4d38c65Smrg	    lt_tool_outputfile="@TOOL_OUTPUT@"~
6161b4d38c65Smrg	    case $lt_outputfile in
6162b4d38c65Smrg	      *.exe|*.EXE) ;;
6163b4d38c65Smrg	      *)
6164b4d38c65Smrg		lt_outputfile="$lt_outputfile.exe"
6165b4d38c65Smrg		lt_tool_outputfile="$lt_tool_outputfile.exe"
6166b4d38c65Smrg		;;
6167b4d38c65Smrg	    esac~
6168b4d38c65Smrg	    func_to_tool_file "$lt_outputfile"~
6169b4d38c65Smrg	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
6170b4d38c65Smrg	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
6171b4d38c65Smrg	      $RM "$lt_outputfile.manifest";
6172b4d38c65Smrg	    fi'
6173b4d38c65Smrg	  ;;
6174b4d38c65Smrg	*)
6175b4d38c65Smrg	  # g++
6176b4d38c65Smrg	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
6177b4d38c65Smrg	  # as there is no search path for DLLs.
6178b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
6179b4d38c65Smrg	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
6180b4d38c65Smrg	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
6181b4d38c65Smrg	  _LT_TAGVAR(always_export_symbols, $1)=no
6182b4d38c65Smrg	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
6183b4d38c65Smrg
6184b4d38c65Smrg	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
6185b4d38c65Smrg	    _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'
6186b4d38c65Smrg	    # If the export-symbols file already is a .def file (1st line
6187b4d38c65Smrg	    # is EXPORTS), use it as is; otherwise, prepend...
6188b4d38c65Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
6189b4d38c65Smrg	      cp $export_symbols $output_objdir/$soname.def;
6190b4d38c65Smrg	    else
6191b4d38c65Smrg	      echo EXPORTS > $output_objdir/$soname.def;
6192b4d38c65Smrg	      cat $export_symbols >> $output_objdir/$soname.def;
6193b4d38c65Smrg	    fi~
6194b4d38c65Smrg	    $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'
6195b4d38c65Smrg	  else
6196b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6197b4d38c65Smrg	  fi
6198b4d38c65Smrg	  ;;
6199b4d38c65Smrg	esac
6200b4d38c65Smrg	;;
6201b4d38c65Smrg      darwin* | rhapsody*)
6202b4d38c65Smrg        _LT_DARWIN_LINKER_FEATURES($1)
6203b4d38c65Smrg	;;
620415fb4814Smrg
6205b4d38c65Smrg      dgux*)
6206b4d38c65Smrg        case $cc_basename in
6207b4d38c65Smrg          ec++*)
6208b4d38c65Smrg	    # FIXME: insert proper C++ library support
6209b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6210b4d38c65Smrg	    ;;
6211b4d38c65Smrg          ghcx*)
6212b4d38c65Smrg	    # Green Hills C++ Compiler
6213b4d38c65Smrg	    # FIXME: insert proper C++ library support
6214b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6215b4d38c65Smrg	    ;;
6216b4d38c65Smrg          *)
6217b4d38c65Smrg	    # FIXME: insert proper C++ library support
6218b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6219b4d38c65Smrg	    ;;
6220b4d38c65Smrg        esac
6221b4d38c65Smrg        ;;
6222b410ddbeSmrg
6223cf503b78Smrg      freebsd2.*)
6224b4d38c65Smrg        # C++ shared libraries reported to be fairly broken before
6225b4d38c65Smrg	# switch to ELF
6226b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6227b4d38c65Smrg        ;;
622815fb4814Smrg
6229b4d38c65Smrg      freebsd-elf*)
6230b4d38c65Smrg        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6231b4d38c65Smrg        ;;
623215fb4814Smrg
6233b4d38c65Smrg      freebsd* | dragonfly*)
6234b4d38c65Smrg        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
6235b4d38c65Smrg        # conventions
6236b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6237b4d38c65Smrg        ;;
623815fb4814Smrg
6239b4d38c65Smrg      gnu*)
6240b4d38c65Smrg        ;;
624115fb4814Smrg
6242b4d38c65Smrg      haiku*)
6243b4d38c65Smrg        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6244b4d38c65Smrg        _LT_TAGVAR(link_all_deplibs, $1)=yes
6245b4d38c65Smrg        ;;
624615fb4814Smrg
6247b4d38c65Smrg      hpux9*)
6248b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6249b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6250b4d38c65Smrg        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6251b4d38c65Smrg        _LT_TAGVAR(hardcode_direct, $1)=yes
6252b4d38c65Smrg        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6253b4d38c65Smrg				             # but as the default
6254b4d38c65Smrg				             # location of the library.
6255b4d38c65Smrg
6256b4d38c65Smrg        case $cc_basename in
6257b4d38c65Smrg          CC*)
6258b4d38c65Smrg            # FIXME: insert proper C++ library support
6259b4d38c65Smrg            _LT_TAGVAR(ld_shlibs, $1)=no
6260b4d38c65Smrg            ;;
6261b4d38c65Smrg          aCC*)
6262b4d38c65Smrg            _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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6263b4d38c65Smrg            # Commands to make compiler produce verbose output that lists
6264b4d38c65Smrg            # what "hidden" libraries, object files and flags are used when
6265b4d38c65Smrg            # linking a shared library.
6266b4d38c65Smrg            #
6267b4d38c65Smrg            # There doesn't appear to be a way to prevent this compiler from
6268b4d38c65Smrg            # explicitly linking system object files so we need to strip them
6269b4d38c65Smrg            # from the output so that they don't get included in the library
6270b4d38c65Smrg            # dependencies.
6271b4d38c65Smrg            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"'
6272b4d38c65Smrg            ;;
6273b4d38c65Smrg          *)
6274b4d38c65Smrg            if test "$GXX" = yes; then
6275b4d38c65Smrg              _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 $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
6276b4d38c65Smrg            else
6277b4d38c65Smrg              # FIXME: insert proper C++ library support
6278b4d38c65Smrg              _LT_TAGVAR(ld_shlibs, $1)=no
6279b4d38c65Smrg            fi
6280b4d38c65Smrg            ;;
6281b4d38c65Smrg        esac
6282b4d38c65Smrg        ;;
628315fb4814Smrg
6284b4d38c65Smrg      hpux10*|hpux11*)
6285b4d38c65Smrg        if test $with_gnu_ld = no; then
6286b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
6287b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6288b4d38c65Smrg
6289b4d38c65Smrg          case $host_cpu in
6290b4d38c65Smrg            hppa*64*|ia64*)
6291b4d38c65Smrg              ;;
6292b4d38c65Smrg            *)
6293b4d38c65Smrg	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6294b4d38c65Smrg              ;;
6295b4d38c65Smrg          esac
6296b4d38c65Smrg        fi
6297b4d38c65Smrg        case $host_cpu in
6298b4d38c65Smrg          hppa*64*|ia64*)
6299b4d38c65Smrg            _LT_TAGVAR(hardcode_direct, $1)=no
6300b4d38c65Smrg            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6301b4d38c65Smrg            ;;
6302b4d38c65Smrg          *)
6303b4d38c65Smrg            _LT_TAGVAR(hardcode_direct, $1)=yes
6304b4d38c65Smrg            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6305b4d38c65Smrg            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
6306b4d38c65Smrg					         # but as the default
6307b4d38c65Smrg					         # location of the library.
6308b4d38c65Smrg            ;;
6309b4d38c65Smrg        esac
631015fb4814Smrg
6311b4d38c65Smrg        case $cc_basename in
6312b4d38c65Smrg          CC*)
6313b4d38c65Smrg	    # FIXME: insert proper C++ library support
6314b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6315b4d38c65Smrg	    ;;
6316b4d38c65Smrg          aCC*)
6317b4d38c65Smrg	    case $host_cpu in
6318b4d38c65Smrg	      hppa*64*)
6319b4d38c65Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6320b4d38c65Smrg	        ;;
6321b4d38c65Smrg	      ia64*)
6322b4d38c65Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6323b4d38c65Smrg	        ;;
6324b4d38c65Smrg	      *)
6325b4d38c65Smrg	        _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'
6326b4d38c65Smrg	        ;;
6327b4d38c65Smrg	    esac
6328b4d38c65Smrg	    # Commands to make compiler produce verbose output that lists
6329b4d38c65Smrg	    # what "hidden" libraries, object files and flags are used when
6330b4d38c65Smrg	    # linking a shared library.
6331b4d38c65Smrg	    #
6332b4d38c65Smrg	    # There doesn't appear to be a way to prevent this compiler from
6333b4d38c65Smrg	    # explicitly linking system object files so we need to strip them
6334b4d38c65Smrg	    # from the output so that they don't get included in the library
6335b4d38c65Smrg	    # dependencies.
6336b4d38c65Smrg	    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"'
6337b4d38c65Smrg	    ;;
6338b4d38c65Smrg          *)
6339b4d38c65Smrg	    if test "$GXX" = yes; then
6340b4d38c65Smrg	      if test $with_gnu_ld = no; then
6341b4d38c65Smrg	        case $host_cpu in
6342b4d38c65Smrg	          hppa*64*)
6343b4d38c65Smrg	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6344b4d38c65Smrg	            ;;
6345b4d38c65Smrg	          ia64*)
6346b4d38c65Smrg	            _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'
6347b4d38c65Smrg	            ;;
6348b4d38c65Smrg	          *)
6349b4d38c65Smrg	            _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'
6350b4d38c65Smrg	            ;;
6351b4d38c65Smrg	        esac
6352b4d38c65Smrg	      fi
6353b4d38c65Smrg	    else
6354b4d38c65Smrg	      # FIXME: insert proper C++ library support
6355b4d38c65Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6356b4d38c65Smrg	    fi
6357b4d38c65Smrg	    ;;
6358b4d38c65Smrg        esac
6359b4d38c65Smrg        ;;
636015fb4814Smrg
6361b4d38c65Smrg      interix[[3-9]]*)
6362b4d38c65Smrg	_LT_TAGVAR(hardcode_direct, $1)=no
6363b4d38c65Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6364b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6365b4d38c65Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6366b4d38c65Smrg	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
6367b4d38c65Smrg	# Instead, shared libraries are loaded at an image base (0x10000000 by
6368b4d38c65Smrg	# default) and relocated if they conflict, which is a slow very memory
6369b4d38c65Smrg	# consuming and fragmenting process.  To avoid this, we pick a random,
6370b4d38c65Smrg	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
6371b4d38c65Smrg	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
6372b4d38c65Smrg	_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'
6373b4d38c65Smrg	_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'
6374b4d38c65Smrg	;;
6375b4d38c65Smrg      irix5* | irix6*)
6376b4d38c65Smrg        case $cc_basename in
6377b4d38c65Smrg          CC*)
6378b4d38c65Smrg	    # SGI C++
6379b4d38c65Smrg	    _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'
6380b4d38c65Smrg
6381b4d38c65Smrg	    # Archives containing C++ object files must be created using
6382b4d38c65Smrg	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
6383b4d38c65Smrg	    # necessary to make sure instantiated templates are included
6384b4d38c65Smrg	    # in the archive.
6385b4d38c65Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
6386b4d38c65Smrg	    ;;
6387b4d38c65Smrg          *)
6388b4d38c65Smrg	    if test "$GXX" = yes; then
6389b4d38c65Smrg	      if test "$with_gnu_ld" = no; then
6390b4d38c65Smrg	        _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'
6391b4d38c65Smrg	      else
6392b4d38c65Smrg	        _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'
6393b4d38c65Smrg	      fi
6394b4d38c65Smrg	    fi
6395b4d38c65Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
6396b4d38c65Smrg	    ;;
6397b4d38c65Smrg        esac
6398b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6399b4d38c65Smrg        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6400b4d38c65Smrg        _LT_TAGVAR(inherit_rpath, $1)=yes
6401b4d38c65Smrg        ;;
640215fb4814Smrg
6403b4d38c65Smrg      linux* | k*bsd*-gnu | kopensolaris*-gnu)
6404b4d38c65Smrg        case $cc_basename in
6405b4d38c65Smrg          KCC*)
6406b4d38c65Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
640715fb4814Smrg
6408b4d38c65Smrg	    # KCC will only create a shared library if the output file
6409b4d38c65Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6410b4d38c65Smrg	    # to its proper name (with version) after linking.
6411b4d38c65Smrg	    _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'
6412b4d38c65Smrg	    _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'
6413b4d38c65Smrg	    # Commands to make compiler produce verbose output that lists
6414b4d38c65Smrg	    # what "hidden" libraries, object files and flags are used when
6415b4d38c65Smrg	    # linking a shared library.
6416b4d38c65Smrg	    #
6417b4d38c65Smrg	    # There doesn't appear to be a way to prevent this compiler from
6418b4d38c65Smrg	    # explicitly linking system object files so we need to strip them
6419b4d38c65Smrg	    # from the output so that they don't get included in the library
6420b4d38c65Smrg	    # dependencies.
6421b4d38c65Smrg	    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"'
6422b4d38c65Smrg
6423b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6424b4d38c65Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6425b4d38c65Smrg
6426b4d38c65Smrg	    # Archives containing C++ object files must be created using
6427b4d38c65Smrg	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
6428b4d38c65Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
6429b4d38c65Smrg	    ;;
6430b4d38c65Smrg	  icpc* | ecpc* )
6431b4d38c65Smrg	    # Intel C++
6432b4d38c65Smrg	    with_gnu_ld=yes
6433b4d38c65Smrg	    # version 8.0 and above of icpc choke on multiply defined symbols
6434b4d38c65Smrg	    # if we add $predep_objects and $postdep_objects, however 7.1 and
6435b4d38c65Smrg	    # earlier do not add the objects themselves.
6436b4d38c65Smrg	    case `$CC -V 2>&1` in
6437b4d38c65Smrg	      *"Version 7."*)
6438b4d38c65Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6439b4d38c65Smrg		_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'
6440b4d38c65Smrg		;;
6441b4d38c65Smrg	      *)  # Version 8.0 or newer
6442b4d38c65Smrg	        tmp_idyn=
6443b4d38c65Smrg	        case $host_cpu in
6444b4d38c65Smrg		  ia64*) tmp_idyn=' -i_dynamic';;
6445b4d38c65Smrg		esac
6446b4d38c65Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6447b4d38c65Smrg		_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'
6448b4d38c65Smrg		;;
6449b4d38c65Smrg	    esac
6450b4d38c65Smrg	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6451b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6452b4d38c65Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6453b4d38c65Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
6454b4d38c65Smrg	    ;;
6455b4d38c65Smrg          pgCC* | pgcpp*)
6456b4d38c65Smrg            # Portland Group C++ compiler
6457b4d38c65Smrg	    case `$CC -V` in
6458b4d38c65Smrg	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
6459b4d38c65Smrg	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
6460b4d38c65Smrg		rm -rf $tpldir~
6461b4d38c65Smrg		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
6462b4d38c65Smrg		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
6463b4d38c65Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
6464b4d38c65Smrg		rm -rf $tpldir~
6465b4d38c65Smrg		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
6466b4d38c65Smrg		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
6467b4d38c65Smrg		$RANLIB $oldlib'
6468b4d38c65Smrg	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
6469b4d38c65Smrg		rm -rf $tpldir~
6470b4d38c65Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6471b4d38c65Smrg		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6472b4d38c65Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
6473b4d38c65Smrg		rm -rf $tpldir~
6474b4d38c65Smrg		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
6475b4d38c65Smrg		$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'
6476b4d38c65Smrg	      ;;
6477b4d38c65Smrg	    *) # Version 6 and above use weak symbols
6478b4d38c65Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
6479b4d38c65Smrg	      _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'
6480b4d38c65Smrg	      ;;
6481b4d38c65Smrg	    esac
648215fb4814Smrg
6483b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
6484b4d38c65Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6485b4d38c65Smrg	    _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'
6486b4d38c65Smrg            ;;
6487b4d38c65Smrg	  cxx*)
6488b4d38c65Smrg	    # Compaq C++
6489b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
6490b4d38c65Smrg	    _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'
649115fb4814Smrg
6492b4d38c65Smrg	    runpath_var=LD_RUN_PATH
6493b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6494b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
649515fb4814Smrg
6496b4d38c65Smrg	    # Commands to make compiler produce verbose output that lists
6497b4d38c65Smrg	    # what "hidden" libraries, object files and flags are used when
6498b4d38c65Smrg	    # linking a shared library.
6499b4d38c65Smrg	    #
6500b4d38c65Smrg	    # There doesn't appear to be a way to prevent this compiler from
6501b4d38c65Smrg	    # explicitly linking system object files so we need to strip them
6502b4d38c65Smrg	    # from the output so that they don't get included in the library
6503b4d38c65Smrg	    # dependencies.
6504b4d38c65Smrg	    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'
6505b4d38c65Smrg	    ;;
6506b4d38c65Smrg	  xl* | mpixl* | bgxl*)
6507b4d38c65Smrg	    # IBM XL 8.0 on PPC, with GNU ld
6508b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6509b4d38c65Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
6510b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
6511b4d38c65Smrg	    if test "x$supports_anon_versioning" = xyes; then
6512b4d38c65Smrg	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
6513b4d38c65Smrg		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
6514b4d38c65Smrg		echo "local: *; };" >> $output_objdir/$libname.ver~
6515b4d38c65Smrg		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
6516b4d38c65Smrg	    fi
6517b4d38c65Smrg	    ;;
6518b4d38c65Smrg	  *)
6519b4d38c65Smrg	    case `$CC -V 2>&1 | sed 5q` in
6520b4d38c65Smrg	    *Sun\ C*)
6521b4d38c65Smrg	      # Sun C++ 5.9
6522b4d38c65Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6523b4d38c65Smrg	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6524b4d38c65Smrg	      _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'
6525b4d38c65Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6526b4d38c65Smrg	      _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'
6527b4d38c65Smrg	      _LT_TAGVAR(compiler_needs_object, $1)=yes
6528b4d38c65Smrg
6529b4d38c65Smrg	      # Not sure whether something based on
6530b4d38c65Smrg	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
6531b4d38c65Smrg	      # would be better.
6532b4d38c65Smrg	      output_verbose_link_cmd='func_echo_all'
6533b4d38c65Smrg
6534b4d38c65Smrg	      # Archives containing C++ object files must be created using
6535b4d38c65Smrg	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6536b4d38c65Smrg	      # necessary to make sure instantiated templates are included
6537b4d38c65Smrg	      # in the archive.
6538b4d38c65Smrg	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6539b4d38c65Smrg	      ;;
6540b4d38c65Smrg	    esac
6541b4d38c65Smrg	    ;;
6542b4d38c65Smrg	esac
6543b4d38c65Smrg	;;
654415fb4814Smrg
6545b4d38c65Smrg      lynxos*)
6546b4d38c65Smrg        # FIXME: insert proper C++ library support
6547b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6548b4d38c65Smrg	;;
654915fb4814Smrg
6550b4d38c65Smrg      m88k*)
6551b4d38c65Smrg        # FIXME: insert proper C++ library support
6552b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6553b4d38c65Smrg	;;
655415fb4814Smrg
6555b4d38c65Smrg      mvs*)
6556b4d38c65Smrg        case $cc_basename in
6557b4d38c65Smrg          cxx*)
6558b4d38c65Smrg	    # FIXME: insert proper C++ library support
6559b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6560b4d38c65Smrg	    ;;
6561b4d38c65Smrg	  *)
6562b4d38c65Smrg	    # FIXME: insert proper C++ library support
6563b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6564b4d38c65Smrg	    ;;
6565b4d38c65Smrg	esac
6566b4d38c65Smrg	;;
656715fb4814Smrg
6568b4d38c65Smrg      netbsd*)
6569b4d38c65Smrg        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
6570b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
6571b4d38c65Smrg	  wlarc=
6572b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6573b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6574b4d38c65Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6575b4d38c65Smrg	fi
6576b4d38c65Smrg	# Workaround some broken pre-1.5 toolchains
6577b4d38c65Smrg	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
6578b4d38c65Smrg	;;
657915fb4814Smrg
6580b4d38c65Smrg      *nto* | *qnx*)
6581b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=yes
6582b4d38c65Smrg	;;
658315fb4814Smrg
6584b4d38c65Smrg      openbsd2*)
6585b4d38c65Smrg        # C++ shared libraries are fairly broken
6586b4d38c65Smrg	_LT_TAGVAR(ld_shlibs, $1)=no
6587b4d38c65Smrg	;;
658815fb4814Smrg
6589b4d38c65Smrg      openbsd*)
6590b4d38c65Smrg	if test -f /usr/libexec/ld.so; then
6591b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct, $1)=yes
6592b4d38c65Smrg	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6593b4d38c65Smrg	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
6594b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
6595b4d38c65Smrg	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6596b4d38c65Smrg	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
6597b4d38c65Smrg	    _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'
6598b4d38c65Smrg	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
6599b4d38c65Smrg	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
6600b4d38c65Smrg	  fi
6601b4d38c65Smrg	  output_verbose_link_cmd=func_echo_all
6602b4d38c65Smrg	else
6603b4d38c65Smrg	  _LT_TAGVAR(ld_shlibs, $1)=no
6604b4d38c65Smrg	fi
6605b4d38c65Smrg	;;
660615fb4814Smrg
6607b4d38c65Smrg      osf3* | osf4* | osf5*)
6608b4d38c65Smrg        case $cc_basename in
6609b4d38c65Smrg          KCC*)
6610b4d38c65Smrg	    # Kuck and Associates, Inc. (KAI) C++ Compiler
6611b4d38c65Smrg
6612b4d38c65Smrg	    # KCC will only create a shared library if the output file
6613b4d38c65Smrg	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
6614b4d38c65Smrg	    # to its proper name (with version) after linking.
6615b4d38c65Smrg	    _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'
6616b4d38c65Smrg
6617b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
6618b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6619b4d38c65Smrg
6620b4d38c65Smrg	    # Archives containing C++ object files must be created using
6621b4d38c65Smrg	    # the KAI C++ compiler.
6622b4d38c65Smrg	    case $host in
6623b4d38c65Smrg	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
6624b4d38c65Smrg	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
6625b4d38c65Smrg	    esac
6626b4d38c65Smrg	    ;;
6627b4d38c65Smrg          RCC*)
6628b4d38c65Smrg	    # Rational C++ 2.4.1
6629b4d38c65Smrg	    # FIXME: insert proper C++ library support
6630b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6631b4d38c65Smrg	    ;;
6632b4d38c65Smrg          cxx*)
6633b4d38c65Smrg	    case $host in
6634b4d38c65Smrg	      osf3*)
6635b4d38c65Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6636b4d38c65Smrg	        _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'
6637b4d38c65Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6638b4d38c65Smrg		;;
6639b4d38c65Smrg	      *)
6640b4d38c65Smrg	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
6641b4d38c65Smrg	        _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'
6642b4d38c65Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
6643b4d38c65Smrg	          echo "-hidden">> $lib.exp~
6644b4d38c65Smrg	          $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~
6645b4d38c65Smrg	          $RM $lib.exp'
6646b4d38c65Smrg	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
6647b4d38c65Smrg		;;
6648b4d38c65Smrg	    esac
664915fb4814Smrg
6650b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
665115fb4814Smrg
6652b4d38c65Smrg	    # Commands to make compiler produce verbose output that lists
6653b4d38c65Smrg	    # what "hidden" libraries, object files and flags are used when
6654b4d38c65Smrg	    # linking a shared library.
6655b4d38c65Smrg	    #
6656b4d38c65Smrg	    # There doesn't appear to be a way to prevent this compiler from
6657b4d38c65Smrg	    # explicitly linking system object files so we need to strip them
6658b4d38c65Smrg	    # from the output so that they don't get included in the library
6659b4d38c65Smrg	    # dependencies.
6660b4d38c65Smrg	    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"'
6661b4d38c65Smrg	    ;;
6662b4d38c65Smrg	  *)
6663b4d38c65Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6664b4d38c65Smrg	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
6665b4d38c65Smrg	      case $host in
6666b4d38c65Smrg	        osf3*)
6667b4d38c65Smrg	          _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'
6668b4d38c65Smrg		  ;;
6669b4d38c65Smrg	        *)
6670b4d38c65Smrg	          _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'
6671b4d38c65Smrg		  ;;
6672b4d38c65Smrg	      esac
6673b4d38c65Smrg
6674b4d38c65Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
6675b4d38c65Smrg	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
6676b4d38c65Smrg
6677b4d38c65Smrg	      # Commands to make compiler produce verbose output that lists
6678b4d38c65Smrg	      # what "hidden" libraries, object files and flags are used when
6679b4d38c65Smrg	      # linking a shared library.
6680b4d38c65Smrg	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6681b4d38c65Smrg
6682b4d38c65Smrg	    else
6683b4d38c65Smrg	      # FIXME: insert proper C++ library support
6684b4d38c65Smrg	      _LT_TAGVAR(ld_shlibs, $1)=no
6685b4d38c65Smrg	    fi
6686b4d38c65Smrg	    ;;
6687b4d38c65Smrg        esac
6688b4d38c65Smrg        ;;
668915fb4814Smrg
6690b4d38c65Smrg      psos*)
6691b4d38c65Smrg        # FIXME: insert proper C++ library support
6692b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6693b4d38c65Smrg        ;;
669415fb4814Smrg
6695b4d38c65Smrg      sunos4*)
6696b4d38c65Smrg        case $cc_basename in
6697b4d38c65Smrg          CC*)
6698b4d38c65Smrg	    # Sun C++ 4.x
6699b4d38c65Smrg	    # FIXME: insert proper C++ library support
6700b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6701b4d38c65Smrg	    ;;
6702b4d38c65Smrg          lcc*)
6703b4d38c65Smrg	    # Lucid
6704b4d38c65Smrg	    # FIXME: insert proper C++ library support
6705b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6706b4d38c65Smrg	    ;;
6707b4d38c65Smrg          *)
6708b4d38c65Smrg	    # FIXME: insert proper C++ library support
6709b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6710b4d38c65Smrg	    ;;
6711b4d38c65Smrg        esac
6712b4d38c65Smrg        ;;
671315fb4814Smrg
6714b4d38c65Smrg      solaris*)
6715b4d38c65Smrg        case $cc_basename in
6716b4d38c65Smrg          CC* | sunCC*)
6717b4d38c65Smrg	    # Sun C++ 4.2, 5.x and Centerline C++
6718b4d38c65Smrg            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
6719b4d38c65Smrg	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
6720b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
6721b4d38c65Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6722b4d38c65Smrg	      $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'
6723b4d38c65Smrg
6724b4d38c65Smrg	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
6725b4d38c65Smrg	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6726b4d38c65Smrg	    case $host_os in
6727b4d38c65Smrg	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6728b4d38c65Smrg	      *)
6729b4d38c65Smrg		# The compiler driver will combine and reorder linker options,
6730b4d38c65Smrg		# but understands `-z linker_flag'.
6731b4d38c65Smrg	        # Supported since Solaris 2.6 (maybe 2.5.1?)
6732b4d38c65Smrg		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
6733b4d38c65Smrg	        ;;
6734b4d38c65Smrg	    esac
6735b4d38c65Smrg	    _LT_TAGVAR(link_all_deplibs, $1)=yes
673615fb4814Smrg
6737b4d38c65Smrg	    output_verbose_link_cmd='func_echo_all'
673815fb4814Smrg
6739b4d38c65Smrg	    # Archives containing C++ object files must be created using
6740b4d38c65Smrg	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
6741b4d38c65Smrg	    # necessary to make sure instantiated templates are included
6742b4d38c65Smrg	    # in the archive.
6743b4d38c65Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
6744b4d38c65Smrg	    ;;
6745b4d38c65Smrg          gcx*)
6746b4d38c65Smrg	    # Green Hills C++ Compiler
6747b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
674815fb4814Smrg
6749b4d38c65Smrg	    # The C++ compiler must be used to create the archive.
6750b4d38c65Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
6751b4d38c65Smrg	    ;;
6752b4d38c65Smrg          *)
6753b4d38c65Smrg	    # GNU C++ compiler with Solaris linker
6754b4d38c65Smrg	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
6755b4d38c65Smrg	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
6756b4d38c65Smrg	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
6757b4d38c65Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6758b4d38c65Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6759b4d38c65Smrg		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6760b4d38c65Smrg
6761b4d38c65Smrg	        # Commands to make compiler produce verbose output that lists
6762b4d38c65Smrg	        # what "hidden" libraries, object files and flags are used when
6763b4d38c65Smrg	        # linking a shared library.
6764b4d38c65Smrg	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6765b4d38c65Smrg	      else
6766b4d38c65Smrg	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
6767b4d38c65Smrg	        # platform.
6768b4d38c65Smrg	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
6769b4d38c65Smrg	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
6770b4d38c65Smrg		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
6771b4d38c65Smrg
6772b4d38c65Smrg	        # Commands to make compiler produce verbose output that lists
6773b4d38c65Smrg	        # what "hidden" libraries, object files and flags are used when
6774b4d38c65Smrg	        # linking a shared library.
6775b4d38c65Smrg	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
6776b4d38c65Smrg	      fi
6777b4d38c65Smrg
6778b4d38c65Smrg	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
6779b4d38c65Smrg	      case $host_os in
6780b4d38c65Smrg		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
6781b4d38c65Smrg		*)
6782b4d38c65Smrg		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
6783b4d38c65Smrg		  ;;
6784b4d38c65Smrg	      esac
6785b4d38c65Smrg	    fi
6786b4d38c65Smrg	    ;;
6787b4d38c65Smrg        esac
6788b4d38c65Smrg        ;;
678915fb4814Smrg
6790b4d38c65Smrg    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
6791b4d38c65Smrg      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6792b4d38c65Smrg      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
6793b4d38c65Smrg      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6794b4d38c65Smrg      runpath_var='LD_RUN_PATH'
679515fb4814Smrg
6796b4d38c65Smrg      case $cc_basename in
6797b4d38c65Smrg        CC*)
6798b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6799b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6800b4d38c65Smrg	  ;;
6801b4d38c65Smrg	*)
6802b4d38c65Smrg	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6803b4d38c65Smrg	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6804b4d38c65Smrg	  ;;
6805b4d38c65Smrg      esac
6806b4d38c65Smrg      ;;
680715fb4814Smrg
6808b4d38c65Smrg      sysv5* | sco3.2v5* | sco5v6*)
6809b4d38c65Smrg	# Note: We can NOT use -z defs as we might desire, because we do not
6810b4d38c65Smrg	# link with -lc, and that would cause any symbols used from libc to
6811b4d38c65Smrg	# always be unresolved, which means just about no library would
6812b4d38c65Smrg	# ever link correctly.  If we're not using GNU ld we use -z text
6813b4d38c65Smrg	# though, which does catch some bad symbols but isn't as heavy-handed
6814b4d38c65Smrg	# as -z defs.
6815b4d38c65Smrg	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
6816b4d38c65Smrg	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
6817b4d38c65Smrg	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
6818b4d38c65Smrg	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
6819b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
6820b4d38c65Smrg	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
6821b4d38c65Smrg	_LT_TAGVAR(link_all_deplibs, $1)=yes
6822b4d38c65Smrg	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
6823b4d38c65Smrg	runpath_var='LD_RUN_PATH'
682415fb4814Smrg
6825b4d38c65Smrg	case $cc_basename in
6826b4d38c65Smrg          CC*)
6827b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6828b4d38c65Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6829b4d38c65Smrg	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
6830b4d38c65Smrg	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
6831b4d38c65Smrg	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
6832b4d38c65Smrg	      '"$_LT_TAGVAR(reload_cmds, $1)"
6833b4d38c65Smrg	    ;;
6834b4d38c65Smrg	  *)
6835b4d38c65Smrg	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6836b4d38c65Smrg	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
6837b4d38c65Smrg	    ;;
6838b4d38c65Smrg	esac
6839b4d38c65Smrg      ;;
684015fb4814Smrg
6841b4d38c65Smrg      tandem*)
6842b4d38c65Smrg        case $cc_basename in
6843b4d38c65Smrg          NCC*)
6844b4d38c65Smrg	    # NonStop-UX NCC 3.20
6845b4d38c65Smrg	    # FIXME: insert proper C++ library support
6846b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6847b4d38c65Smrg	    ;;
6848b4d38c65Smrg          *)
6849b4d38c65Smrg	    # FIXME: insert proper C++ library support
6850b4d38c65Smrg	    _LT_TAGVAR(ld_shlibs, $1)=no
6851b4d38c65Smrg	    ;;
6852b4d38c65Smrg        esac
6853b4d38c65Smrg        ;;
685415fb4814Smrg
6855b4d38c65Smrg      vxworks*)
6856b4d38c65Smrg        # FIXME: insert proper C++ library support
6857b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6858b4d38c65Smrg        ;;
685915fb4814Smrg
6860b4d38c65Smrg      *)
6861b4d38c65Smrg        # FIXME: insert proper C++ library support
6862b4d38c65Smrg        _LT_TAGVAR(ld_shlibs, $1)=no
6863b4d38c65Smrg        ;;
6864b4d38c65Smrg    esac
686515fb4814Smrg
6866b4d38c65Smrg    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
6867b4d38c65Smrg    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
6868b4d38c65Smrg
6869b4d38c65Smrg    _LT_TAGVAR(GCC, $1)="$GXX"
6870b4d38c65Smrg    _LT_TAGVAR(LD, $1)="$LD"
6871b4d38c65Smrg
6872b4d38c65Smrg    ## CAVEAT EMPTOR:
6873b4d38c65Smrg    ## There is no encapsulation within the following macros, do not change
6874b4d38c65Smrg    ## the running order or otherwise move them around unless you know exactly
6875b4d38c65Smrg    ## what you are doing...
6876b4d38c65Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
6877b4d38c65Smrg    _LT_COMPILER_PIC($1)
6878b4d38c65Smrg    _LT_COMPILER_C_O($1)
6879b4d38c65Smrg    _LT_COMPILER_FILE_LOCKS($1)
6880b4d38c65Smrg    _LT_LINKER_SHLIBS($1)
6881b4d38c65Smrg    _LT_SYS_DYNAMIC_LINKER($1)
6882b4d38c65Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
6883b4d38c65Smrg
6884b4d38c65Smrg    _LT_CONFIG($1)
6885b4d38c65Smrg  fi # test -n "$compiler"
6886b4d38c65Smrg
6887b4d38c65Smrg  CC=$lt_save_CC
6888b4d38c65Smrg  CFLAGS=$lt_save_CFLAGS
6889b4d38c65Smrg  LDCXX=$LD
6890b4d38c65Smrg  LD=$lt_save_LD
6891b4d38c65Smrg  GCC=$lt_save_GCC
6892b4d38c65Smrg  with_gnu_ld=$lt_save_with_gnu_ld
6893b4d38c65Smrg  lt_cv_path_LDCXX=$lt_cv_path_LD
6894b4d38c65Smrg  lt_cv_path_LD=$lt_save_path_LD
6895b4d38c65Smrg  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
6896b4d38c65Smrg  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
6897b4d38c65Smrgfi # test "$_lt_caught_CXX_error" != yes
689815fb4814Smrg
6899b4d38c65SmrgAC_LANG_POP
6900b4d38c65Smrg])# _LT_LANG_CXX_CONFIG
690115fb4814Smrg
690215fb4814Smrg
6903b4d38c65Smrg# _LT_FUNC_STRIPNAME_CNF
6904b4d38c65Smrg# ----------------------
6905b4d38c65Smrg# func_stripname_cnf prefix suffix name
6906b4d38c65Smrg# strip PREFIX and SUFFIX off of NAME.
6907b4d38c65Smrg# PREFIX and SUFFIX must not contain globbing or regex special
6908b4d38c65Smrg# characters, hashes, percent signs, but SUFFIX may contain a leading
6909b4d38c65Smrg# dot (in which case that matches only a dot).
6910b4d38c65Smrg#
6911b4d38c65Smrg# This function is identical to the (non-XSI) version of func_stripname,
6912b4d38c65Smrg# except this one can be used by m4 code that may be executed by configure,
6913b4d38c65Smrg# rather than the libtool script.
6914b4d38c65Smrgm4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
6915b4d38c65SmrgAC_REQUIRE([_LT_DECL_SED])
6916b4d38c65SmrgAC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
6917b4d38c65Smrgfunc_stripname_cnf ()
6918b4d38c65Smrg{
6919b4d38c65Smrg  case ${2} in
6920b4d38c65Smrg  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
6921b4d38c65Smrg  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
6922b534f209Smrg  esac
6923b4d38c65Smrg} # func_stripname_cnf
6924b4d38c65Smrg])# _LT_FUNC_STRIPNAME_CNF
692515fb4814Smrg
6926b4d38c65Smrg# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
6927b4d38c65Smrg# ---------------------------------
6928b4d38c65Smrg# Figure out "hidden" library dependencies from verbose
6929b4d38c65Smrg# compiler output when linking a shared library.
6930b4d38c65Smrg# Parse the compiler output and extract the necessary
6931b4d38c65Smrg# objects, libraries and library flags.
6932b4d38c65Smrgm4_defun([_LT_SYS_HIDDEN_LIBDEPS],
6933b4d38c65Smrg[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
6934b4d38c65SmrgAC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
6935b4d38c65Smrg# Dependencies to place before and after the object being linked:
6936b4d38c65Smrg_LT_TAGVAR(predep_objects, $1)=
6937b4d38c65Smrg_LT_TAGVAR(postdep_objects, $1)=
6938b4d38c65Smrg_LT_TAGVAR(predeps, $1)=
6939b4d38c65Smrg_LT_TAGVAR(postdeps, $1)=
6940b4d38c65Smrg_LT_TAGVAR(compiler_lib_search_path, $1)=
694115fb4814Smrg
6942b4d38c65Smrgdnl we can't use the lt_simple_compile_test_code here,
6943b4d38c65Smrgdnl because it contains code intended for an executable,
6944b4d38c65Smrgdnl not a library.  It's possible we should let each
6945b4d38c65Smrgdnl tag define a new lt_????_link_test_code variable,
6946b4d38c65Smrgdnl but it's only used here...
6947b4d38c65Smrgm4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
6948b4d38c65Smrgint a;
6949b4d38c65Smrgvoid foo (void) { a = 0; }
6950b4d38c65Smrg_LT_EOF
6951b4d38c65Smrg], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
6952b4d38c65Smrgclass Foo
6953b4d38c65Smrg{
6954b4d38c65Smrgpublic:
6955b4d38c65Smrg  Foo (void) { a = 0; }
6956b4d38c65Smrgprivate:
6957b4d38c65Smrg  int a;
6958b4d38c65Smrg};
6959b4d38c65Smrg_LT_EOF
6960b4d38c65Smrg], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
6961b4d38c65Smrg      subroutine foo
6962b4d38c65Smrg      implicit none
6963b4d38c65Smrg      integer*4 a
6964b4d38c65Smrg      a=0
6965b4d38c65Smrg      return
6966b4d38c65Smrg      end
6967b4d38c65Smrg_LT_EOF
6968b4d38c65Smrg], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
6969b4d38c65Smrg      subroutine foo
6970b4d38c65Smrg      implicit none
6971b4d38c65Smrg      integer a
6972b4d38c65Smrg      a=0
6973b4d38c65Smrg      return
6974b4d38c65Smrg      end
6975b4d38c65Smrg_LT_EOF
6976b4d38c65Smrg], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
6977b4d38c65Smrgpublic class foo {
6978b4d38c65Smrg  private int a;
6979b4d38c65Smrg  public void bar (void) {
6980b4d38c65Smrg    a = 0;
6981b4d38c65Smrg  }
6982b4d38c65Smrg};
6983b4d38c65Smrg_LT_EOF
6984cf503b78Smrg], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
6985cf503b78Smrgpackage foo
6986cf503b78Smrgfunc foo() {
6987cf503b78Smrg}
6988cf503b78Smrg_LT_EOF
6989b534f209Smrg])
6990b410ddbeSmrg
6991b4d38c65Smrg_lt_libdeps_save_CFLAGS=$CFLAGS
6992b4d38c65Smrgcase "$CC $CFLAGS " in #(
6993b4d38c65Smrg*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
6994b4d38c65Smrg*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
6995cf503b78Smrg*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
6996b4d38c65Smrgesac
699715fb4814Smrg
6998b4d38c65Smrgdnl Parse the compiler output and extract the necessary
6999b4d38c65Smrgdnl objects, libraries and library flags.
7000b4d38c65Smrgif AC_TRY_EVAL(ac_compile); then
7001b4d38c65Smrg  # Parse the compiler output and extract the necessary
7002b4d38c65Smrg  # objects, libraries and library flags.
700315fb4814Smrg
7004b4d38c65Smrg  # Sentinel used to keep track of whether or not we are before
7005b4d38c65Smrg  # the conftest object file.
7006b4d38c65Smrg  pre_test_object_deps_done=no
700715fb4814Smrg
7008b4d38c65Smrg  for p in `eval "$output_verbose_link_cmd"`; do
7009b4d38c65Smrg    case ${prev}${p} in
701015fb4814Smrg
7011b4d38c65Smrg    -L* | -R* | -l*)
7012b4d38c65Smrg       # Some compilers place space between "-{L,R}" and the path.
7013b4d38c65Smrg       # Remove the space.
7014b4d38c65Smrg       if test $p = "-L" ||
7015b4d38c65Smrg          test $p = "-R"; then
7016b4d38c65Smrg	 prev=$p
7017b4d38c65Smrg	 continue
7018b4d38c65Smrg       fi
701915fb4814Smrg
7020b4d38c65Smrg       # Expand the sysroot to ease extracting the directories later.
7021b4d38c65Smrg       if test -z "$prev"; then
7022b4d38c65Smrg         case $p in
7023b4d38c65Smrg         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
7024b4d38c65Smrg         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
7025b4d38c65Smrg         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
7026b4d38c65Smrg         esac
7027b4d38c65Smrg       fi
7028b4d38c65Smrg       case $p in
7029b4d38c65Smrg       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
7030b4d38c65Smrg       esac
7031b4d38c65Smrg       if test "$pre_test_object_deps_done" = no; then
7032b4d38c65Smrg	 case ${prev} in
7033b4d38c65Smrg	 -L | -R)
7034b4d38c65Smrg	   # Internal compiler library paths should come after those
7035b4d38c65Smrg	   # provided the user.  The postdeps already come after the
7036b4d38c65Smrg	   # user supplied libs so there is no need to process them.
7037b4d38c65Smrg	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
7038b4d38c65Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
7039b4d38c65Smrg	   else
7040b4d38c65Smrg	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
7041b4d38c65Smrg	   fi
7042b4d38c65Smrg	   ;;
7043b4d38c65Smrg	 # The "-l" case would never come before the object being
7044b4d38c65Smrg	 # linked, so don't bother handling this case.
7045b4d38c65Smrg	 esac
7046b4d38c65Smrg       else
7047b4d38c65Smrg	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
7048b4d38c65Smrg	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
7049b4d38c65Smrg	 else
7050b4d38c65Smrg	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
7051b4d38c65Smrg	 fi
7052b4d38c65Smrg       fi
7053b4d38c65Smrg       prev=
7054b4d38c65Smrg       ;;
705515fb4814Smrg
7056b4d38c65Smrg    *.lto.$objext) ;; # Ignore GCC LTO objects
7057b4d38c65Smrg    *.$objext)
7058b4d38c65Smrg       # This assumes that the test object file only shows up
7059b4d38c65Smrg       # once in the compiler output.
7060b4d38c65Smrg       if test "$p" = "conftest.$objext"; then
7061b4d38c65Smrg	 pre_test_object_deps_done=yes
7062b4d38c65Smrg	 continue
7063b4d38c65Smrg       fi
706415fb4814Smrg
7065b4d38c65Smrg       if test "$pre_test_object_deps_done" = no; then
7066b4d38c65Smrg	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
7067b4d38c65Smrg	   _LT_TAGVAR(predep_objects, $1)="$p"
7068b4d38c65Smrg	 else
7069b4d38c65Smrg	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
7070b4d38c65Smrg	 fi
7071b4d38c65Smrg       else
7072b4d38c65Smrg	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
7073b4d38c65Smrg	   _LT_TAGVAR(postdep_objects, $1)="$p"
7074b4d38c65Smrg	 else
7075b4d38c65Smrg	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
7076b4d38c65Smrg	 fi
7077b4d38c65Smrg       fi
7078b4d38c65Smrg       ;;
707915fb4814Smrg
7080b4d38c65Smrg    *) ;; # Ignore the rest.
708115fb4814Smrg
7082b4d38c65Smrg    esac
7083b4d38c65Smrg  done
7084b4d38c65Smrg
7085b4d38c65Smrg  # Clean up.
7086b4d38c65Smrg  rm -f a.out a.exe
7087b4d38c65Smrgelse
7088b4d38c65Smrg  echo "libtool.m4: error: problem compiling $1 test program"
7089b4d38c65Smrgfi
7090b4d38c65Smrg
7091b4d38c65Smrg$RM -f confest.$objext
7092b4d38c65SmrgCFLAGS=$_lt_libdeps_save_CFLAGS
7093b4d38c65Smrg
7094b4d38c65Smrg# PORTME: override above test on systems where it is broken
7095b4d38c65Smrgm4_if([$1], [CXX],
7096b4d38c65Smrg[case $host_os in
7097b4d38c65Smrginterix[[3-9]]*)
7098b4d38c65Smrg  # Interix 3.5 installs completely hosed .la files for C++, so rather than
7099b4d38c65Smrg  # hack all around it, let's just trust "g++" to DTRT.
7100b4d38c65Smrg  _LT_TAGVAR(predep_objects,$1)=
7101b4d38c65Smrg  _LT_TAGVAR(postdep_objects,$1)=
7102b4d38c65Smrg  _LT_TAGVAR(postdeps,$1)=
7103b534f209Smrg  ;;
7104b4d38c65Smrg
7105b4d38c65Smrglinux*)
7106b4d38c65Smrg  case `$CC -V 2>&1 | sed 5q` in
7107b4d38c65Smrg  *Sun\ C*)
7108b4d38c65Smrg    # Sun C++ 5.9
7109b4d38c65Smrg
7110b4d38c65Smrg    # The more standards-conforming stlport4 library is
7111b4d38c65Smrg    # incompatible with the Cstd library. Avoid specifying
7112b4d38c65Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7113b4d38c65Smrg    # -library=stlport4 depends on it.
7114b4d38c65Smrg    case " $CXX $CXXFLAGS " in
7115b4d38c65Smrg    *" -library=stlport4 "*)
7116b4d38c65Smrg      solaris_use_stlport4=yes
7117b4d38c65Smrg      ;;
7118b4d38c65Smrg    esac
7119b4d38c65Smrg
7120b4d38c65Smrg    if test "$solaris_use_stlport4" != yes; then
7121b4d38c65Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7122b4d38c65Smrg    fi
7123b4d38c65Smrg    ;;
7124b4d38c65Smrg  esac
7125b534f209Smrg  ;;
7126b4d38c65Smrg
7127b534f209Smrgsolaris*)
7128b4d38c65Smrg  case $cc_basename in
7129b4d38c65Smrg  CC* | sunCC*)
7130b4d38c65Smrg    # The more standards-conforming stlport4 library is
7131b4d38c65Smrg    # incompatible with the Cstd library. Avoid specifying
7132b4d38c65Smrg    # it if it's in CXXFLAGS. Ignore libCrun as
7133b4d38c65Smrg    # -library=stlport4 depends on it.
7134b4d38c65Smrg    case " $CXX $CXXFLAGS " in
7135b4d38c65Smrg    *" -library=stlport4 "*)
7136b4d38c65Smrg      solaris_use_stlport4=yes
7137b4d38c65Smrg      ;;
7138b4d38c65Smrg    esac
713915fb4814Smrg
7140b4d38c65Smrg    # Adding this requires a known-good setup of shared libraries for
7141b4d38c65Smrg    # Sun compiler versions before 5.6, else PIC objects from an old
7142b4d38c65Smrg    # archive will be linked into the output, leading to subtle bugs.
7143b4d38c65Smrg    if test "$solaris_use_stlport4" != yes; then
7144b4d38c65Smrg      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
7145b4d38c65Smrg    fi
7146b4d38c65Smrg    ;;
7147b4d38c65Smrg  esac
7148b534f209Smrg  ;;
7149b534f209Smrgesac
7150b4d38c65Smrg])
715115fb4814Smrg
7152b4d38c65Smrgcase " $_LT_TAGVAR(postdeps, $1) " in
7153b4d38c65Smrg*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
7154b534f209Smrgesac
7155b4d38c65Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=
7156b4d38c65Smrgif test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
7157b4d38c65Smrg _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
7158b4d38c65Smrgfi
7159b4d38c65Smrg_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
7160b4d38c65Smrg    [The directories searched by this compiler when creating a shared library])
7161b4d38c65Smrg_LT_TAGDECL([], [predep_objects], [1],
7162b4d38c65Smrg    [Dependencies to place before and after the objects being linked to
7163b4d38c65Smrg    create a shared library])
7164b4d38c65Smrg_LT_TAGDECL([], [postdep_objects], [1])
7165b4d38c65Smrg_LT_TAGDECL([], [predeps], [1])
7166b4d38c65Smrg_LT_TAGDECL([], [postdeps], [1])
7167b4d38c65Smrg_LT_TAGDECL([], [compiler_lib_search_path], [1],
7168b4d38c65Smrg    [The library search path used internally by the compiler when linking
7169b4d38c65Smrg    a shared library])
7170b4d38c65Smrg])# _LT_SYS_HIDDEN_LIBDEPS
7171b4d38c65Smrg
7172b4d38c65Smrg
7173b4d38c65Smrg# _LT_LANG_F77_CONFIG([TAG])
7174b4d38c65Smrg# --------------------------
7175b4d38c65Smrg# Ensure that the configuration variables for a Fortran 77 compiler are
7176b4d38c65Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7177b4d38c65Smrg# to write the compiler configuration to `libtool'.
7178b4d38c65Smrgm4_defun([_LT_LANG_F77_CONFIG],
7179b4d38c65Smrg[AC_LANG_PUSH(Fortran 77)
7180b4d38c65Smrgif test -z "$F77" || test "X$F77" = "Xno"; then
7181b4d38c65Smrg  _lt_disable_F77=yes
7182b4d38c65Smrgfi
718315fb4814Smrg
7184b4d38c65Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7185b4d38c65Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7186b4d38c65Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7187b4d38c65Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7188b4d38c65Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7189b4d38c65Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7190b4d38c65Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7191b4d38c65Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7192b4d38c65Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7193b4d38c65Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7194b4d38c65Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7195b4d38c65Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7196b4d38c65Smrg_LT_TAGVAR(module_cmds, $1)=
7197b4d38c65Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7198b4d38c65Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7199b4d38c65Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7200b4d38c65Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7201b4d38c65Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7202b4d38c65Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7203b4d38c65Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7204b4d38c65Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7205b410ddbeSmrg
7206b4d38c65Smrg# Source file extension for f77 test sources.
7207b4d38c65Smrgac_ext=f
720815fb4814Smrg
7209b4d38c65Smrg# Object file extension for compiled f77 test sources.
7210b4d38c65Smrgobjext=o
7211b4d38c65Smrg_LT_TAGVAR(objext, $1)=$objext
7212b4d38c65Smrg
7213b4d38c65Smrg# No sense in running all these tests if we already determined that
7214b4d38c65Smrg# the F77 compiler isn't working.  Some variables (like enable_shared)
7215b4d38c65Smrg# are currently assumed to apply to all compilers on this platform,
7216b4d38c65Smrg# and will be corrupted by setting them based on a non-working compiler.
7217b4d38c65Smrgif test "$_lt_disable_F77" != yes; then
7218b4d38c65Smrg  # Code to be used in simple compile tests
7219b4d38c65Smrg  lt_simple_compile_test_code="\
7220b4d38c65Smrg      subroutine t
7221b4d38c65Smrg      return
7222b4d38c65Smrg      end
7223b4d38c65Smrg"
7224b410ddbeSmrg
7225b4d38c65Smrg  # Code to be used in simple link tests
7226b4d38c65Smrg  lt_simple_link_test_code="\
7227b4d38c65Smrg      program t
7228b4d38c65Smrg      end
7229b4d38c65Smrg"
7230b410ddbeSmrg
7231b4d38c65Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7232b4d38c65Smrg  _LT_TAG_COMPILER
7233b4d38c65Smrg
7234b4d38c65Smrg  # save warnings/boilerplate of simple test code
7235b4d38c65Smrg  _LT_COMPILER_BOILERPLATE
7236b4d38c65Smrg  _LT_LINKER_BOILERPLATE
7237b4d38c65Smrg
7238b4d38c65Smrg  # Allow CC to be a program name with arguments.
7239b4d38c65Smrg  lt_save_CC="$CC"
7240b4d38c65Smrg  lt_save_GCC=$GCC
7241b4d38c65Smrg  lt_save_CFLAGS=$CFLAGS
7242b4d38c65Smrg  CC=${F77-"f77"}
7243b4d38c65Smrg  CFLAGS=$FFLAGS
7244b4d38c65Smrg  compiler=$CC
7245b4d38c65Smrg  _LT_TAGVAR(compiler, $1)=$CC
7246b4d38c65Smrg  _LT_CC_BASENAME([$compiler])
7247b4d38c65Smrg  GCC=$G77
7248b4d38c65Smrg  if test -n "$compiler"; then
7249b4d38c65Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7250b4d38c65Smrg    AC_MSG_RESULT([$can_build_shared])
725115fb4814Smrg
7252b4d38c65Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7253b4d38c65Smrg    test "$can_build_shared" = "no" && enable_shared=no
725415fb4814Smrg
7255b4d38c65Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7256b4d38c65Smrg    # are all built from PIC.
7257b4d38c65Smrg    case $host_os in
7258b4d38c65Smrg      aix3*)
7259b4d38c65Smrg        test "$enable_shared" = yes && enable_static=no
7260b4d38c65Smrg        if test -n "$RANLIB"; then
7261b4d38c65Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7262b4d38c65Smrg          postinstall_cmds='$RANLIB $lib'
7263b4d38c65Smrg        fi
7264b4d38c65Smrg        ;;
7265b4d38c65Smrg      aix[[4-9]]*)
7266b4d38c65Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7267b4d38c65Smrg	  test "$enable_shared" = yes && enable_static=no
7268b4d38c65Smrg	fi
7269b4d38c65Smrg        ;;
7270b4d38c65Smrg    esac
7271b4d38c65Smrg    AC_MSG_RESULT([$enable_shared])
7272b4d38c65Smrg
7273b4d38c65Smrg    AC_MSG_CHECKING([whether to build static libraries])
7274b4d38c65Smrg    # Make sure either enable_shared or enable_static is yes.
7275b4d38c65Smrg    test "$enable_shared" = yes || enable_static=yes
7276b4d38c65Smrg    AC_MSG_RESULT([$enable_static])
7277b4d38c65Smrg
7278b4d38c65Smrg    _LT_TAGVAR(GCC, $1)="$G77"
7279b4d38c65Smrg    _LT_TAGVAR(LD, $1)="$LD"
7280b4d38c65Smrg
7281b4d38c65Smrg    ## CAVEAT EMPTOR:
7282b4d38c65Smrg    ## There is no encapsulation within the following macros, do not change
7283b4d38c65Smrg    ## the running order or otherwise move them around unless you know exactly
7284b4d38c65Smrg    ## what you are doing...
7285b4d38c65Smrg    _LT_COMPILER_PIC($1)
7286b4d38c65Smrg    _LT_COMPILER_C_O($1)
7287b4d38c65Smrg    _LT_COMPILER_FILE_LOCKS($1)
7288b4d38c65Smrg    _LT_LINKER_SHLIBS($1)
7289b4d38c65Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7290b4d38c65Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7291b4d38c65Smrg
7292b4d38c65Smrg    _LT_CONFIG($1)
7293b4d38c65Smrg  fi # test -n "$compiler"
7294b4d38c65Smrg
7295b4d38c65Smrg  GCC=$lt_save_GCC
7296b4d38c65Smrg  CC="$lt_save_CC"
7297b4d38c65Smrg  CFLAGS="$lt_save_CFLAGS"
7298b4d38c65Smrgfi # test "$_lt_disable_F77" != yes
729915fb4814Smrg
7300b4d38c65SmrgAC_LANG_POP
7301b4d38c65Smrg])# _LT_LANG_F77_CONFIG
7302b410ddbeSmrg
7303b410ddbeSmrg
7304b4d38c65Smrg# _LT_LANG_FC_CONFIG([TAG])
7305b4d38c65Smrg# -------------------------
7306b4d38c65Smrg# Ensure that the configuration variables for a Fortran compiler are
7307b4d38c65Smrg# suitably defined.  These variables are subsequently used by _LT_CONFIG
7308b4d38c65Smrg# to write the compiler configuration to `libtool'.
7309b4d38c65Smrgm4_defun([_LT_LANG_FC_CONFIG],
7310b4d38c65Smrg[AC_LANG_PUSH(Fortran)
7311b4d38c65Smrg
7312b4d38c65Smrgif test -z "$FC" || test "X$FC" = "Xno"; then
7313b4d38c65Smrg  _lt_disable_FC=yes
7314b4d38c65Smrgfi
7315b410ddbeSmrg
7316b4d38c65Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7317b4d38c65Smrg_LT_TAGVAR(allow_undefined_flag, $1)=
7318b4d38c65Smrg_LT_TAGVAR(always_export_symbols, $1)=no
7319b4d38c65Smrg_LT_TAGVAR(archive_expsym_cmds, $1)=
7320b4d38c65Smrg_LT_TAGVAR(export_dynamic_flag_spec, $1)=
7321b4d38c65Smrg_LT_TAGVAR(hardcode_direct, $1)=no
7322b4d38c65Smrg_LT_TAGVAR(hardcode_direct_absolute, $1)=no
7323b4d38c65Smrg_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
7324b4d38c65Smrg_LT_TAGVAR(hardcode_libdir_separator, $1)=
7325b4d38c65Smrg_LT_TAGVAR(hardcode_minus_L, $1)=no
7326b4d38c65Smrg_LT_TAGVAR(hardcode_automatic, $1)=no
7327b4d38c65Smrg_LT_TAGVAR(inherit_rpath, $1)=no
7328b4d38c65Smrg_LT_TAGVAR(module_cmds, $1)=
7329b4d38c65Smrg_LT_TAGVAR(module_expsym_cmds, $1)=
7330b4d38c65Smrg_LT_TAGVAR(link_all_deplibs, $1)=unknown
7331b4d38c65Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7332b4d38c65Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7333b4d38c65Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7334b4d38c65Smrg_LT_TAGVAR(no_undefined_flag, $1)=
7335b4d38c65Smrg_LT_TAGVAR(whole_archive_flag_spec, $1)=
7336b4d38c65Smrg_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
7337b4d38c65Smrg
7338b4d38c65Smrg# Source file extension for fc test sources.
7339b4d38c65Smrgac_ext=${ac_fc_srcext-f}
7340b4d38c65Smrg
7341b4d38c65Smrg# Object file extension for compiled fc test sources.
7342b4d38c65Smrgobjext=o
7343b4d38c65Smrg_LT_TAGVAR(objext, $1)=$objext
7344b4d38c65Smrg
7345b4d38c65Smrg# No sense in running all these tests if we already determined that
7346b4d38c65Smrg# the FC compiler isn't working.  Some variables (like enable_shared)
7347b4d38c65Smrg# are currently assumed to apply to all compilers on this platform,
7348b4d38c65Smrg# and will be corrupted by setting them based on a non-working compiler.
7349b4d38c65Smrgif test "$_lt_disable_FC" != yes; then
7350b4d38c65Smrg  # Code to be used in simple compile tests
7351b4d38c65Smrg  lt_simple_compile_test_code="\
7352b4d38c65Smrg      subroutine t
7353b4d38c65Smrg      return
7354b4d38c65Smrg      end
7355b4d38c65Smrg"
7356b410ddbeSmrg
7357b4d38c65Smrg  # Code to be used in simple link tests
7358b4d38c65Smrg  lt_simple_link_test_code="\
7359b4d38c65Smrg      program t
7360b4d38c65Smrg      end
7361b4d38c65Smrg"
736215fb4814Smrg
7363b4d38c65Smrg  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
7364b4d38c65Smrg  _LT_TAG_COMPILER
7365b410ddbeSmrg
7366b4d38c65Smrg  # save warnings/boilerplate of simple test code
7367b4d38c65Smrg  _LT_COMPILER_BOILERPLATE
7368b4d38c65Smrg  _LT_LINKER_BOILERPLATE
7369b410ddbeSmrg
7370b4d38c65Smrg  # Allow CC to be a program name with arguments.
7371b4d38c65Smrg  lt_save_CC="$CC"
7372b4d38c65Smrg  lt_save_GCC=$GCC
7373b4d38c65Smrg  lt_save_CFLAGS=$CFLAGS
7374b4d38c65Smrg  CC=${FC-"f95"}
7375b4d38c65Smrg  CFLAGS=$FCFLAGS
7376b4d38c65Smrg  compiler=$CC
7377b4d38c65Smrg  GCC=$ac_cv_fc_compiler_gnu
7378b410ddbeSmrg
7379b4d38c65Smrg  _LT_TAGVAR(compiler, $1)=$CC
7380b4d38c65Smrg  _LT_CC_BASENAME([$compiler])
7381b4d38c65Smrg
7382b4d38c65Smrg  if test -n "$compiler"; then
7383b4d38c65Smrg    AC_MSG_CHECKING([if libtool supports shared libraries])
7384b4d38c65Smrg    AC_MSG_RESULT([$can_build_shared])
7385b4d38c65Smrg
7386b4d38c65Smrg    AC_MSG_CHECKING([whether to build shared libraries])
7387b4d38c65Smrg    test "$can_build_shared" = "no" && enable_shared=no
7388b4d38c65Smrg
7389b4d38c65Smrg    # On AIX, shared libraries and static libraries use the same namespace, and
7390b4d38c65Smrg    # are all built from PIC.
739115fb4814Smrg    case $host_os in
7392b4d38c65Smrg      aix3*)
7393b4d38c65Smrg        test "$enable_shared" = yes && enable_static=no
7394b4d38c65Smrg        if test -n "$RANLIB"; then
7395b4d38c65Smrg          archive_cmds="$archive_cmds~\$RANLIB \$lib"
7396b4d38c65Smrg          postinstall_cmds='$RANLIB $lib'
7397b4d38c65Smrg        fi
7398b4d38c65Smrg        ;;
7399b4d38c65Smrg      aix[[4-9]]*)
7400b4d38c65Smrg	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
7401b4d38c65Smrg	  test "$enable_shared" = yes && enable_static=no
7402b534f209Smrg	fi
7403b4d38c65Smrg        ;;
7404b534f209Smrg    esac
7405b4d38c65Smrg    AC_MSG_RESULT([$enable_shared])
7406b4d38c65Smrg
7407b4d38c65Smrg    AC_MSG_CHECKING([whether to build static libraries])
7408b4d38c65Smrg    # Make sure either enable_shared or enable_static is yes.
7409b4d38c65Smrg    test "$enable_shared" = yes || enable_static=yes
7410b4d38c65Smrg    AC_MSG_RESULT([$enable_static])
7411b4d38c65Smrg
7412b4d38c65Smrg    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
7413b4d38c65Smrg    _LT_TAGVAR(LD, $1)="$LD"
7414b4d38c65Smrg
7415b4d38c65Smrg    ## CAVEAT EMPTOR:
7416b4d38c65Smrg    ## There is no encapsulation within the following macros, do not change
7417b4d38c65Smrg    ## the running order or otherwise move them around unless you know exactly
7418b4d38c65Smrg    ## what you are doing...
7419b4d38c65Smrg    _LT_SYS_HIDDEN_LIBDEPS($1)
7420b4d38c65Smrg    _LT_COMPILER_PIC($1)
7421b4d38c65Smrg    _LT_COMPILER_C_O($1)
7422b4d38c65Smrg    _LT_COMPILER_FILE_LOCKS($1)
7423b4d38c65Smrg    _LT_LINKER_SHLIBS($1)
7424b4d38c65Smrg    _LT_SYS_DYNAMIC_LINKER($1)
7425b4d38c65Smrg    _LT_LINKER_HARDCODE_LIBPATH($1)
7426b4d38c65Smrg
7427b4d38c65Smrg    _LT_CONFIG($1)
7428b4d38c65Smrg  fi # test -n "$compiler"
7429b4d38c65Smrg
7430b4d38c65Smrg  GCC=$lt_save_GCC
7431b4d38c65Smrg  CC=$lt_save_CC
7432b4d38c65Smrg  CFLAGS=$lt_save_CFLAGS
7433b4d38c65Smrgfi # test "$_lt_disable_FC" != yes
7434b534f209Smrg
7435b4d38c65SmrgAC_LANG_POP
7436b4d38c65Smrg])# _LT_LANG_FC_CONFIG
7437b534f209Smrg
7438b534f209Smrg
7439b4d38c65Smrg# _LT_LANG_GCJ_CONFIG([TAG])
7440b4d38c65Smrg# --------------------------
7441b4d38c65Smrg# Ensure that the configuration variables for the GNU Java Compiler compiler
7442b4d38c65Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7443b4d38c65Smrg# to write the compiler configuration to `libtool'.
7444b4d38c65Smrgm4_defun([_LT_LANG_GCJ_CONFIG],
7445b4d38c65Smrg[AC_REQUIRE([LT_PROG_GCJ])dnl
7446b4d38c65SmrgAC_LANG_SAVE
7447b534f209Smrg
7448b4d38c65Smrg# Source file extension for Java test sources.
7449b4d38c65Smrgac_ext=java
7450b534f209Smrg
7451b4d38c65Smrg# Object file extension for compiled Java test sources.
7452b4d38c65Smrgobjext=o
7453b4d38c65Smrg_LT_TAGVAR(objext, $1)=$objext
7454b534f209Smrg
7455b4d38c65Smrg# Code to be used in simple compile tests
7456b4d38c65Smrglt_simple_compile_test_code="class foo {}"
7457b534f209Smrg
7458b4d38c65Smrg# Code to be used in simple link tests
7459b4d38c65Smrglt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
7460b534f209Smrg
7461b4d38c65Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7462b4d38c65Smrg_LT_TAG_COMPILER
7463b534f209Smrg
7464b4d38c65Smrg# save warnings/boilerplate of simple test code
7465b4d38c65Smrg_LT_COMPILER_BOILERPLATE
7466b4d38c65Smrg_LT_LINKER_BOILERPLATE
7467b534f209Smrg
7468b4d38c65Smrg# Allow CC to be a program name with arguments.
7469b4d38c65Smrglt_save_CC=$CC
7470b4d38c65Smrglt_save_CFLAGS=$CFLAGS
7471b4d38c65Smrglt_save_GCC=$GCC
7472b4d38c65SmrgGCC=yes
7473b4d38c65SmrgCC=${GCJ-"gcj"}
7474b4d38c65SmrgCFLAGS=$GCJFLAGS
7475b4d38c65Smrgcompiler=$CC
7476b4d38c65Smrg_LT_TAGVAR(compiler, $1)=$CC
7477b4d38c65Smrg_LT_TAGVAR(LD, $1)="$LD"
7478b4d38c65Smrg_LT_CC_BASENAME([$compiler])
7479b534f209Smrg
7480b4d38c65Smrg# GCJ did not exist at the time GCC didn't implicitly link libc in.
7481b4d38c65Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7482b534f209Smrg
7483b4d38c65Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7484b4d38c65Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7485b4d38c65Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7486b534f209Smrg
7487b4d38c65Smrgif test -n "$compiler"; then
7488b4d38c65Smrg  _LT_COMPILER_NO_RTTI($1)
7489b4d38c65Smrg  _LT_COMPILER_PIC($1)
7490b4d38c65Smrg  _LT_COMPILER_C_O($1)
7491b4d38c65Smrg  _LT_COMPILER_FILE_LOCKS($1)
7492b4d38c65Smrg  _LT_LINKER_SHLIBS($1)
7493b4d38c65Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7494b534f209Smrg
7495b4d38c65Smrg  _LT_CONFIG($1)
7496b4d38c65Smrgfi
7497b534f209Smrg
7498b4d38c65SmrgAC_LANG_RESTORE
7499b534f209Smrg
7500b4d38c65SmrgGCC=$lt_save_GCC
7501b4d38c65SmrgCC=$lt_save_CC
7502b4d38c65SmrgCFLAGS=$lt_save_CFLAGS
7503b4d38c65Smrg])# _LT_LANG_GCJ_CONFIG
7504b534f209Smrg
7505b534f209Smrg
7506cf503b78Smrg# _LT_LANG_GO_CONFIG([TAG])
7507cf503b78Smrg# --------------------------
7508cf503b78Smrg# Ensure that the configuration variables for the GNU Go compiler
7509cf503b78Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7510cf503b78Smrg# to write the compiler configuration to `libtool'.
7511cf503b78Smrgm4_defun([_LT_LANG_GO_CONFIG],
7512cf503b78Smrg[AC_REQUIRE([LT_PROG_GO])dnl
7513cf503b78SmrgAC_LANG_SAVE
7514cf503b78Smrg
7515cf503b78Smrg# Source file extension for Go test sources.
7516cf503b78Smrgac_ext=go
7517cf503b78Smrg
7518cf503b78Smrg# Object file extension for compiled Go test sources.
7519cf503b78Smrgobjext=o
7520cf503b78Smrg_LT_TAGVAR(objext, $1)=$objext
7521cf503b78Smrg
7522cf503b78Smrg# Code to be used in simple compile tests
7523cf503b78Smrglt_simple_compile_test_code="package main; func main() { }"
7524cf503b78Smrg
7525cf503b78Smrg# Code to be used in simple link tests
7526cf503b78Smrglt_simple_link_test_code='package main; func main() { }'
7527cf503b78Smrg
7528cf503b78Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7529cf503b78Smrg_LT_TAG_COMPILER
7530cf503b78Smrg
7531cf503b78Smrg# save warnings/boilerplate of simple test code
7532cf503b78Smrg_LT_COMPILER_BOILERPLATE
7533cf503b78Smrg_LT_LINKER_BOILERPLATE
7534cf503b78Smrg
7535cf503b78Smrg# Allow CC to be a program name with arguments.
7536cf503b78Smrglt_save_CC=$CC
7537cf503b78Smrglt_save_CFLAGS=$CFLAGS
7538cf503b78Smrglt_save_GCC=$GCC
7539cf503b78SmrgGCC=yes
7540cf503b78SmrgCC=${GOC-"gccgo"}
7541cf503b78SmrgCFLAGS=$GOFLAGS
7542cf503b78Smrgcompiler=$CC
7543cf503b78Smrg_LT_TAGVAR(compiler, $1)=$CC
7544cf503b78Smrg_LT_TAGVAR(LD, $1)="$LD"
7545cf503b78Smrg_LT_CC_BASENAME([$compiler])
7546cf503b78Smrg
7547cf503b78Smrg# Go did not exist at the time GCC didn't implicitly link libc in.
7548cf503b78Smrg_LT_TAGVAR(archive_cmds_need_lc, $1)=no
7549cf503b78Smrg
7550cf503b78Smrg_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
7551cf503b78Smrg_LT_TAGVAR(reload_flag, $1)=$reload_flag
7552cf503b78Smrg_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
7553cf503b78Smrg
7554cf503b78Smrgif test -n "$compiler"; then
7555cf503b78Smrg  _LT_COMPILER_NO_RTTI($1)
7556cf503b78Smrg  _LT_COMPILER_PIC($1)
7557cf503b78Smrg  _LT_COMPILER_C_O($1)
7558cf503b78Smrg  _LT_COMPILER_FILE_LOCKS($1)
7559cf503b78Smrg  _LT_LINKER_SHLIBS($1)
7560cf503b78Smrg  _LT_LINKER_HARDCODE_LIBPATH($1)
7561cf503b78Smrg
7562cf503b78Smrg  _LT_CONFIG($1)
7563cf503b78Smrgfi
7564cf503b78Smrg
7565cf503b78SmrgAC_LANG_RESTORE
7566cf503b78Smrg
7567cf503b78SmrgGCC=$lt_save_GCC
7568cf503b78SmrgCC=$lt_save_CC
7569cf503b78SmrgCFLAGS=$lt_save_CFLAGS
7570cf503b78Smrg])# _LT_LANG_GO_CONFIG
7571cf503b78Smrg
7572cf503b78Smrg
7573b4d38c65Smrg# _LT_LANG_RC_CONFIG([TAG])
7574b4d38c65Smrg# -------------------------
7575b4d38c65Smrg# Ensure that the configuration variables for the Windows resource compiler
7576b4d38c65Smrg# are suitably defined.  These variables are subsequently used by _LT_CONFIG
7577b4d38c65Smrg# to write the compiler configuration to `libtool'.
7578b4d38c65Smrgm4_defun([_LT_LANG_RC_CONFIG],
7579b4d38c65Smrg[AC_REQUIRE([LT_PROG_RC])dnl
7580b4d38c65SmrgAC_LANG_SAVE
7581b534f209Smrg
7582b4d38c65Smrg# Source file extension for RC test sources.
7583b4d38c65Smrgac_ext=rc
7584b534f209Smrg
7585b4d38c65Smrg# Object file extension for compiled RC test sources.
7586b4d38c65Smrgobjext=o
7587b4d38c65Smrg_LT_TAGVAR(objext, $1)=$objext
7588b534f209Smrg
7589b4d38c65Smrg# Code to be used in simple compile tests
7590b4d38c65Smrglt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
7591b534f209Smrg
7592b4d38c65Smrg# Code to be used in simple link tests
7593b4d38c65Smrglt_simple_link_test_code="$lt_simple_compile_test_code"
7594b534f209Smrg
7595b4d38c65Smrg# ltmain only uses $CC for tagged configurations so make sure $CC is set.
7596b4d38c65Smrg_LT_TAG_COMPILER
7597b534f209Smrg
7598b4d38c65Smrg# save warnings/boilerplate of simple test code
7599b4d38c65Smrg_LT_COMPILER_BOILERPLATE
7600b4d38c65Smrg_LT_LINKER_BOILERPLATE
7601b534f209Smrg
7602b4d38c65Smrg# Allow CC to be a program name with arguments.
7603b4d38c65Smrglt_save_CC="$CC"
7604b4d38c65Smrglt_save_CFLAGS=$CFLAGS
7605b4d38c65Smrglt_save_GCC=$GCC
7606b4d38c65SmrgGCC=
7607b4d38c65SmrgCC=${RC-"windres"}
7608b4d38c65SmrgCFLAGS=
7609b4d38c65Smrgcompiler=$CC
7610b4d38c65Smrg_LT_TAGVAR(compiler, $1)=$CC
7611b4d38c65Smrg_LT_CC_BASENAME([$compiler])
7612b4d38c65Smrg_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
7613b534f209Smrg
7614b4d38c65Smrgif test -n "$compiler"; then
7615b4d38c65Smrg  :
7616b4d38c65Smrg  _LT_CONFIG($1)
7617b4d38c65Smrgfi
7618b534f209Smrg
7619b4d38c65SmrgGCC=$lt_save_GCC
7620b4d38c65SmrgAC_LANG_RESTORE
7621b4d38c65SmrgCC=$lt_save_CC
7622b4d38c65SmrgCFLAGS=$lt_save_CFLAGS
7623b4d38c65Smrg])# _LT_LANG_RC_CONFIG
7624b534f209Smrg
7625b534f209Smrg
7626b4d38c65Smrg# LT_PROG_GCJ
7627b4d38c65Smrg# -----------
7628b4d38c65SmrgAC_DEFUN([LT_PROG_GCJ],
7629b4d38c65Smrg[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
7630b4d38c65Smrg  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
7631b4d38c65Smrg    [AC_CHECK_TOOL(GCJ, gcj,)
7632b4d38c65Smrg      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
7633b4d38c65Smrg      AC_SUBST(GCJFLAGS)])])[]dnl
7634b4d38c65Smrg])
7635b534f209Smrg
7636b4d38c65Smrg# Old name:
7637b4d38c65SmrgAU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
7638b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
7639b4d38c65Smrgdnl AC_DEFUN([LT_AC_PROG_GCJ], [])
7640b534f209Smrg
7641b534f209Smrg
7642cf503b78Smrg# LT_PROG_GO
7643cf503b78Smrg# ----------
7644cf503b78SmrgAC_DEFUN([LT_PROG_GO],
7645cf503b78Smrg[AC_CHECK_TOOL(GOC, gccgo,)
7646cf503b78Smrg])
7647cf503b78Smrg
7648cf503b78Smrg
7649b4d38c65Smrg# LT_PROG_RC
7650b4d38c65Smrg# ----------
7651b4d38c65SmrgAC_DEFUN([LT_PROG_RC],
7652b4d38c65Smrg[AC_CHECK_TOOL(RC, windres,)
7653b4d38c65Smrg])
765415fb4814Smrg
7655b4d38c65Smrg# Old name:
7656b4d38c65SmrgAU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
7657b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
7658b4d38c65Smrgdnl AC_DEFUN([LT_AC_PROG_RC], [])
7659b534f209Smrg
7660b534f209Smrg
7661b4d38c65Smrg# _LT_DECL_EGREP
7662b4d38c65Smrg# --------------
7663b4d38c65Smrg# If we don't have a new enough Autoconf to choose the best grep
7664b4d38c65Smrg# available, choose the one first in the user's PATH.
7665b4d38c65Smrgm4_defun([_LT_DECL_EGREP],
7666b4d38c65Smrg[AC_REQUIRE([AC_PROG_EGREP])dnl
7667b4d38c65SmrgAC_REQUIRE([AC_PROG_FGREP])dnl
7668b4d38c65Smrgtest -z "$GREP" && GREP=grep
7669b4d38c65Smrg_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
7670b4d38c65Smrg_LT_DECL([], [EGREP], [1], [An ERE matcher])
7671b4d38c65Smrg_LT_DECL([], [FGREP], [1], [A literal string matcher])
7672b4d38c65Smrgdnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
7673b4d38c65SmrgAC_SUBST([GREP])
7674b4d38c65Smrg])
7675b534f209Smrg
7676b534f209Smrg
7677b4d38c65Smrg# _LT_DECL_OBJDUMP
7678b4d38c65Smrg# --------------
7679b4d38c65Smrg# If we don't have a new enough Autoconf to choose the best objdump
7680b4d38c65Smrg# available, choose the one first in the user's PATH.
7681b4d38c65Smrgm4_defun([_LT_DECL_OBJDUMP],
7682b4d38c65Smrg[AC_CHECK_TOOL(OBJDUMP, objdump, false)
7683b4d38c65Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
7684b4d38c65Smrg_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
7685b4d38c65SmrgAC_SUBST([OBJDUMP])
7686b4d38c65Smrg])
7687b534f209Smrg
7688b4d38c65Smrg# _LT_DECL_DLLTOOL
7689b4d38c65Smrg# ----------------
7690b4d38c65Smrg# Ensure DLLTOOL variable is set.
7691b4d38c65Smrgm4_defun([_LT_DECL_DLLTOOL],
7692b4d38c65Smrg[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
7693b4d38c65Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
7694b4d38c65Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
7695b4d38c65SmrgAC_SUBST([DLLTOOL])
7696b4d38c65Smrg])
7697b534f209Smrg
7698b4d38c65Smrg# _LT_DECL_SED
7699b4d38c65Smrg# ------------
7700b4d38c65Smrg# Check for a fully-functional sed program, that truncates
7701b4d38c65Smrg# as few characters as possible.  Prefer GNU sed if found.
7702b4d38c65Smrgm4_defun([_LT_DECL_SED],
7703b4d38c65Smrg[AC_PROG_SED
7704b4d38c65Smrgtest -z "$SED" && SED=sed
7705b4d38c65SmrgXsed="$SED -e 1s/^X//"
7706b4d38c65Smrg_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
7707b4d38c65Smrg_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
7708b4d38c65Smrg    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
7709b4d38c65Smrg])# _LT_DECL_SED
7710b534f209Smrg
7711b4d38c65Smrgm4_ifndef([AC_PROG_SED], [
7712b4d38c65Smrg# NOTE: This macro has been submitted for inclusion into   #
7713b4d38c65Smrg#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
7714b4d38c65Smrg#  a released version of Autoconf we should remove this    #
7715b4d38c65Smrg#  macro and use it instead.                               #
7716b4d38c65Smrg
7717b4d38c65Smrgm4_defun([AC_PROG_SED],
7718b4d38c65Smrg[AC_MSG_CHECKING([for a sed that does not truncate output])
7719b4d38c65SmrgAC_CACHE_VAL(lt_cv_path_SED,
7720b4d38c65Smrg[# Loop through the user's path and test for sed and gsed.
7721b4d38c65Smrg# Then use that list of sed's as ones to test for truncation.
7722b4d38c65Smrgas_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7723b4d38c65Smrgfor as_dir in $PATH
7724b4d38c65Smrgdo
7725b4d38c65Smrg  IFS=$as_save_IFS
7726b4d38c65Smrg  test -z "$as_dir" && as_dir=.
7727b4d38c65Smrg  for lt_ac_prog in sed gsed; do
7728b4d38c65Smrg    for ac_exec_ext in '' $ac_executable_extensions; do
7729b4d38c65Smrg      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
7730b4d38c65Smrg        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
7731b534f209Smrg      fi
7732b4d38c65Smrg    done
7733b4d38c65Smrg  done
7734b4d38c65Smrgdone
7735b4d38c65SmrgIFS=$as_save_IFS
7736b4d38c65Smrglt_ac_max=0
7737b4d38c65Smrglt_ac_count=0
7738b4d38c65Smrg# Add /usr/xpg4/bin/sed as it is typically found on Solaris
7739b4d38c65Smrg# along with /bin/sed that truncates output.
7740b4d38c65Smrgfor lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
7741b4d38c65Smrg  test ! -f $lt_ac_sed && continue
7742b4d38c65Smrg  cat /dev/null > conftest.in
7743b4d38c65Smrg  lt_ac_count=0
7744b4d38c65Smrg  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
7745b4d38c65Smrg  # Check for GNU sed and select it if it is found.
7746b4d38c65Smrg  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
7747b4d38c65Smrg    lt_cv_path_SED=$lt_ac_sed
7748b4d38c65Smrg    break
7749b4d38c65Smrg  fi
7750b4d38c65Smrg  while true; do
7751b4d38c65Smrg    cat conftest.in conftest.in >conftest.tmp
7752b4d38c65Smrg    mv conftest.tmp conftest.in
7753b4d38c65Smrg    cp conftest.in conftest.nl
7754b4d38c65Smrg    echo >>conftest.nl
7755b4d38c65Smrg    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
7756b4d38c65Smrg    cmp -s conftest.out conftest.nl || break
7757b4d38c65Smrg    # 10000 chars as input seems more than enough
7758b4d38c65Smrg    test $lt_ac_count -gt 10 && break
7759b4d38c65Smrg    lt_ac_count=`expr $lt_ac_count + 1`
7760b4d38c65Smrg    if test $lt_ac_count -gt $lt_ac_max; then
7761b4d38c65Smrg      lt_ac_max=$lt_ac_count
7762b4d38c65Smrg      lt_cv_path_SED=$lt_ac_sed
7763b4d38c65Smrg    fi
7764b4d38c65Smrg  done
7765b4d38c65Smrgdone
7766b4d38c65Smrg])
7767b4d38c65SmrgSED=$lt_cv_path_SED
7768b4d38c65SmrgAC_SUBST([SED])
7769b4d38c65SmrgAC_MSG_RESULT([$SED])
7770b4d38c65Smrg])#AC_PROG_SED
7771b4d38c65Smrg])#m4_ifndef
7772b534f209Smrg
7773b4d38c65Smrg# Old name:
7774b4d38c65SmrgAU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
7775b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
7776b4d38c65Smrgdnl AC_DEFUN([LT_AC_PROG_SED], [])
7777b534f209Smrg
7778b534f209Smrg
7779b4d38c65Smrg# _LT_CHECK_SHELL_FEATURES
7780b4d38c65Smrg# ------------------------
7781b4d38c65Smrg# Find out whether the shell is Bourne or XSI compatible,
7782b4d38c65Smrg# or has some other useful features.
7783b4d38c65Smrgm4_defun([_LT_CHECK_SHELL_FEATURES],
7784b4d38c65Smrg[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
7785b4d38c65Smrg# Try some XSI features
7786b4d38c65Smrgxsi_shell=no
7787b4d38c65Smrg( _lt_dummy="a/b/c"
7788b4d38c65Smrg  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
7789b4d38c65Smrg      = c,a/b,b/c, \
7790b4d38c65Smrg    && eval 'test $(( 1 + 1 )) -eq 2 \
7791b4d38c65Smrg    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
7792b4d38c65Smrg  && xsi_shell=yes
7793b4d38c65SmrgAC_MSG_RESULT([$xsi_shell])
7794b4d38c65Smrg_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
7795b4d38c65Smrg
7796b4d38c65SmrgAC_MSG_CHECKING([whether the shell understands "+="])
7797b4d38c65Smrglt_shell_append=no
7798b4d38c65Smrg( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
7799b4d38c65Smrg    >/dev/null 2>&1 \
7800b4d38c65Smrg  && lt_shell_append=yes
7801b4d38c65SmrgAC_MSG_RESULT([$lt_shell_append])
7802b4d38c65Smrg_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
7803b4d38c65Smrg
7804b4d38c65Smrgif ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
7805b4d38c65Smrg  lt_unset=unset
7806b4d38c65Smrgelse
7807b4d38c65Smrg  lt_unset=false
7808b4d38c65Smrgfi
7809b4d38c65Smrg_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
7810b4d38c65Smrg
7811b4d38c65Smrg# test EBCDIC or ASCII
7812b4d38c65Smrgcase `echo X|tr X '\101'` in
7813b4d38c65Smrg A) # ASCII based system
7814b4d38c65Smrg    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
7815b4d38c65Smrg  lt_SP2NL='tr \040 \012'
7816b4d38c65Smrg  lt_NL2SP='tr \015\012 \040\040'
7817b4d38c65Smrg  ;;
7818b4d38c65Smrg *) # EBCDIC based system
7819b4d38c65Smrg  lt_SP2NL='tr \100 \n'
7820b4d38c65Smrg  lt_NL2SP='tr \r\n \100\100'
7821b4d38c65Smrg  ;;
7822b4d38c65Smrgesac
7823b4d38c65Smrg_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
7824b4d38c65Smrg_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
7825b4d38c65Smrg])# _LT_CHECK_SHELL_FEATURES
7826b4d38c65Smrg
7827b4d38c65Smrg
7828b4d38c65Smrg# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
7829b4d38c65Smrg# ------------------------------------------------------
7830b4d38c65Smrg# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
7831b4d38c65Smrg# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
7832b4d38c65Smrgm4_defun([_LT_PROG_FUNCTION_REPLACE],
7833b4d38c65Smrg[dnl {
7834b4d38c65Smrgsed -e '/^$1 ()$/,/^} # $1 /c\
7835b4d38c65Smrg$1 ()\
7836b4d38c65Smrg{\
7837b4d38c65Smrgm4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
7838b4d38c65Smrg} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
7839b4d38c65Smrg  && mv -f "$cfgfile.tmp" "$cfgfile" \
7840b4d38c65Smrg    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7841b4d38c65Smrgtest 0 -eq $? || _lt_function_replace_fail=:
7842b4d38c65Smrg])
7843b534f209Smrg
784415fb4814Smrg
7845b4d38c65Smrg# _LT_PROG_REPLACE_SHELLFNS
7846b4d38c65Smrg# -------------------------
7847b4d38c65Smrg# Replace existing portable implementations of several shell functions with
7848b4d38c65Smrg# equivalent extended shell implementations where those features are available..
7849b4d38c65Smrgm4_defun([_LT_PROG_REPLACE_SHELLFNS],
7850b4d38c65Smrg[if test x"$xsi_shell" = xyes; then
7851b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
7852b4d38c65Smrg    case ${1} in
7853b4d38c65Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7854b4d38c65Smrg      *  ) func_dirname_result="${3}" ;;
7855b4d38c65Smrg    esac])
7856b4d38c65Smrg
7857b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
7858b4d38c65Smrg    func_basename_result="${1##*/}"])
7859b4d38c65Smrg
7860b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
7861b4d38c65Smrg    case ${1} in
7862b4d38c65Smrg      */*) func_dirname_result="${1%/*}${2}" ;;
7863b4d38c65Smrg      *  ) func_dirname_result="${3}" ;;
7864b4d38c65Smrg    esac
7865b4d38c65Smrg    func_basename_result="${1##*/}"])
786615fb4814Smrg
7867b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
7868b4d38c65Smrg    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
7869b4d38c65Smrg    # positional parameters, so assign one to ordinary parameter first.
7870b4d38c65Smrg    func_stripname_result=${3}
7871b4d38c65Smrg    func_stripname_result=${func_stripname_result#"${1}"}
7872b4d38c65Smrg    func_stripname_result=${func_stripname_result%"${2}"}])
787315fb4814Smrg
7874b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
7875b4d38c65Smrg    func_split_long_opt_name=${1%%=*}
7876b4d38c65Smrg    func_split_long_opt_arg=${1#*=}])
787715fb4814Smrg
7878b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
7879b4d38c65Smrg    func_split_short_opt_arg=${1#??}
7880b4d38c65Smrg    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
788115fb4814Smrg
7882b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
7883b4d38c65Smrg    case ${1} in
7884b4d38c65Smrg      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
7885b4d38c65Smrg      *)    func_lo2o_result=${1} ;;
7886b4d38c65Smrg    esac])
788715fb4814Smrg
7888b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
788915fb4814Smrg
7890b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
789115fb4814Smrg
7892b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
7893b4d38c65Smrgfi
789415fb4814Smrg
7895b4d38c65Smrgif test x"$lt_shell_append" = xyes; then
7896b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
789715fb4814Smrg
7898b4d38c65Smrg  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
7899b4d38c65Smrg    func_quote_for_eval "${2}"
7900b4d38c65Smrgdnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
7901b4d38c65Smrg    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
790215fb4814Smrg
7903b4d38c65Smrg  # Save a `func_append' function call where possible by direct use of '+='
7904b4d38c65Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
7905b4d38c65Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7906b4d38c65Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7907b4d38c65Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7908b4d38c65Smrgelse
7909b4d38c65Smrg  # Save a `func_append' function call even when '+=' is not available
7910b4d38c65Smrg  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
7911b4d38c65Smrg    && mv -f "$cfgfile.tmp" "$cfgfile" \
7912b4d38c65Smrg      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
7913b4d38c65Smrg  test 0 -eq $? || _lt_function_replace_fail=:
7914b4d38c65Smrgfi
791515fb4814Smrg
7916b4d38c65Smrgif test x"$_lt_function_replace_fail" = x":"; then
7917b4d38c65Smrg  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
7918b4d38c65Smrgfi
7919b4d38c65Smrg])
792015fb4814Smrg
7921b4d38c65Smrg# _LT_PATH_CONVERSION_FUNCTIONS
7922b4d38c65Smrg# -----------------------------
7923b4d38c65Smrg# Determine which file name conversion functions should be used by
7924b4d38c65Smrg# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
7925b4d38c65Smrg# for certain cross-compile configurations and native mingw.
7926b4d38c65Smrgm4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
7927b4d38c65Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
7928b4d38c65SmrgAC_REQUIRE([AC_CANONICAL_BUILD])dnl
7929b4d38c65SmrgAC_MSG_CHECKING([how to convert $build file names to $host format])
7930b4d38c65SmrgAC_CACHE_VAL(lt_cv_to_host_file_cmd,
7931b4d38c65Smrg[case $host in
7932b4d38c65Smrg  *-*-mingw* )
7933b4d38c65Smrg    case $build in
7934b4d38c65Smrg      *-*-mingw* ) # actually msys
7935b4d38c65Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
7936b4d38c65Smrg        ;;
7937b4d38c65Smrg      *-*-cygwin* )
7938b4d38c65Smrg        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
7939b4d38c65Smrg        ;;
7940b4d38c65Smrg      * ) # otherwise, assume *nix
7941b4d38c65Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
7942b4d38c65Smrg        ;;
7943b4d38c65Smrg    esac
7944b4d38c65Smrg    ;;
7945b4d38c65Smrg  *-*-cygwin* )
7946b4d38c65Smrg    case $build in
7947b4d38c65Smrg      *-*-mingw* ) # actually msys
7948b4d38c65Smrg        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
7949b4d38c65Smrg        ;;
7950b4d38c65Smrg      *-*-cygwin* )
7951b4d38c65Smrg        lt_cv_to_host_file_cmd=func_convert_file_noop
7952b4d38c65Smrg        ;;
7953b4d38c65Smrg      * ) # otherwise, assume *nix
7954b4d38c65Smrg        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
7955b4d38c65Smrg        ;;
7956b4d38c65Smrg    esac
7957b4d38c65Smrg    ;;
7958b4d38c65Smrg  * ) # unhandled hosts (and "normal" native builds)
7959b4d38c65Smrg    lt_cv_to_host_file_cmd=func_convert_file_noop
7960b4d38c65Smrg    ;;
7961b4d38c65Smrgesac
7962b4d38c65Smrg])
7963b4d38c65Smrgto_host_file_cmd=$lt_cv_to_host_file_cmd
7964b4d38c65SmrgAC_MSG_RESULT([$lt_cv_to_host_file_cmd])
7965b4d38c65Smrg_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
7966b4d38c65Smrg         [0], [convert $build file names to $host format])dnl
7967b4d38c65Smrg
7968b4d38c65SmrgAC_MSG_CHECKING([how to convert $build file names to toolchain format])
7969b4d38c65SmrgAC_CACHE_VAL(lt_cv_to_tool_file_cmd,
7970b4d38c65Smrg[#assume ordinary cross tools, or native build.
7971b4d38c65Smrglt_cv_to_tool_file_cmd=func_convert_file_noop
7972b4d38c65Smrgcase $host in
7973b4d38c65Smrg  *-*-mingw* )
7974b4d38c65Smrg    case $build in
7975b4d38c65Smrg      *-*-mingw* ) # actually msys
7976b4d38c65Smrg        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
7977b4d38c65Smrg        ;;
7978b4d38c65Smrg    esac
7979b4d38c65Smrg    ;;
7980b4d38c65Smrgesac
7981b4d38c65Smrg])
7982b4d38c65Smrgto_tool_file_cmd=$lt_cv_to_tool_file_cmd
7983b4d38c65SmrgAC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
7984b4d38c65Smrg_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
7985b4d38c65Smrg         [0], [convert $build files to toolchain format])dnl
7986b4d38c65Smrg])# _LT_PATH_CONVERSION_FUNCTIONS
7987b410ddbeSmrg
7988b4d38c65Smrg# Helper functions for option handling.                    -*- Autoconf -*-
7989b4d38c65Smrg#
7990b4d38c65Smrg#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
7991b4d38c65Smrg#   Inc.
7992b4d38c65Smrg#   Written by Gary V. Vaughan, 2004
7993b4d38c65Smrg#
7994b4d38c65Smrg# This file is free software; the Free Software Foundation gives
7995b4d38c65Smrg# unlimited permission to copy and/or distribute it, with or without
7996b4d38c65Smrg# modifications, as long as this notice is preserved.
7997b410ddbeSmrg
7998b4d38c65Smrg# serial 7 ltoptions.m4
7999b410ddbeSmrg
8000b4d38c65Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8001b4d38c65SmrgAC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
8002b410ddbeSmrg
8003b410ddbeSmrg
8004b4d38c65Smrg# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
8005b4d38c65Smrg# ------------------------------------------
8006b4d38c65Smrgm4_define([_LT_MANGLE_OPTION],
8007b4d38c65Smrg[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
8008b410ddbeSmrg
800915fb4814Smrg
8010b4d38c65Smrg# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
8011b4d38c65Smrg# ---------------------------------------
8012b4d38c65Smrg# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
8013b4d38c65Smrg# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
8014b4d38c65Smrg# saved as a flag.
8015b4d38c65Smrgm4_define([_LT_SET_OPTION],
8016b4d38c65Smrg[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
8017b4d38c65Smrgm4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
8018b4d38c65Smrg        _LT_MANGLE_DEFUN([$1], [$2]),
8019b4d38c65Smrg    [m4_warning([Unknown $1 option `$2'])])[]dnl
8020b4d38c65Smrg])
802115fb4814Smrg
8022de78e416Smrg
8023b4d38c65Smrg# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
8024b4d38c65Smrg# ------------------------------------------------------------
8025b4d38c65Smrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
8026b4d38c65Smrgm4_define([_LT_IF_OPTION],
8027b4d38c65Smrg[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
8028b4d38c65Smrg
8029b4d38c65Smrg
8030b4d38c65Smrg# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
8031b4d38c65Smrg# -------------------------------------------------------
8032b4d38c65Smrg# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
8033b4d38c65Smrg# are set.
8034b4d38c65Smrgm4_define([_LT_UNLESS_OPTIONS],
8035b4d38c65Smrg[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8036b4d38c65Smrg	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
8037b4d38c65Smrg		      [m4_define([$0_found])])])[]dnl
8038b4d38c65Smrgm4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
8039b4d38c65Smrg])[]dnl
8040b4d38c65Smrg])
804115fb4814Smrg
804215fb4814Smrg
8043b4d38c65Smrg# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
8044b4d38c65Smrg# ----------------------------------------
8045b4d38c65Smrg# OPTION-LIST is a space-separated list of Libtool options associated
8046b4d38c65Smrg# with MACRO-NAME.  If any OPTION has a matching handler declared with
8047b4d38c65Smrg# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
8048b4d38c65Smrg# the unknown option and exit.
8049b4d38c65Smrgm4_defun([_LT_SET_OPTIONS],
8050b4d38c65Smrg[# Set options
8051b4d38c65Smrgm4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
8052b4d38c65Smrg    [_LT_SET_OPTION([$1], _LT_Option)])
8053b4d38c65Smrg
8054b4d38c65Smrgm4_if([$1],[LT_INIT],[
8055b4d38c65Smrg  dnl
8056b4d38c65Smrg  dnl Simply set some default values (i.e off) if boolean options were not
8057b4d38c65Smrg  dnl specified:
8058b4d38c65Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
8059b4d38c65Smrg  ])
8060b4d38c65Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
8061b4d38c65Smrg  ])
8062b4d38c65Smrg  dnl
8063b4d38c65Smrg  dnl If no reference was made to various pairs of opposing options, then
8064b4d38c65Smrg  dnl we run the default mode handler for the pair.  For example, if neither
8065b4d38c65Smrg  dnl `shared' nor `disable-shared' was passed, we enable building of shared
8066b4d38c65Smrg  dnl archives by default:
8067b4d38c65Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
8068b4d38c65Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
8069b4d38c65Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
8070b4d38c65Smrg  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
8071b4d38c65Smrg  		   [_LT_ENABLE_FAST_INSTALL])
8072b4d38c65Smrg  ])
8073b4d38c65Smrg])# _LT_SET_OPTIONS
807415fb4814Smrg
8075b534f209Smrg
8076b534f209Smrg
8077b4d38c65Smrg# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
8078b4d38c65Smrg# -----------------------------------------
8079b4d38c65Smrgm4_define([_LT_MANGLE_DEFUN],
8080b4d38c65Smrg[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
8081b534f209Smrg
8082b534f209Smrg
8083b4d38c65Smrg# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
8084b4d38c65Smrg# -----------------------------------------------
8085b4d38c65Smrgm4_define([LT_OPTION_DEFINE],
8086b4d38c65Smrg[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
8087b4d38c65Smrg])# LT_OPTION_DEFINE
8088b534f209Smrg
8089b534f209Smrg
8090b4d38c65Smrg# dlopen
8091b4d38c65Smrg# ------
8092b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
8093b534f209Smrg])
8094b534f209Smrg
8095b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_DLOPEN],
8096b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], [dlopen])
8097b4d38c65SmrgAC_DIAGNOSE([obsolete],
8098b4d38c65Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8099b4d38c65Smrgput the `dlopen' option into LT_INIT's first parameter.])
8100b4d38c65Smrg])
8101b534f209Smrg
8102b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
8103b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
810415fb4814Smrg
810515fb4814Smrg
8106b4d38c65Smrg# win32-dll
8107b4d38c65Smrg# ---------
8108b4d38c65Smrg# Declare package support for building win32 dll's.
8109b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [win32-dll],
8110b4d38c65Smrg[enable_win32_dll=yes
811115fb4814Smrg
8112b4d38c65Smrgcase $host in
8113b4d38c65Smrg*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
8114b4d38c65Smrg  AC_CHECK_TOOL(AS, as, false)
8115b4d38c65Smrg  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
8116b4d38c65Smrg  AC_CHECK_TOOL(OBJDUMP, objdump, false)
8117b4d38c65Smrg  ;;
8118b4d38c65Smrgesac
8119b410ddbeSmrg
8120b4d38c65Smrgtest -z "$AS" && AS=as
8121b4d38c65Smrg_LT_DECL([], [AS],      [1], [Assembler program])dnl
812215fb4814Smrg
8123b4d38c65Smrgtest -z "$DLLTOOL" && DLLTOOL=dlltool
8124b4d38c65Smrg_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
812515fb4814Smrg
8126b4d38c65Smrgtest -z "$OBJDUMP" && OBJDUMP=objdump
8127b4d38c65Smrg_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
8128b4d38c65Smrg])# win32-dll
8129b410ddbeSmrg
8130b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_WIN32_DLL],
8131b4d38c65Smrg[AC_REQUIRE([AC_CANONICAL_HOST])dnl
8132b4d38c65Smrg_LT_SET_OPTION([LT_INIT], [win32-dll])
8133b4d38c65SmrgAC_DIAGNOSE([obsolete],
8134b4d38c65Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8135b4d38c65Smrgput the `win32-dll' option into LT_INIT's first parameter.])
813615fb4814Smrg])
813715fb4814Smrg
8138b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
8139b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
814015fb4814Smrg
8141b410ddbeSmrg
8142b4d38c65Smrg# _LT_ENABLE_SHARED([DEFAULT])
8143b4d38c65Smrg# ----------------------------
8144b4d38c65Smrg# implement the --enable-shared flag, and supports the `shared' and
8145b4d38c65Smrg# `disable-shared' LT_INIT options.
8146b4d38c65Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8147b4d38c65Smrgm4_define([_LT_ENABLE_SHARED],
8148b4d38c65Smrg[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
8149b4d38c65SmrgAC_ARG_ENABLE([shared],
8150b4d38c65Smrg    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
8151b4d38c65Smrg	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
8152b4d38c65Smrg    [p=${PACKAGE-default}
8153b4d38c65Smrg    case $enableval in
8154b4d38c65Smrg    yes) enable_shared=yes ;;
8155b4d38c65Smrg    no) enable_shared=no ;;
8156b4d38c65Smrg    *)
8157b4d38c65Smrg      enable_shared=no
8158b4d38c65Smrg      # Look at the argument we got.  We use all the common list separators.
8159b4d38c65Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8160b4d38c65Smrg      for pkg in $enableval; do
8161b4d38c65Smrg	IFS="$lt_save_ifs"
8162b4d38c65Smrg	if test "X$pkg" = "X$p"; then
8163b4d38c65Smrg	  enable_shared=yes
8164b4d38c65Smrg	fi
8165b4d38c65Smrg      done
8166b4d38c65Smrg      IFS="$lt_save_ifs"
8167b4d38c65Smrg      ;;
8168b4d38c65Smrg    esac],
8169b4d38c65Smrg    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
8170b4d38c65Smrg
8171b4d38c65Smrg    _LT_DECL([build_libtool_libs], [enable_shared], [0],
8172b4d38c65Smrg	[Whether or not to build shared libraries])
8173b4d38c65Smrg])# _LT_ENABLE_SHARED
8174b4d38c65Smrg
8175b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
8176b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
8177b4d38c65Smrg
8178b4d38c65Smrg# Old names:
8179b4d38c65SmrgAC_DEFUN([AC_ENABLE_SHARED],
8180b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
8181b410ddbeSmrg])
8182b4d38c65Smrg
8183b4d38c65SmrgAC_DEFUN([AC_DISABLE_SHARED],
8184b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], [disable-shared])
8185b4d38c65Smrg])
8186b4d38c65Smrg
8187b4d38c65SmrgAU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
8188b4d38c65SmrgAU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
8189b4d38c65Smrg
8190b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
8191b4d38c65Smrgdnl AC_DEFUN([AM_ENABLE_SHARED], [])
8192b4d38c65Smrgdnl AC_DEFUN([AM_DISABLE_SHARED], [])
8193b4d38c65Smrg
8194b4d38c65Smrg
8195b4d38c65Smrg
8196b4d38c65Smrg# _LT_ENABLE_STATIC([DEFAULT])
8197b4d38c65Smrg# ----------------------------
8198b4d38c65Smrg# implement the --enable-static flag, and support the `static' and
8199b4d38c65Smrg# `disable-static' LT_INIT options.
8200b4d38c65Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8201b4d38c65Smrgm4_define([_LT_ENABLE_STATIC],
8202b4d38c65Smrg[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
8203b4d38c65SmrgAC_ARG_ENABLE([static],
8204b4d38c65Smrg    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
8205b4d38c65Smrg	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
8206b4d38c65Smrg    [p=${PACKAGE-default}
8207b4d38c65Smrg    case $enableval in
8208b4d38c65Smrg    yes) enable_static=yes ;;
8209b4d38c65Smrg    no) enable_static=no ;;
8210b4d38c65Smrg    *)
8211b4d38c65Smrg     enable_static=no
8212b4d38c65Smrg      # Look at the argument we got.  We use all the common list separators.
8213b4d38c65Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8214b4d38c65Smrg      for pkg in $enableval; do
8215b4d38c65Smrg	IFS="$lt_save_ifs"
8216b4d38c65Smrg	if test "X$pkg" = "X$p"; then
8217b4d38c65Smrg	  enable_static=yes
8218b4d38c65Smrg	fi
8219b4d38c65Smrg      done
8220b4d38c65Smrg      IFS="$lt_save_ifs"
8221b4d38c65Smrg      ;;
8222b4d38c65Smrg    esac],
8223b4d38c65Smrg    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
8224b4d38c65Smrg
8225b4d38c65Smrg    _LT_DECL([build_old_libs], [enable_static], [0],
8226b4d38c65Smrg	[Whether or not to build static libraries])
8227b4d38c65Smrg])# _LT_ENABLE_STATIC
8228b4d38c65Smrg
8229b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
8230b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
8231b4d38c65Smrg
8232b4d38c65Smrg# Old names:
8233b4d38c65SmrgAC_DEFUN([AC_ENABLE_STATIC],
8234b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
8235b4d38c65Smrg])
8236b4d38c65Smrg
8237b4d38c65SmrgAC_DEFUN([AC_DISABLE_STATIC],
8238b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], [disable-static])
8239b4d38c65Smrg])
8240b4d38c65Smrg
8241b4d38c65SmrgAU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
8242b4d38c65SmrgAU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
8243b4d38c65Smrg
8244b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
8245b4d38c65Smrgdnl AC_DEFUN([AM_ENABLE_STATIC], [])
8246b4d38c65Smrgdnl AC_DEFUN([AM_DISABLE_STATIC], [])
8247b4d38c65Smrg
8248b4d38c65Smrg
8249b4d38c65Smrg
8250b4d38c65Smrg# _LT_ENABLE_FAST_INSTALL([DEFAULT])
8251b4d38c65Smrg# ----------------------------------
8252b4d38c65Smrg# implement the --enable-fast-install flag, and support the `fast-install'
8253b4d38c65Smrg# and `disable-fast-install' LT_INIT options.
8254b4d38c65Smrg# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
8255b4d38c65Smrgm4_define([_LT_ENABLE_FAST_INSTALL],
8256b4d38c65Smrg[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
8257b4d38c65SmrgAC_ARG_ENABLE([fast-install],
8258b4d38c65Smrg    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
8259b4d38c65Smrg    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
8260b4d38c65Smrg    [p=${PACKAGE-default}
8261b4d38c65Smrg    case $enableval in
8262b4d38c65Smrg    yes) enable_fast_install=yes ;;
8263b4d38c65Smrg    no) enable_fast_install=no ;;
8264b4d38c65Smrg    *)
8265b4d38c65Smrg      enable_fast_install=no
8266b4d38c65Smrg      # Look at the argument we got.  We use all the common list separators.
8267b4d38c65Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8268b4d38c65Smrg      for pkg in $enableval; do
8269b4d38c65Smrg	IFS="$lt_save_ifs"
8270b4d38c65Smrg	if test "X$pkg" = "X$p"; then
8271b4d38c65Smrg	  enable_fast_install=yes
8272b4d38c65Smrg	fi
8273b4d38c65Smrg      done
8274b4d38c65Smrg      IFS="$lt_save_ifs"
8275b4d38c65Smrg      ;;
8276b4d38c65Smrg    esac],
8277b4d38c65Smrg    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
8278b4d38c65Smrg
8279b4d38c65Smrg_LT_DECL([fast_install], [enable_fast_install], [0],
8280b4d38c65Smrg	 [Whether or not to optimize for fast installation])dnl
8281b4d38c65Smrg])# _LT_ENABLE_FAST_INSTALL
8282b4d38c65Smrg
8283b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
8284b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
8285b4d38c65Smrg
8286b4d38c65Smrg# Old names:
8287b4d38c65SmrgAU_DEFUN([AC_ENABLE_FAST_INSTALL],
8288b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
8289b4d38c65SmrgAC_DIAGNOSE([obsolete],
8290b4d38c65Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8291b4d38c65Smrgthe `fast-install' option into LT_INIT's first parameter.])
8292b4d38c65Smrg])
8293b4d38c65Smrg
8294b4d38c65SmrgAU_DEFUN([AC_DISABLE_FAST_INSTALL],
8295b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
8296b4d38c65SmrgAC_DIAGNOSE([obsolete],
8297b4d38c65Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you put
8298b4d38c65Smrgthe `disable-fast-install' option into LT_INIT's first parameter.])
8299b4d38c65Smrg])
8300b4d38c65Smrg
8301b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
8302b4d38c65Smrgdnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
8303b4d38c65Smrgdnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
8304b4d38c65Smrg
8305b4d38c65Smrg
8306b4d38c65Smrg# _LT_WITH_PIC([MODE])
8307b4d38c65Smrg# --------------------
8308b4d38c65Smrg# implement the --with-pic flag, and support the `pic-only' and `no-pic'
8309b4d38c65Smrg# LT_INIT options.
8310b4d38c65Smrg# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
8311b4d38c65Smrgm4_define([_LT_WITH_PIC],
8312b4d38c65Smrg[AC_ARG_WITH([pic],
8313cf503b78Smrg    [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
8314b4d38c65Smrg	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
8315cf503b78Smrg    [lt_p=${PACKAGE-default}
8316cf503b78Smrg    case $withval in
8317cf503b78Smrg    yes|no) pic_mode=$withval ;;
8318cf503b78Smrg    *)
8319cf503b78Smrg      pic_mode=default
8320cf503b78Smrg      # Look at the argument we got.  We use all the common list separators.
8321cf503b78Smrg      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
8322cf503b78Smrg      for lt_pkg in $withval; do
8323cf503b78Smrg	IFS="$lt_save_ifs"
8324cf503b78Smrg	if test "X$lt_pkg" = "X$lt_p"; then
8325cf503b78Smrg	  pic_mode=yes
8326cf503b78Smrg	fi
8327cf503b78Smrg      done
8328cf503b78Smrg      IFS="$lt_save_ifs"
8329cf503b78Smrg      ;;
8330cf503b78Smrg    esac],
8331b4d38c65Smrg    [pic_mode=default])
8332b4d38c65Smrg
8333b4d38c65Smrgtest -z "$pic_mode" && pic_mode=m4_default([$1], [default])
8334b4d38c65Smrg
8335b4d38c65Smrg_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
8336b4d38c65Smrg])# _LT_WITH_PIC
8337b4d38c65Smrg
8338b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
8339b4d38c65SmrgLT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
8340b4d38c65Smrg
8341b4d38c65Smrg# Old name:
8342b4d38c65SmrgAU_DEFUN([AC_LIBTOOL_PICMODE],
8343b4d38c65Smrg[_LT_SET_OPTION([LT_INIT], [pic-only])
8344b4d38c65SmrgAC_DIAGNOSE([obsolete],
8345b4d38c65Smrg[$0: Remove this warning and the call to _LT_SET_OPTION when you
8346b4d38c65Smrgput the `pic-only' option into LT_INIT's first parameter.])
8347b4d38c65Smrg])
8348b4d38c65Smrg
8349b4d38c65Smrgdnl aclocal-1.4 backwards compatibility:
8350b4d38c65Smrgdnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
8351b4d38c65Smrg
8352b4d38c65Smrg
8353b4d38c65Smrgm4_define([_LTDL_MODE], [])
8354b4d38c65SmrgLT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
8355b4d38c65Smrg		 [m4_define([_LTDL_MODE], [nonrecursive])])
8356b4d38c65SmrgLT_OPTION_DEFINE([LTDL_INIT], [recursive],
8357b4d38c65Smrg		 [m4_define([_LTDL_MODE], [recursive])])
8358b4d38c65SmrgLT_OPTION_DEFINE([LTDL_INIT], [subproject],
8359b4d38c65Smrg		 [m4_define([_LTDL_MODE], [subproject])])
8360b4d38c65Smrg
8361b4d38c65Smrgm4_define([_LTDL_TYPE], [])
8362b4d38c65SmrgLT_OPTION_DEFINE([LTDL_INIT], [installable],
8363b4d38c65Smrg		 [m4_define([_LTDL_TYPE], [installable])])
8364b4d38c65SmrgLT_OPTION_DEFINE([LTDL_INIT], [convenience],
8365b4d38c65Smrg		 [m4_define([_LTDL_TYPE], [convenience])])
8366b4d38c65Smrg
8367b4d38c65Smrg# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
8368b4d38c65Smrg#
8369b4d38c65Smrg# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
8370b4d38c65Smrg# Written by Gary V. Vaughan, 2004
8371b4d38c65Smrg#
8372b4d38c65Smrg# This file is free software; the Free Software Foundation gives
8373b4d38c65Smrg# unlimited permission to copy and/or distribute it, with or without
8374b4d38c65Smrg# modifications, as long as this notice is preserved.
8375b4d38c65Smrg
8376b4d38c65Smrg# serial 6 ltsugar.m4
8377b4d38c65Smrg
8378b4d38c65Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8379b4d38c65SmrgAC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
8380b4d38c65Smrg
8381b4d38c65Smrg
8382b4d38c65Smrg# lt_join(SEP, ARG1, [ARG2...])
8383b4d38c65Smrg# -----------------------------
8384b4d38c65Smrg# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
8385b4d38c65Smrg# associated separator.
8386b4d38c65Smrg# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
8387b4d38c65Smrg# versions in m4sugar had bugs.
8388b4d38c65Smrgm4_define([lt_join],
8389b4d38c65Smrg[m4_if([$#], [1], [],
8390b4d38c65Smrg       [$#], [2], [[$2]],
8391b4d38c65Smrg       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
8392b4d38c65Smrgm4_define([_lt_join],
8393b4d38c65Smrg[m4_if([$#$2], [2], [],
8394b4d38c65Smrg       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
8395b4d38c65Smrg
8396b4d38c65Smrg
8397b4d38c65Smrg# lt_car(LIST)
8398b4d38c65Smrg# lt_cdr(LIST)
8399b4d38c65Smrg# ------------
8400b4d38c65Smrg# Manipulate m4 lists.
8401b4d38c65Smrg# These macros are necessary as long as will still need to support
8402b4d38c65Smrg# Autoconf-2.59 which quotes differently.
8403b4d38c65Smrgm4_define([lt_car], [[$1]])
8404b4d38c65Smrgm4_define([lt_cdr],
8405b4d38c65Smrg[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
8406b4d38c65Smrg       [$#], 1, [],
8407b4d38c65Smrg       [m4_dquote(m4_shift($@))])])
8408b4d38c65Smrgm4_define([lt_unquote], $1)
8409b4d38c65Smrg
8410b4d38c65Smrg
8411b4d38c65Smrg# lt_append(MACRO-NAME, STRING, [SEPARATOR])
8412b4d38c65Smrg# ------------------------------------------
8413b4d38c65Smrg# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
8414b4d38c65Smrg# Note that neither SEPARATOR nor STRING are expanded; they are appended
8415b4d38c65Smrg# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
8416b4d38c65Smrg# No SEPARATOR is output if MACRO-NAME was previously undefined (different
8417b4d38c65Smrg# than defined and empty).
8418b4d38c65Smrg#
8419b4d38c65Smrg# This macro is needed until we can rely on Autoconf 2.62, since earlier
8420b4d38c65Smrg# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
8421b4d38c65Smrgm4_define([lt_append],
8422b4d38c65Smrg[m4_define([$1],
8423b4d38c65Smrg	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
8424b4d38c65Smrg
8425b4d38c65Smrg
8426b4d38c65Smrg
8427b4d38c65Smrg# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
8428b4d38c65Smrg# ----------------------------------------------------------
8429b4d38c65Smrg# Produce a SEP delimited list of all paired combinations of elements of
8430b4d38c65Smrg# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
8431b4d38c65Smrg# has the form PREFIXmINFIXSUFFIXn.
8432b4d38c65Smrg# Needed until we can rely on m4_combine added in Autoconf 2.62.
8433b4d38c65Smrgm4_define([lt_combine],
8434b4d38c65Smrg[m4_if(m4_eval([$# > 3]), [1],
8435b4d38c65Smrg       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
8436b4d38c65Smrg[[m4_foreach([_Lt_prefix], [$2],
8437b4d38c65Smrg	     [m4_foreach([_Lt_suffix],
8438b4d38c65Smrg		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
8439b4d38c65Smrg	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
8440b4d38c65Smrg
8441b4d38c65Smrg
8442b4d38c65Smrg# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
8443b4d38c65Smrg# -----------------------------------------------------------------------
8444b4d38c65Smrg# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
8445b4d38c65Smrg# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
8446b4d38c65Smrgm4_define([lt_if_append_uniq],
8447b4d38c65Smrg[m4_ifdef([$1],
8448b4d38c65Smrg	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
8449b4d38c65Smrg		 [lt_append([$1], [$2], [$3])$4],
8450b4d38c65Smrg		 [$5])],
8451b4d38c65Smrg	  [lt_append([$1], [$2], [$3])$4])])
8452b4d38c65Smrg
8453b4d38c65Smrg
8454b4d38c65Smrg# lt_dict_add(DICT, KEY, VALUE)
8455b4d38c65Smrg# -----------------------------
8456b4d38c65Smrgm4_define([lt_dict_add],
8457b4d38c65Smrg[m4_define([$1($2)], [$3])])
8458b4d38c65Smrg
8459b4d38c65Smrg
8460b4d38c65Smrg# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
8461b4d38c65Smrg# --------------------------------------------
8462b4d38c65Smrgm4_define([lt_dict_add_subkey],
8463b4d38c65Smrg[m4_define([$1($2:$3)], [$4])])
8464b4d38c65Smrg
8465b4d38c65Smrg
8466b4d38c65Smrg# lt_dict_fetch(DICT, KEY, [SUBKEY])
8467b4d38c65Smrg# ----------------------------------
8468b4d38c65Smrgm4_define([lt_dict_fetch],
8469b4d38c65Smrg[m4_ifval([$3],
8470b4d38c65Smrg	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
8471b4d38c65Smrg    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
8472b4d38c65Smrg
8473b4d38c65Smrg
8474b4d38c65Smrg# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
8475b4d38c65Smrg# -----------------------------------------------------------------
8476b4d38c65Smrgm4_define([lt_if_dict_fetch],
8477b4d38c65Smrg[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
8478b4d38c65Smrg	[$5],
8479b4d38c65Smrg    [$6])])
8480b4d38c65Smrg
8481b4d38c65Smrg
8482b4d38c65Smrg# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
8483b4d38c65Smrg# --------------------------------------------------------------
8484b4d38c65Smrgm4_define([lt_dict_filter],
8485b4d38c65Smrg[m4_if([$5], [], [],
8486b4d38c65Smrg  [lt_join(m4_quote(m4_default([$4], [[, ]])),
8487b4d38c65Smrg           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
8488b4d38c65Smrg		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
8489b4d38c65Smrg])
8490b4d38c65Smrg
8491b4d38c65Smrg# ltversion.m4 -- version numbers			-*- Autoconf -*-
8492b4d38c65Smrg#
8493b4d38c65Smrg#   Copyright (C) 2004 Free Software Foundation, Inc.
8494b4d38c65Smrg#   Written by Scott James Remnant, 2004
8495b4d38c65Smrg#
8496b4d38c65Smrg# This file is free software; the Free Software Foundation gives
8497b4d38c65Smrg# unlimited permission to copy and/or distribute it, with or without
8498b4d38c65Smrg# modifications, as long as this notice is preserved.
8499b4d38c65Smrg
8500b4d38c65Smrg# @configure_input@
8501b4d38c65Smrg
8502cf503b78Smrg# serial 3337 ltversion.m4
8503b4d38c65Smrg# This file is part of GNU Libtool
8504b4d38c65Smrg
8505cf503b78Smrgm4_define([LT_PACKAGE_VERSION], [2.4.2])
8506cf503b78Smrgm4_define([LT_PACKAGE_REVISION], [1.3337])
8507b4d38c65Smrg
8508b4d38c65SmrgAC_DEFUN([LTVERSION_VERSION],
8509cf503b78Smrg[macro_version='2.4.2'
8510cf503b78Smrgmacro_revision='1.3337'
8511b4d38c65Smrg_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
8512b4d38c65Smrg_LT_DECL(, macro_revision, 0)
8513b410ddbeSmrg])
851415fb4814Smrg
8515b4d38c65Smrg# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
8516b4d38c65Smrg#
8517b4d38c65Smrg#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
8518b4d38c65Smrg#   Written by Scott James Remnant, 2004.
8519b4d38c65Smrg#
8520b4d38c65Smrg# This file is free software; the Free Software Foundation gives
8521b4d38c65Smrg# unlimited permission to copy and/or distribute it, with or without
8522b4d38c65Smrg# modifications, as long as this notice is preserved.
8523b4d38c65Smrg
8524b4d38c65Smrg# serial 5 lt~obsolete.m4
8525b4d38c65Smrg
8526b4d38c65Smrg# These exist entirely to fool aclocal when bootstrapping libtool.
8527b4d38c65Smrg#
8528b4d38c65Smrg# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
8529b4d38c65Smrg# which have later been changed to m4_define as they aren't part of the
8530b4d38c65Smrg# exported API, or moved to Autoconf or Automake where they belong.
8531b4d38c65Smrg#
8532b4d38c65Smrg# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
8533b4d38c65Smrg# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
8534b4d38c65Smrg# using a macro with the same name in our local m4/libtool.m4 it'll
8535b4d38c65Smrg# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
8536b4d38c65Smrg# and doesn't know about Autoconf macros at all.)
8537b4d38c65Smrg#
8538b4d38c65Smrg# So we provide this file, which has a silly filename so it's always
8539b4d38c65Smrg# included after everything else.  This provides aclocal with the
8540b4d38c65Smrg# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
8541b4d38c65Smrg# because those macros already exist, or will be overwritten later.
8542b4d38c65Smrg# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
8543b4d38c65Smrg#
8544b4d38c65Smrg# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
8545b4d38c65Smrg# Yes, that means every name once taken will need to remain here until
8546b4d38c65Smrg# we give up compatibility with versions before 1.7, at which point
8547b4d38c65Smrg# we need to keep only those names which we still refer to.
8548b4d38c65Smrg
8549b4d38c65Smrg# This is to help aclocal find these macros, as it can't see m4_define.
8550b4d38c65SmrgAC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
8551b4d38c65Smrg
8552b4d38c65Smrgm4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
8553b4d38c65Smrgm4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
8554b4d38c65Smrgm4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
8555b4d38c65Smrgm4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
8556b4d38c65Smrgm4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
8557b4d38c65Smrgm4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
8558b4d38c65Smrgm4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
8559b4d38c65Smrgm4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
8560b4d38c65Smrgm4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
8561b4d38c65Smrgm4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
8562b4d38c65Smrgm4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
8563b4d38c65Smrgm4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
8564b4d38c65Smrgm4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
8565b4d38c65Smrgm4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
8566b4d38c65Smrgm4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
8567b4d38c65Smrgm4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
8568b4d38c65Smrgm4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
8569b4d38c65Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
8570b4d38c65Smrgm4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
8571b4d38c65Smrgm4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
8572b4d38c65Smrgm4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
8573b4d38c65Smrgm4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
8574b4d38c65Smrgm4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
8575b4d38c65Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
8576b4d38c65Smrgm4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
8577b4d38c65Smrgm4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
8578b4d38c65Smrgm4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
8579b4d38c65Smrgm4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
8580b4d38c65Smrgm4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
8581b4d38c65Smrgm4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
8582b4d38c65Smrgm4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
8583b4d38c65Smrgm4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
8584b4d38c65Smrgm4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
8585b4d38c65Smrgm4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
8586b4d38c65Smrgm4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
8587b4d38c65Smrgm4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
8588b4d38c65Smrgm4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
8589b4d38c65Smrgm4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
8590b4d38c65Smrgm4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
8591b4d38c65Smrgm4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
8592b4d38c65Smrgm4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
8593b4d38c65Smrgm4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
8594b4d38c65Smrgm4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
8595b4d38c65Smrgm4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
8596b4d38c65Smrgm4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
8597b4d38c65Smrgm4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
8598b4d38c65Smrgm4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
8599b4d38c65Smrgm4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
8600b4d38c65Smrgm4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
8601b4d38c65Smrgm4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
8602b4d38c65Smrgm4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
8603b4d38c65Smrgm4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
8604b4d38c65Smrgm4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
8605b4d38c65Smrgm4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
8606b4d38c65Smrgm4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
8607b4d38c65Smrgm4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
8608b4d38c65Smrgm4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
8609b4d38c65Smrgm4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
8610b4d38c65Smrgm4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
8611b4d38c65Smrgm4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
8612b4d38c65Smrgm4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
8613b4d38c65Smrg
8614b534f209Smrg# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
8615b4d38c65Smrg# serial 1 (pkg-config-0.24)
8616b534f209Smrg# 
8617b534f209Smrg# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
8618b410ddbeSmrg#
8619b534f209Smrg# This program is free software; you can redistribute it and/or modify
8620b534f209Smrg# it under the terms of the GNU General Public License as published by
8621b534f209Smrg# the Free Software Foundation; either version 2 of the License, or
8622b534f209Smrg# (at your option) any later version.
8623b410ddbeSmrg#
8624b534f209Smrg# This program is distributed in the hope that it will be useful, but
8625b534f209Smrg# WITHOUT ANY WARRANTY; without even the implied warranty of
8626b534f209Smrg# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
8627b534f209Smrg# General Public License for more details.
8628b534f209Smrg#
8629b534f209Smrg# You should have received a copy of the GNU General Public License
8630b534f209Smrg# along with this program; if not, write to the Free Software
8631b534f209Smrg# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
8632b534f209Smrg#
8633b534f209Smrg# As a special exception to the GNU General Public License, if you
8634b534f209Smrg# distribute this file as part of a program that contains a
8635b534f209Smrg# configuration script generated by Autoconf, you may include it under
8636b534f209Smrg# the same distribution terms that you use for the rest of that program.
863715fb4814Smrg
8638b534f209Smrg# PKG_PROG_PKG_CONFIG([MIN-VERSION])
8639b534f209Smrg# ----------------------------------
8640b534f209SmrgAC_DEFUN([PKG_PROG_PKG_CONFIG],
8641b534f209Smrg[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
8642cf503b78Smrgm4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
8643cf503b78Smrgm4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
8644b4d38c65SmrgAC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
8645b4d38c65SmrgAC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
8646b4d38c65SmrgAC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
8647b4d38c65Smrg
8648b534f209Smrgif test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8649b534f209Smrg	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
8650b534f209Smrgfi
8651b534f209Smrgif test -n "$PKG_CONFIG"; then
8652b534f209Smrg	_pkg_min_version=m4_default([$1], [0.9.0])
8653b534f209Smrg	AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
8654b534f209Smrg	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8655b534f209Smrg		AC_MSG_RESULT([yes])
8656b534f209Smrg	else
8657b534f209Smrg		AC_MSG_RESULT([no])
8658b534f209Smrg		PKG_CONFIG=""
8659b410ddbeSmrg	fi
8660b534f209Smrgfi[]dnl
8661b534f209Smrg])# PKG_PROG_PKG_CONFIG
866215fb4814Smrg
8663b534f209Smrg# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
8664b534f209Smrg#
8665b534f209Smrg# Check to see whether a particular set of modules exists.  Similar
8666b534f209Smrg# to PKG_CHECK_MODULES(), but does not set variables or print errors.
8667b534f209Smrg#
8668b4d38c65Smrg# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8669b4d38c65Smrg# only at the first occurence in configure.ac, so if the first place
8670b4d38c65Smrg# it's called might be skipped (such as if it is within an "if", you
8671b4d38c65Smrg# have to call PKG_CHECK_EXISTS manually
8672b534f209Smrg# --------------------------------------------------------------
8673b534f209SmrgAC_DEFUN([PKG_CHECK_EXISTS],
8674b534f209Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8675b534f209Smrgif test -n "$PKG_CONFIG" && \
8676b534f209Smrg    AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
8677b4d38c65Smrg  m4_default([$2], [:])
8678b534f209Smrgm4_ifvaln([$3], [else
8679b534f209Smrg  $3])dnl
8680b534f209Smrgfi])
868115fb4814Smrg
8682b534f209Smrg# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
8683b534f209Smrg# ---------------------------------------------
8684b534f209Smrgm4_define([_PKG_CONFIG],
8685b4d38c65Smrg[if test -n "$$1"; then
8686b4d38c65Smrg    pkg_cv_[]$1="$$1"
8687b4d38c65Smrg elif test -n "$PKG_CONFIG"; then
8688b4d38c65Smrg    PKG_CHECK_EXISTS([$3],
8689cf503b78Smrg                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
8690cf503b78Smrg		      test "x$?" != "x0" && pkg_failed=yes ],
8691b4d38c65Smrg		     [pkg_failed=yes])
8692b4d38c65Smrg else
8693b4d38c65Smrg    pkg_failed=untried
8694b534f209Smrgfi[]dnl
8695b534f209Smrg])# _PKG_CONFIG
869615fb4814Smrg
8697b534f209Smrg# _PKG_SHORT_ERRORS_SUPPORTED
8698b534f209Smrg# -----------------------------
8699b534f209SmrgAC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
8700b534f209Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
8701b534f209Smrgif $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
8702b534f209Smrg        _pkg_short_errors_supported=yes
8703b534f209Smrgelse
8704b534f209Smrg        _pkg_short_errors_supported=no
8705b534f209Smrgfi[]dnl
8706b534f209Smrg])# _PKG_SHORT_ERRORS_SUPPORTED
870715fb4814Smrg
870815fb4814Smrg
8709b534f209Smrg# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
8710b534f209Smrg# [ACTION-IF-NOT-FOUND])
8711b534f209Smrg#
8712b534f209Smrg#
8713b534f209Smrg# Note that if there is a possibility the first call to
8714b534f209Smrg# PKG_CHECK_MODULES might not happen, you should be sure to include an
8715b534f209Smrg# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
8716b534f209Smrg#
8717b534f209Smrg#
8718b534f209Smrg# --------------------------------------------------------------
8719b534f209SmrgAC_DEFUN([PKG_CHECK_MODULES],
8720b534f209Smrg[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
8721b534f209SmrgAC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
8722b534f209SmrgAC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
872315fb4814Smrg
8724b534f209Smrgpkg_failed=no
8725b534f209SmrgAC_MSG_CHECKING([for $1])
872615fb4814Smrg
8727b534f209Smrg_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
8728b534f209Smrg_PKG_CONFIG([$1][_LIBS], [libs], [$2])
872915fb4814Smrg
8730b534f209Smrgm4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
8731b534f209Smrgand $1[]_LIBS to avoid the need to call pkg-config.
8732b534f209SmrgSee the pkg-config man page for more details.])
8733b410ddbeSmrg
8734b534f209Smrgif test $pkg_failed = yes; then
8735b4d38c65Smrg   	AC_MSG_RESULT([no])
8736b534f209Smrg        _PKG_SHORT_ERRORS_SUPPORTED
8737b534f209Smrg        if test $_pkg_short_errors_supported = yes; then
8738cf503b78Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
8739b534f209Smrg        else 
8740cf503b78Smrg	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
8741b534f209Smrg        fi
8742b534f209Smrg	# Put the nasty error message in config.log where it belongs
8743b534f209Smrg	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
8744b410ddbeSmrg
8745b4d38c65Smrg	m4_default([$4], [AC_MSG_ERROR(
8746b534f209Smrg[Package requirements ($2) were not met:
8747b410ddbeSmrg
8748b534f209Smrg$$1_PKG_ERRORS
874915fb4814Smrg
8750b534f209SmrgConsider adjusting the PKG_CONFIG_PATH environment variable if you
8751b534f209Smrginstalled software in a non-standard prefix.
875215fb4814Smrg
8753cf503b78Smrg_PKG_TEXT])[]dnl
8754b4d38c65Smrg        ])
8755b534f209Smrgelif test $pkg_failed = untried; then
8756b4d38c65Smrg     	AC_MSG_RESULT([no])
8757b4d38c65Smrg	m4_default([$4], [AC_MSG_FAILURE(
8758b534f209Smrg[The pkg-config script could not be found or is too old.  Make sure it
8759b534f209Smrgis in your PATH or set the PKG_CONFIG environment variable to the full
8760b534f209Smrgpath to pkg-config.
876115fb4814Smrg
8762b534f209Smrg_PKG_TEXT
8763b410ddbeSmrg
8764cf503b78SmrgTo get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
8765b4d38c65Smrg        ])
8766b534f209Smrgelse
8767b534f209Smrg	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
8768b534f209Smrg	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
8769b534f209Smrg        AC_MSG_RESULT([yes])
8770b4d38c65Smrg	$3
8771b534f209Smrgfi[]dnl
8772b534f209Smrg])# PKG_CHECK_MODULES
8773b410ddbeSmrg
8774cf503b78Smrg
8775cf503b78Smrg# PKG_INSTALLDIR(DIRECTORY)
8776cf503b78Smrg# -------------------------
8777cf503b78Smrg# Substitutes the variable pkgconfigdir as the location where a module
8778cf503b78Smrg# should install pkg-config .pc files. By default the directory is
8779cf503b78Smrg# $libdir/pkgconfig, but the default can be changed by passing
8780cf503b78Smrg# DIRECTORY. The user can override through the --with-pkgconfigdir
8781cf503b78Smrg# parameter.
8782cf503b78SmrgAC_DEFUN([PKG_INSTALLDIR],
8783cf503b78Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
8784cf503b78Smrgm4_pushdef([pkg_description],
8785cf503b78Smrg    [pkg-config installation directory @<:@]pkg_default[@:>@])
8786cf503b78SmrgAC_ARG_WITH([pkgconfigdir],
8787cf503b78Smrg    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
8788cf503b78Smrg    [with_pkgconfigdir=]pkg_default)
8789cf503b78SmrgAC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
8790cf503b78Smrgm4_popdef([pkg_default])
8791cf503b78Smrgm4_popdef([pkg_description])
8792cf503b78Smrg]) dnl PKG_INSTALLDIR
8793cf503b78Smrg
8794cf503b78Smrg
8795cf503b78Smrg# PKG_NOARCH_INSTALLDIR(DIRECTORY)
8796cf503b78Smrg# -------------------------
8797cf503b78Smrg# Substitutes the variable noarch_pkgconfigdir as the location where a
8798cf503b78Smrg# module should install arch-independent pkg-config .pc files. By
8799cf503b78Smrg# default the directory is $datadir/pkgconfig, but the default can be
8800cf503b78Smrg# changed by passing DIRECTORY. The user can override through the
8801cf503b78Smrg# --with-noarch-pkgconfigdir parameter.
8802cf503b78SmrgAC_DEFUN([PKG_NOARCH_INSTALLDIR],
8803cf503b78Smrg[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
8804cf503b78Smrgm4_pushdef([pkg_description],
8805cf503b78Smrg    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
8806cf503b78SmrgAC_ARG_WITH([noarch-pkgconfigdir],
8807cf503b78Smrg    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
8808cf503b78Smrg    [with_noarch_pkgconfigdir=]pkg_default)
8809cf503b78SmrgAC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
8810cf503b78Smrgm4_popdef([pkg_default])
8811cf503b78Smrgm4_popdef([pkg_description])
8812cf503b78Smrg]) dnl PKG_NOARCH_INSTALLDIR
8813cf503b78Smrg
8814cf503b78Smrg# Copyright (C) 2002-2013 Free Software Foundation, Inc.
88157fe5393cSmrg#
88167fe5393cSmrg# This file is free software; the Free Software Foundation
88177fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
88187fe5393cSmrg# with or without modifications, as long as this notice is preserved.
8819b410ddbeSmrg
88207fe5393cSmrg# AM_AUTOMAKE_VERSION(VERSION)
88217fe5393cSmrg# ----------------------------
88227fe5393cSmrg# Automake X.Y traces this macro to ensure aclocal.m4 has been
88237fe5393cSmrg# generated from the m4 files accompanying Automake X.Y.
88247fe5393cSmrg# (This private macro should not be called outside this file.)
88257fe5393cSmrgAC_DEFUN([AM_AUTOMAKE_VERSION],
8826cf503b78Smrg[am__api_version='1.13'
88277fe5393cSmrgdnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
88287fe5393cSmrgdnl require some minimum version.  Point them to the right macro.
8829cf503b78Smrgm4_if([$1], [1.13.2], [],
88307fe5393cSmrg      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
88317fe5393cSmrg])
88327fe5393cSmrg
88337fe5393cSmrg# _AM_AUTOCONF_VERSION(VERSION)
88347fe5393cSmrg# -----------------------------
88357fe5393cSmrg# aclocal traces this macro to find the Autoconf version.
88367fe5393cSmrg# This is a private macro too.  Using m4_define simplifies
88377fe5393cSmrg# the logic in aclocal, which can simply ignore this definition.
88387fe5393cSmrgm4_define([_AM_AUTOCONF_VERSION], [])
88397fe5393cSmrg
88407fe5393cSmrg# AM_SET_CURRENT_AUTOMAKE_VERSION
88417fe5393cSmrg# -------------------------------
88427fe5393cSmrg# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
88437fe5393cSmrg# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
88447fe5393cSmrgAC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
8845cf503b78Smrg[AM_AUTOMAKE_VERSION([1.13.2])dnl
88467fe5393cSmrgm4_ifndef([AC_AUTOCONF_VERSION],
88477fe5393cSmrg  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
88487fe5393cSmrg_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
88497fe5393cSmrg
88507fe5393cSmrg# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
88517fe5393cSmrg
8852cf503b78Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
8853b534f209Smrg#
88547fe5393cSmrg# This file is free software; the Free Software Foundation
88557fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
88567fe5393cSmrg# with or without modifications, as long as this notice is preserved.
88577fe5393cSmrg
88587fe5393cSmrg# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
8859cf503b78Smrg# $ac_aux_dir to '$srcdir/foo'.  In other projects, it is set to
8860cf503b78Smrg# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
8861b534f209Smrg#
88627fe5393cSmrg# Of course, Automake must honor this variable whenever it calls a
88637fe5393cSmrg# tool from the auxiliary directory.  The problem is that $srcdir (and
88647fe5393cSmrg# therefore $ac_aux_dir as well) can be either absolute or relative,
88657fe5393cSmrg# depending on how configure is run.  This is pretty annoying, since
88667fe5393cSmrg# it makes $ac_aux_dir quite unusable in subdirectories: in the top
88677fe5393cSmrg# source directory, any form will work fine, but in subdirectories a
88687fe5393cSmrg# relative path needs to be adjusted first.
88697fe5393cSmrg#
88707fe5393cSmrg# $ac_aux_dir/missing
88717fe5393cSmrg#    fails when called from a subdirectory if $ac_aux_dir is relative
88727fe5393cSmrg# $top_srcdir/$ac_aux_dir/missing
88737fe5393cSmrg#    fails if $ac_aux_dir is absolute,
88747fe5393cSmrg#    fails when called from a subdirectory in a VPATH build with
88757fe5393cSmrg#          a relative $ac_aux_dir
8876b534f209Smrg#
88777fe5393cSmrg# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
88787fe5393cSmrg# are both prefixed by $srcdir.  In an in-source build this is usually
8879cf503b78Smrg# harmless because $srcdir is '.', but things will broke when you
88807fe5393cSmrg# start a VPATH build or use an absolute $srcdir.
8881b534f209Smrg#
88827fe5393cSmrg# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
88837fe5393cSmrg# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
88847fe5393cSmrg#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
88857fe5393cSmrg# and then we would define $MISSING as
88867fe5393cSmrg#   MISSING="\${SHELL} $am_aux_dir/missing"
88877fe5393cSmrg# This will work as long as MISSING is not called from configure, because
88887fe5393cSmrg# unfortunately $(top_srcdir) has no meaning in configure.
88897fe5393cSmrg# However there are other variables, like CC, which are often used in
88907fe5393cSmrg# configure, and could therefore not use this "fixed" $ac_aux_dir.
88917fe5393cSmrg#
88927fe5393cSmrg# Another solution, used here, is to always expand $ac_aux_dir to an
88937fe5393cSmrg# absolute PATH.  The drawback is that using absolute paths prevent a
88947fe5393cSmrg# configured tree to be moved without reconfiguration.
8895b410ddbeSmrg
88967fe5393cSmrgAC_DEFUN([AM_AUX_DIR_EXPAND],
88977fe5393cSmrg[dnl Rely on autoconf to set up CDPATH properly.
88987fe5393cSmrgAC_PREREQ([2.50])dnl
88997fe5393cSmrg# expand $ac_aux_dir to an absolute path
89007fe5393cSmrgam_aux_dir=`cd $ac_aux_dir && pwd`
89017fe5393cSmrg])
89027fe5393cSmrg
89037fe5393cSmrg# AM_CONDITIONAL                                            -*- Autoconf -*-
89047fe5393cSmrg
8905cf503b78Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
8906b534f209Smrg#
89077fe5393cSmrg# This file is free software; the Free Software Foundation
89087fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
89097fe5393cSmrg# with or without modifications, as long as this notice is preserved.
891015fb4814Smrg
89117fe5393cSmrg# AM_CONDITIONAL(NAME, SHELL-CONDITION)
89127fe5393cSmrg# -------------------------------------
89137fe5393cSmrg# Define a conditional.
89147fe5393cSmrgAC_DEFUN([AM_CONDITIONAL],
8915cf503b78Smrg[AC_PREREQ([2.52])dnl
8916cf503b78Smrg m4_if([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
8917cf503b78Smrg       [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
89187fe5393cSmrgAC_SUBST([$1_TRUE])dnl
89197fe5393cSmrgAC_SUBST([$1_FALSE])dnl
89207fe5393cSmrg_AM_SUBST_NOTMAKE([$1_TRUE])dnl
89217fe5393cSmrg_AM_SUBST_NOTMAKE([$1_FALSE])dnl
89227fe5393cSmrgm4_define([_AM_COND_VALUE_$1], [$2])dnl
89237fe5393cSmrgif $2; then
89247fe5393cSmrg  $1_TRUE=
89257fe5393cSmrg  $1_FALSE='#'
8926b534f209Smrgelse
89277fe5393cSmrg  $1_TRUE='#'
89287fe5393cSmrg  $1_FALSE=
8929b534f209Smrgfi
89307fe5393cSmrgAC_CONFIG_COMMANDS_PRE(
89317fe5393cSmrg[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
89327fe5393cSmrg  AC_MSG_ERROR([[conditional "$1" was never defined.
89337fe5393cSmrgUsually this means the macro was only invoked conditionally.]])
89347fe5393cSmrgfi])])
893515fb4814Smrg
8936cf503b78Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
8937b534f209Smrg#
89387fe5393cSmrg# This file is free software; the Free Software Foundation
89397fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
89407fe5393cSmrg# with or without modifications, as long as this notice is preserved.
894115fb4814Smrg
894215fb4814Smrg
8943cf503b78Smrg# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
89447fe5393cSmrg# written in clear, in which case automake, when reading aclocal.m4,
89457fe5393cSmrg# will think it sees a *use*, and therefore will trigger all it's
89467fe5393cSmrg# C support machinery.  Also note that it means that autoscan, seeing
89477fe5393cSmrg# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
8948b410ddbeSmrg
8949b410ddbeSmrg
89507fe5393cSmrg# _AM_DEPENDENCIES(NAME)
89517fe5393cSmrg# ----------------------
89527fe5393cSmrg# See how the compiler implements dependency checking.
8953cf503b78Smrg# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
89547fe5393cSmrg# We try a few techniques and use that to set a single cache variable.
89557fe5393cSmrg#
89567fe5393cSmrg# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
89577fe5393cSmrg# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
89587fe5393cSmrg# dependency, and given that the user is not expected to run this macro,
89597fe5393cSmrg# just rely on AC_PROG_CC.
89607fe5393cSmrgAC_DEFUN([_AM_DEPENDENCIES],
89617fe5393cSmrg[AC_REQUIRE([AM_SET_DEPDIR])dnl
89627fe5393cSmrgAC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
89637fe5393cSmrgAC_REQUIRE([AM_MAKE_INCLUDE])dnl
89647fe5393cSmrgAC_REQUIRE([AM_DEP_TRACK])dnl
8965b410ddbeSmrg
8966cf503b78Smrgm4_if([$1], [CC],   [depcc="$CC"   am_compiler_list=],
8967cf503b78Smrg      [$1], [CXX],  [depcc="$CXX"  am_compiler_list=],
8968cf503b78Smrg      [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
8969cf503b78Smrg      [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
8970cf503b78Smrg      [$1], [UPC],  [depcc="$UPC"  am_compiler_list=],
8971cf503b78Smrg      [$1], [GCJ],  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
8972cf503b78Smrg                    [depcc="$$1"   am_compiler_list=])
897315fb4814Smrg
89747fe5393cSmrgAC_CACHE_CHECK([dependency style of $depcc],
89757fe5393cSmrg               [am_cv_$1_dependencies_compiler_type],
89767fe5393cSmrg[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
89777fe5393cSmrg  # We make a subdir and do the tests there.  Otherwise we can end up
89787fe5393cSmrg  # making bogus files that we don't know about and never remove.  For
89797fe5393cSmrg  # instance it was reported that on HP-UX the gcc test will end up
8980cf503b78Smrg  # making a dummy file named 'D' -- because '-MD' means "put the output
8981cf503b78Smrg  # in D".
8982cf503b78Smrg  rm -rf conftest.dir
89837fe5393cSmrg  mkdir conftest.dir
89847fe5393cSmrg  # Copy depcomp to subdir because otherwise we won't find it if we're
89857fe5393cSmrg  # using a relative directory.
89867fe5393cSmrg  cp "$am_depcomp" conftest.dir
89877fe5393cSmrg  cd conftest.dir
89887fe5393cSmrg  # We will build objects and dependencies in a subdirectory because
89897fe5393cSmrg  # it helps to detect inapplicable dependency modes.  For instance
89907fe5393cSmrg  # both Tru64's cc and ICC support -MD to output dependencies as a
89917fe5393cSmrg  # side effect of compilation, but ICC will put the dependencies in
89927fe5393cSmrg  # the current directory while Tru64 will put them in the object
89937fe5393cSmrg  # directory.
89947fe5393cSmrg  mkdir sub
8995de78e416Smrg
89967fe5393cSmrg  am_cv_$1_dependencies_compiler_type=none
89977fe5393cSmrg  if test "$am_compiler_list" = ""; then
89987fe5393cSmrg     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
89997fe5393cSmrg  fi
90007fe5393cSmrg  am__universal=false
90017fe5393cSmrg  m4_case([$1], [CC],
90027fe5393cSmrg    [case " $depcc " in #(
90037fe5393cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
90047fe5393cSmrg     esac],
90057fe5393cSmrg    [CXX],
90067fe5393cSmrg    [case " $depcc " in #(
90077fe5393cSmrg     *\ -arch\ *\ -arch\ *) am__universal=true ;;
90087fe5393cSmrg     esac])
90097fe5393cSmrg
90107fe5393cSmrg  for depmode in $am_compiler_list; do
90117fe5393cSmrg    # Setup a source with many dependencies, because some compilers
90127fe5393cSmrg    # like to wrap large dependency lists on column 80 (with \), and
90137fe5393cSmrg    # we should not choose a depcomp mode which is confused by this.
90147fe5393cSmrg    #
90157fe5393cSmrg    # We need to recreate these files for each test, as the compiler may
90167fe5393cSmrg    # overwrite some of them when testing with obscure command lines.
90177fe5393cSmrg    # This happens at least with the AIX C compiler.
90187fe5393cSmrg    : > sub/conftest.c
90197fe5393cSmrg    for i in 1 2 3 4 5 6; do
90207fe5393cSmrg      echo '#include "conftst'$i'.h"' >> sub/conftest.c
9021cf503b78Smrg      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
9022cf503b78Smrg      # Solaris 10 /bin/sh.
9023cf503b78Smrg      echo '/* dummy */' > sub/conftst$i.h
90247fe5393cSmrg    done
90257fe5393cSmrg    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
90267fe5393cSmrg
9027cf503b78Smrg    # We check with '-c' and '-o' for the sake of the "dashmstdout"
90287fe5393cSmrg    # mode.  It turns out that the SunPro C++ compiler does not properly
9029cf503b78Smrg    # handle '-M -o', and we need to detect this.  Also, some Intel
9030cf503b78Smrg    # versions had trouble with output in subdirs.
90317fe5393cSmrg    am__obj=sub/conftest.${OBJEXT-o}
90327fe5393cSmrg    am__minus_obj="-o $am__obj"
90337fe5393cSmrg    case $depmode in
90347fe5393cSmrg    gcc)
90357fe5393cSmrg      # This depmode causes a compiler race in universal mode.
90367fe5393cSmrg      test "$am__universal" = false || continue
90377fe5393cSmrg      ;;
90387fe5393cSmrg    nosideeffect)
9039cf503b78Smrg      # After this tag, mechanisms are not by side-effect, so they'll
9040cf503b78Smrg      # only be used when explicitly requested.
90417fe5393cSmrg      if test "x$enable_dependency_tracking" = xyes; then
90427fe5393cSmrg	continue
90437fe5393cSmrg      else
90447fe5393cSmrg	break
90457fe5393cSmrg      fi
90467fe5393cSmrg      ;;
9047cf503b78Smrg    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
9048cf503b78Smrg      # This compiler won't grok '-c -o', but also, the minuso test has
90497fe5393cSmrg      # not run yet.  These depmodes are late enough in the game, and
90507fe5393cSmrg      # so weak that their functioning should not be impacted.
90517fe5393cSmrg      am__obj=conftest.${OBJEXT-o}
90527fe5393cSmrg      am__minus_obj=
90537fe5393cSmrg      ;;
90547fe5393cSmrg    none) break ;;
9055b534f209Smrg    esac
90567fe5393cSmrg    if depmode=$depmode \
90577fe5393cSmrg       source=sub/conftest.c object=$am__obj \
90587fe5393cSmrg       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
90597fe5393cSmrg       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
90607fe5393cSmrg         >/dev/null 2>conftest.err &&
90617fe5393cSmrg       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
90627fe5393cSmrg       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
90637fe5393cSmrg       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
90647fe5393cSmrg       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
90657fe5393cSmrg      # icc doesn't choke on unknown options, it will just issue warnings
90667fe5393cSmrg      # or remarks (even with -Werror).  So we grep stderr for any message
90677fe5393cSmrg      # that says an option was ignored or not supported.
90687fe5393cSmrg      # When given -MP, icc 7.0 and 7.1 complain thusly:
90697fe5393cSmrg      #   icc: Command line warning: ignoring option '-M'; no argument required
90707fe5393cSmrg      # The diagnosis changed in icc 8.0:
90717fe5393cSmrg      #   icc: Command line remark: option '-MP' not supported
90727fe5393cSmrg      if (grep 'ignoring option' conftest.err ||
90737fe5393cSmrg          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
90747fe5393cSmrg        am_cv_$1_dependencies_compiler_type=$depmode
90757fe5393cSmrg        break
90767fe5393cSmrg      fi
90777fe5393cSmrg    fi
90787fe5393cSmrg  done
90797fe5393cSmrg
90807fe5393cSmrg  cd ..
90817fe5393cSmrg  rm -rf conftest.dir
90827fe5393cSmrgelse
90837fe5393cSmrg  am_cv_$1_dependencies_compiler_type=none
9084b534f209Smrgfi
90857fe5393cSmrg])
90867fe5393cSmrgAC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
90877fe5393cSmrgAM_CONDITIONAL([am__fastdep$1], [
90887fe5393cSmrg  test "x$enable_dependency_tracking" != xno \
90897fe5393cSmrg  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
90907fe5393cSmrg])
9091de78e416Smrg
9092de78e416Smrg
90937fe5393cSmrg# AM_SET_DEPDIR
90947fe5393cSmrg# -------------
90957fe5393cSmrg# Choose a directory name for dependency files.
9096cf503b78Smrg# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
90977fe5393cSmrgAC_DEFUN([AM_SET_DEPDIR],
90987fe5393cSmrg[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
90997fe5393cSmrgAC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
91007fe5393cSmrg])
9101b4d38c65Smrg
9102b4d38c65Smrg
91037fe5393cSmrg# AM_DEP_TRACK
91047fe5393cSmrg# ------------
91057fe5393cSmrgAC_DEFUN([AM_DEP_TRACK],
9106cf503b78Smrg[AC_ARG_ENABLE([dependency-tracking], [dnl
9107cf503b78SmrgAS_HELP_STRING(
9108cf503b78Smrg  [--enable-dependency-tracking],
9109cf503b78Smrg  [do not reject slow dependency extractors])
9110cf503b78SmrgAS_HELP_STRING(
9111cf503b78Smrg  [--disable-dependency-tracking],
9112cf503b78Smrg  [speeds up one-time build])])
91137fe5393cSmrgif test "x$enable_dependency_tracking" != xno; then
91147fe5393cSmrg  am_depcomp="$ac_aux_dir/depcomp"
91157fe5393cSmrg  AMDEPBACKSLASH='\'
9116cf503b78Smrg  am__nodep='_no'
9117b4d38c65Smrgfi
91187fe5393cSmrgAM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
91197fe5393cSmrgAC_SUBST([AMDEPBACKSLASH])dnl
91207fe5393cSmrg_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
9121cf503b78SmrgAC_SUBST([am__nodep])dnl
9122cf503b78Smrg_AM_SUBST_NOTMAKE([am__nodep])dnl
91237fe5393cSmrg])
9124b4d38c65Smrg
91257fe5393cSmrg# Generate code to set up dependency tracking.              -*- Autoconf -*-
9126b4d38c65Smrg
9127cf503b78Smrg# Copyright (C) 1999-2013 Free Software Foundation, Inc.
9128b4d38c65Smrg#
91297fe5393cSmrg# This file is free software; the Free Software Foundation
91307fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
91317fe5393cSmrg# with or without modifications, as long as this notice is preserved.
9132b410ddbeSmrg
9133b410ddbeSmrg
91347fe5393cSmrg# _AM_OUTPUT_DEPENDENCY_COMMANDS
91357fe5393cSmrg# ------------------------------
91367fe5393cSmrgAC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
91377fe5393cSmrg[{
9138cf503b78Smrg  # Older Autoconf quotes --file arguments for eval, but not when files
91397fe5393cSmrg  # are listed without --file.  Let's play safe and only enable the eval
91407fe5393cSmrg  # if we detect the quoting.
91417fe5393cSmrg  case $CONFIG_FILES in
91427fe5393cSmrg  *\'*) eval set x "$CONFIG_FILES" ;;
91437fe5393cSmrg  *)   set x $CONFIG_FILES ;;
91447fe5393cSmrg  esac
91457fe5393cSmrg  shift
91467fe5393cSmrg  for mf
91477fe5393cSmrg  do
91487fe5393cSmrg    # Strip MF so we end up with the name of the file.
91497fe5393cSmrg    mf=`echo "$mf" | sed -e 's/:.*$//'`
91507fe5393cSmrg    # Check whether this is an Automake generated Makefile or not.
9151cf503b78Smrg    # We used to match only the files named 'Makefile.in', but
91527fe5393cSmrg    # some people rename them; so instead we look at the file content.
91537fe5393cSmrg    # Grep'ing the first line is not enough: some people post-process
91547fe5393cSmrg    # each Makefile.in and add a new line on top of each file to say so.
91557fe5393cSmrg    # Grep'ing the whole file is not good either: AIX grep has a line
91567fe5393cSmrg    # limit of 2048, but all sed's we know have understand at least 4000.
91577fe5393cSmrg    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
91587fe5393cSmrg      dirpart=`AS_DIRNAME("$mf")`
91597fe5393cSmrg    else
91607fe5393cSmrg      continue
91617fe5393cSmrg    fi
91627fe5393cSmrg    # Extract the definition of DEPDIR, am__include, and am__quote
9163cf503b78Smrg    # from the Makefile without running 'make'.
91647fe5393cSmrg    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
91657fe5393cSmrg    test -z "$DEPDIR" && continue
91667fe5393cSmrg    am__include=`sed -n 's/^am__include = //p' < "$mf"`
9167cf503b78Smrg    test -z "$am__include" && continue
91687fe5393cSmrg    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
91697fe5393cSmrg    # Find all dependency output files, they are included files with
91707fe5393cSmrg    # $(DEPDIR) in their names.  We invoke sed twice because it is the
91717fe5393cSmrg    # simplest approach to changing $(DEPDIR) to its actual value in the
91727fe5393cSmrg    # expansion.
91737fe5393cSmrg    for file in `sed -n "
91747fe5393cSmrg      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
9175cf503b78Smrg	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
91767fe5393cSmrg      # Make sure the directory exists.
91777fe5393cSmrg      test -f "$dirpart/$file" && continue
91787fe5393cSmrg      fdir=`AS_DIRNAME(["$file"])`
91797fe5393cSmrg      AS_MKDIR_P([$dirpart/$fdir])
91807fe5393cSmrg      # echo "creating $dirpart/$file"
91817fe5393cSmrg      echo '# dummy' > "$dirpart/$file"
91827fe5393cSmrg    done
91837fe5393cSmrg  done
91847fe5393cSmrg}
91857fe5393cSmrg])# _AM_OUTPUT_DEPENDENCY_COMMANDS
9186b410ddbeSmrg
9187b410ddbeSmrg
91887fe5393cSmrg# AM_OUTPUT_DEPENDENCY_COMMANDS
91897fe5393cSmrg# -----------------------------
91907fe5393cSmrg# This macro should only be invoked once -- use via AC_REQUIRE.
91917fe5393cSmrg#
91927fe5393cSmrg# This code is only required when automatic dependency tracking
9193cf503b78Smrg# is enabled.  FIXME.  This creates each '.P' file that we will
91947fe5393cSmrg# need in order to bootstrap the dependency handling code.
91957fe5393cSmrgAC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
91967fe5393cSmrg[AC_CONFIG_COMMANDS([depfiles],
91977fe5393cSmrg     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
91987fe5393cSmrg     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
91997fe5393cSmrg])
9200b410ddbeSmrg
92017fe5393cSmrg# Do all the work for Automake.                             -*- Autoconf -*-
9202b410ddbeSmrg
9203cf503b78Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9204b410ddbeSmrg#
92057fe5393cSmrg# This file is free software; the Free Software Foundation
92067fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
92077fe5393cSmrg# with or without modifications, as long as this notice is preserved.
9208b4d38c65Smrg
92097fe5393cSmrg# This macro actually does too much.  Some checks are only needed if
92107fe5393cSmrg# your package does certain things.  But this isn't really a big deal.
921115fb4814Smrg
92127fe5393cSmrg# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
92137fe5393cSmrg# AM_INIT_AUTOMAKE([OPTIONS])
92147fe5393cSmrg# -----------------------------------------------
92157fe5393cSmrg# The call with PACKAGE and VERSION arguments is the old style
92167fe5393cSmrg# call (pre autoconf-2.50), which is being phased out.  PACKAGE
92177fe5393cSmrg# and VERSION should now be passed to AC_INIT and removed from
92187fe5393cSmrg# the call to AM_INIT_AUTOMAKE.
92197fe5393cSmrg# We support both call styles for the transition.  After
92207fe5393cSmrg# the next Automake release, Autoconf can make the AC_INIT
92217fe5393cSmrg# arguments mandatory, and then we can depend on a new Autoconf
92227fe5393cSmrg# release and drop the old call support.
92237fe5393cSmrgAC_DEFUN([AM_INIT_AUTOMAKE],
9224cf503b78Smrg[AC_PREREQ([2.65])dnl
92257fe5393cSmrgdnl Autoconf wants to disallow AM_ names.  We explicitly allow
92267fe5393cSmrgdnl the ones we care about.
92277fe5393cSmrgm4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
92287fe5393cSmrgAC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
92297fe5393cSmrgAC_REQUIRE([AC_PROG_INSTALL])dnl
92307fe5393cSmrgif test "`cd $srcdir && pwd`" != "`pwd`"; then
92317fe5393cSmrg  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
92327fe5393cSmrg  # is not polluted with repeated "-I."
92337fe5393cSmrg  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
92347fe5393cSmrg  # test to see if srcdir already configured
92357fe5393cSmrg  if test -f $srcdir/config.status; then
92367fe5393cSmrg    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
92377fe5393cSmrg  fi
923815fb4814Smrgfi
923915fb4814Smrg
92407fe5393cSmrg# test whether we have cygpath
92417fe5393cSmrgif test -z "$CYGPATH_W"; then
92427fe5393cSmrg  if (cygpath --version) >/dev/null 2>/dev/null; then
92437fe5393cSmrg    CYGPATH_W='cygpath -w'
92447fe5393cSmrg  else
92457fe5393cSmrg    CYGPATH_W=echo
92467fe5393cSmrg  fi
9247b534f209Smrgfi
92487fe5393cSmrgAC_SUBST([CYGPATH_W])
924915fb4814Smrg
92507fe5393cSmrg# Define the identity of the package.
92517fe5393cSmrgdnl Distinguish between old-style and new-style calls.
92527fe5393cSmrgm4_ifval([$2],
9253cf503b78Smrg[AC_DIAGNOSE([obsolete],
9254cf503b78Smrg             [$0: two- and three-arguments forms are deprecated.])
9255cf503b78Smrgm4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
92567fe5393cSmrg AC_SUBST([PACKAGE], [$1])dnl
92577fe5393cSmrg AC_SUBST([VERSION], [$2])],
92587fe5393cSmrg[_AM_SET_OPTIONS([$1])dnl
92597fe5393cSmrgdnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
9260cf503b78Smrgm4_if(
9261cf503b78Smrg  m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
9262cf503b78Smrg  [ok:ok],,
92637fe5393cSmrg  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
92647fe5393cSmrg AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
92657fe5393cSmrg AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
926615fb4814Smrg
92677fe5393cSmrg_AM_IF_OPTION([no-define],,
9268cf503b78Smrg[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
9269cf503b78Smrg AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
927015fb4814Smrg
92717fe5393cSmrg# Some tools Automake needs.
92727fe5393cSmrgAC_REQUIRE([AM_SANITY_CHECK])dnl
92737fe5393cSmrgAC_REQUIRE([AC_ARG_PROGRAM])dnl
9274cf503b78SmrgAM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
9275cf503b78SmrgAM_MISSING_PROG([AUTOCONF], [autoconf])
9276cf503b78SmrgAM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
9277cf503b78SmrgAM_MISSING_PROG([AUTOHEADER], [autoheader])
9278cf503b78SmrgAM_MISSING_PROG([MAKEINFO], [makeinfo])
92797fe5393cSmrgAC_REQUIRE([AM_PROG_INSTALL_SH])dnl
92807fe5393cSmrgAC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
9281cf503b78SmrgAC_REQUIRE([AC_PROG_MKDIR_P])dnl
9282cf503b78Smrg# For better backward compatibility.  To be removed once Automake 1.9.x
9283cf503b78Smrg# dies out for good.  For more background, see:
9284cf503b78Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
9285cf503b78Smrg# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
9286cf503b78SmrgAC_SUBST([mkdir_p], ['$(MKDIR_P)'])
92877fe5393cSmrg# We need awk for the "check" target.  The system "awk" is bad on
92887fe5393cSmrg# some platforms.
92897fe5393cSmrgAC_REQUIRE([AC_PROG_AWK])dnl
92907fe5393cSmrgAC_REQUIRE([AC_PROG_MAKE_SET])dnl
92917fe5393cSmrgAC_REQUIRE([AM_SET_LEADING_DOT])dnl
92927fe5393cSmrg_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
92937fe5393cSmrg	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
92947fe5393cSmrg			     [_AM_PROG_TAR([v7])])])
92957fe5393cSmrg_AM_IF_OPTION([no-dependencies],,
92967fe5393cSmrg[AC_PROVIDE_IFELSE([AC_PROG_CC],
9297cf503b78Smrg		  [_AM_DEPENDENCIES([CC])],
9298cf503b78Smrg		  [m4_define([AC_PROG_CC],
9299cf503b78Smrg			     m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
93007fe5393cSmrgAC_PROVIDE_IFELSE([AC_PROG_CXX],
9301cf503b78Smrg		  [_AM_DEPENDENCIES([CXX])],
9302cf503b78Smrg		  [m4_define([AC_PROG_CXX],
9303cf503b78Smrg			     m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
93047fe5393cSmrgAC_PROVIDE_IFELSE([AC_PROG_OBJC],
9305cf503b78Smrg		  [_AM_DEPENDENCIES([OBJC])],
9306cf503b78Smrg		  [m4_define([AC_PROG_OBJC],
9307cf503b78Smrg			     m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
9308cf503b78SmrgAC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
9309cf503b78Smrg		  [_AM_DEPENDENCIES([OBJCXX])],
9310cf503b78Smrg		  [m4_define([AC_PROG_OBJCXX],
9311cf503b78Smrg			     m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
93127fe5393cSmrg])
9313cf503b78SmrgAC_REQUIRE([AM_SILENT_RULES])dnl
9314cf503b78Smrgdnl The testsuite driver may need to know about EXEEXT, so add the
9315cf503b78Smrgdnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This
9316cf503b78Smrgdnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
93177fe5393cSmrgAC_CONFIG_COMMANDS_PRE(dnl
93187fe5393cSmrg[m4_provide_if([_AM_COMPILER_EXEEXT],
93197fe5393cSmrg  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
93207fe5393cSmrg])
932115fb4814Smrg
9322cf503b78Smrgdnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
93237fe5393cSmrgdnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
93247fe5393cSmrgdnl mangled by Autoconf and run in a shell conditional statement.
93257fe5393cSmrgm4_define([_AC_COMPILER_EXEEXT],
93267fe5393cSmrgm4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
93277fe5393cSmrg
93287fe5393cSmrg
93297fe5393cSmrg# When config.status generates a header, we must update the stamp-h file.
93307fe5393cSmrg# This file resides in the same directory as the config header
93317fe5393cSmrg# that is generated.  The stamp files are numbered to have different names.
93327fe5393cSmrg
93337fe5393cSmrg# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
93347fe5393cSmrg# loop where config.status creates the headers, so we can generate
93357fe5393cSmrg# our stamp files there.
93367fe5393cSmrgAC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
93377fe5393cSmrg[# Compute $1's index in $config_headers.
93387fe5393cSmrg_am_arg=$1
93397fe5393cSmrg_am_stamp_count=1
93407fe5393cSmrgfor _am_header in $config_headers :; do
93417fe5393cSmrg  case $_am_header in
93427fe5393cSmrg    $_am_arg | $_am_arg:* )
93437fe5393cSmrg      break ;;
93447fe5393cSmrg    * )
93457fe5393cSmrg      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
93467fe5393cSmrg  esac
93477fe5393cSmrgdone
93487fe5393cSmrgecho "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
93497fe5393cSmrg
9350cf503b78Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9351b4d38c65Smrg#
93527fe5393cSmrg# This file is free software; the Free Software Foundation
93537fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
93547fe5393cSmrg# with or without modifications, as long as this notice is preserved.
93557fe5393cSmrg
93567fe5393cSmrg# AM_PROG_INSTALL_SH
93577fe5393cSmrg# ------------------
93587fe5393cSmrg# Define $install_sh.
93597fe5393cSmrgAC_DEFUN([AM_PROG_INSTALL_SH],
93607fe5393cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
93617fe5393cSmrgif test x"${install_sh}" != xset; then
93627fe5393cSmrg  case $am_aux_dir in
93637fe5393cSmrg  *\ * | *\	*)
93647fe5393cSmrg    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
93657fe5393cSmrg  *)
93667fe5393cSmrg    install_sh="\${SHELL} $am_aux_dir/install-sh"
93677fe5393cSmrg  esac
93687fe5393cSmrgfi
9369cf503b78SmrgAC_SUBST([install_sh])])
93707fe5393cSmrg
9371cf503b78Smrg# Copyright (C) 2003-2013 Free Software Foundation, Inc.
9372b4d38c65Smrg#
93737fe5393cSmrg# This file is free software; the Free Software Foundation
93747fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
93757fe5393cSmrg# with or without modifications, as long as this notice is preserved.
937615fb4814Smrg
93777fe5393cSmrg# Check whether the underlying file-system supports filenames
93787fe5393cSmrg# with a leading dot.  For instance MS-DOS doesn't.
93797fe5393cSmrgAC_DEFUN([AM_SET_LEADING_DOT],
93807fe5393cSmrg[rm -rf .tst 2>/dev/null
93817fe5393cSmrgmkdir .tst 2>/dev/null
93827fe5393cSmrgif test -d .tst; then
93837fe5393cSmrg  am__leading_dot=.
938415fb4814Smrgelse
93857fe5393cSmrg  am__leading_dot=_
9386b534f209Smrgfi
93877fe5393cSmrgrmdir .tst 2>/dev/null
93887fe5393cSmrgAC_SUBST([am__leading_dot])])
938915fb4814Smrg
93907fe5393cSmrg# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
93917fe5393cSmrg# From Jim Meyering
9392b4d38c65Smrg
9393cf503b78Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9394b4d38c65Smrg#
93957fe5393cSmrg# This file is free software; the Free Software Foundation
93967fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
93977fe5393cSmrg# with or without modifications, as long as this notice is preserved.
939815fb4814Smrg
93997fe5393cSmrg# AM_MAINTAINER_MODE([DEFAULT-MODE])
94007fe5393cSmrg# ----------------------------------
94017fe5393cSmrg# Control maintainer-specific portions of Makefiles.
9402cf503b78Smrg# Default is to disable them, unless 'enable' is passed literally.
9403cf503b78Smrg# For symmetry, 'disable' may be passed as well.  Anyway, the user
94047fe5393cSmrg# can override the default with the --enable/--disable switch.
94057fe5393cSmrgAC_DEFUN([AM_MAINTAINER_MODE],
94067fe5393cSmrg[m4_case(m4_default([$1], [disable]),
94077fe5393cSmrg       [enable], [m4_define([am_maintainer_other], [disable])],
94087fe5393cSmrg       [disable], [m4_define([am_maintainer_other], [enable])],
94097fe5393cSmrg       [m4_define([am_maintainer_other], [enable])
94107fe5393cSmrg        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
9411cf503b78SmrgAC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
94127fe5393cSmrg  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
94137fe5393cSmrg  AC_ARG_ENABLE([maintainer-mode],
9414cf503b78Smrg    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
9415cf503b78Smrg      am_maintainer_other[ make rules and dependencies not useful
9416cf503b78Smrg      (and sometimes confusing) to the casual installer])],
9417cf503b78Smrg    [USE_MAINTAINER_MODE=$enableval],
9418cf503b78Smrg    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
94197fe5393cSmrg  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
94207fe5393cSmrg  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
94217fe5393cSmrg  MAINT=$MAINTAINER_MODE_TRUE
94227fe5393cSmrg  AC_SUBST([MAINT])dnl
94237fe5393cSmrg]
94247fe5393cSmrg)
9425b534f209Smrg
94267fe5393cSmrg# Check to see how 'make' treats includes.	            -*- Autoconf -*-
94277fe5393cSmrg
9428cf503b78Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9429b4d38c65Smrg#
94307fe5393cSmrg# This file is free software; the Free Software Foundation
94317fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
94327fe5393cSmrg# with or without modifications, as long as this notice is preserved.
943315fb4814Smrg
94347fe5393cSmrg# AM_MAKE_INCLUDE()
94357fe5393cSmrg# -----------------
94367fe5393cSmrg# Check to see how make treats includes.
94377fe5393cSmrgAC_DEFUN([AM_MAKE_INCLUDE],
94387fe5393cSmrg[am_make=${MAKE-make}
94397fe5393cSmrgcat > confinc << 'END'
94407fe5393cSmrgam__doit:
94417fe5393cSmrg	@echo this is the am__doit target
94427fe5393cSmrg.PHONY: am__doit
94437fe5393cSmrgEND
94447fe5393cSmrg# If we don't find an include directive, just comment out the code.
94457fe5393cSmrgAC_MSG_CHECKING([for style of include used by $am_make])
94467fe5393cSmrgam__include="#"
94477fe5393cSmrgam__quote=
94487fe5393cSmrg_am_result=none
94497fe5393cSmrg# First try GNU make style include.
94507fe5393cSmrgecho "include confinc" > confmf
9451cf503b78Smrg# Ignore all kinds of additional output from 'make'.
94527fe5393cSmrgcase `$am_make -s -f confmf 2> /dev/null` in #(
94537fe5393cSmrg*the\ am__doit\ target*)
94547fe5393cSmrg  am__include=include
94557fe5393cSmrg  am__quote=
94567fe5393cSmrg  _am_result=GNU
94577fe5393cSmrg  ;;
94587fe5393cSmrgesac
94597fe5393cSmrg# Now try BSD make style include.
94607fe5393cSmrgif test "$am__include" = "#"; then
94617fe5393cSmrg   echo '.include "confinc"' > confmf
94627fe5393cSmrg   case `$am_make -s -f confmf 2> /dev/null` in #(
94637fe5393cSmrg   *the\ am__doit\ target*)
94647fe5393cSmrg     am__include=.include
94657fe5393cSmrg     am__quote="\""
94667fe5393cSmrg     _am_result=BSD
94677fe5393cSmrg     ;;
94687fe5393cSmrg   esac
9469b4d38c65Smrgfi
94707fe5393cSmrgAC_SUBST([am__include])
94717fe5393cSmrgAC_SUBST([am__quote])
94727fe5393cSmrgAC_MSG_RESULT([$_am_result])
94737fe5393cSmrgrm -f confinc confmf
94747fe5393cSmrg])
947515fb4814Smrg
94767fe5393cSmrg# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
9477b534f209Smrg
9478cf503b78Smrg# Copyright (C) 1997-2013 Free Software Foundation, Inc.
9479b534f209Smrg#
94807fe5393cSmrg# This file is free software; the Free Software Foundation
94817fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
94827fe5393cSmrg# with or without modifications, as long as this notice is preserved.
948315fb4814Smrg
94847fe5393cSmrg# AM_MISSING_PROG(NAME, PROGRAM)
94857fe5393cSmrg# ------------------------------
94867fe5393cSmrgAC_DEFUN([AM_MISSING_PROG],
94877fe5393cSmrg[AC_REQUIRE([AM_MISSING_HAS_RUN])
94887fe5393cSmrg$1=${$1-"${am_missing_run}$2"}
94897fe5393cSmrgAC_SUBST($1)])
94907fe5393cSmrg
94917fe5393cSmrg# AM_MISSING_HAS_RUN
94927fe5393cSmrg# ------------------
9493cf503b78Smrg# Define MISSING if not defined so far and test if it is modern enough.
9494cf503b78Smrg# If it is, set am_missing_run to use it, otherwise, to nothing.
94957fe5393cSmrgAC_DEFUN([AM_MISSING_HAS_RUN],
94967fe5393cSmrg[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
94977fe5393cSmrgAC_REQUIRE_AUX_FILE([missing])dnl
94987fe5393cSmrgif test x"${MISSING+set}" != xset; then
94997fe5393cSmrg  case $am_aux_dir in
95007fe5393cSmrg  *\ * | *\	*)
95017fe5393cSmrg    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
95027fe5393cSmrg  *)
95037fe5393cSmrg    MISSING="\${SHELL} $am_aux_dir/missing" ;;
95047fe5393cSmrg  esac
95057fe5393cSmrgfi
95067fe5393cSmrg# Use eval to expand $SHELL
9507cf503b78Smrgif eval "$MISSING --is-lightweight"; then
9508cf503b78Smrg  am_missing_run="$MISSING "
9509b534f209Smrgelse
95107fe5393cSmrg  am_missing_run=
9511cf503b78Smrg  AC_MSG_WARN(['missing' script is too old or missing])
951215fb4814Smrgfi
95137fe5393cSmrg])
951415fb4814Smrg
95157fe5393cSmrg# Helper functions for option handling.                     -*- Autoconf -*-
95167fe5393cSmrg
9517cf503b78Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
9518b4d38c65Smrg#
95197fe5393cSmrg# This file is free software; the Free Software Foundation
95207fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
95217fe5393cSmrg# with or without modifications, as long as this notice is preserved.
95227fe5393cSmrg
95237fe5393cSmrg# _AM_MANGLE_OPTION(NAME)
95247fe5393cSmrg# -----------------------
95257fe5393cSmrgAC_DEFUN([_AM_MANGLE_OPTION],
95267fe5393cSmrg[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
95277fe5393cSmrg
95287fe5393cSmrg# _AM_SET_OPTION(NAME)
9529cf503b78Smrg# --------------------
95307fe5393cSmrg# Set option NAME.  Presently that only means defining a flag for this option.
95317fe5393cSmrgAC_DEFUN([_AM_SET_OPTION],
9532cf503b78Smrg[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
95337fe5393cSmrg
95347fe5393cSmrg# _AM_SET_OPTIONS(OPTIONS)
9535cf503b78Smrg# ------------------------
95367fe5393cSmrg# OPTIONS is a space-separated list of Automake options.
95377fe5393cSmrgAC_DEFUN([_AM_SET_OPTIONS],
95387fe5393cSmrg[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
95397fe5393cSmrg
95407fe5393cSmrg# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
95417fe5393cSmrg# -------------------------------------------
95427fe5393cSmrg# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
95437fe5393cSmrgAC_DEFUN([_AM_IF_OPTION],
95447fe5393cSmrg[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
95457fe5393cSmrg
95467fe5393cSmrg# Check to make sure that the build environment is sane.    -*- Autoconf -*-
95477fe5393cSmrg
9548cf503b78Smrg# Copyright (C) 1996-2013 Free Software Foundation, Inc.
9549b4d38c65Smrg#
95507fe5393cSmrg# This file is free software; the Free Software Foundation
95517fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
95527fe5393cSmrg# with or without modifications, as long as this notice is preserved.
9553b410ddbeSmrg
95547fe5393cSmrg# AM_SANITY_CHECK
95557fe5393cSmrg# ---------------
95567fe5393cSmrgAC_DEFUN([AM_SANITY_CHECK],
95577fe5393cSmrg[AC_MSG_CHECKING([whether build environment is sane])
95587fe5393cSmrg# Reject unsafe characters in $srcdir or the absolute working directory
95597fe5393cSmrg# name.  Accept space and tab only in the latter.
95607fe5393cSmrgam_lf='
95617fe5393cSmrg'
95627fe5393cSmrgcase `pwd` in
95637fe5393cSmrg  *[[\\\"\#\$\&\'\`$am_lf]]*)
95647fe5393cSmrg    AC_MSG_ERROR([unsafe absolute working directory name]);;
95657fe5393cSmrgesac
95667fe5393cSmrgcase $srcdir in
95677fe5393cSmrg  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
9568cf503b78Smrg    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
95697fe5393cSmrgesac
95707fe5393cSmrg
9571cf503b78Smrg# Do 'set' in a subshell so we don't clobber the current shell's
95727fe5393cSmrg# arguments.  Must try -L first in case configure is actually a
95737fe5393cSmrg# symlink; some systems play weird games with the mod time of symlinks
95747fe5393cSmrg# (eg FreeBSD returns the mod time of the symlink's containing
95757fe5393cSmrg# directory).
95767fe5393cSmrgif (
9577cf503b78Smrg   am_has_slept=no
9578cf503b78Smrg   for am_try in 1 2; do
9579cf503b78Smrg     echo "timestamp, slept: $am_has_slept" > conftest.file
9580cf503b78Smrg     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
9581cf503b78Smrg     if test "$[*]" = "X"; then
9582cf503b78Smrg	# -L didn't work.
9583cf503b78Smrg	set X `ls -t "$srcdir/configure" conftest.file`
9584cf503b78Smrg     fi
9585cf503b78Smrg     if test "$[*]" != "X $srcdir/configure conftest.file" \
9586cf503b78Smrg	&& test "$[*]" != "X conftest.file $srcdir/configure"; then
9587cf503b78Smrg
9588cf503b78Smrg	# If neither matched, then we have a broken ls.  This can happen
9589cf503b78Smrg	# if, for instance, CONFIG_SHELL is bash and it inherits a
9590cf503b78Smrg	# broken ls alias from the environment.  This has actually
9591cf503b78Smrg	# happened.  Such a system could not be considered "sane".
9592cf503b78Smrg	AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
9593cf503b78Smrg  alias in your environment])
9594cf503b78Smrg     fi
9595cf503b78Smrg     if test "$[2]" = conftest.file || test $am_try -eq 2; then
9596cf503b78Smrg       break
9597cf503b78Smrg     fi
9598cf503b78Smrg     # Just in case.
9599cf503b78Smrg     sleep 1
9600cf503b78Smrg     am_has_slept=yes
9601cf503b78Smrg   done
96027fe5393cSmrg   test "$[2]" = conftest.file
96037fe5393cSmrg   )
96047fe5393cSmrgthen
96057fe5393cSmrg   # Ok.
96067fe5393cSmrg   :
9607b4d38c65Smrgelse
96087fe5393cSmrg   AC_MSG_ERROR([newly created file is older than distributed files!
96097fe5393cSmrgCheck your system clock])
9610b4d38c65Smrgfi
9611cf503b78SmrgAC_MSG_RESULT([yes])
9612cf503b78Smrg# If we didn't sleep, we still need to ensure time stamps of config.status and
9613cf503b78Smrg# generated files are strictly newer.
9614cf503b78Smrgam_sleep_pid=
9615cf503b78Smrgif grep 'slept: no' conftest.file >/dev/null 2>&1; then
9616cf503b78Smrg  ( sleep 1 ) &
9617cf503b78Smrg  am_sleep_pid=$!
9618cf503b78Smrgfi
9619cf503b78SmrgAC_CONFIG_COMMANDS_PRE(
9620cf503b78Smrg  [AC_MSG_CHECKING([that generated files are newer than configure])
9621cf503b78Smrg   if test -n "$am_sleep_pid"; then
9622cf503b78Smrg     # Hide warnings about reused PIDs.
9623cf503b78Smrg     wait $am_sleep_pid 2>/dev/null
9624cf503b78Smrg   fi
9625cf503b78Smrg   AC_MSG_RESULT([done])])
9626cf503b78Smrgrm -f conftest.file
9627cf503b78Smrg])
9628b410ddbeSmrg
9629cf503b78Smrg# Copyright (C) 2009-2013 Free Software Foundation, Inc.
9630b4d38c65Smrg#
96317fe5393cSmrg# This file is free software; the Free Software Foundation
96327fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
96337fe5393cSmrg# with or without modifications, as long as this notice is preserved.
963415fb4814Smrg
96357fe5393cSmrg# AM_SILENT_RULES([DEFAULT])
96367fe5393cSmrg# --------------------------
96377fe5393cSmrg# Enable less verbose build rules; with the default set to DEFAULT
9638cf503b78Smrg# ("yes" being less verbose, "no" or empty being verbose).
96397fe5393cSmrgAC_DEFUN([AM_SILENT_RULES],
9640cf503b78Smrg[AC_ARG_ENABLE([silent-rules], [dnl
9641cf503b78SmrgAS_HELP_STRING(
9642cf503b78Smrg  [--enable-silent-rules],
9643cf503b78Smrg  [less verbose build output (undo: "make V=1")])
9644cf503b78SmrgAS_HELP_STRING(
9645cf503b78Smrg  [--disable-silent-rules],
9646cf503b78Smrg  [verbose build output (undo: "make V=0")])dnl
9647cf503b78Smrg])
9648cf503b78Smrgcase $enable_silent_rules in @%:@ (((
9649cf503b78Smrg  yes) AM_DEFAULT_VERBOSITY=0;;
9650cf503b78Smrg   no) AM_DEFAULT_VERBOSITY=1;;
9651cf503b78Smrg    *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
96527fe5393cSmrgesac
9653cf503b78Smrgdnl
9654cf503b78Smrgdnl A few 'make' implementations (e.g., NonStop OS and NextStep)
9655cf503b78Smrgdnl do not support nested variable expansions.
9656cf503b78Smrgdnl See automake bug#9928 and bug#10237.
9657cf503b78Smrgam_make=${MAKE-make}
9658cf503b78SmrgAC_CACHE_CHECK([whether $am_make supports nested variables],
9659cf503b78Smrg   [am_cv_make_support_nested_variables],
9660cf503b78Smrg   [if AS_ECHO([['TRUE=$(BAR$(V))
9661cf503b78SmrgBAR0=false
9662cf503b78SmrgBAR1=true
9663cf503b78SmrgV=1
9664cf503b78Smrgam__doit:
9665cf503b78Smrg	@$(TRUE)
9666cf503b78Smrg.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
9667cf503b78Smrg  am_cv_make_support_nested_variables=yes
9668cf503b78Smrgelse
9669cf503b78Smrg  am_cv_make_support_nested_variables=no
9670cf503b78Smrgfi])
9671cf503b78Smrgif test $am_cv_make_support_nested_variables = yes; then
9672cf503b78Smrg  dnl Using '$V' instead of '$(V)' breaks IRIX make.
9673cf503b78Smrg  AM_V='$(V)'
9674cf503b78Smrg  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
9675cf503b78Smrgelse
9676cf503b78Smrg  AM_V=$AM_DEFAULT_VERBOSITY
9677cf503b78Smrg  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
9678cf503b78Smrgfi
9679cf503b78SmrgAC_SUBST([AM_V])dnl
9680cf503b78SmrgAM_SUBST_NOTMAKE([AM_V])dnl
9681cf503b78SmrgAC_SUBST([AM_DEFAULT_V])dnl
9682cf503b78SmrgAM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
96837fe5393cSmrgAC_SUBST([AM_DEFAULT_VERBOSITY])dnl
96847fe5393cSmrgAM_BACKSLASH='\'
96857fe5393cSmrgAC_SUBST([AM_BACKSLASH])dnl
96867fe5393cSmrg_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
96877fe5393cSmrg])
968815fb4814Smrg
9689cf503b78Smrg# Copyright (C) 2001-2013 Free Software Foundation, Inc.
96907fe5393cSmrg#
96917fe5393cSmrg# This file is free software; the Free Software Foundation
96927fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
96937fe5393cSmrg# with or without modifications, as long as this notice is preserved.
969415fb4814Smrg
96957fe5393cSmrg# AM_PROG_INSTALL_STRIP
96967fe5393cSmrg# ---------------------
9697cf503b78Smrg# One issue with vendor 'install' (even GNU) is that you can't
96987fe5393cSmrg# specify the program used to strip binaries.  This is especially
96997fe5393cSmrg# annoying in cross-compiling environments, where the build's strip
97007fe5393cSmrg# is unlikely to handle the host's binaries.
97017fe5393cSmrg# Fortunately install-sh will honor a STRIPPROG variable, so we
9702cf503b78Smrg# always use install-sh in "make install-strip", and initialize
97037fe5393cSmrg# STRIPPROG with the value of the STRIP variable (set by the user).
97047fe5393cSmrgAC_DEFUN([AM_PROG_INSTALL_STRIP],
97057fe5393cSmrg[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
9706cf503b78Smrg# Installed binaries are usually stripped using 'strip' when the user
9707cf503b78Smrg# run "make install-strip".  However 'strip' might not be the right
97087fe5393cSmrg# tool to use in cross-compilation environments, therefore Automake
9709cf503b78Smrg# will honor the 'STRIP' environment variable to overrule this program.
9710cf503b78Smrgdnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
97117fe5393cSmrgif test "$cross_compiling" != no; then
97127fe5393cSmrg  AC_CHECK_TOOL([STRIP], [strip], :)
97137fe5393cSmrgfi
97147fe5393cSmrgINSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
97157fe5393cSmrgAC_SUBST([INSTALL_STRIP_PROGRAM])])
971615fb4814Smrg
9717cf503b78Smrg# Copyright (C) 2006-2013 Free Software Foundation, Inc.
9718b4d38c65Smrg#
97197fe5393cSmrg# This file is free software; the Free Software Foundation
97207fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
97217fe5393cSmrg# with or without modifications, as long as this notice is preserved.
972215fb4814Smrg
97237fe5393cSmrg# _AM_SUBST_NOTMAKE(VARIABLE)
97247fe5393cSmrg# ---------------------------
97257fe5393cSmrg# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
97267fe5393cSmrg# This macro is traced by Automake.
97277fe5393cSmrgAC_DEFUN([_AM_SUBST_NOTMAKE])
9728b410ddbeSmrg
97297fe5393cSmrg# AM_SUBST_NOTMAKE(VARIABLE)
9730cf503b78Smrg# --------------------------
97317fe5393cSmrg# Public sister of _AM_SUBST_NOTMAKE.
97327fe5393cSmrgAC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
9733b410ddbeSmrg
97347fe5393cSmrg# Check how to create a tarball.                            -*- Autoconf -*-
9735b410ddbeSmrg
9736cf503b78Smrg# Copyright (C) 2004-2013 Free Software Foundation, Inc.
9737b4d38c65Smrg#
97387fe5393cSmrg# This file is free software; the Free Software Foundation
97397fe5393cSmrg# gives unlimited permission to copy and/or distribute it,
97407fe5393cSmrg# with or without modifications, as long as this notice is preserved.
9741b410ddbeSmrg
97427fe5393cSmrg# _AM_PROG_TAR(FORMAT)
97437fe5393cSmrg# --------------------
97447fe5393cSmrg# Check how to create a tarball in format FORMAT.
9745cf503b78Smrg# FORMAT should be one of 'v7', 'ustar', or 'pax'.
9746b4d38c65Smrg#
97477fe5393cSmrg# Substitute a variable $(am__tar) that is a command
97487fe5393cSmrg# writing to stdout a FORMAT-tarball containing the directory
97497fe5393cSmrg# $tardir.
97507fe5393cSmrg#     tardir=directory && $(am__tar) > result.tar
9751b4d38c65Smrg#
97527fe5393cSmrg# Substitute a variable $(am__untar) that extract such
97537fe5393cSmrg# a tarball read from stdin.
97547fe5393cSmrg#     $(am__untar) < result.tar
9755cf503b78Smrg#
97567fe5393cSmrgAC_DEFUN([_AM_PROG_TAR],
9757cf503b78Smrg[# Always define AMTAR for backward compatibility.  Yes, it's still used
9758cf503b78Smrg# in the wild :-(  We should find a proper way to deprecate it ...
9759cf503b78SmrgAC_SUBST([AMTAR], ['$${TAR-tar}'])
9760cf503b78Smrg
9761cf503b78Smrg# We'll loop over all known methods to create a tar archive until one works.
97627fe5393cSmrg_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
9763b410ddbeSmrg
9764cf503b78Smrgm4_if([$1], [v7],
9765cf503b78Smrg  [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
9766cf503b78Smrg
9767cf503b78Smrg  [m4_case([$1],
9768cf503b78Smrg    [ustar],
9769cf503b78Smrg     [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
9770cf503b78Smrg      # There is notably a 21 bits limit for the UID and the GID.  In fact,
9771cf503b78Smrg      # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
9772cf503b78Smrg      # and bug#13588).
9773cf503b78Smrg      am_max_uid=2097151 # 2^21 - 1
9774cf503b78Smrg      am_max_gid=$am_max_uid
9775cf503b78Smrg      # The $UID and $GID variables are not portable, so we need to resort
9776cf503b78Smrg      # to the POSIX-mandated id(1) utility.  Errors in the 'id' calls
9777cf503b78Smrg      # below are definitely unexpected, so allow the users to see them
9778cf503b78Smrg      # (that is, avoid stderr redirection).
9779cf503b78Smrg      am_uid=`id -u || echo unknown`
9780cf503b78Smrg      am_gid=`id -g || echo unknown`
9781cf503b78Smrg      AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
9782cf503b78Smrg      if test $am_uid -le $am_max_uid; then
9783cf503b78Smrg         AC_MSG_RESULT([yes])
9784cf503b78Smrg      else
9785cf503b78Smrg         AC_MSG_RESULT([no])
9786cf503b78Smrg         _am_tools=none
9787cf503b78Smrg      fi
9788cf503b78Smrg      AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
9789cf503b78Smrg      if test $am_gid -le $am_max_gid; then
9790cf503b78Smrg         AC_MSG_RESULT([yes])
9791cf503b78Smrg      else
9792cf503b78Smrg        AC_MSG_RESULT([no])
9793cf503b78Smrg        _am_tools=none
9794cf503b78Smrg      fi],
9795b410ddbeSmrg
9796cf503b78Smrg  [pax],
9797cf503b78Smrg    [],
9798cf503b78Smrg
9799cf503b78Smrg  [m4_fatal([Unknown tar format])])
9800cf503b78Smrg
9801cf503b78Smrg  AC_MSG_CHECKING([how to create a $1 tar archive])
9802cf503b78Smrg
9803cf503b78Smrg  # Go ahead even if we have the value already cached.  We do so because we
9804cf503b78Smrg  # need to set the values for the 'am__tar' and 'am__untar' variables.
9805cf503b78Smrg  _am_tools=${am_cv_prog_tar_$1-$_am_tools}
9806cf503b78Smrg
9807cf503b78Smrg  for _am_tool in $_am_tools; do
9808cf503b78Smrg    case $_am_tool in
9809cf503b78Smrg    gnutar)
9810cf503b78Smrg      for _am_tar in tar gnutar gtar; do
9811cf503b78Smrg        AM_RUN_LOG([$_am_tar --version]) && break
9812cf503b78Smrg      done
9813cf503b78Smrg      am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
9814cf503b78Smrg      am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
9815cf503b78Smrg      am__untar="$_am_tar -xf -"
9816cf503b78Smrg      ;;
9817cf503b78Smrg    plaintar)
9818cf503b78Smrg      # Must skip GNU tar: if it does not support --format= it doesn't create
9819cf503b78Smrg      # ustar tarball either.
9820cf503b78Smrg      (tar --version) >/dev/null 2>&1 && continue
9821cf503b78Smrg      am__tar='tar chf - "$$tardir"'
9822cf503b78Smrg      am__tar_='tar chf - "$tardir"'
9823cf503b78Smrg      am__untar='tar xf -'
9824cf503b78Smrg      ;;
9825cf503b78Smrg    pax)
9826cf503b78Smrg      am__tar='pax -L -x $1 -w "$$tardir"'
9827cf503b78Smrg      am__tar_='pax -L -x $1 -w "$tardir"'
9828cf503b78Smrg      am__untar='pax -r'
9829cf503b78Smrg      ;;
9830cf503b78Smrg    cpio)
9831cf503b78Smrg      am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
9832cf503b78Smrg      am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
9833cf503b78Smrg      am__untar='cpio -i -H $1 -d'
9834cf503b78Smrg      ;;
9835cf503b78Smrg    none)
9836cf503b78Smrg      am__tar=false
9837cf503b78Smrg      am__tar_=false
9838cf503b78Smrg      am__untar=false
9839cf503b78Smrg      ;;
9840cf503b78Smrg    esac
9841cf503b78Smrg
9842cf503b78Smrg    # If the value was cached, stop now.  We just wanted to have am__tar
9843cf503b78Smrg    # and am__untar set.
9844cf503b78Smrg    test -n "${am_cv_prog_tar_$1}" && break
9845cf503b78Smrg
9846cf503b78Smrg    # tar/untar a dummy directory, and stop if the command works.
9847cf503b78Smrg    rm -rf conftest.dir
9848cf503b78Smrg    mkdir conftest.dir
9849cf503b78Smrg    echo GrepMe > conftest.dir/file
9850cf503b78Smrg    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
9851cf503b78Smrg    rm -rf conftest.dir
9852cf503b78Smrg    if test -s conftest.tar; then
9853cf503b78Smrg      AM_RUN_LOG([$am__untar <conftest.tar])
9854cf503b78Smrg      AM_RUN_LOG([cat conftest.dir/file])
9855cf503b78Smrg      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
9856cf503b78Smrg    fi
9857cf503b78Smrg  done
98587fe5393cSmrg  rm -rf conftest.dir
9859b410ddbeSmrg
9860cf503b78Smrg  AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
9861cf503b78Smrg  AC_MSG_RESULT([$am_cv_prog_tar_$1])])
9862cf503b78Smrg
98637fe5393cSmrgAC_SUBST([am__tar])
98647fe5393cSmrgAC_SUBST([am__untar])
98657fe5393cSmrg]) # _AM_PROG_TAR
98667fe5393cSmrg
98677fe5393cSmrgdnl xorg-macros.m4.  Generated from xorg-macros.m4.in xorgversion.m4 by configure.
98687fe5393cSmrgdnl
98697fe5393cSmrgdnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
9870cf503b78Smrgdnl
98717fe5393cSmrgdnl Permission is hereby granted, free of charge, to any person obtaining a
98727fe5393cSmrgdnl copy of this software and associated documentation files (the "Software"),
98737fe5393cSmrgdnl to deal in the Software without restriction, including without limitation
98747fe5393cSmrgdnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
98757fe5393cSmrgdnl and/or sell copies of the Software, and to permit persons to whom the
98767fe5393cSmrgdnl Software is furnished to do so, subject to the following conditions:
98777fe5393cSmrgdnl
98787fe5393cSmrgdnl The above copyright notice and this permission notice (including the next
98797fe5393cSmrgdnl paragraph) shall be included in all copies or substantial portions of the
98807fe5393cSmrgdnl Software.
98817fe5393cSmrgdnl
98827fe5393cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
98837fe5393cSmrgdnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
98847fe5393cSmrgdnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
98857fe5393cSmrgdnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
98867fe5393cSmrgdnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
98877fe5393cSmrgdnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
98887fe5393cSmrgdnl DEALINGS IN THE SOFTWARE.
98897fe5393cSmrg
98907fe5393cSmrg# XORG_MACROS_VERSION(required-version)
98917fe5393cSmrg# -------------------------------------
98927fe5393cSmrg# Minimum version: 1.1.0
9893b410ddbeSmrg#
98947fe5393cSmrg# If you're using a macro added in Version 1.1 or newer, include this in
98957fe5393cSmrg# your configure.ac with the minimum required version, such as:
98967fe5393cSmrg# XORG_MACROS_VERSION(1.1)
9897b4d38c65Smrg#
98987fe5393cSmrg# To ensure that this macro is defined, also add:
98997fe5393cSmrg# m4_ifndef([XORG_MACROS_VERSION],
99007fe5393cSmrg#     [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])])
9901b4d38c65Smrg#
9902b4d38c65Smrg#
9903cf503b78Smrg# See the "minimum version" comment for each macro you use to see what
99047fe5393cSmrg# version you require.
99057fe5393cSmrgm4_defun([XORG_MACROS_VERSION],[
9906cf503b78Smrgm4_define([vers_have], [1.19.0])
99077fe5393cSmrgm4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
99087fe5393cSmrgm4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
99097fe5393cSmrgm4_if(m4_cmp(maj_have, maj_needed), 0,,
99107fe5393cSmrg    [m4_fatal([xorg-macros major version ]maj_needed[ is required but ]vers_have[ found])])
99117fe5393cSmrgm4_if(m4_version_compare(vers_have, [$1]), -1,
99127fe5393cSmrg    [m4_fatal([xorg-macros version $1 or higher is required but ]vers_have[ found])])
99137fe5393cSmrgm4_undefine([vers_have])
99147fe5393cSmrgm4_undefine([maj_have])
99157fe5393cSmrgm4_undefine([maj_needed])
99167fe5393cSmrg]) # XORG_MACROS_VERSION
9917b410ddbeSmrg
99187fe5393cSmrg# XORG_PROG_RAWCPP()
99197fe5393cSmrg# ------------------
99207fe5393cSmrg# Minimum version: 1.0.0
9921b4d38c65Smrg#
99227fe5393cSmrg# Find cpp program and necessary flags for use in pre-processing text files
99237fe5393cSmrg# such as man pages and config files
99247fe5393cSmrgAC_DEFUN([XORG_PROG_RAWCPP],[
99257fe5393cSmrgAC_REQUIRE([AC_PROG_CPP])
9926cf503b78SmrgAC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
99277fe5393cSmrg   [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
9928b534f209Smrg
99297fe5393cSmrg# Check for flag to avoid builtin definitions - assumes unix is predefined,
99307fe5393cSmrg# which is not the best choice for supporting other OS'es, but covers most
99317fe5393cSmrg# of the ones we need for now.
99327fe5393cSmrgAC_MSG_CHECKING([if $RAWCPP requires -undef])
99337fe5393cSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp redefine unix ?]])])
99347fe5393cSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99357fe5393cSmrg	AC_MSG_RESULT([no])
99367fe5393cSmrgelse
99377fe5393cSmrg	if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99387fe5393cSmrg		RAWCPPFLAGS=-undef
99397fe5393cSmrg		AC_MSG_RESULT([yes])
99407fe5393cSmrg	# under Cygwin unix is still defined even with -undef
99417fe5393cSmrg	elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
99427fe5393cSmrg		RAWCPPFLAGS="-undef -ansi"
99437fe5393cSmrg		AC_MSG_RESULT([yes, with -ansi])
99447fe5393cSmrg	else
99457fe5393cSmrg		AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef.  I don't know what to do.])
99467fe5393cSmrg	fi
9947b410ddbeSmrgfi
99487fe5393cSmrgrm -f conftest.$ac_ext
9949b534f209Smrg
99507fe5393cSmrgAC_MSG_CHECKING([if $RAWCPP requires -traditional])
99517fe5393cSmrgAC_LANG_CONFTEST([AC_LANG_SOURCE([[Does cpp preserve   "whitespace"?]])])
99527fe5393cSmrgif test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
99537fe5393cSmrg	AC_MSG_RESULT([no])
99547fe5393cSmrgelse
99557fe5393cSmrg	if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve   \"'` -eq 1 ; then
9956cf503b78Smrg		TRADITIONALCPPFLAGS="-traditional"
99577fe5393cSmrg		RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
99587fe5393cSmrg		AC_MSG_RESULT([yes])
99597fe5393cSmrg	else
99607fe5393cSmrg		AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional.  I don't know what to do.])
99617fe5393cSmrg	fi
9962b4d38c65Smrgfi
99637fe5393cSmrgrm -f conftest.$ac_ext
99647fe5393cSmrgAC_SUBST(RAWCPPFLAGS)
9965cf503b78SmrgAC_SUBST(TRADITIONALCPPFLAGS)
99667fe5393cSmrg]) # XORG_PROG_RAWCPP
9967b534f209Smrg
99687fe5393cSmrg# XORG_MANPAGE_SECTIONS()
99697fe5393cSmrg# -----------------------
99707fe5393cSmrg# Minimum version: 1.0.0
99717fe5393cSmrg#
99727fe5393cSmrg# Determine which sections man pages go in for the different man page types
99737fe5393cSmrg# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
99747fe5393cSmrg# Not sure if there's any better way than just hardcoding by OS name.
99757fe5393cSmrg# Override default settings by setting environment variables
99767fe5393cSmrg# Added MAN_SUBSTS in version 1.8
99777fe5393cSmrg# Added AC_PROG_SED in version 1.8
99787fe5393cSmrg
99797fe5393cSmrgAC_DEFUN([XORG_MANPAGE_SECTIONS],[
99807fe5393cSmrgAC_REQUIRE([AC_CANONICAL_HOST])
99817fe5393cSmrgAC_REQUIRE([AC_PROG_SED])
99827fe5393cSmrg
99837fe5393cSmrgif test x$APP_MAN_SUFFIX = x    ; then
99847fe5393cSmrg    APP_MAN_SUFFIX=1
99857fe5393cSmrgfi
99867fe5393cSmrgif test x$APP_MAN_DIR = x    ; then
99877fe5393cSmrg    APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
9988b4d38c65Smrgfi
9989b534f209Smrg
99907fe5393cSmrgif test x$LIB_MAN_SUFFIX = x    ; then
99917fe5393cSmrg    LIB_MAN_SUFFIX=3
99927fe5393cSmrgfi
99937fe5393cSmrgif test x$LIB_MAN_DIR = x    ; then
99947fe5393cSmrg    LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
9995b4d38c65Smrgfi
9996b534f209Smrg
99977fe5393cSmrgif test x$FILE_MAN_SUFFIX = x    ; then
99987fe5393cSmrg    case $host_os in
99997fe5393cSmrg	solaris*)	FILE_MAN_SUFFIX=4  ;;
100007fe5393cSmrg	*)		FILE_MAN_SUFFIX=5  ;;
100017fe5393cSmrg    esac
100027fe5393cSmrgfi
100037fe5393cSmrgif test x$FILE_MAN_DIR = x    ; then
100047fe5393cSmrg    FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
100057fe5393cSmrgfi
10006b534f209Smrg
100077fe5393cSmrgif test x$MISC_MAN_SUFFIX = x    ; then
100087fe5393cSmrg    case $host_os in
100097fe5393cSmrg	solaris*)	MISC_MAN_SUFFIX=5  ;;
100107fe5393cSmrg	*)		MISC_MAN_SUFFIX=7  ;;
100117fe5393cSmrg    esac
100127fe5393cSmrgfi
100137fe5393cSmrgif test x$MISC_MAN_DIR = x    ; then
100147fe5393cSmrg    MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
10015b410ddbeSmrgfi
10016b534f209Smrg
100177fe5393cSmrgif test x$DRIVER_MAN_SUFFIX = x    ; then
100187fe5393cSmrg    case $host_os in
100197fe5393cSmrg	solaris*)	DRIVER_MAN_SUFFIX=7  ;;
100207fe5393cSmrg	*)		DRIVER_MAN_SUFFIX=4  ;;
100217fe5393cSmrg    esac
100227fe5393cSmrgfi
100237fe5393cSmrgif test x$DRIVER_MAN_DIR = x    ; then
100247fe5393cSmrg    DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
1002583cab373Smrgfi
1002615fb4814Smrg
100277fe5393cSmrgif test x$ADMIN_MAN_SUFFIX = x    ; then
100287fe5393cSmrg    case $host_os in
100297fe5393cSmrg	solaris*)	ADMIN_MAN_SUFFIX=1m ;;
100307fe5393cSmrg	*)		ADMIN_MAN_SUFFIX=8  ;;
100317fe5393cSmrg    esac
100327fe5393cSmrgfi
100337fe5393cSmrgif test x$ADMIN_MAN_DIR = x    ; then
100347fe5393cSmrg    ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
100357fe5393cSmrgfi
10036b534f209Smrg
10037b534f209Smrg
100387fe5393cSmrgAC_SUBST([APP_MAN_SUFFIX])
100397fe5393cSmrgAC_SUBST([LIB_MAN_SUFFIX])
100407fe5393cSmrgAC_SUBST([FILE_MAN_SUFFIX])
100417fe5393cSmrgAC_SUBST([MISC_MAN_SUFFIX])
100427fe5393cSmrgAC_SUBST([DRIVER_MAN_SUFFIX])
100437fe5393cSmrgAC_SUBST([ADMIN_MAN_SUFFIX])
100447fe5393cSmrgAC_SUBST([APP_MAN_DIR])
100457fe5393cSmrgAC_SUBST([LIB_MAN_DIR])
100467fe5393cSmrgAC_SUBST([FILE_MAN_DIR])
100477fe5393cSmrgAC_SUBST([MISC_MAN_DIR])
100487fe5393cSmrgAC_SUBST([DRIVER_MAN_DIR])
100497fe5393cSmrgAC_SUBST([ADMIN_MAN_DIR])
10050b534f209Smrg
100517fe5393cSmrgXORG_MAN_PAGE="X Version 11"
100527fe5393cSmrgAC_SUBST([XORG_MAN_PAGE])
100537fe5393cSmrgMAN_SUBSTS="\
100547fe5393cSmrg	-e 's|__vendorversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
100557fe5393cSmrg	-e 's|__xorgversion__|\"\$(PACKAGE_STRING)\" \"\$(XORG_MAN_PAGE)\"|' \
100567fe5393cSmrg	-e 's|__xservername__|Xorg|g' \
100577fe5393cSmrg	-e 's|__xconfigfile__|xorg.conf|g' \
100587fe5393cSmrg	-e 's|__projectroot__|\$(prefix)|g' \
100597fe5393cSmrg	-e 's|__apploaddir__|\$(appdefaultdir)|g' \
100607fe5393cSmrg	-e 's|__appmansuffix__|\$(APP_MAN_SUFFIX)|g' \
100617fe5393cSmrg	-e 's|__drivermansuffix__|\$(DRIVER_MAN_SUFFIX)|g' \
100627fe5393cSmrg	-e 's|__adminmansuffix__|\$(ADMIN_MAN_SUFFIX)|g' \
100637fe5393cSmrg	-e 's|__libmansuffix__|\$(LIB_MAN_SUFFIX)|g' \
100647fe5393cSmrg	-e 's|__miscmansuffix__|\$(MISC_MAN_SUFFIX)|g' \
100657fe5393cSmrg	-e 's|__filemansuffix__|\$(FILE_MAN_SUFFIX)|g'"
100667fe5393cSmrgAC_SUBST([MAN_SUBSTS])
10067b534f209Smrg
100687fe5393cSmrg]) # XORG_MANPAGE_SECTIONS
10069b534f209Smrg
100707fe5393cSmrg# XORG_CHECK_SGML_DOCTOOLS([MIN-VERSION])
100717fe5393cSmrg# ------------------------
100727fe5393cSmrg# Minimum version: 1.7.0
10073b4d38c65Smrg#
100747fe5393cSmrg# Defines the variable XORG_SGML_PATH containing the location of X11/defs.ent
100757fe5393cSmrg# provided by xorg-sgml-doctools, if installed.
100767fe5393cSmrgAC_DEFUN([XORG_CHECK_SGML_DOCTOOLS],[
100777fe5393cSmrgAC_MSG_CHECKING([for X.Org SGML entities m4_ifval([$1],[>= $1])])
100787fe5393cSmrgXORG_SGML_PATH=
100797fe5393cSmrgPKG_CHECK_EXISTS([xorg-sgml-doctools m4_ifval([$1],[>= $1])],
100807fe5393cSmrg    [XORG_SGML_PATH=`$PKG_CONFIG --variable=sgmlrootdir xorg-sgml-doctools`],
100817fe5393cSmrg    [m4_ifval([$1],[:],
100827fe5393cSmrg        [if test x"$cross_compiling" != x"yes" ; then
100837fe5393cSmrg            AC_CHECK_FILE([$prefix/share/sgml/X11/defs.ent],
100847fe5393cSmrg                          [XORG_SGML_PATH=$prefix/share/sgml])
100857fe5393cSmrg         fi])
100867fe5393cSmrg    ])
10087b534f209Smrg
100887fe5393cSmrg# Define variables STYLESHEET_SRCDIR and XSL_STYLESHEET containing
100897fe5393cSmrg# the path and the name of the doc stylesheet
100907fe5393cSmrgif test "x$XORG_SGML_PATH" != "x" ; then
100917fe5393cSmrg   AC_MSG_RESULT([$XORG_SGML_PATH])
100927fe5393cSmrg   STYLESHEET_SRCDIR=$XORG_SGML_PATH/X11
100937fe5393cSmrg   XSL_STYLESHEET=$STYLESHEET_SRCDIR/xorg.xsl
10094b4d38c65Smrgelse
100957fe5393cSmrg   AC_MSG_RESULT([no])
10096b4d38c65Smrgfi
10097b410ddbeSmrg
100987fe5393cSmrgAC_SUBST(XORG_SGML_PATH)
100997fe5393cSmrgAC_SUBST(STYLESHEET_SRCDIR)
101007fe5393cSmrgAC_SUBST(XSL_STYLESHEET)
101017fe5393cSmrgAM_CONDITIONAL([HAVE_STYLESHEETS], [test "x$XSL_STYLESHEET" != "x"])
101027fe5393cSmrg]) # XORG_CHECK_SGML_DOCTOOLS
10103b534f209Smrg
101047fe5393cSmrg# XORG_CHECK_LINUXDOC
101057fe5393cSmrg# -------------------
101067fe5393cSmrg# Minimum version: 1.0.0
10107b4d38c65Smrg#
101087fe5393cSmrg# Defines the variable MAKE_TEXT if the necessary tools and
101097fe5393cSmrg# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
101107fe5393cSmrg# Whether or not the necessary tools and files are found can be checked
101117fe5393cSmrg# with the AM_CONDITIONAL "BUILD_LINUXDOC"
101127fe5393cSmrgAC_DEFUN([XORG_CHECK_LINUXDOC],[
101137fe5393cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
101147fe5393cSmrgAC_REQUIRE([XORG_WITH_PS2PDF])
10115b534f209Smrg
101167fe5393cSmrgAC_PATH_PROG(LINUXDOC, linuxdoc)
1011715fb4814Smrg
101187fe5393cSmrgAC_MSG_CHECKING([whether to build documentation])
10119b4d38c65Smrg
101207fe5393cSmrgif test x$XORG_SGML_PATH != x && test x$LINUXDOC != x ; then
101217fe5393cSmrg   BUILDDOC=yes
10122b534f209Smrgelse
101237fe5393cSmrg   BUILDDOC=no
1012415fb4814Smrgfi
10125b410ddbeSmrg
101267fe5393cSmrgAM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
10127b4d38c65Smrg
101287fe5393cSmrgAC_MSG_RESULT([$BUILDDOC])
10129b4d38c65Smrg
101307fe5393cSmrgAC_MSG_CHECKING([whether to build pdf documentation])
10131b4d38c65Smrg
101327fe5393cSmrgif test x$have_ps2pdf != xno && test x$BUILD_PDFDOC != xno; then
101337fe5393cSmrg   BUILDPDFDOC=yes
101347fe5393cSmrgelse
101357fe5393cSmrg   BUILDPDFDOC=no
101367fe5393cSmrgfi
10137b410ddbeSmrg
101387fe5393cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
10139b4d38c65Smrg
101407fe5393cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10141de78e416Smrg
101427fe5393cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt -f"
101437fe5393cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
101447fe5393cSmrgMAKE_PDF="$PS2PDF"
101457fe5393cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC  -B html --split=0"
10146b4d38c65Smrg
101477fe5393cSmrgAC_SUBST(MAKE_TEXT)
101487fe5393cSmrgAC_SUBST(MAKE_PS)
101497fe5393cSmrgAC_SUBST(MAKE_PDF)
101507fe5393cSmrgAC_SUBST(MAKE_HTML)
101517fe5393cSmrg]) # XORG_CHECK_LINUXDOC
10152b4d38c65Smrg
101537fe5393cSmrg# XORG_CHECK_DOCBOOK
10154b4d38c65Smrg# -------------------
101557fe5393cSmrg# Minimum version: 1.0.0
10156b4d38c65Smrg#
101577fe5393cSmrg# Checks for the ability to build output formats from SGML DocBook source.
101587fe5393cSmrg# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
101597fe5393cSmrg# indicates whether the necessary tools and files are found and, if set,
101607fe5393cSmrg# $(MAKE_XXX) blah.sgml will produce blah.xxx.
101617fe5393cSmrgAC_DEFUN([XORG_CHECK_DOCBOOK],[
101627fe5393cSmrgAC_REQUIRE([XORG_CHECK_SGML_DOCTOOLS])
10163b4d38c65Smrg
101647fe5393cSmrgBUILDTXTDOC=no
101657fe5393cSmrgBUILDPDFDOC=no
101667fe5393cSmrgBUILDPSDOC=no
101677fe5393cSmrgBUILDHTMLDOC=no
10168de78e416Smrg
101697fe5393cSmrgAC_PATH_PROG(DOCBOOKPS, docbook2ps)
101707fe5393cSmrgAC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
101717fe5393cSmrgAC_PATH_PROG(DOCBOOKHTML, docbook2html)
101727fe5393cSmrgAC_PATH_PROG(DOCBOOKTXT, docbook2txt)
10173b4d38c65Smrg
101747fe5393cSmrgAC_MSG_CHECKING([whether to build text documentation])
101757fe5393cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKTXT != x &&
101767fe5393cSmrg   test x$BUILD_TXTDOC != xno; then
101777fe5393cSmrg	BUILDTXTDOC=yes
10178b4d38c65Smrgfi
101797fe5393cSmrgAM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
101807fe5393cSmrgAC_MSG_RESULT([$BUILDTXTDOC])
10181de78e416Smrg
101827fe5393cSmrgAC_MSG_CHECKING([whether to build PDF documentation])
101837fe5393cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPDF != x &&
101847fe5393cSmrg   test x$BUILD_PDFDOC != xno; then
101857fe5393cSmrg	BUILDPDFDOC=yes
10186b4d38c65Smrgfi
101877fe5393cSmrgAM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
101887fe5393cSmrgAC_MSG_RESULT([$BUILDPDFDOC])
10189b410ddbeSmrg
101907fe5393cSmrgAC_MSG_CHECKING([whether to build PostScript documentation])
101917fe5393cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKPS != x &&
101927fe5393cSmrg   test x$BUILD_PSDOC != xno; then
101937fe5393cSmrg	BUILDPSDOC=yes
101947fe5393cSmrgfi
101957fe5393cSmrgAM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
101967fe5393cSmrgAC_MSG_RESULT([$BUILDPSDOC])
10197b4d38c65Smrg
101987fe5393cSmrgAC_MSG_CHECKING([whether to build HTML documentation])
101997fe5393cSmrgif test x$XORG_SGML_PATH != x && test x$DOCBOOKHTML != x &&
102007fe5393cSmrg   test x$BUILD_HTMLDOC != xno; then
102017fe5393cSmrg	BUILDHTMLDOC=yes
102027fe5393cSmrgfi
102037fe5393cSmrgAM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
102047fe5393cSmrgAC_MSG_RESULT([$BUILDHTMLDOC])
10205b4d38c65Smrg
102067fe5393cSmrgMAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
102077fe5393cSmrgMAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
102087fe5393cSmrgMAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
102097fe5393cSmrgMAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
10210b4d38c65Smrg
102117fe5393cSmrgAC_SUBST(MAKE_TEXT)
102127fe5393cSmrgAC_SUBST(MAKE_PS)
102137fe5393cSmrgAC_SUBST(MAKE_PDF)
102147fe5393cSmrgAC_SUBST(MAKE_HTML)
102157fe5393cSmrg]) # XORG_CHECK_DOCBOOK
10216b410ddbeSmrg
102177fe5393cSmrg# XORG_WITH_XMLTO([MIN-VERSION], [DEFAULT])
102187fe5393cSmrg# ----------------
102197fe5393cSmrg# Minimum version: 1.5.0
102207fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10221b534f209Smrg#
102227fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
102237fe5393cSmrg# not at the appropriate level. This macro enables a module to test for the
102247fe5393cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
102257fe5393cSmrg# the --with-xmlto option, it allows maximum flexibilty in making decisions
102267fe5393cSmrg# as whether or not to use the xmlto package. When DEFAULT is not specified,
102277fe5393cSmrg# --with-xmlto assumes 'auto'.
10228b534f209Smrg#
102297fe5393cSmrg# Interface to module:
102307fe5393cSmrg# HAVE_XMLTO: 	used in makefiles to conditionally generate documentation
102317fe5393cSmrg# XMLTO:	returns the path of the xmlto program found
102327fe5393cSmrg#		returns the path set by the user in the environment
102337fe5393cSmrg# --with-xmlto:	'yes' user instructs the module to use xmlto
102347fe5393cSmrg#		'no' user instructs the module not to use xmlto
10235b4d38c65Smrg#
102367fe5393cSmrg# Added in version 1.10.0
102377fe5393cSmrg# HAVE_XMLTO_TEXT: used in makefiles to conditionally generate text documentation
102387fe5393cSmrg#                  xmlto for text output requires either lynx, links, or w3m browsers
102397fe5393cSmrg#
102407fe5393cSmrg# If the user sets the value of XMLTO, AC_PATH_PROG skips testing the path.
102417fe5393cSmrg#
102427fe5393cSmrgAC_DEFUN([XORG_WITH_XMLTO],[
102437fe5393cSmrgAC_ARG_VAR([XMLTO], [Path to xmlto command])
102447fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
102457fe5393cSmrgAC_ARG_WITH(xmlto,
102467fe5393cSmrg	AS_HELP_STRING([--with-xmlto],
102477fe5393cSmrg	   [Use xmlto to regenerate documentation (default: ]_defopt[)]),
102487fe5393cSmrg	   [use_xmlto=$withval], [use_xmlto=]_defopt)
102497fe5393cSmrgm4_undefine([_defopt])
10250b4d38c65Smrg
102517fe5393cSmrgif test "x$use_xmlto" = x"auto"; then
102527fe5393cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
102537fe5393cSmrg   if test "x$XMLTO" = "x"; then
102547fe5393cSmrg        AC_MSG_WARN([xmlto not found - documentation targets will be skipped])
102557fe5393cSmrg	have_xmlto=no
102567fe5393cSmrg   else
102577fe5393cSmrg        have_xmlto=yes
102587fe5393cSmrg   fi
102597fe5393cSmrgelif test "x$use_xmlto" = x"yes" ; then
102607fe5393cSmrg   AC_PATH_PROG([XMLTO], [xmlto])
102617fe5393cSmrg   if test "x$XMLTO" = "x"; then
102627fe5393cSmrg        AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
102637fe5393cSmrg   fi
102647fe5393cSmrg   have_xmlto=yes
102657fe5393cSmrgelif test "x$use_xmlto" = x"no" ; then
102667fe5393cSmrg   if test "x$XMLTO" != "x"; then
102677fe5393cSmrg      AC_MSG_WARN([ignoring XMLTO environment variable since --with-xmlto=no was specified])
102687fe5393cSmrg   fi
102697fe5393cSmrg   have_xmlto=no
10270b4d38c65Smrgelse
102717fe5393cSmrg   AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
10272b4d38c65Smrgfi
10273de78e416Smrg
102747fe5393cSmrg# Test for a minimum version of xmlto, if provided.
102757fe5393cSmrgm4_ifval([$1],
102767fe5393cSmrg[if test "$have_xmlto" = yes; then
102777fe5393cSmrg    # scrape the xmlto version
102787fe5393cSmrg    AC_MSG_CHECKING([the xmlto version])
102797fe5393cSmrg    xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
102807fe5393cSmrg    AC_MSG_RESULT([$xmlto_version])
102817fe5393cSmrg    AS_VERSION_COMPARE([$xmlto_version], [$1],
102827fe5393cSmrg        [if test "x$use_xmlto" = xauto; then
102837fe5393cSmrg            AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
102847fe5393cSmrg            have_xmlto=no
102857fe5393cSmrg        else
102867fe5393cSmrg            AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
102877fe5393cSmrg        fi])
102887fe5393cSmrgfi])
10289de78e416Smrg
102907fe5393cSmrg# Test for the ability of xmlto to generate a text target
102917fe5393cSmrghave_xmlto_text=no
102927fe5393cSmrgcat > conftest.xml << "EOF"
102937fe5393cSmrgEOF
102947fe5393cSmrgAS_IF([test "$have_xmlto" = yes],
102957fe5393cSmrg      [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1],
102967fe5393cSmrg             [have_xmlto_text=yes],
102977fe5393cSmrg             [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])
102987fe5393cSmrgrm -f conftest.xml
102997fe5393cSmrgAM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes])
103007fe5393cSmrgAM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
103017fe5393cSmrg]) # XORG_WITH_XMLTO
10302b4d38c65Smrg
103037fe5393cSmrg# XORG_WITH_XSLTPROC([MIN-VERSION], [DEFAULT])
103047fe5393cSmrg# --------------------------------------------
103057fe5393cSmrg# Minimum version: 1.12.0
103067fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.12.0
103077fe5393cSmrg#
103087fe5393cSmrg# XSLT (Extensible Stylesheet Language Transformations) is a declarative,
103097fe5393cSmrg# XML-based language used for the transformation of XML documents.
103107fe5393cSmrg# The xsltproc command line tool is for applying XSLT stylesheets to XML documents.
103117fe5393cSmrg# It is used under the cover by xmlto to generate html files from DocBook/XML.
103127fe5393cSmrg# The XSLT processor is often used as a standalone tool for transformations.
103137fe5393cSmrg# It should not be assumed that this tool is used only to work with documnetation.
103147fe5393cSmrg# When DEFAULT is not specified, --with-xsltproc assumes 'auto'.
103157fe5393cSmrg#
103167fe5393cSmrg# Interface to module:
103177fe5393cSmrg# HAVE_XSLTPROC: used in makefiles to conditionally generate documentation
103187fe5393cSmrg# XSLTPROC:	 returns the path of the xsltproc program found
103197fe5393cSmrg#		 returns the path set by the user in the environment
103207fe5393cSmrg# --with-xsltproc: 'yes' user instructs the module to use xsltproc
103217fe5393cSmrg#		  'no' user instructs the module not to use xsltproc
103227fe5393cSmrg# have_xsltproc: returns yes if xsltproc found in PATH or no
103237fe5393cSmrg#
103247fe5393cSmrg# If the user sets the value of XSLTPROC, AC_PATH_PROG skips testing the path.
103257fe5393cSmrg#
103267fe5393cSmrgAC_DEFUN([XORG_WITH_XSLTPROC],[
103277fe5393cSmrgAC_ARG_VAR([XSLTPROC], [Path to xsltproc command])
103287fe5393cSmrg# Preserves the interface, should it be implemented later
103297fe5393cSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for xsltproc MIN-VERSION is not implemented])])
103307fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
103317fe5393cSmrgAC_ARG_WITH(xsltproc,
103327fe5393cSmrg	AS_HELP_STRING([--with-xsltproc],
103337fe5393cSmrg	   [Use xsltproc for the transformation of XML documents (default: ]_defopt[)]),
103347fe5393cSmrg	   [use_xsltproc=$withval], [use_xsltproc=]_defopt)
103357fe5393cSmrgm4_undefine([_defopt])
10336b4d38c65Smrg
103377fe5393cSmrgif test "x$use_xsltproc" = x"auto"; then
103387fe5393cSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
103397fe5393cSmrg   if test "x$XSLTPROC" = "x"; then
103407fe5393cSmrg        AC_MSG_WARN([xsltproc not found - cannot transform XML documents])
103417fe5393cSmrg	have_xsltproc=no
103427fe5393cSmrg   else
103437fe5393cSmrg        have_xsltproc=yes
103447fe5393cSmrg   fi
103457fe5393cSmrgelif test "x$use_xsltproc" = x"yes" ; then
103467fe5393cSmrg   AC_PATH_PROG([XSLTPROC], [xsltproc])
103477fe5393cSmrg   if test "x$XSLTPROC" = "x"; then
103487fe5393cSmrg        AC_MSG_ERROR([--with-xsltproc=yes specified but xsltproc not found in PATH])
103497fe5393cSmrg   fi
103507fe5393cSmrg   have_xsltproc=yes
103517fe5393cSmrgelif test "x$use_xsltproc" = x"no" ; then
103527fe5393cSmrg   if test "x$XSLTPROC" != "x"; then
103537fe5393cSmrg      AC_MSG_WARN([ignoring XSLTPROC environment variable since --with-xsltproc=no was specified])
103547fe5393cSmrg   fi
103557fe5393cSmrg   have_xsltproc=no
10356b4d38c65Smrgelse
103577fe5393cSmrg   AC_MSG_ERROR([--with-xsltproc expects 'yes' or 'no'])
10358b4d38c65Smrgfi
10359de78e416Smrg
103607fe5393cSmrgAM_CONDITIONAL([HAVE_XSLTPROC], [test "$have_xsltproc" = yes])
103617fe5393cSmrg]) # XORG_WITH_XSLTPROC
10362b534f209Smrg
103637fe5393cSmrg# XORG_WITH_PERL([MIN-VERSION], [DEFAULT])
103647fe5393cSmrg# ----------------------------------------
103657fe5393cSmrg# Minimum version: 1.15.0
1036683cab373Smrg#
103677fe5393cSmrg# PERL (Practical Extraction and Report Language) is a language optimized for
103687fe5393cSmrg# scanning arbitrary text files, extracting information from those text files,
103697fe5393cSmrg# and printing reports based on that information.
1037083cab373Smrg#
103717fe5393cSmrg# When DEFAULT is not specified, --with-perl assumes 'auto'.
10372b410ddbeSmrg#
103737fe5393cSmrg# Interface to module:
103747fe5393cSmrg# HAVE_PERL: used in makefiles to conditionally scan text files
103757fe5393cSmrg# PERL:	     returns the path of the perl program found
103767fe5393cSmrg#	     returns the path set by the user in the environment
103777fe5393cSmrg# --with-perl: 'yes' user instructs the module to use perl
103787fe5393cSmrg#	       'no' user instructs the module not to use perl
103797fe5393cSmrg# have_perl: returns yes if perl found in PATH or no
1038083cab373Smrg#
103817fe5393cSmrg# If the user sets the value of PERL, AC_PATH_PROG skips testing the path.
10382b4d38c65Smrg#
103837fe5393cSmrgAC_DEFUN([XORG_WITH_PERL],[
103847fe5393cSmrgAC_ARG_VAR([PERL], [Path to perl command])
103857fe5393cSmrg# Preserves the interface, should it be implemented later
103867fe5393cSmrgm4_ifval([$1], [m4_warn([syntax], [Checking for perl MIN-VERSION is not implemented])])
103877fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
103887fe5393cSmrgAC_ARG_WITH(perl,
103897fe5393cSmrg	AS_HELP_STRING([--with-perl],
103907fe5393cSmrg	   [Use perl for extracting information from files (default: ]_defopt[)]),
103917fe5393cSmrg	   [use_perl=$withval], [use_perl=]_defopt)
103927fe5393cSmrgm4_undefine([_defopt])
10393de78e416Smrg
103947fe5393cSmrgif test "x$use_perl" = x"auto"; then
103957fe5393cSmrg   AC_PATH_PROG([PERL], [perl])
103967fe5393cSmrg   if test "x$PERL" = "x"; then
103977fe5393cSmrg        AC_MSG_WARN([perl not found - cannot extract information and report])
103987fe5393cSmrg	have_perl=no
103997fe5393cSmrg   else
104007fe5393cSmrg        have_perl=yes
104017fe5393cSmrg   fi
104027fe5393cSmrgelif test "x$use_perl" = x"yes" ; then
104037fe5393cSmrg   AC_PATH_PROG([PERL], [perl])
104047fe5393cSmrg   if test "x$PERL" = "x"; then
104057fe5393cSmrg        AC_MSG_ERROR([--with-perl=yes specified but perl not found in PATH])
104067fe5393cSmrg   fi
104077fe5393cSmrg   have_perl=yes
104087fe5393cSmrgelif test "x$use_perl" = x"no" ; then
104097fe5393cSmrg   if test "x$PERL" != "x"; then
104107fe5393cSmrg      AC_MSG_WARN([ignoring PERL environment variable since --with-perl=no was specified])
104117fe5393cSmrg   fi
104127fe5393cSmrg   have_perl=no
104137fe5393cSmrgelse
104147fe5393cSmrg   AC_MSG_ERROR([--with-perl expects 'yes' or 'no'])
10415b534f209Smrgfi
10416de78e416Smrg
104177fe5393cSmrgAM_CONDITIONAL([HAVE_PERL], [test "$have_perl" = yes])
104187fe5393cSmrg]) # XORG_WITH_PERL
10419de78e416Smrg
104207fe5393cSmrg# XORG_WITH_ASCIIDOC([MIN-VERSION], [DEFAULT])
10421b4d38c65Smrg# ----------------
104227fe5393cSmrg# Minimum version: 1.5.0
104237fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
1042483cab373Smrg#
104257fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
104267fe5393cSmrg# not at the appropriate level. This macro enables a module to test for the
104277fe5393cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104287fe5393cSmrg# the --with-asciidoc option, it allows maximum flexibilty in making decisions
104297fe5393cSmrg# as whether or not to use the asciidoc package. When DEFAULT is not specified,
104307fe5393cSmrg# --with-asciidoc assumes 'auto'.
10431b4d38c65Smrg#
104327fe5393cSmrg# Interface to module:
104337fe5393cSmrg# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
104347fe5393cSmrg# ASCIIDOC:	 returns the path of the asciidoc program found
104357fe5393cSmrg#		 returns the path set by the user in the environment
104367fe5393cSmrg# --with-asciidoc: 'yes' user instructs the module to use asciidoc
104377fe5393cSmrg#		  'no' user instructs the module not to use asciidoc
10438b4d38c65Smrg#
104397fe5393cSmrg# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
10440b4d38c65Smrg#
104417fe5393cSmrgAC_DEFUN([XORG_WITH_ASCIIDOC],[
104427fe5393cSmrgAC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
104437fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
104447fe5393cSmrgAC_ARG_WITH(asciidoc,
104457fe5393cSmrg	AS_HELP_STRING([--with-asciidoc],
104467fe5393cSmrg	   [Use asciidoc to regenerate documentation (default: ]_defopt[)]),
104477fe5393cSmrg	   [use_asciidoc=$withval], [use_asciidoc=]_defopt)
104487fe5393cSmrgm4_undefine([_defopt])
10449de78e416Smrg
104507fe5393cSmrgif test "x$use_asciidoc" = x"auto"; then
104517fe5393cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
104527fe5393cSmrg   if test "x$ASCIIDOC" = "x"; then
104537fe5393cSmrg        AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
104547fe5393cSmrg	have_asciidoc=no
104557fe5393cSmrg   else
104567fe5393cSmrg        have_asciidoc=yes
104577fe5393cSmrg   fi
104587fe5393cSmrgelif test "x$use_asciidoc" = x"yes" ; then
104597fe5393cSmrg   AC_PATH_PROG([ASCIIDOC], [asciidoc])
104607fe5393cSmrg   if test "x$ASCIIDOC" = "x"; then
104617fe5393cSmrg        AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
104627fe5393cSmrg   fi
104637fe5393cSmrg   have_asciidoc=yes
104647fe5393cSmrgelif test "x$use_asciidoc" = x"no" ; then
104657fe5393cSmrg   if test "x$ASCIIDOC" != "x"; then
104667fe5393cSmrg      AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
104677fe5393cSmrg   fi
104687fe5393cSmrg   have_asciidoc=no
104697fe5393cSmrgelse
104707fe5393cSmrg   AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
104717fe5393cSmrgfi
104727fe5393cSmrgm4_ifval([$1],
104737fe5393cSmrg[if test "$have_asciidoc" = yes; then
104747fe5393cSmrg    # scrape the asciidoc version
104757fe5393cSmrg    AC_MSG_CHECKING([the asciidoc version])
104767fe5393cSmrg    asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
104777fe5393cSmrg    AC_MSG_RESULT([$asciidoc_version])
104787fe5393cSmrg    AS_VERSION_COMPARE([$asciidoc_version], [$1],
104797fe5393cSmrg        [if test "x$use_asciidoc" = xauto; then
104807fe5393cSmrg            AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
104817fe5393cSmrg            have_asciidoc=no
104827fe5393cSmrg        else
104837fe5393cSmrg            AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
104847fe5393cSmrg        fi])
104857fe5393cSmrgfi])
104867fe5393cSmrgAM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
104877fe5393cSmrg]) # XORG_WITH_ASCIIDOC
10488de78e416Smrg
104897fe5393cSmrg# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
10490cf503b78Smrg# -------------------------------------------
104917fe5393cSmrg# Minimum version: 1.5.0
104927fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10493cf503b78Smrg# Minimum version for optional DOT checking: 1.18.0
10494b4d38c65Smrg#
104957fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
104967fe5393cSmrg# not at the appropriate level. This macro enables a module to test for the
104977fe5393cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
104987fe5393cSmrg# the --with-doxygen option, it allows maximum flexibilty in making decisions
104997fe5393cSmrg# as whether or not to use the doxygen package. When DEFAULT is not specified,
105007fe5393cSmrg# --with-doxygen assumes 'auto'.
10501b4d38c65Smrg#
105027fe5393cSmrg# Interface to module:
105037fe5393cSmrg# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
105047fe5393cSmrg# DOXYGEN:	 returns the path of the doxygen program found
105057fe5393cSmrg#		 returns the path set by the user in the environment
105067fe5393cSmrg# --with-doxygen: 'yes' user instructs the module to use doxygen
105077fe5393cSmrg#		  'no' user instructs the module not to use doxygen
105087fe5393cSmrg#
105097fe5393cSmrg# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
105107fe5393cSmrg#
105117fe5393cSmrgAC_DEFUN([XORG_WITH_DOXYGEN],[
105127fe5393cSmrgAC_ARG_VAR([DOXYGEN], [Path to doxygen command])
10513cf503b78SmrgAC_ARG_VAR([DOT], [Path to the dot graphics utility])
105147fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
105157fe5393cSmrgAC_ARG_WITH(doxygen,
105167fe5393cSmrg	AS_HELP_STRING([--with-doxygen],
105177fe5393cSmrg	   [Use doxygen to regenerate documentation (default: ]_defopt[)]),
105187fe5393cSmrg	   [use_doxygen=$withval], [use_doxygen=]_defopt)
105197fe5393cSmrgm4_undefine([_defopt])
1052015fb4814Smrg
105217fe5393cSmrgif test "x$use_doxygen" = x"auto"; then
105227fe5393cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
105237fe5393cSmrg   if test "x$DOXYGEN" = "x"; then
105247fe5393cSmrg        AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
105257fe5393cSmrg	have_doxygen=no
105267fe5393cSmrg   else
105277fe5393cSmrg        have_doxygen=yes
105287fe5393cSmrg   fi
105297fe5393cSmrgelif test "x$use_doxygen" = x"yes" ; then
105307fe5393cSmrg   AC_PATH_PROG([DOXYGEN], [doxygen])
105317fe5393cSmrg   if test "x$DOXYGEN" = "x"; then
105327fe5393cSmrg        AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
105337fe5393cSmrg   fi
105347fe5393cSmrg   have_doxygen=yes
105357fe5393cSmrgelif test "x$use_doxygen" = x"no" ; then
105367fe5393cSmrg   if test "x$DOXYGEN" != "x"; then
105377fe5393cSmrg      AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
105387fe5393cSmrg   fi
105397fe5393cSmrg   have_doxygen=no
105407fe5393cSmrgelse
105417fe5393cSmrg   AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
105427fe5393cSmrgfi
105437fe5393cSmrgm4_ifval([$1],
105447fe5393cSmrg[if test "$have_doxygen" = yes; then
105457fe5393cSmrg    # scrape the doxygen version
105467fe5393cSmrg    AC_MSG_CHECKING([the doxygen version])
105477fe5393cSmrg    doxygen_version=`$DOXYGEN --version 2>/dev/null`
105487fe5393cSmrg    AC_MSG_RESULT([$doxygen_version])
105497fe5393cSmrg    AS_VERSION_COMPARE([$doxygen_version], [$1],
105507fe5393cSmrg        [if test "x$use_doxygen" = xauto; then
105517fe5393cSmrg            AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
105527fe5393cSmrg            have_doxygen=no
105537fe5393cSmrg        else
105547fe5393cSmrg            AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
105557fe5393cSmrg        fi])
105567fe5393cSmrgfi])
10557cf503b78Smrg
10558cf503b78Smrgdnl Check for DOT if we have doxygen. The caller decides if it is mandatory
10559cf503b78Smrgdnl HAVE_DOT is a variable that can be used in your doxygen.in config file:
10560cf503b78Smrgdnl 	HAVE_DOT = @HAVE_DOT@
10561cf503b78SmrgHAVE_DOT=no
10562cf503b78Smrgif test "x$have_doxygen" = "xyes"; then
10563cf503b78Smrg  AC_PATH_PROG([DOT], [dot])
10564cf503b78Smrg    if test "x$DOT" != "x"; then
10565cf503b78Smrg      HAVE_DOT=yes
10566cf503b78Smrg    fi
10567cf503b78Smrgfi
10568cf503b78Smrg
10569cf503b78SmrgAC_SUBST([HAVE_DOT])
10570cf503b78SmrgAM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"])
105717fe5393cSmrgAM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
105727fe5393cSmrg]) # XORG_WITH_DOXYGEN
1057383cab373Smrg
105747fe5393cSmrg# XORG_WITH_GROFF([DEFAULT])
105757fe5393cSmrg# ----------------
105767fe5393cSmrg# Minimum version: 1.6.0
105777fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
10578b4d38c65Smrg#
105797fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
105807fe5393cSmrg# not at the appropriate level. This macro enables a module to test for the
105817fe5393cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
105827fe5393cSmrg# the --with-groff option, it allows maximum flexibilty in making decisions
105837fe5393cSmrg# as whether or not to use the groff package. When DEFAULT is not specified,
105847fe5393cSmrg# --with-groff assumes 'auto'.
10585b4d38c65Smrg#
105867fe5393cSmrg# Interface to module:
105877fe5393cSmrg# HAVE_GROFF:	 used in makefiles to conditionally generate documentation
105887fe5393cSmrg# HAVE_GROFF_MM: the memorandum macros (-mm) package
105897fe5393cSmrg# HAVE_GROFF_MS: the -ms macros package
105907fe5393cSmrg# GROFF:	 returns the path of the groff program found
105917fe5393cSmrg#		 returns the path set by the user in the environment
105927fe5393cSmrg# --with-groff:	 'yes' user instructs the module to use groff
105937fe5393cSmrg#		 'no' user instructs the module not to use groff
10594b4d38c65Smrg#
105957fe5393cSmrg# Added in version 1.9.0:
105967fe5393cSmrg# HAVE_GROFF_HTML: groff has dependencies to output HTML format:
105977fe5393cSmrg#		   pnmcut pnmcrop pnmtopng pnmtops from the netpbm package.
105987fe5393cSmrg#		   psselect from the psutils package.
105997fe5393cSmrg#		   the ghostcript package. Refer to the grohtml man pages
10600b4d38c65Smrg#
106017fe5393cSmrg# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
10602b4d38c65Smrg#
106037fe5393cSmrg# OS and distros often splits groff in a basic and full package, the former
106047fe5393cSmrg# having the groff program and the later having devices, fonts and macros
106057fe5393cSmrg# Checking for the groff executable is not enough.
10606b534f209Smrg#
106077fe5393cSmrg# If macros are missing, we cannot assume that groff is useless, so we don't
106087fe5393cSmrg# unset HAVE_GROFF or GROFF env variables.
106097fe5393cSmrg# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
10610b534f209Smrg#
106117fe5393cSmrgAC_DEFUN([XORG_WITH_GROFF],[
106127fe5393cSmrgAC_ARG_VAR([GROFF], [Path to groff command])
106137fe5393cSmrgm4_define([_defopt], m4_default([$1], [auto]))
106147fe5393cSmrgAC_ARG_WITH(groff,
106157fe5393cSmrg	AS_HELP_STRING([--with-groff],
106167fe5393cSmrg	   [Use groff to regenerate documentation (default: ]_defopt[)]),
106177fe5393cSmrg	   [use_groff=$withval], [use_groff=]_defopt)
106187fe5393cSmrgm4_undefine([_defopt])
1061983cab373Smrg
106207fe5393cSmrgif test "x$use_groff" = x"auto"; then
106217fe5393cSmrg   AC_PATH_PROG([GROFF], [groff])
106227fe5393cSmrg   if test "x$GROFF" = "x"; then
106237fe5393cSmrg        AC_MSG_WARN([groff not found - documentation targets will be skipped])
106247fe5393cSmrg	have_groff=no
106257fe5393cSmrg   else
106267fe5393cSmrg        have_groff=yes
106277fe5393cSmrg   fi
106287fe5393cSmrgelif test "x$use_groff" = x"yes" ; then
106297fe5393cSmrg   AC_PATH_PROG([GROFF], [groff])
106307fe5393cSmrg   if test "x$GROFF" = "x"; then
106317fe5393cSmrg        AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
106327fe5393cSmrg   fi
106337fe5393cSmrg   have_groff=yes
106347fe5393cSmrgelif test "x$use_groff" = x"no" ; then
106357fe5393cSmrg   if test "x$GROFF" != "x"; then
106367fe5393cSmrg      AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
106377fe5393cSmrg   fi
106387fe5393cSmrg   have_groff=no
106397fe5393cSmrgelse
106407fe5393cSmrg   AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
106417fe5393cSmrgfi
1064283cab373Smrg
106437fe5393cSmrg# We have groff, test for the presence of the macro packages
106447fe5393cSmrgif test "x$have_groff" = x"yes"; then
106457fe5393cSmrg    AC_MSG_CHECKING([for ${GROFF} -ms macros])
106467fe5393cSmrg    if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
106477fe5393cSmrg        groff_ms_works=yes
106487fe5393cSmrg    else
106497fe5393cSmrg        groff_ms_works=no
106507fe5393cSmrg    fi
106517fe5393cSmrg    AC_MSG_RESULT([$groff_ms_works])
106527fe5393cSmrg    AC_MSG_CHECKING([for ${GROFF} -mm macros])
106537fe5393cSmrg    if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
106547fe5393cSmrg        groff_mm_works=yes
106557fe5393cSmrg    else
106567fe5393cSmrg        groff_mm_works=no
106577fe5393cSmrg    fi
106587fe5393cSmrg    AC_MSG_RESULT([$groff_mm_works])
106597fe5393cSmrgfi
10660b534f209Smrg
106617fe5393cSmrg# We have groff, test for HTML dependencies, one command per package
106627fe5393cSmrgif test "x$have_groff" = x"yes"; then
106637fe5393cSmrg   AC_PATH_PROGS(GS_PATH, [gs gswin32c])
106647fe5393cSmrg   AC_PATH_PROG(PNMTOPNG_PATH, [pnmtopng])
106657fe5393cSmrg   AC_PATH_PROG(PSSELECT_PATH, [psselect])
106667fe5393cSmrg   if test "x$GS_PATH" != "x" -a "x$PNMTOPNG_PATH" != "x" -a "x$PSSELECT_PATH" != "x"; then
106677fe5393cSmrg      have_groff_html=yes
106687fe5393cSmrg   else
106697fe5393cSmrg      have_groff_html=no
106707fe5393cSmrg      AC_MSG_WARN([grohtml dependencies not found - HTML Documentation skipped. Refer to grohtml man pages])
106717fe5393cSmrg   fi
106727fe5393cSmrgfi
10673b4d38c65Smrg
106747fe5393cSmrg# Set Automake conditionals for Makefiles
106757fe5393cSmrgAM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
106767fe5393cSmrgAM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
106777fe5393cSmrgAM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
106787fe5393cSmrgAM_CONDITIONAL([HAVE_GROFF_HTML], [test "$have_groff_html" = yes])
106797fe5393cSmrg]) # XORG_WITH_GROFF
10680b4d38c65Smrg
106817fe5393cSmrg# XORG_WITH_FOP([MIN-VERSION], [DEFAULT])
106827fe5393cSmrg# ---------------------------------------
106837fe5393cSmrg# Minimum version: 1.6.0
106847fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
106857fe5393cSmrg# Minimum version for optional MIN-VERSION argument: 1.15.0
106867fe5393cSmrg#
106877fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
106887fe5393cSmrg# not at the appropriate level. This macro enables a module to test for the
106897fe5393cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
106907fe5393cSmrg# the --with-fop option, it allows maximum flexibilty in making decisions
106917fe5393cSmrg# as whether or not to use the fop package. When DEFAULT is not specified,
106927fe5393cSmrg# --with-fop assumes 'auto'.
106937fe5393cSmrg#
106947fe5393cSmrg# Interface to module:
106957fe5393cSmrg# HAVE_FOP: 	used in makefiles to conditionally generate documentation
106967fe5393cSmrg# FOP:	 	returns the path of the fop program found
106977fe5393cSmrg#		returns the path set by the user in the environment
106987fe5393cSmrg# --with-fop: 	'yes' user instructs the module to use fop
106997fe5393cSmrg#		'no' user instructs the module not to use fop
107007fe5393cSmrg#
107017fe5393cSmrg# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
107027fe5393cSmrg#
107037fe5393cSmrgAC_DEFUN([XORG_WITH_FOP],[
107047fe5393cSmrgAC_ARG_VAR([FOP], [Path to fop command])
107057fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
107067fe5393cSmrgAC_ARG_WITH(fop,
107077fe5393cSmrg	AS_HELP_STRING([--with-fop],
107087fe5393cSmrg	   [Use fop to regenerate documentation (default: ]_defopt[)]),
107097fe5393cSmrg	   [use_fop=$withval], [use_fop=]_defopt)
107107fe5393cSmrgm4_undefine([_defopt])
10711b4d38c65Smrg
107127fe5393cSmrgif test "x$use_fop" = x"auto"; then
107137fe5393cSmrg   AC_PATH_PROG([FOP], [fop])
107147fe5393cSmrg   if test "x$FOP" = "x"; then
107157fe5393cSmrg        AC_MSG_WARN([fop not found - documentation targets will be skipped])
107167fe5393cSmrg	have_fop=no
107177fe5393cSmrg   else
107187fe5393cSmrg        have_fop=yes
107197fe5393cSmrg   fi
107207fe5393cSmrgelif test "x$use_fop" = x"yes" ; then
107217fe5393cSmrg   AC_PATH_PROG([FOP], [fop])
107227fe5393cSmrg   if test "x$FOP" = "x"; then
107237fe5393cSmrg        AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
107247fe5393cSmrg   fi
107257fe5393cSmrg   have_fop=yes
107267fe5393cSmrgelif test "x$use_fop" = x"no" ; then
107277fe5393cSmrg   if test "x$FOP" != "x"; then
107287fe5393cSmrg      AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
107297fe5393cSmrg   fi
107307fe5393cSmrg   have_fop=no
10731b534f209Smrgelse
107327fe5393cSmrg   AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
1073383cab373Smrgfi
1073483cab373Smrg
107357fe5393cSmrg# Test for a minimum version of fop, if provided.
107367fe5393cSmrgm4_ifval([$1],
107377fe5393cSmrg[if test "$have_fop" = yes; then
107387fe5393cSmrg    # scrape the fop version
107397fe5393cSmrg    AC_MSG_CHECKING([for fop minimum version])
107407fe5393cSmrg    fop_version=`$FOP -version 2>/dev/null | cut -d' ' -f3`
107417fe5393cSmrg    AC_MSG_RESULT([$fop_version])
107427fe5393cSmrg    AS_VERSION_COMPARE([$fop_version], [$1],
107437fe5393cSmrg        [if test "x$use_fop" = xauto; then
107447fe5393cSmrg            AC_MSG_WARN([fop version $fop_version found, but $1 needed])
107457fe5393cSmrg            have_fop=no
107467fe5393cSmrg        else
107477fe5393cSmrg            AC_MSG_ERROR([fop version $fop_version found, but $1 needed])
107487fe5393cSmrg        fi])
107497fe5393cSmrgfi])
107507fe5393cSmrgAM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
107517fe5393cSmrg]) # XORG_WITH_FOP
1075283cab373Smrg
10753cf503b78Smrg# XORG_WITH_M4([MIN-VERSION])
10754cf503b78Smrg# ---------------------------
10755cf503b78Smrg# Minimum version: 1.19.0
10756cf503b78Smrg#
10757cf503b78Smrg# This macro attempts to locate an m4 macro processor which supports
10758cf503b78Smrg# -I option and is only useful for modules relying on M4 in order to
10759cf503b78Smrg# expand macros in source code files.
10760cf503b78Smrg#
10761cf503b78Smrg# Interface to module:
10762cf503b78Smrg# M4:	 	returns the path of the m4 program found
10763cf503b78Smrg#		returns the path set by the user in the environment
10764cf503b78Smrg#
10765cf503b78SmrgAC_DEFUN([XORG_WITH_M4], [
10766cf503b78SmrgAC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
10767cf503b78Smrg   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
10768cf503b78Smrg       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
10769cf503b78Smrg         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
10770cf503b78Smrg   [AC_MSG_ERROR([could not find m4 that supports -I option])],
10771cf503b78Smrg   [$PATH:/usr/gnu/bin])])
10772cf503b78Smrg
10773cf503b78SmrgAC_SUBST([M4], [$ac_cv_path_M4])
10774cf503b78Smrg]) # XORG_WITH_M4
10775cf503b78Smrg
107767fe5393cSmrg# XORG_WITH_PS2PDF([DEFAULT])
107777fe5393cSmrg# ----------------
107787fe5393cSmrg# Minimum version: 1.6.0
107797fe5393cSmrg# Minimum version for optional DEFAULT argument: 1.11.0
107807fe5393cSmrg#
107817fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
107827fe5393cSmrg# not at the appropriate level. This macro enables a module to test for the
107837fe5393cSmrg# presence of the tool and obtain it's path in separate variables. Coupled with
107847fe5393cSmrg# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
107857fe5393cSmrg# as whether or not to use the ps2pdf package. When DEFAULT is not specified,
107867fe5393cSmrg# --with-ps2pdf assumes 'auto'.
107877fe5393cSmrg#
107887fe5393cSmrg# Interface to module:
107897fe5393cSmrg# HAVE_PS2PDF: 	used in makefiles to conditionally generate documentation
107907fe5393cSmrg# PS2PDF:	returns the path of the ps2pdf program found
107917fe5393cSmrg#		returns the path set by the user in the environment
107927fe5393cSmrg# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
107937fe5393cSmrg#		 'no' user instructs the module not to use ps2pdf
107947fe5393cSmrg#
107957fe5393cSmrg# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
107967fe5393cSmrg#
107977fe5393cSmrgAC_DEFUN([XORG_WITH_PS2PDF],[
107987fe5393cSmrgAC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
107997fe5393cSmrgm4_define([_defopt], m4_default([$1], [auto]))
108007fe5393cSmrgAC_ARG_WITH(ps2pdf,
108017fe5393cSmrg	AS_HELP_STRING([--with-ps2pdf],
108027fe5393cSmrg	   [Use ps2pdf to regenerate documentation (default: ]_defopt[)]),
108037fe5393cSmrg	   [use_ps2pdf=$withval], [use_ps2pdf=]_defopt)
108047fe5393cSmrgm4_undefine([_defopt])
10805b4d38c65Smrg
108067fe5393cSmrgif test "x$use_ps2pdf" = x"auto"; then
108077fe5393cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
108087fe5393cSmrg   if test "x$PS2PDF" = "x"; then
108097fe5393cSmrg        AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
108107fe5393cSmrg	have_ps2pdf=no
108117fe5393cSmrg   else
108127fe5393cSmrg        have_ps2pdf=yes
108137fe5393cSmrg   fi
108147fe5393cSmrgelif test "x$use_ps2pdf" = x"yes" ; then
108157fe5393cSmrg   AC_PATH_PROG([PS2PDF], [ps2pdf])
108167fe5393cSmrg   if test "x$PS2PDF" = "x"; then
108177fe5393cSmrg        AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
108187fe5393cSmrg   fi
108197fe5393cSmrg   have_ps2pdf=yes
108207fe5393cSmrgelif test "x$use_ps2pdf" = x"no" ; then
108217fe5393cSmrg   if test "x$PS2PDF" != "x"; then
108227fe5393cSmrg      AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
108237fe5393cSmrg   fi
108247fe5393cSmrg   have_ps2pdf=no
108257fe5393cSmrgelse
108267fe5393cSmrg   AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
10827b534f209Smrgfi
108287fe5393cSmrgAM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
108297fe5393cSmrg]) # XORG_WITH_PS2PDF
10830b4d38c65Smrg
108317fe5393cSmrg# XORG_ENABLE_DOCS (enable_docs=yes)
108327fe5393cSmrg# ----------------
108337fe5393cSmrg# Minimum version: 1.6.0
10834b534f209Smrg#
108357fe5393cSmrg# Documentation tools are not always available on all platforms and sometimes
108367fe5393cSmrg# not at the appropriate level. This macro enables a builder to skip all
108377fe5393cSmrg# documentation targets except traditional man pages.
108387fe5393cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
108397fe5393cSmrg# maximum flexibilty in controlling documentation building.
108407fe5393cSmrg# Refer to:
108417fe5393cSmrg# XORG_WITH_XMLTO         --with-xmlto
108427fe5393cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
108437fe5393cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
108447fe5393cSmrg# XORG_WITH_FOP           --with-fop
108457fe5393cSmrg# XORG_WITH_GROFF         --with-groff
108467fe5393cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
108477fe5393cSmrg#
108487fe5393cSmrg# Interface to module:
108497fe5393cSmrg# ENABLE_DOCS: 	  used in makefiles to conditionally generate documentation
108507fe5393cSmrg# --enable-docs: 'yes' user instructs the module to generate docs
108517fe5393cSmrg#		 'no' user instructs the module not to generate docs
108527fe5393cSmrg# parm1:	specify the default value, yes or no.
108537fe5393cSmrg#
108547fe5393cSmrgAC_DEFUN([XORG_ENABLE_DOCS],[
108557fe5393cSmrgm4_define([docs_default], m4_default([$1], [yes]))
108567fe5393cSmrgAC_ARG_ENABLE(docs,
108577fe5393cSmrg	AS_HELP_STRING([--enable-docs],
108587fe5393cSmrg	   [Enable building the documentation (default: ]docs_default[)]),
108597fe5393cSmrg	   [build_docs=$enableval], [build_docs=]docs_default)
108607fe5393cSmrgm4_undefine([docs_default])
108617fe5393cSmrgAM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
108627fe5393cSmrgAC_MSG_CHECKING([whether to build documentation])
108637fe5393cSmrgAC_MSG_RESULT([$build_docs])
108647fe5393cSmrg]) # XORG_ENABLE_DOCS
10865de78e416Smrg
108667fe5393cSmrg# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
108677fe5393cSmrg# ----------------
108687fe5393cSmrg# Minimum version: 1.6.0
108697fe5393cSmrg#
108707fe5393cSmrg# This macro enables a builder to skip all developer documentation.
108717fe5393cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
108727fe5393cSmrg# maximum flexibilty in controlling documentation building.
108737fe5393cSmrg# Refer to:
108747fe5393cSmrg# XORG_WITH_XMLTO         --with-xmlto
108757fe5393cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
108767fe5393cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
108777fe5393cSmrg# XORG_WITH_FOP           --with-fop
108787fe5393cSmrg# XORG_WITH_GROFF         --with-groff
108797fe5393cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
108807fe5393cSmrg#
108817fe5393cSmrg# Interface to module:
108827fe5393cSmrg# ENABLE_DEVEL_DOCS:	used in makefiles to conditionally generate developer docs
108837fe5393cSmrg# --enable-devel-docs:	'yes' user instructs the module to generate developer docs
108847fe5393cSmrg#			'no' user instructs the module not to generate developer docs
108857fe5393cSmrg# parm1:		specify the default value, yes or no.
108867fe5393cSmrg#
108877fe5393cSmrgAC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
108887fe5393cSmrgm4_define([devel_default], m4_default([$1], [yes]))
108897fe5393cSmrgAC_ARG_ENABLE(devel-docs,
108907fe5393cSmrg	AS_HELP_STRING([--enable-devel-docs],
108917fe5393cSmrg	   [Enable building the developer documentation (default: ]devel_default[)]),
108927fe5393cSmrg	   [build_devel_docs=$enableval], [build_devel_docs=]devel_default)
108937fe5393cSmrgm4_undefine([devel_default])
108947fe5393cSmrgAM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
108957fe5393cSmrgAC_MSG_CHECKING([whether to build developer documentation])
108967fe5393cSmrgAC_MSG_RESULT([$build_devel_docs])
108977fe5393cSmrg]) # XORG_ENABLE_DEVEL_DOCS
10898de78e416Smrg
108997fe5393cSmrg# XORG_ENABLE_SPECS (enable_specs=yes)
109007fe5393cSmrg# ----------------
109017fe5393cSmrg# Minimum version: 1.6.0
109027fe5393cSmrg#
109037fe5393cSmrg# This macro enables a builder to skip all functional specification targets.
109047fe5393cSmrg# Combined with the specific tool checking macros XORG_WITH_*, it provides
109057fe5393cSmrg# maximum flexibilty in controlling documentation building.
109067fe5393cSmrg# Refer to:
109077fe5393cSmrg# XORG_WITH_XMLTO         --with-xmlto
109087fe5393cSmrg# XORG_WITH_ASCIIDOC      --with-asciidoc
109097fe5393cSmrg# XORG_WITH_DOXYGEN       --with-doxygen
109107fe5393cSmrg# XORG_WITH_FOP           --with-fop
109117fe5393cSmrg# XORG_WITH_GROFF         --with-groff
109127fe5393cSmrg# XORG_WITH_PS2PDF        --with-ps2pdf
109137fe5393cSmrg#
109147fe5393cSmrg# Interface to module:
109157fe5393cSmrg# ENABLE_SPECS:		used in makefiles to conditionally generate specs
109167fe5393cSmrg# --enable-specs:	'yes' user instructs the module to generate specs
109177fe5393cSmrg#			'no' user instructs the module not to generate specs
109187fe5393cSmrg# parm1:		specify the default value, yes or no.
109197fe5393cSmrg#
109207fe5393cSmrgAC_DEFUN([XORG_ENABLE_SPECS],[
109217fe5393cSmrgm4_define([spec_default], m4_default([$1], [yes]))
109227fe5393cSmrgAC_ARG_ENABLE(specs,
109237fe5393cSmrg	AS_HELP_STRING([--enable-specs],
109247fe5393cSmrg	   [Enable building the specs (default: ]spec_default[)]),
109257fe5393cSmrg	   [build_specs=$enableval], [build_specs=]spec_default)
109267fe5393cSmrgm4_undefine([spec_default])
109277fe5393cSmrgAM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
109287fe5393cSmrgAC_MSG_CHECKING([whether to build functional specifications])
109297fe5393cSmrgAC_MSG_RESULT([$build_specs])
109307fe5393cSmrg]) # XORG_ENABLE_SPECS
10931b4d38c65Smrg
109327fe5393cSmrg# XORG_ENABLE_UNIT_TESTS (enable_unit_tests=auto)
109337fe5393cSmrg# ----------------------------------------------
109347fe5393cSmrg# Minimum version: 1.13.0
109357fe5393cSmrg#
109367fe5393cSmrg# This macro enables a builder to enable/disable unit testing
109377fe5393cSmrg# It makes no assumption about the test cases implementation
109387fe5393cSmrg# Test cases may or may not use Automake "Support for test suites"
109397fe5393cSmrg# They may or may not use the software utility library GLib
109407fe5393cSmrg#
109417fe5393cSmrg# When used in conjunction with XORG_WITH_GLIB, use both AM_CONDITIONAL
109427fe5393cSmrg# ENABLE_UNIT_TESTS and HAVE_GLIB. Not all unit tests may use glib.
109437fe5393cSmrg# The variable enable_unit_tests is used by other macros in this file.
109447fe5393cSmrg#
109457fe5393cSmrg# Interface to module:
109467fe5393cSmrg# ENABLE_UNIT_TESTS:	used in makefiles to conditionally build tests
109477fe5393cSmrg# enable_unit_tests:    used in configure.ac for additional configuration
109487fe5393cSmrg# --enable-unit-tests:	'yes' user instructs the module to build tests
109497fe5393cSmrg#			'no' user instructs the module not to build tests
109507fe5393cSmrg# parm1:		specify the default value, yes or no.
109517fe5393cSmrg#
109527fe5393cSmrgAC_DEFUN([XORG_ENABLE_UNIT_TESTS],[
109537fe5393cSmrgAC_BEFORE([$0], [XORG_WITH_GLIB])
109547fe5393cSmrgAC_BEFORE([$0], [XORG_LD_WRAP])
109557fe5393cSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
109567fe5393cSmrgm4_define([_defopt], m4_default([$1], [auto]))
109577fe5393cSmrgAC_ARG_ENABLE(unit-tests, AS_HELP_STRING([--enable-unit-tests],
109587fe5393cSmrg	[Enable building unit test cases (default: ]_defopt[)]),
109597fe5393cSmrg	[enable_unit_tests=$enableval], [enable_unit_tests=]_defopt)
109607fe5393cSmrgm4_undefine([_defopt])
109617fe5393cSmrgAM_CONDITIONAL(ENABLE_UNIT_TESTS, [test "x$enable_unit_tests" != xno])
109627fe5393cSmrgAC_MSG_CHECKING([whether to build unit test cases])
109637fe5393cSmrgAC_MSG_RESULT([$enable_unit_tests])
109647fe5393cSmrg]) # XORG_ENABLE_UNIT_TESTS
10965b4d38c65Smrg
109667fe5393cSmrg# XORG_ENABLE_INTEGRATION_TESTS (enable_unit_tests=auto)
109677fe5393cSmrg# ------------------------------------------------------
109687fe5393cSmrg# Minimum version: 1.17.0
109697fe5393cSmrg#
109707fe5393cSmrg# This macro enables a builder to enable/disable integration testing
109717fe5393cSmrg# It makes no assumption about the test cases' implementation
109727fe5393cSmrg# Test cases may or may not use Automake "Support for test suites"
109737fe5393cSmrg#
109747fe5393cSmrg# Please see XORG_ENABLE_UNIT_TESTS for unit test support. Unit test support
109757fe5393cSmrg# usually requires less dependencies and may be built and run under less
109767fe5393cSmrg# stringent environments than integration tests.
109777fe5393cSmrg#
109787fe5393cSmrg# Interface to module:
109797fe5393cSmrg# ENABLE_INTEGRATION_TESTS:   used in makefiles to conditionally build tests
109807fe5393cSmrg# enable_integration_tests:   used in configure.ac for additional configuration
109817fe5393cSmrg# --enable-integration-tests: 'yes' user instructs the module to build tests
109827fe5393cSmrg#                             'no' user instructs the module not to build tests
109837fe5393cSmrg# parm1:                      specify the default value, yes or no.
10984b534f209Smrg#
109857fe5393cSmrgAC_DEFUN([XORG_ENABLE_INTEGRATION_TESTS],[
109867fe5393cSmrgAC_REQUIRE([XORG_MEMORY_CHECK_FLAGS])
109877fe5393cSmrgm4_define([_defopt], m4_default([$1], [auto]))
109887fe5393cSmrgAC_ARG_ENABLE(integration-tests, AS_HELP_STRING([--enable-integration-tests],
109897fe5393cSmrg	[Enable building integration test cases (default: ]_defopt[)]),
109907fe5393cSmrg	[enable_integration_tests=$enableval],
109917fe5393cSmrg	[enable_integration_tests=]_defopt)
109927fe5393cSmrgm4_undefine([_defopt])
109937fe5393cSmrgAM_CONDITIONAL([ENABLE_INTEGRATION_TESTS],
109947fe5393cSmrg	[test "x$enable_integration_tests" != xno])
109957fe5393cSmrgAC_MSG_CHECKING([whether to build unit test cases])
109967fe5393cSmrgAC_MSG_RESULT([$enable_integration_tests])
109977fe5393cSmrg]) # XORG_ENABLE_INTEGRATION_TESTS
10998b4d38c65Smrg
109997fe5393cSmrg# XORG_WITH_GLIB([MIN-VERSION], [DEFAULT])
110007fe5393cSmrg# ----------------------------------------
110017fe5393cSmrg# Minimum version: 1.13.0
11002b534f209Smrg#
110037fe5393cSmrg# GLib is a library which provides advanced data structures and functions.
110047fe5393cSmrg# This macro enables a module to test for the presence of Glib.
110057fe5393cSmrg#
110067fe5393cSmrg# When used with ENABLE_UNIT_TESTS, it is assumed GLib is used for unit testing.
110077fe5393cSmrg# Otherwise the value of $enable_unit_tests is blank.
110087fe5393cSmrg#
110097fe5393cSmrg# Please see XORG_ENABLE_INTEGRATION_TESTS for integration test support. Unit
110107fe5393cSmrg# test support usually requires less dependencies and may be built and run under
110117fe5393cSmrg# less stringent environments than integration tests.
110127fe5393cSmrg#
110137fe5393cSmrg# Interface to module:
110147fe5393cSmrg# HAVE_GLIB: used in makefiles to conditionally build targets
110157fe5393cSmrg# with_glib: used in configure.ac to know if GLib has been found
110167fe5393cSmrg# --with-glib:	'yes' user instructs the module to use glib
110177fe5393cSmrg#		'no' user instructs the module not to use glib
110187fe5393cSmrg#
110197fe5393cSmrgAC_DEFUN([XORG_WITH_GLIB],[
110207fe5393cSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
110217fe5393cSmrgm4_define([_defopt], m4_default([$2], [auto]))
110227fe5393cSmrgAC_ARG_WITH(glib, AS_HELP_STRING([--with-glib],
110237fe5393cSmrg	[Use GLib library for unit testing (default: ]_defopt[)]),
110247fe5393cSmrg	[with_glib=$withval], [with_glib=]_defopt)
110257fe5393cSmrgm4_undefine([_defopt])
11026b4d38c65Smrg
110277fe5393cSmrghave_glib=no
110287fe5393cSmrg# Do not probe GLib if user explicitly disabled unit testing
110297fe5393cSmrgif test "x$enable_unit_tests" != x"no"; then
110307fe5393cSmrg  # Do not probe GLib if user explicitly disabled it
110317fe5393cSmrg  if test "x$with_glib" != x"no"; then
110327fe5393cSmrg    m4_ifval(
110337fe5393cSmrg      [$1],
110347fe5393cSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0 >= $1], [have_glib=yes], [have_glib=no])],
110357fe5393cSmrg      [PKG_CHECK_MODULES([GLIB], [glib-2.0], [have_glib=yes], [have_glib=no])]
110367fe5393cSmrg    )
11037b4d38c65Smrg  fi
1103883cab373Smrgfi
1103983cab373Smrg
110407fe5393cSmrg# Not having GLib when unit testing has been explicitly requested is an error
110417fe5393cSmrgif test "x$enable_unit_tests" = x"yes"; then
110427fe5393cSmrg  if test "x$have_glib" = x"no"; then
110437fe5393cSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
11044b4d38c65Smrg  fi
11045b534f209Smrgfi
1104615fb4814Smrg
110477fe5393cSmrg# Having unit testing disabled when GLib has been explicitly requested is an error
110487fe5393cSmrgif test "x$enable_unit_tests" = x"no"; then
110497fe5393cSmrg  if test "x$with_glib" = x"yes"; then
110507fe5393cSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but glib-2.0 not found])
110517fe5393cSmrg  fi
110527fe5393cSmrgfi
11053de78e416Smrg
110547fe5393cSmrg# Not having GLib when it has been explicitly requested is an error
110557fe5393cSmrgif test "x$with_glib" = x"yes"; then
110567fe5393cSmrg  if test "x$have_glib" = x"no"; then
110577fe5393cSmrg    AC_MSG_ERROR([--with-glib=yes specified but glib-2.0 not found])
110587fe5393cSmrg  fi
110597fe5393cSmrgfi
11060de78e416Smrg
110617fe5393cSmrgAM_CONDITIONAL([HAVE_GLIB], [test "$have_glib" = yes])
110627fe5393cSmrg]) # XORG_WITH_GLIB
11063b534f209Smrg
110647fe5393cSmrg# XORG_LD_WRAP([required|optional])
110657fe5393cSmrg# ---------------------------------
110667fe5393cSmrg# Minimum version: 1.13.0
110677fe5393cSmrg#
110687fe5393cSmrg# Check if linker supports -wrap, passed via compiler flags
110697fe5393cSmrg#
110707fe5393cSmrg# When used with ENABLE_UNIT_TESTS, it is assumed -wrap is used for unit testing.
110717fe5393cSmrg# Otherwise the value of $enable_unit_tests is blank.
110727fe5393cSmrg#
110737fe5393cSmrg# Argument added in 1.16.0 - default is "required", to match existing behavior
110747fe5393cSmrg# of returning an error if enable_unit_tests is yes, and ld -wrap is not
110757fe5393cSmrg# available, an argument of "optional" allows use when some unit tests require
110767fe5393cSmrg# ld -wrap and others do not.
110777fe5393cSmrg#
110787fe5393cSmrgAC_DEFUN([XORG_LD_WRAP],[
110797fe5393cSmrgXORG_CHECK_LINKER_FLAGS([-Wl,-wrap,exit],[have_ld_wrap=yes],[have_ld_wrap=no],
110807fe5393cSmrg    [AC_LANG_PROGRAM([#include <stdlib.h>
110817fe5393cSmrg                      void __wrap_exit(int status) { return; }],
110827fe5393cSmrg                     [exit(0);])])
110837fe5393cSmrg# Not having ld wrap when unit testing has been explicitly requested is an error
110847fe5393cSmrgif test "x$enable_unit_tests" = x"yes" -a "x$1" != "xoptional"; then
110857fe5393cSmrg  if test "x$have_ld_wrap" = x"no"; then
110867fe5393cSmrg    AC_MSG_ERROR([--enable-unit-tests=yes specified but ld -wrap support is not available])
110877fe5393cSmrg  fi
110887fe5393cSmrgfi
110897fe5393cSmrgAM_CONDITIONAL([HAVE_LD_WRAP], [test "$have_ld_wrap" = yes])
110907fe5393cSmrg#
110917fe5393cSmrg]) # XORG_LD_WRAP
11092b534f209Smrg
110937fe5393cSmrg# XORG_CHECK_LINKER_FLAGS
110947fe5393cSmrg# -----------------------
110957fe5393cSmrg# SYNOPSIS
110967fe5393cSmrg#
110977fe5393cSmrg#   XORG_CHECK_LINKER_FLAGS(FLAGS, [ACTION-SUCCESS], [ACTION-FAILURE], [PROGRAM-SOURCE])
110987fe5393cSmrg#
110997fe5393cSmrg# DESCRIPTION
111007fe5393cSmrg#
111017fe5393cSmrg#   Check whether the given linker FLAGS work with the current language's
111027fe5393cSmrg#   linker, or whether they give an error.
111037fe5393cSmrg#
111047fe5393cSmrg#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
111057fe5393cSmrg#   success/failure.
111067fe5393cSmrg#
111077fe5393cSmrg#   PROGRAM-SOURCE is the program source to link with, if needed
111087fe5393cSmrg#
111097fe5393cSmrg#   NOTE: Based on AX_CHECK_COMPILER_FLAGS.
111107fe5393cSmrg#
111117fe5393cSmrg# LICENSE
111127fe5393cSmrg#
111137fe5393cSmrg#   Copyright (c) 2009 Mike Frysinger <vapier@gentoo.org>
111147fe5393cSmrg#   Copyright (c) 2009 Steven G. Johnson <stevenj@alum.mit.edu>
111157fe5393cSmrg#   Copyright (c) 2009 Matteo Frigo
11116b4d38c65Smrg#
111177fe5393cSmrg#   This program is free software: you can redistribute it and/or modify it
111187fe5393cSmrg#   under the terms of the GNU General Public License as published by the
111197fe5393cSmrg#   Free Software Foundation, either version 3 of the License, or (at your
111207fe5393cSmrg#   option) any later version.
111217fe5393cSmrg#
111227fe5393cSmrg#   This program is distributed in the hope that it will be useful, but
111237fe5393cSmrg#   WITHOUT ANY WARRANTY; without even the implied warranty of
111247fe5393cSmrg#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
111257fe5393cSmrg#   Public License for more details.
111267fe5393cSmrg#
111277fe5393cSmrg#   You should have received a copy of the GNU General Public License along
111287fe5393cSmrg#   with this program. If not, see <http://www.gnu.org/licenses/>.
111297fe5393cSmrg#
111307fe5393cSmrg#   As a special exception, the respective Autoconf Macro's copyright owner
111317fe5393cSmrg#   gives unlimited permission to copy, distribute and modify the configure
111327fe5393cSmrg#   scripts that are the output of Autoconf when processing the Macro. You
111337fe5393cSmrg#   need not follow the terms of the GNU General Public License when using
111347fe5393cSmrg#   or distributing such scripts, even though portions of the text of the
111357fe5393cSmrg#   Macro appear in them. The GNU General Public License (GPL) does govern
111367fe5393cSmrg#   all other use of the material that constitutes the Autoconf Macro.
111377fe5393cSmrg#
111387fe5393cSmrg#   This special exception to the GPL applies to versions of the Autoconf
111397fe5393cSmrg#   Macro released by the Autoconf Archive. When you make and distribute a
111407fe5393cSmrg#   modified version of the Autoconf Macro, you may extend this special
111417fe5393cSmrg#   exception to the GPL to apply to your modified version as well.#
111427fe5393cSmrgAC_DEFUN([XORG_CHECK_LINKER_FLAGS],
111437fe5393cSmrg[AC_MSG_CHECKING([whether the linker accepts $1])
111447fe5393cSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname:
111457fe5393cSmrgAS_LITERAL_IF([$1],
111467fe5393cSmrg  [AC_CACHE_VAL(AS_TR_SH(xorg_cv_linker_flags_[$1]), [
111477fe5393cSmrg      ax_save_FLAGS=$LDFLAGS
111487fe5393cSmrg      LDFLAGS="$1"
111497fe5393cSmrg      AC_LINK_IFELSE([m4_default([$4],[AC_LANG_PROGRAM()])],
111507fe5393cSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
111517fe5393cSmrg        AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
111527fe5393cSmrg      LDFLAGS=$ax_save_FLAGS])],
111537fe5393cSmrg  [ax_save_FLAGS=$LDFLAGS
111547fe5393cSmrg   LDFLAGS="$1"
111557fe5393cSmrg   AC_LINK_IFELSE([AC_LANG_PROGRAM()],
111567fe5393cSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=yes,
111577fe5393cSmrg     eval AS_TR_SH(xorg_cv_linker_flags_[$1])=no)
111587fe5393cSmrg   LDFLAGS=$ax_save_FLAGS])
111597fe5393cSmrgeval xorg_check_linker_flags=$AS_TR_SH(xorg_cv_linker_flags_[$1])
111607fe5393cSmrgAC_MSG_RESULT($xorg_check_linker_flags)
111617fe5393cSmrgif test "x$xorg_check_linker_flags" = xyes; then
111627fe5393cSmrg	m4_default([$2], :)
111637fe5393cSmrgelse
111647fe5393cSmrg	m4_default([$3], :)
11165b534f209Smrgfi
111667fe5393cSmrg]) # XORG_CHECK_LINKER_FLAGS
1116715fb4814Smrg
111687fe5393cSmrg# XORG_MEMORY_CHECK_FLAGS
111697fe5393cSmrg# -----------------------
111707fe5393cSmrg# Minimum version: 1.16.0
11171b4d38c65Smrg#
111727fe5393cSmrg# This macro attempts to find appropriate memory checking functionality
111737fe5393cSmrg# for various platforms which unit testing code may use to catch various
111747fe5393cSmrg# forms of memory allocation and access errors in testing.
111757fe5393cSmrg#
111767fe5393cSmrg# Interface to module:
111777fe5393cSmrg# XORG_MALLOC_DEBUG_ENV - environment variables to set to enable debugging
111787fe5393cSmrg#                         Usually added to TESTS_ENVIRONMENT in Makefile.am
111797fe5393cSmrg#
111807fe5393cSmrg# If the user sets the value of XORG_MALLOC_DEBUG_ENV, it is used verbatim.
111817fe5393cSmrg#
111827fe5393cSmrgAC_DEFUN([XORG_MEMORY_CHECK_FLAGS],[
11183b4d38c65Smrg
111847fe5393cSmrgAC_REQUIRE([AC_CANONICAL_HOST])
111857fe5393cSmrgAC_ARG_VAR([XORG_MALLOC_DEBUG_ENV],
111867fe5393cSmrg           [Environment variables to enable memory checking in tests])
11187b4d38c65Smrg
111887fe5393cSmrg# Check for different types of support on different platforms
111897fe5393cSmrgcase $host_os in
111907fe5393cSmrg    solaris*)
111917fe5393cSmrg        AC_CHECK_LIB([umem], [umem_alloc],
111927fe5393cSmrg            [malloc_debug_env='LD_PRELOAD=libumem.so UMEM_DEBUG=default'])
111937fe5393cSmrg        ;;
111947fe5393cSmrg    *-gnu*) # GNU libc - Value is used as a single byte bit pattern,
111957fe5393cSmrg        # both directly and inverted, so should not be 0 or 255.
111967fe5393cSmrg        malloc_debug_env='MALLOC_PERTURB_=15'
111977fe5393cSmrg        ;;
111987fe5393cSmrg    darwin*)
111997fe5393cSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1 DYLD_INSERT_LIBRARIES=/usr/lib/libgmalloc.dylib'
112007fe5393cSmrg        ;;
112017fe5393cSmrg    *bsd*)
112027fe5393cSmrg        malloc_debug_env='MallocPreScribble=1 MallocScribble=1'
112037fe5393cSmrg        ;;
112047fe5393cSmrgesac
112057fe5393cSmrg
112067fe5393cSmrg# User supplied flags override default flags
112077fe5393cSmrgif test "x$XORG_MALLOC_DEBUG_ENV" != "x"; then
112087fe5393cSmrg    malloc_debug_env="$XORG_MALLOC_DEBUG_ENV"
11209b534f209Smrgfi
1121015fb4814Smrg
112117fe5393cSmrgAC_SUBST([XORG_MALLOC_DEBUG_ENV],[$malloc_debug_env])
112127fe5393cSmrg]) # XORG_WITH_LINT
1121315fb4814Smrg
112147fe5393cSmrg# XORG_CHECK_MALLOC_ZERO
112157fe5393cSmrg# ----------------------
112167fe5393cSmrg# Minimum version: 1.0.0
11217b534f209Smrg#
112187fe5393cSmrg# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
112197fe5393cSmrg# malloc(0) returns NULL.  Packages should add one of these cflags to
112207fe5393cSmrg# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
112217fe5393cSmrgAC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
112227fe5393cSmrgAC_ARG_ENABLE(malloc0returnsnull,
112237fe5393cSmrg	AS_HELP_STRING([--enable-malloc0returnsnull],
112247fe5393cSmrg		       [malloc(0) returns NULL (default: auto)]),
112257fe5393cSmrg	[MALLOC_ZERO_RETURNS_NULL=$enableval],
112267fe5393cSmrg	[MALLOC_ZERO_RETURNS_NULL=auto])
11227b4d38c65Smrg
112287fe5393cSmrgAC_MSG_CHECKING([whether malloc(0) returns NULL])
112297fe5393cSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
11230cf503b78SmrgAC_CACHE_VAL([xorg_cv_malloc0_returns_null],
11231cf503b78Smrg	[AC_RUN_IFELSE([AC_LANG_PROGRAM([
112327fe5393cSmrg#include <stdlib.h>
112337fe5393cSmrg],[
112347fe5393cSmrg    char *m0, *r0, *c0, *p;
112357fe5393cSmrg    m0 = malloc(0);
112367fe5393cSmrg    p = malloc(10);
112377fe5393cSmrg    r0 = realloc(p,0);
112387fe5393cSmrg    c0 = calloc(0,10);
112397fe5393cSmrg    exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
112407fe5393cSmrg])],
11241cf503b78Smrg		[xorg_cv_malloc0_returns_null=yes],
11242cf503b78Smrg		[xorg_cv_malloc0_returns_null=no])])
11243cf503b78SmrgMALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
112447fe5393cSmrgfi
112457fe5393cSmrgAC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
11246b4d38c65Smrg
112477fe5393cSmrgif test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
112487fe5393cSmrg	MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
112497fe5393cSmrg	XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
112507fe5393cSmrg	XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
112517fe5393cSmrgelse
112527fe5393cSmrg	MALLOC_ZERO_CFLAGS=""
112537fe5393cSmrg	XMALLOC_ZERO_CFLAGS=""
112547fe5393cSmrg	XTMALLOC_ZERO_CFLAGS=""
112557fe5393cSmrgfi
11256b4d38c65Smrg
112577fe5393cSmrgAC_SUBST([MALLOC_ZERO_CFLAGS])
112587fe5393cSmrgAC_SUBST([XMALLOC_ZERO_CFLAGS])
112597fe5393cSmrgAC_SUBST([XTMALLOC_ZERO_CFLAGS])
112607fe5393cSmrg]) # XORG_CHECK_MALLOC_ZERO
11261b4d38c65Smrg
112627fe5393cSmrg# XORG_WITH_LINT()
112637fe5393cSmrg# ----------------
112647fe5393cSmrg# Minimum version: 1.1.0
11265b534f209Smrg#
112667fe5393cSmrg# This macro enables the use of a tool that flags some suspicious and
112677fe5393cSmrg# non-portable constructs (likely to be bugs) in C language source code.
112687fe5393cSmrg# It will attempt to locate the tool and use appropriate options.
112697fe5393cSmrg# There are various lint type tools on different platforms.
112707fe5393cSmrg#
112717fe5393cSmrg# Interface to module:
112727fe5393cSmrg# LINT:		returns the path to the tool found on the platform
112737fe5393cSmrg#		or the value set to LINT on the configure cmd line
112747fe5393cSmrg#		also an Automake conditional
112757fe5393cSmrg# LINT_FLAGS:	an Automake variable with appropriate flags
112767fe5393cSmrg#
112777fe5393cSmrg# --with-lint:	'yes' user instructs the module to use lint
112787fe5393cSmrg#		'no' user instructs the module not to use lint (default)
112797fe5393cSmrg#
112807fe5393cSmrg# If the user sets the value of LINT, AC_PATH_PROG skips testing the path.
112817fe5393cSmrg# If the user sets the value of LINT_FLAGS, they are used verbatim.
112827fe5393cSmrg#
112837fe5393cSmrgAC_DEFUN([XORG_WITH_LINT],[
11284b4d38c65Smrg
112857fe5393cSmrgAC_ARG_VAR([LINT], [Path to a lint-style command])
112867fe5393cSmrgAC_ARG_VAR([LINT_FLAGS], [Flags for the lint-style command])
112877fe5393cSmrgAC_ARG_WITH(lint, [AS_HELP_STRING([--with-lint],
112887fe5393cSmrg		[Use a lint-style source code checker (default: disabled)])],
112897fe5393cSmrg		[use_lint=$withval], [use_lint=no])
112907fe5393cSmrg
112917fe5393cSmrg# Obtain platform specific info like program name and options
112927fe5393cSmrg# The lint program on FreeBSD and NetBSD is different from the one on Solaris
112937fe5393cSmrgcase $host_os in
112947fe5393cSmrg  *linux* | *openbsd* | kfreebsd*-gnu | darwin* | cygwin*)
112957fe5393cSmrg	lint_name=splint
112967fe5393cSmrg	lint_options="-badflag"
112977fe5393cSmrg	;;
112987fe5393cSmrg  *freebsd* | *netbsd*)
112997fe5393cSmrg	lint_name=lint
113007fe5393cSmrg	lint_options="-u -b"
113017fe5393cSmrg	;;
113027fe5393cSmrg  *solaris*)
113037fe5393cSmrg	lint_name=lint
113047fe5393cSmrg	lint_options="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
113057fe5393cSmrg	;;
11306b4d38c65Smrgesac
113077fe5393cSmrg
113087fe5393cSmrg# Test for the presence of the program (either guessed by the code or spelled out by the user)
113097fe5393cSmrgif test "x$use_lint" = x"yes" ; then
113107fe5393cSmrg   AC_PATH_PROG([LINT], [$lint_name])
113117fe5393cSmrg   if test "x$LINT" = "x"; then
113127fe5393cSmrg        AC_MSG_ERROR([--with-lint=yes specified but lint-style tool not found in PATH])
113137fe5393cSmrg   fi
113147fe5393cSmrgelif test "x$use_lint" = x"no" ; then
113157fe5393cSmrg   if test "x$LINT" != "x"; then
113167fe5393cSmrg      AC_MSG_WARN([ignoring LINT environment variable since --with-lint=no was specified])
113177fe5393cSmrg   fi
113187fe5393cSmrgelse
113197fe5393cSmrg   AC_MSG_ERROR([--with-lint expects 'yes' or 'no'. Use LINT variable to specify path.])
11320b534f209Smrgfi
1132115fb4814Smrg
113227fe5393cSmrg# User supplied flags override default flags
113237fe5393cSmrgif test "x$LINT_FLAGS" != "x"; then
113247fe5393cSmrg   lint_options=$LINT_FLAGS
113257fe5393cSmrgfi
11326b4d38c65Smrg
113277fe5393cSmrgAC_SUBST([LINT_FLAGS],[$lint_options])
113287fe5393cSmrgAM_CONDITIONAL(LINT, [test "x$LINT" != x])
11329b4d38c65Smrg
113307fe5393cSmrg]) # XORG_WITH_LINT
11331b4d38c65Smrg
113327fe5393cSmrg# XORG_LINT_LIBRARY(LIBNAME)
113337fe5393cSmrg# --------------------------
113347fe5393cSmrg# Minimum version: 1.1.0
113357fe5393cSmrg#
113367fe5393cSmrg# Sets up flags for building lint libraries for checking programs that call
113377fe5393cSmrg# functions in the library.
113387fe5393cSmrg#
113397fe5393cSmrg# Interface to module:
113407fe5393cSmrg# LINTLIB		- Automake variable with the name of lint library file to make
113417fe5393cSmrg# MAKE_LINT_LIB		- Automake conditional
113427fe5393cSmrg#
113437fe5393cSmrg# --enable-lint-library:  - 'yes' user instructs the module to created a lint library
113447fe5393cSmrg#			  - 'no' user instructs the module not to create a lint library (default)
11345b4d38c65Smrg
113467fe5393cSmrgAC_DEFUN([XORG_LINT_LIBRARY],[
113477fe5393cSmrgAC_REQUIRE([XORG_WITH_LINT])
113487fe5393cSmrgAC_ARG_ENABLE(lint-library, [AS_HELP_STRING([--enable-lint-library],
113497fe5393cSmrg	[Create lint library (default: disabled)])],
113507fe5393cSmrg	[make_lint_lib=$enableval], [make_lint_lib=no])
11351b4d38c65Smrg
113527fe5393cSmrgif test "x$make_lint_lib" = x"yes" ; then
113537fe5393cSmrg   LINTLIB=llib-l$1.ln
113547fe5393cSmrg   if test "x$LINT" = "x"; then
113557fe5393cSmrg        AC_MSG_ERROR([Cannot make lint library without --with-lint])
113567fe5393cSmrg   fi
113577fe5393cSmrgelif test "x$make_lint_lib" != x"no" ; then
113587fe5393cSmrg   AC_MSG_ERROR([--enable-lint-library expects 'yes' or 'no'.])
11359b534f209Smrgfi
11360b4d38c65Smrg
113617fe5393cSmrgAC_SUBST(LINTLIB)
113627fe5393cSmrgAM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
11363b4d38c65Smrg
113647fe5393cSmrg]) # XORG_LINT_LIBRARY
11365b4d38c65Smrg
113667fe5393cSmrg# XORG_COMPILER_BRAND
113677fe5393cSmrg# -------------------
113687fe5393cSmrg# Minimum version: 1.14.0
113697fe5393cSmrg#
113707fe5393cSmrg# Checks for various brands of compilers and sets flags as appropriate:
113717fe5393cSmrg#   GNU gcc - relies on AC_PROG_CC (via AC_PROG_CC_C99) to set GCC to "yes"
113727fe5393cSmrg#   GNU g++ - relies on AC_PROG_CXX to set GXX to "yes"
113737fe5393cSmrg#   clang compiler - sets CLANGCC to "yes"
113747fe5393cSmrg#   Intel compiler - sets INTELCC to "yes"
113757fe5393cSmrg#   Sun/Oracle Solaris Studio cc - sets SUNCC to "yes"
113767fe5393cSmrg#
113777fe5393cSmrgAC_DEFUN([XORG_COMPILER_BRAND], [
113787fe5393cSmrgAC_LANG_CASE(
113797fe5393cSmrg	[C], [
113807fe5393cSmrg		AC_REQUIRE([AC_PROG_CC_C99])
113817fe5393cSmrg	],
113827fe5393cSmrg	[C++], [
113837fe5393cSmrg		AC_REQUIRE([AC_PROG_CXX])
113847fe5393cSmrg	]
113857fe5393cSmrg)
113867fe5393cSmrgAC_CHECK_DECL([__clang__], [CLANGCC="yes"], [CLANGCC="no"])
113877fe5393cSmrgAC_CHECK_DECL([__INTEL_COMPILER], [INTELCC="yes"], [INTELCC="no"])
113887fe5393cSmrgAC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
113897fe5393cSmrg]) # XORG_COMPILER_BRAND
113907fe5393cSmrg
113917fe5393cSmrg# XORG_TESTSET_CFLAG(<variable>, <flag>, [<alternative flag>, ...])
11392b4d38c65Smrg# ---------------
113937fe5393cSmrg# Minimum version: 1.16.0
113947fe5393cSmrg#
113957fe5393cSmrg# Test if the compiler works when passed the given flag as a command line argument.
113967fe5393cSmrg# If it succeeds, the flag is appeneded to the given variable.  If not, it tries the
113977fe5393cSmrg# next flag in the list until there are no more options.
113987fe5393cSmrg#
113997fe5393cSmrg# Note that this does not guarantee that the compiler supports the flag as some
114007fe5393cSmrg# compilers will simply ignore arguments that they do not understand, but we do
114017fe5393cSmrg# attempt to weed out false positives by using -Werror=unknown-warning-option and
114027fe5393cSmrg# -Werror=unused-command-line-argument
114037fe5393cSmrg#
114047fe5393cSmrgAC_DEFUN([XORG_TESTSET_CFLAG], [
114057fe5393cSmrgm4_if([$#], 0, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
114067fe5393cSmrgm4_if([$#], 1, [m4_fatal([XORG_TESTSET_CFLAG was given with an unsupported number of arguments])])
11407b4d38c65Smrg
114087fe5393cSmrgAC_LANG_COMPILER_REQUIRE
1140915fb4814Smrg
114107fe5393cSmrgAC_LANG_CASE(
114117fe5393cSmrg	[C], [
114127fe5393cSmrg		AC_REQUIRE([AC_PROG_CC_C99])
114137fe5393cSmrg		define([PREFIX], [C])
114147fe5393cSmrg		define([CACHE_PREFIX], [cc])
114157fe5393cSmrg		define([COMPILER], [$CC])
114167fe5393cSmrg	],
114177fe5393cSmrg	[C++], [
114187fe5393cSmrg		define([PREFIX], [CXX])
114197fe5393cSmrg		define([CACHE_PREFIX], [cxx])
114207fe5393cSmrg		define([COMPILER], [$CXX])
114217fe5393cSmrg	]
114227fe5393cSmrg)
1142315fb4814Smrg
114247fe5393cSmrg[xorg_testset_save_]PREFIX[FLAGS]="$PREFIX[FLAGS]"
1142515fb4814Smrg
114267fe5393cSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "x" ; then
114277fe5393cSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
114287fe5393cSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unknown-warning-option],
114297fe5393cSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option],
114307fe5393cSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
114317fe5393cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=yes],
114327fe5393cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option=no]))
114337fe5393cSmrg	[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]=$[xorg_cv_]CACHE_PREFIX[_flag_unknown_warning_option]
114347fe5393cSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
114357fe5393cSmrgfi
1143615fb4814Smrg
114377fe5393cSmrgif test "x$[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]" = "x" ; then
114387fe5393cSmrg	if test "x$[xorg_testset_]CACHE_PREFIX[_unknown_warning_option]" = "xyes" ; then
114397fe5393cSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
114407fe5393cSmrg	fi
114417fe5393cSmrg	PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
114427fe5393cSmrg	AC_CACHE_CHECK([if ]COMPILER[ supports -Werror=unused-command-line-argument],
114437fe5393cSmrg			[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument],
114447fe5393cSmrg			AC_COMPILE_IFELSE([AC_LANG_SOURCE([int i;])],
114457fe5393cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=yes],
114467fe5393cSmrg					  [xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument=no]))
114477fe5393cSmrg	[xorg_testset_]CACHE_PREFIX[_unused_command_line_argument]=$[xorg_cv_]CACHE_PREFIX[_flag_unused_command_line_argument]
114487fe5393cSmrg	PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
114497fe5393cSmrgfi
1145015fb4814Smrg
114517fe5393cSmrgfound="no"
114527fe5393cSmrgm4_foreach([flag], m4_cdr($@), [
114537fe5393cSmrg	if test $found = "no" ; then
11454cf503b78Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then
114557fe5393cSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option"
114567fe5393cSmrg		fi
11457b4d38c65Smrg
11458cf503b78Smrg		if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then
114597fe5393cSmrg			PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument"
114607fe5393cSmrg		fi
11461b4d38c65Smrg
114627fe5393cSmrg		PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag["
114637fe5393cSmrg
114647fe5393cSmrgdnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname
114657fe5393cSmrg		AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[])
114667fe5393cSmrg		cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[])
114677fe5393cSmrg		AC_CACHE_VAL($cacheid,
114687fe5393cSmrg			     [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])],
114697fe5393cSmrg					     [eval $cacheid=yes],
114707fe5393cSmrg					     [eval $cacheid=no])])
11471b4d38c65Smrg
114727fe5393cSmrg		PREFIX[FLAGS]="$[xorg_testset_save_]PREFIX[FLAGS]"
11473de78e416Smrg
114747fe5393cSmrg		eval supported=\$$cacheid
114757fe5393cSmrg		AC_MSG_RESULT([$supported])
114767fe5393cSmrg		if test "$supported" = "yes" ; then
114777fe5393cSmrg			$1="$$1 ]flag["
114787fe5393cSmrg			found="yes"
114797fe5393cSmrg		fi
114807fe5393cSmrg	fi
114817fe5393cSmrg])
114827fe5393cSmrg]) # XORG_TESTSET_CFLAG
1148315fb4814Smrg
114847fe5393cSmrg# XORG_COMPILER_FLAGS
11485b4d38c65Smrg# ---------------
114867fe5393cSmrg# Minimum version: 1.16.0
114877fe5393cSmrg#
114887fe5393cSmrg# Defines BASE_CFLAGS or BASE_CXXFLAGS to contain a set of command line
114897fe5393cSmrg# arguments supported by the selected compiler which do NOT alter the generated
114907fe5393cSmrg# code.  These arguments will cause the compiler to print various warnings
114917fe5393cSmrg# during compilation AND turn a conservative set of warnings into errors.
114927fe5393cSmrg#
114937fe5393cSmrg# The set of flags supported by BASE_CFLAGS and BASE_CXXFLAGS will grow in
114947fe5393cSmrg# future versions of util-macros as options are added to new compilers.
114957fe5393cSmrg#
114967fe5393cSmrgAC_DEFUN([XORG_COMPILER_FLAGS], [
114977fe5393cSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
11498b4d38c65Smrg
114997fe5393cSmrgAC_ARG_ENABLE(selective-werror,
115007fe5393cSmrg              AS_HELP_STRING([--disable-selective-werror],
115017fe5393cSmrg                             [Turn off selective compiler errors. (default: enabled)]),
115027fe5393cSmrg              [SELECTIVE_WERROR=$enableval],
115037fe5393cSmrg              [SELECTIVE_WERROR=yes])
1150483cab373Smrg
115057fe5393cSmrgAC_LANG_CASE(
115067fe5393cSmrg        [C], [
115077fe5393cSmrg                define([PREFIX], [C])
115087fe5393cSmrg        ],
115097fe5393cSmrg        [C++], [
115107fe5393cSmrg                define([PREFIX], [CXX])
115117fe5393cSmrg        ]
115127fe5393cSmrg)
115137fe5393cSmrg# -v is too short to test reliably with XORG_TESTSET_CFLAG
115147fe5393cSmrgif test "x$SUNCC" = "xyes"; then
115157fe5393cSmrg    [BASE_]PREFIX[FLAGS]="-v"
11516b4d38c65Smrgelse
115177fe5393cSmrg    [BASE_]PREFIX[FLAGS]=""
11518b534f209Smrgfi
11519b410ddbeSmrg
115207fe5393cSmrg# This chunk of warnings were those that existed in the legacy CWARNFLAGS
115217fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wall])
115227fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-arith])
115237fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-declarations])
115247fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wformat=2], [-Wformat])
1152583cab373Smrg
115267fe5393cSmrgAC_LANG_CASE(
115277fe5393cSmrg	[C], [
115287fe5393cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wstrict-prototypes])
115297fe5393cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
115307fe5393cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
115317fe5393cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast])
11532cf503b78Smrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd])
115337fe5393cSmrg		XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
115347fe5393cSmrg	]
115357fe5393cSmrg)
11536b534f209Smrg
115377fe5393cSmrg# This chunk adds additional warnings that could catch undesired effects.
115387fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
115397fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
115407fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow])
115417fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn])
115427fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute])
115437fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls])
11544cf503b78SmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op])
1154515fb4814Smrg
115467fe5393cSmrg# These are currently disabled because they are noisy.  They will be enabled
115477fe5393cSmrg# in the future once the codebase is sufficiently modernized to silence
115487fe5393cSmrg# them.  For now, I don't want them to drown out the other warnings.
115497fe5393cSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses])
115507fe5393cSmrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align])
11551cf503b78Smrg# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual])
11552b534f209Smrg
115537fe5393cSmrg# Turn some warnings into errors, so we don't accidently get successful builds
115547fe5393cSmrg# when there are problems that should be fixed.
11555b4d38c65Smrg
115567fe5393cSmrgif test "x$SELECTIVE_WERROR" = "xyes" ; then
115577fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=implicit], [-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED])
115587fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=nonnull])
115597fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=init-self])
115607fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=main])
115617fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=missing-braces])
115627fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=sequence-point])
115637fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=return-type], [-errwarn=E_FUNC_HAS_NO_RETURN_STMT])
115647fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=trigraphs])
115657fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=array-bounds])
115667fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=write-strings])
115677fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=address])
115687fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=int-to-pointer-cast], [-errwarn=E_BAD_PTR_INT_COMBINATION])
115697fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Werror=pointer-to-int-cast]) # Also -errwarn=E_BAD_PTR_INT_COMBINATION
115707fe5393cSmrgelse
115717fe5393cSmrgAC_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])
115727fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wimplicit])
115737fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnonnull])
115747fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Winit-self])
115757fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmain])
115767fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-braces])
115777fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wsequence-point])
115787fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wreturn-type])
115797fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wtrigraphs])
115807fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Warray-bounds])
115817fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wwrite-strings])
115827fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Waddress])
115837fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wint-to-pointer-cast])
115847fe5393cSmrgXORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wpointer-to-int-cast])
11585b534f209Smrgfi
11586b534f209Smrg
115877fe5393cSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
115887fe5393cSmrg]) # XORG_COMPILER_FLAGS
115897fe5393cSmrg
115907fe5393cSmrg# XORG_CWARNFLAGS
115917fe5393cSmrg# ---------------
115927fe5393cSmrg# Minimum version: 1.2.0
115937fe5393cSmrg# Deprecated since: 1.16.0 (Use XORG_COMPILER_FLAGS instead)
11594b534f209Smrg#
115957fe5393cSmrg# Defines CWARNFLAGS to enable C compiler warnings.
115967fe5393cSmrg#
115977fe5393cSmrg# This function is deprecated because it defines -fno-strict-aliasing
115987fe5393cSmrg# which alters the code generated by the compiler.  If -fno-strict-aliasing
115997fe5393cSmrg# is needed, then it should be added explicitly in the module when
116007fe5393cSmrg# it is updated to use BASE_CFLAGS.
116017fe5393cSmrg#
116027fe5393cSmrgAC_DEFUN([XORG_CWARNFLAGS], [
116037fe5393cSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
116047fe5393cSmrgAC_REQUIRE([XORG_COMPILER_BRAND])
116057fe5393cSmrgAC_LANG_CASE(
116067fe5393cSmrg	[C], [
116077fe5393cSmrg		CWARNFLAGS="$BASE_CFLAGS"
116087fe5393cSmrg		if  test "x$GCC" = xyes ; then
116097fe5393cSmrg		    CWARNFLAGS="$CWARNFLAGS -fno-strict-aliasing"
116107fe5393cSmrg		fi
116117fe5393cSmrg		AC_SUBST(CWARNFLAGS)
116127fe5393cSmrg	]
116137fe5393cSmrg)
116147fe5393cSmrg]) # XORG_CWARNFLAGS
116157fe5393cSmrg
116167fe5393cSmrg# XORG_STRICT_OPTION
116177fe5393cSmrg# -----------------------
116187fe5393cSmrg# Minimum version: 1.3.0
116197fe5393cSmrg#
116207fe5393cSmrg# Add configure option to enable strict compilation flags, such as treating
116217fe5393cSmrg# warnings as fatal errors.
116227fe5393cSmrg# If --enable-strict-compilation is passed to configure, adds strict flags to
116237fe5393cSmrg# $BASE_CFLAGS or $BASE_CXXFLAGS and the deprecated $CWARNFLAGS.
116247fe5393cSmrg#
116257fe5393cSmrg# Starting in 1.14.0 also exports $STRICT_CFLAGS for use in other tests or
116267fe5393cSmrg# when strict compilation is unconditionally desired.
116277fe5393cSmrgAC_DEFUN([XORG_STRICT_OPTION], [
116287fe5393cSmrgAC_REQUIRE([XORG_CWARNFLAGS])
116297fe5393cSmrgAC_REQUIRE([XORG_COMPILER_FLAGS])
1163015fb4814Smrg
116317fe5393cSmrgAC_ARG_ENABLE(strict-compilation,
116327fe5393cSmrg			  AS_HELP_STRING([--enable-strict-compilation],
116337fe5393cSmrg			  [Enable all warnings from compiler and make them errors (default: disabled)]),
116347fe5393cSmrg			  [STRICT_COMPILE=$enableval], [STRICT_COMPILE=no])
1163515fb4814Smrg
116367fe5393cSmrgAC_LANG_CASE(
116377fe5393cSmrg        [C], [
116387fe5393cSmrg                define([PREFIX], [C])
116397fe5393cSmrg        ],
116407fe5393cSmrg        [C++], [
116417fe5393cSmrg                define([PREFIX], [CXX])
116427fe5393cSmrg        ]
116437fe5393cSmrg)
1164415fb4814Smrg
116457fe5393cSmrg[STRICT_]PREFIX[FLAGS]=""
116467fe5393cSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-pedantic])
116477fe5393cSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror], [-errwarn])
11648de78e416Smrg
116497fe5393cSmrg# Earlier versions of gcc (eg: 4.2) support -Werror=attributes, but do not
116507fe5393cSmrg# activate it with -Werror, so we add it here explicitly.
116517fe5393cSmrgXORG_TESTSET_CFLAG([[STRICT_]PREFIX[FLAGS]], [-Werror=attributes])
116527fe5393cSmrg
116537fe5393cSmrgif test "x$STRICT_COMPILE" = "xyes"; then
116547fe5393cSmrg    [BASE_]PREFIX[FLAGS]="$[BASE_]PREFIX[FLAGS] $[STRICT_]PREFIX[FLAGS]"
116557fe5393cSmrg    AC_LANG_CASE([C], [CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"])
116567fe5393cSmrgfi
116577fe5393cSmrgAC_SUBST([STRICT_]PREFIX[FLAGS])
116587fe5393cSmrgAC_SUBST([BASE_]PREFIX[FLAGS])
116597fe5393cSmrgAC_LANG_CASE([C], AC_SUBST([CWARNFLAGS]))
116607fe5393cSmrg]) # XORG_STRICT_OPTION
11661b534f209Smrg
116627fe5393cSmrg# XORG_DEFAULT_OPTIONS
116637fe5393cSmrg# --------------------
116647fe5393cSmrg# Minimum version: 1.3.0
1166515fb4814Smrg#
116667fe5393cSmrg# Defines default options for X.Org modules.
116677fe5393cSmrg#
116687fe5393cSmrgAC_DEFUN([XORG_DEFAULT_OPTIONS], [
116697fe5393cSmrgAC_REQUIRE([AC_PROG_INSTALL])
116707fe5393cSmrgXORG_COMPILER_FLAGS
116717fe5393cSmrgXORG_CWARNFLAGS
116727fe5393cSmrgXORG_STRICT_OPTION
116737fe5393cSmrgXORG_RELEASE_VERSION
116747fe5393cSmrgXORG_CHANGELOG
116757fe5393cSmrgXORG_INSTALL
116767fe5393cSmrgXORG_MANPAGE_SECTIONS
116777fe5393cSmrgm4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
116787fe5393cSmrg    [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
116797fe5393cSmrg]) # XORG_DEFAULT_OPTIONS
11680b4d38c65Smrg
116817fe5393cSmrg# XORG_INSTALL()
116827fe5393cSmrg# ----------------
116837fe5393cSmrg# Minimum version: 1.4.0
116847fe5393cSmrg#
116857fe5393cSmrg# Defines the variable INSTALL_CMD as the command to copy
116867fe5393cSmrg# INSTALL from $prefix/share/util-macros.
116877fe5393cSmrg#
116887fe5393cSmrgAC_DEFUN([XORG_INSTALL], [
116897fe5393cSmrgAC_REQUIRE([PKG_PROG_PKG_CONFIG])
116907fe5393cSmrgmacros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
116917fe5393cSmrgINSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
116927fe5393cSmrgmv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
116937fe5393cSmrg|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
116947fe5393cSmrgecho 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
116957fe5393cSmrgAC_SUBST([INSTALL_CMD])
116967fe5393cSmrg]) # XORG_INSTALL
116977fe5393cSmrgdnl Copyright 2005 Red Hat, Inc
116987fe5393cSmrgdnl
116997fe5393cSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
117007fe5393cSmrgdnl documentation for any purpose is hereby granted without fee, provided that
117017fe5393cSmrgdnl the above copyright notice appear in all copies and that both that
117027fe5393cSmrgdnl copyright notice and this permission notice appear in supporting
117037fe5393cSmrgdnl documentation.
117047fe5393cSmrgdnl
117057fe5393cSmrgdnl The above copyright notice and this permission notice shall be included
117067fe5393cSmrgdnl in all copies or substantial portions of the Software.
117077fe5393cSmrgdnl
117087fe5393cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
117097fe5393cSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
117107fe5393cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
117117fe5393cSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
117127fe5393cSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
117137fe5393cSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
117147fe5393cSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
117157fe5393cSmrgdnl
117167fe5393cSmrgdnl Except as contained in this notice, the name of the copyright holders shall
117177fe5393cSmrgdnl not be used in advertising or otherwise to promote the sale, use or
117187fe5393cSmrgdnl other dealings in this Software without prior written authorization
117197fe5393cSmrgdnl from the copyright holders.
117207fe5393cSmrgdnl
11721b4d38c65Smrg
117227fe5393cSmrg# XORG_RELEASE_VERSION
11723b4d38c65Smrg# --------------------
117247fe5393cSmrg# Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use.
11725cf503b78Smrg
117267fe5393cSmrgAC_DEFUN([XORG_RELEASE_VERSION],[
117277fe5393cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR],
117287fe5393cSmrg		[`echo $PACKAGE_VERSION | cut -d . -f 1`],
117297fe5393cSmrg		[Major version of this package])
117307fe5393cSmrg	PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
117317fe5393cSmrg	if test "x$PVM" = "x"; then
117327fe5393cSmrg		PVM="0"
117337fe5393cSmrg	fi
117347fe5393cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR],
117357fe5393cSmrg		[$PVM],
117367fe5393cSmrg		[Minor version of this package])
117377fe5393cSmrg	PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
117387fe5393cSmrg	if test "x$PVP" = "x"; then
117397fe5393cSmrg		PVP="0"
117407fe5393cSmrg	fi
117417fe5393cSmrg	AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL],
117427fe5393cSmrg		[$PVP],
117437fe5393cSmrg		[Patch version of this package])
117447fe5393cSmrg])
117457fe5393cSmrg
117467fe5393cSmrg# XORG_CHANGELOG()
117477fe5393cSmrg# ----------------
117487fe5393cSmrg# Minimum version: 1.2.0
11749de78e416Smrg#
117507fe5393cSmrg# Defines the variable CHANGELOG_CMD as the command to generate
117517fe5393cSmrg# ChangeLog from git.
11752b534f209Smrg#
117537fe5393cSmrg#
117547fe5393cSmrgAC_DEFUN([XORG_CHANGELOG], [
117557fe5393cSmrgCHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
117567fe5393cSmrgmv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
117577fe5393cSmrg|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
117587fe5393cSmrgecho 'git directory not found: installing possibly empty changelog.' >&2)"
117597fe5393cSmrgAC_SUBST([CHANGELOG_CMD])
117607fe5393cSmrg]) # XORG_CHANGELOG
1176183cab373Smrg
117627fe5393cSmrgdnl Copyright 2005 Red Hat, Inc
117637fe5393cSmrgdnl 
117647fe5393cSmrgdnl Permission to use, copy, modify, distribute, and sell this software and its
117657fe5393cSmrgdnl documentation for any purpose is hereby granted without fee, provided that
117667fe5393cSmrgdnl the above copyright notice appear in all copies and that both that
117677fe5393cSmrgdnl copyright notice and this permission notice appear in supporting
117687fe5393cSmrgdnl documentation.
117697fe5393cSmrgdnl 
117707fe5393cSmrgdnl The above copyright notice and this permission notice shall be included
117717fe5393cSmrgdnl in all copies or substantial portions of the Software.
117727fe5393cSmrgdnl 
117737fe5393cSmrgdnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
117747fe5393cSmrgdnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
117757fe5393cSmrgdnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
117767fe5393cSmrgdnl IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
117777fe5393cSmrgdnl OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
117787fe5393cSmrgdnl ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
117797fe5393cSmrgdnl OTHER DEALINGS IN THE SOFTWARE.
117807fe5393cSmrgdnl 
117817fe5393cSmrgdnl Except as contained in this notice, the name of the copyright holders shall
117827fe5393cSmrgdnl not be used in advertising or otherwise to promote the sale, use or
117837fe5393cSmrgdnl other dealings in this Software without prior written authorization
117847fe5393cSmrgdnl from the copyright holders.
117857fe5393cSmrgdnl 
1178683cab373Smrg
117877fe5393cSmrg# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
117887fe5393cSmrg# --------------------------
117897fe5393cSmrg# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
117907fe5393cSmrg# is defined, then add the given PROTO to $REQUIRED_MODULES.
1179183cab373Smrg
117927fe5393cSmrgAC_DEFUN([XORG_DRIVER_CHECK_EXT],[
117937fe5393cSmrg	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
117947fe5393cSmrg	SAVE_CFLAGS="$CFLAGS"
117957fe5393cSmrg	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
117967fe5393cSmrg	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
117977fe5393cSmrg#include "xorg-server.h"
117987fe5393cSmrg#if !defined $1
117997fe5393cSmrg#error $1 not defined
118007fe5393cSmrg#endif
118017fe5393cSmrg		]])],
118027fe5393cSmrg		[_EXT_CHECK=yes],
118037fe5393cSmrg		[_EXT_CHECK=no])
118047fe5393cSmrg	CFLAGS="$SAVE_CFLAGS"
118057fe5393cSmrg	AC_MSG_CHECKING([if $1 is defined])
118067fe5393cSmrg	AC_MSG_RESULT([$_EXT_CHECK])
118077fe5393cSmrg	if test "$_EXT_CHECK" != no; then
118087fe5393cSmrg		REQUIRED_MODULES="$REQUIRED_MODULES $2"
118097fe5393cSmrg	fi
118107fe5393cSmrg])
1181115fb4814Smrg
11812